From 18649329ec58be7c2f639ed89cf159908aecec3d Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sun, 17 Mar 2019 10:35:12 +0800 Subject: [PATCH] Added SpecialDeathGVAR option to override the global variable number for special death. Minor fix for Stats.ini. --- artifacts/config_files/Perks.ini | 2 +- artifacts/ddraw.ini | 4 ++++ sfall/Modules/MiscPatches.cpp | 3 +++ sfall/Modules/Stats.cpp | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/artifacts/config_files/Perks.ini b/artifacts/config_files/Perks.ini index 21111a34..a04da032 100644 --- a/artifacts/config_files/Perks.ini +++ b/artifacts/config_files/Perks.ini @@ -36,7 +36,7 @@ ;If the value is set to -99999, the variable will be ignored (similar to comment out that line) ;You can add simple extra perks with ID numbers from 119 to 255 -; that do not require using scripting functions to change player stats +; that do not require using scripting functions to change player stats, and can also be used for Armor perks ;These parameters are only for extra perks ;Stat1-Stat2 = same as Stat ;Stat1Mag-Stat2Mag = same as StatMag diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index f19aaad8..1ae022b7 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -676,6 +676,10 @@ SkipLoadingGameSettings=0 ;Set to 1 to prevent the inventory/loot/automap interfaces from being placed on top of other script-created windows InterfaceDontMoveOnTop=0 +;Overrides the global variable number used to show the special death message of the Modoc toilet explosion +;Set to -1 to disable the special death message when the global variable is set +SpecialDeathGVAR=491 + ;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/MiscPatches.cpp b/sfall/Modules/MiscPatches.cpp index dadc7268..a6eef2a3 100644 --- a/sfall/Modules/MiscPatches.cpp +++ b/sfall/Modules/MiscPatches.cpp @@ -924,6 +924,9 @@ 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); + LoadGameHook::OnBeforeGameStart() += BodypartHitChances; // set on start & load CombatProcFix(); diff --git a/sfall/Modules/Stats.cpp b/sfall/Modules/Stats.cpp index 835edd37..5679f61b 100644 --- a/sfall/Modules/Stats.cpp +++ b/sfall/Modules/Stats.cpp @@ -258,7 +258,7 @@ void Stats::init() { StatFormulas[i * 2 + 1] = GetPrivateProfileInt(key, "min", StatFormulas[i * 2 + 1], statFile); for (int j = 0; j < fo::Stat::STAT_max_hit_points; j++) { sprintf(buf2, "shift%d", j); - StatShifts[i * 7 + j] = GetPrivateProfileInt(key, buf2, StatShifts[i * 7 + 0], statFile); + StatShifts[i * 7 + j] = GetPrivateProfileInt(key, buf2, StatShifts[i * 7 + j], statFile); sprintf(buf2, "multi%d", j); _gcvt(StatMulti[i * 7 + j], 16, buf3); GetPrivateProfileStringA(key, buf2, buf3, buf2, 256, statFile);