diff --git a/CHANGELOG.md b/CHANGELOG.md index 52cab34fa..39f328ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - added the triggered music tracks to the savegame so one shot tracks don't replay on load (#371) - added forward/backward input detection in line with TR2+ for jump-twists (#931) - added an option to restore the mummy in City of Khamoon room 25, similar to the PS1 version (#886) +- added a flag indicating if new game plus is unlocked to the player config which allows the player to select new game plus or not when making a new game (#966) - changed the installer to always overwrite all essential files such as the gameflow and injections (#904) - changed the data injection system to warn when it detects invalid or missing files, rather than preventing levels from loading (#918) - changed the gameflow to detect and skip over legacy sequence types, rather than preventing the game from starting (#882) diff --git a/README.md b/README.md index 0e97663f0..6d1e7b725 100644 --- a/README.md +++ b/README.md @@ -257,6 +257,7 @@ Not all options are turned on by default. Refer to `Tomb1Main_ConfigTool.exe` fo - added the "Story so far..." option in the select level menu to view cutscenes and FMVs - added graphics effects, lava emitters, flame emitters, and waterfalls to the savegame so they now persist on load - added an option to restore the mummy in City of Khamoon room 25, similar to the PS version +- added a flag indicating if new game plus is unlocked to the player config which allows the player to select new game plus or not when making a new game - fixed keys and items not working when drawing guns immediately after using them - fixed counting the secret in The Great Pyramid - fixed running out of ammo forcing Lara to equip pistols even if she doesn't carry them diff --git a/src/config.c b/src/config.c index ae004552b..db4633643 100644 --- a/src/config.c +++ b/src/config.c @@ -268,6 +268,8 @@ bool Config_ReadFromJSON(const char *cfg_data) READ_FLOAT(ui.bar_scale, DEFAULT_UI_SCALE); CLAMP(g_Config.ui.bar_scale, MIN_BAR_SCALE, MAX_BAR_SCALE); + READ_BOOL(profile.new_game_plus_unlock, false); + char layout_name[50]; for (INPUT_LAYOUT layout = INPUT_LAYOUT_CUSTOM_1; layout < INPUT_LAYOUT_NUMBER_OF; layout++) { @@ -441,6 +443,8 @@ bool Config_Write(void) WRITE_FLOAT(ui.text_scale); WRITE_FLOAT(ui.bar_scale); + WRITE_BOOL(profile.new_game_plus_unlock); + char layout_name[20]; for (INPUT_LAYOUT layout = INPUT_LAYOUT_CUSTOM_1; layout < INPUT_LAYOUT_NUMBER_OF; layout++) { diff --git a/src/config.h b/src/config.h index 3891d6ad1..e8259b0a8 100644 --- a/src/config.h +++ b/src/config.h @@ -137,6 +137,10 @@ typedef struct { UI_STYLE menu_style; } ui; + struct { + bool new_game_plus_unlock; + } profile; + int32_t sound_volume; int32_t music_volume; diff --git a/src/game/game/game.c b/src/game/game/game.c index f605538f7..af993dfa3 100644 --- a/src/game/game/game.c +++ b/src/game/game/game.c @@ -205,7 +205,8 @@ int32_t Game_Stop(void) Savegame_PersistGameToCurrentInfo(g_CurrentLevel); if (g_CurrentLevel == g_GameFlow.last_level_num) { - g_GameInfo.bonus_flag = GBF_NGPLUS; + g_Config.profile.new_game_plus_unlock = true; + Config_Write(); } else { Savegame_CarryCurrentInfoToNextLevel( g_CurrentLevel, g_CurrentLevel + 1); diff --git a/src/game/option/option_passport.c b/src/game/option/option_passport.c index 718c79c27..7caa87a81 100644 --- a/src/game/option/option_passport.c +++ b/src/game/option/option_passport.c @@ -473,7 +473,8 @@ void Option_Passport(INVENTORY_ITEM *inv_item) if (g_InvMode == INV_TITLE_MODE || (g_CurrentLevel == g_GameFlow.gym_level_num && g_InvMode != INV_DEATH_MODE)) { - if (g_Config.enable_game_modes) { + if (g_Config.enable_game_modes + || g_Config.profile.new_game_plus_unlock) { Option_PassportInitNewGameRequester(); m_PassportMode = PASSPORT_MODE_NEW_GAME; g_Input = (INPUT_STATE) { 0 }; diff --git a/src/game/savegame/savegame.c b/src/game/savegame/savegame.c index 91411cab2..d25435e02 100644 --- a/src/game/savegame/savegame.c +++ b/src/game/savegame/savegame.c @@ -158,6 +158,11 @@ static void Savegame_LoadPostprocess(void) g_MusicTrackFlags[MX_BALDY_SPEECH] |= IF_ONESHOT; } } + + if (g_GameInfo.bonus_flag) { + g_Config.profile.new_game_plus_unlock = true; + } + LOT_ClearLOT(&g_Lara.LOT); } diff --git a/src/game/savegame/savegame_bson.c b/src/game/savegame/savegame_bson.c index ea01e3bd1..874ac9fa3 100644 --- a/src/game/savegame/savegame_bson.c +++ b/src/game/savegame/savegame_bson.c @@ -378,7 +378,6 @@ static bool Savegame_BSON_LoadMisc( return false; } game_info->bonus_flag = json_object_get_int(misc_obj, "bonus_flag", 0); - LOG_DEBUG("Load bonus_flag: %d", game_info->bonus_flag); return true; } @@ -930,7 +929,6 @@ static struct json_object_s *Savegame_BSON_DumpMisc(GAME_INFO *game_info) assert(game_info); struct json_object_s *misc_obj = json_object_new(); json_object_append_int(misc_obj, "bonus_flag", game_info->bonus_flag); - LOG_DEBUG("Dump bonus_flag: %d", game_info->bonus_flag); return misc_obj; }