From ceba5d1da252f5fe7084f41e30a4aa374432721e Mon Sep 17 00:00:00 2001 From: NovaRain Date: Wed, 22 Jan 2020 10:27:11 +0800 Subject: [PATCH] Added a flashing icon to the Horrigan encounter Minor edits to some code and documents. --- artifacts/scripting/headers/sfall.h | 2 +- sfall/FalloutEngine.h | 5 +++++ sfall/Worldmap.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index 1cda8e42..375c94ba 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -53,7 +53,7 @@ #define LIST_GROUNDITEMS (1) #define LIST_SCENERY (2) #define LIST_WALLS (3) -//#define LIST_TILES (4) //Not listable via sfall list functions +//#define LIST_TILES (4) //Not listable via sfall list functions #define LIST_MISC (5) #define LIST_SPATIAL (6) #define LIST_ALL (9) diff --git a/sfall/FalloutEngine.h b/sfall/FalloutEngine.h index cf5f2587..4193ea8a 100644 --- a/sfall/FalloutEngine.h +++ b/sfall/FalloutEngine.h @@ -72,6 +72,7 @@ #define _dialogue_head 0x518850 #define _dialogue_state 0x518714 #define _dialogue_switch_mode 0x518718 +#define _dialogueBackWindow 0x518740 #define _display_win 0x631E4C #define _displayMapList 0x41B560 #define _dropped_explosive 0x5190E0 @@ -180,6 +181,7 @@ #define _optionsButtonUp 0x59D3FC #define _optionsButtonUp1 0x570514 #define _optionsButtonUpKey 0x518F28 +#define _optnwin 0x663900 #define _outlined_object 0x518D94 #define _partyMemberAIOptions 0x519DB8 #define _partyMemberCount 0x519DAC @@ -217,6 +219,7 @@ #define _script_engine_running 0x51C714 #define _scriptListInfo 0x51C7C8 #define _skill_data 0x51D118 +#define _skldxwin 0x668140 #define _slot_cursor 0x5193B8 #define _sndfx_volume 0x518E90 #define _sneak_working 0x56D77C // DWORD var @@ -254,6 +257,8 @@ #define _wd_obj 0x59E98C #define _window 0x6ADE58 #define _wmAreaInfoList 0x51DDF8 +#define _wmBkWin 0x51DE14 +#define _wmBkWinBuf 0x51DE24 #define _wmEncounterIconShow 0x672E48 #define _wmLastRndTime 0x51DEA0 #define _wmMaxMapNum 0x51DE10 diff --git a/sfall/Worldmap.cpp b/sfall/Worldmap.cpp index c0c8e768..0b77afdd 100644 --- a/sfall/Worldmap.cpp +++ b/sfall/Worldmap.cpp @@ -271,6 +271,28 @@ end: } } +static void __declspec(naked) wmRndEncounterOccurred_hook() { + __asm { + push eax; + mov edx, 1; + mov dword ptr ds:[_wmRndCursorFid], 0; + mov ds:[_wmEncounterIconShow], edx; + mov ecx, 7; +jLoop: + mov eax, edx; + sub eax, ds:[_wmRndCursorFid]; + mov ds:[_wmRndCursorFid], eax; + call wmInterfaceRefresh_; + mov eax, 200; + call block_for_tocks_; + dec ecx; + jnz jLoop; + mov ds:[_wmEncounterIconShow], ecx; + pop eax; // map id + jmp map_load_idx_; + } +} + void WorldLimitsPatches() { DWORD data = GetConfigInt("Misc", "LocalMapXLimit", 0); if (data) { @@ -455,4 +477,7 @@ void WorldmapInit() { WorldLimitsPatches(); WorldmapFpsPatch(); PipBoyAutomapsPatch(); + + // Add a flashing icon to the Horrigan encounter + HookCall(0x4C071C, wmRndEncounterOccurred_hook); }