From cde315715325d9f177e6f7071f10b801c670378e Mon Sep 17 00:00:00 2001 From: NovaRain Date: Thu, 4 Jul 2019 12:00:10 +0800 Subject: [PATCH] Added KnockoutTime option to change the duration of the knockout effect. Renamed WorldMapInterface option to ExpandWorldMap. Fixed op_lookup_string_proc_ engine function not searching the last procedure in a script. --- artifacts/ddraw.ini | 8 ++++++-- sfall/Modules/BugFixes.cpp | 3 +++ sfall/Modules/Interface.cpp | 2 +- sfall/Modules/MiscPatches.cpp | 5 +++-- sfall/Modules/Objects.cpp | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index dccc2a16..0ce6d6fc 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -108,10 +108,10 @@ FadeMultiplier=100 ;You can use resized FRMs in 700x682 for town maps in the expanded world map interface ;Requires High Resolution Patch v4.1.8 and a new WORLDMAP.frm file in art\intrface\ (included in sfall.dat) ;The resolution of hi-res patch must be set to at least 890x720 -WorldMapInterface=0 +ExpandWorldMap=0 ;Set to 1 to expand the number of action points displayed on the interface bar -;Requires new IFACE_E.frm and HR_IFACE_800E.frm files in art\intrface\ (included in sfall.dat) to display correctly +;Requires new IFACE_E.frm and HR_IFACE_E.frm files in art\intrface\ (included in sfall.dat) to display correctly ;The minimum supported version of High Resolution Patch is 4.1.8 ActionPointsBar=0 @@ -703,6 +703,10 @@ SpecialDeathGVAR=491 ;Note that enabling this option can break the map changes in Modoc and Vault 15 DisableSpecialMapIDs=0 +;Changes the base value of the duration of the knockout effect (valid range: 35..100) +;The formula for the duration in ticks is: 10 * (value - 3 * EN) +KnockoutTime=35 + ;Set to 1 to display sfall built-in credits at the bottom of credits.txt contents instead of at the top CreditsAtBottom=0 diff --git a/sfall/Modules/BugFixes.cpp b/sfall/Modules/BugFixes.cpp index 2effd2e4..aedcf11f 100644 --- a/sfall/Modules/BugFixes.cpp +++ b/sfall/Modules/BugFixes.cpp @@ -2793,6 +2793,9 @@ void BugFixes::init() // Fix for combat not ending automatically when there are no hostile critters MakeCall(0x422CF3, combat_should_end_hack); SafeWrite16(0x422CEA, 0x0C74); // jz 0x422CF8 (skip party members) + + // Fix for op_lookup_string_proc_ engine function not searching the last procedure in a script + SafeWrite8(0x46C7AC, 0x76); // jb > jbe } } diff --git a/sfall/Modules/Interface.cpp b/sfall/Modules/Interface.cpp index 52a7a502..04fd6233 100644 --- a/sfall/Modules/Interface.cpp +++ b/sfall/Modules/Interface.cpp @@ -440,7 +440,7 @@ static void WorldMapInterfacePatch() { } if (hrpIsEnabled) { - if (worldmapInterface = GetConfigInt("Interface", "WorldMapInterface", 0)) { + if (worldmapInterface = GetConfigInt("Interface", "ExpandWorldMap", 0)) { LoadGameHook::OnAfterGameInit() += WorldmapViewportPatch; // Note: must be applied after WorldMapSlots patch } } diff --git a/sfall/Modules/MiscPatches.cpp b/sfall/Modules/MiscPatches.cpp index 93427e18..4aad6fae 100644 --- a/sfall/Modules/MiscPatches.cpp +++ b/sfall/Modules/MiscPatches.cpp @@ -846,8 +846,7 @@ void MiscPatches::init() { dlogr(" Done", DL_INIT); } - int gvar = GetConfigInt("Misc", "SpecialDeathGVAR", fo::GVAR_MODOC_SHITTY_DEATH); - if (gvar != fo::GVAR_MODOC_SHITTY_DEATH) SafeWrite32(0x440C2A, gvar); + SimplePatch(0x440C2A, "Misc", "SpecialDeathGVAR", fo::GVAR_MODOC_SHITTY_DEATH); // Remove hardcoding for maps with IDs 19 and 37 if (GetConfigInt("Misc", "DisableSpecialMapIDs", 0)) { @@ -856,6 +855,8 @@ void MiscPatches::init() { dlogr(" Done", DL_INIT); } + SimplePatch(0x424FA7, "Misc", "KnockoutTime", 35, 35, 100); + // Increase the max text width of the information card in the character screen SafeWriteBatch(144, {0x43ACD5, 0x43DD37}); // 136, 133 diff --git a/sfall/Modules/Objects.cpp b/sfall/Modules/Objects.cpp index cde4f9ef..7b5d4eb1 100644 --- a/sfall/Modules/Objects.cpp +++ b/sfall/Modules/Objects.cpp @@ -168,7 +168,7 @@ void Objects::init() { MakeCall(0x477A0E, item_identical_hack); // don't put item with unique ID to items stack - // Fix mapper bug by reassigning object IDs to critters (for maps not yet visited) + // Fix mapper bug by reassigning object IDs to critters (for unvisited maps) MakeCall(0x482E6B, map_load_file_hack); SafeWrite8(0x482E71, 0x85); // jz > jnz }