diff --git a/artifacts/config_files/sfall-mods.ini b/artifacts/config_files/sfall-mods.ini index e5c83dbc..288249ac 100644 --- a/artifacts/config_files/sfall-mods.ini +++ b/artifacts/config_files/sfall-mods.ini @@ -20,7 +20,7 @@ CheckLOS=0 ; 16 - bright yellow ; 32 - dark yellow ; 64 - purple -; You can set a custom color from the game palette by multiplying the color index value by 256 (available since sfall 4.2.7) +; You can set a custom color from the game palette by multiplying the color index value by 256 (in 4.2.7 or later) OutlineColor=16 ; Motion Scanner mode: @@ -31,11 +31,11 @@ MotionScanner=0 [CombatControl] -;Allows you to directly control other critters in combat +;Allows you to control other critters directly in combat ;Set to 0 to disable ;Set to 1 to control all critters in combat (allowed only in sfall debugging mode) ;Set to 2 to control all party members -;Set to 3 to let you order party members to attack specified targets after your first attack instead of controlling them directly +;Set to 3 to let you use the command cursor to specify targets for party members to attack in combat Mode=0 ;If you want to control only specific critters, uncomment the PIDList line and set a comma delimited list of PIDs ;PIDList=62,89,97,107,160,161 diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 34f3b961..95f112d1 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -150,7 +150,7 @@ OverrideMusicDir=1 ;This will slightly increase the startup time of the game on older computers AutoSearchSFX=1 -;Uncomment these lines to override the names of sound files for game modes +;Uncomment these lines to override the names of sound files used by the engine ;Filenames are limited to 8 characters (without extension) ;MainMenuMusic=07desert ;WorldMapMusic=23world @@ -296,8 +296,7 @@ DataLoadOrderPatch=1 ;Set to 2 to also load subtitle files from text\\cuts_female\ for female PC FemaleDialogMsgs=0 -;Set to 1 to allow using the special '^' character in dialog msg files to specify the alternative text -;that will be displayed in the dialogue based on the player's gender +;Set to 1 to allow using the caret character '^' in dialog msg files to specify the alternative text based on the player's gender ;The text must be enclosed in angle brackets (example: ) DialogGenderWords=0 diff --git a/artifacts/scripting/functions.yml b/artifacts/scripting/functions.yml index 80f927a8..ac5c81b2 100644 --- a/artifacts/scripting/functions.yml +++ b/artifacts/scripting/functions.yml @@ -1568,7 +1568,7 @@ - name: detail: int get_combat_free_move - doc: Returns current "bonus move" points of a current critter's turn. For NPC's this is always 0, unless changed by set_combat_free_move. + doc: Returns available "bonus move" points of the current critter's turn. For NPCs, this is always 0 unless changed by `set_combat_free_move` macro: sfall.h - name: set_combat_free_move diff --git a/artifacts/scripting/headers/lib.strings.h b/artifacts/scripting/headers/lib.strings.h index dc01884e..942bb3b0 100644 --- a/artifacts/scripting/headers/lib.strings.h +++ b/artifacts/scripting/headers/lib.strings.h @@ -168,7 +168,7 @@ end * Useful in cunjunction with is_in_array() */ procedure string_split_ints(variable str, variable split) begin - variable n; + variable n := 0; variable list, result, val; if (str == "" or typeof(str) != VALTYPE_STR) then @@ -177,10 +177,10 @@ procedure string_split_ints(variable str, variable split) begin list := string_split(str, split); result := temp_array_list(0); foreach (val in list) begin - if val != "" then begin + if (val != "") then begin resize_array(result, n + 1); result[n] := atoi(val); - n += 1; + n++; end end return result; diff --git a/artifacts/scripting/sfall function notes.md b/artifacts/scripting/sfall function notes.md index b238f0cc..8e22a41f 100644 --- a/artifacts/scripting/sfall function notes.md +++ b/artifacts/scripting/sfall function notes.md @@ -1081,7 +1081,7 @@ sfall_funcX metarule functions ##### get_combat_free_move `int sfall_func0("get_combat_free_move")` -- Returns current "bonus move" points of a current critter's turn. For NPC's this is always 0, unless changed by set_combat_free_move. +- Returns available "bonus move" points of the current critter's turn. For NPCs, this is always 0 unless changed by `set_combat_free_move`. ---- ##### set_combat_free_move diff --git a/sfall/Game/combatAI.cpp b/sfall/Game/combatAI.cpp index 62ab8de4..45ea8b52 100644 --- a/sfall/Game/combatAI.cpp +++ b/sfall/Game/combatAI.cpp @@ -19,13 +19,13 @@ namespace game namespace sf = sfall; static const long aiUseItemAPCost = 2; - +/* // Implementation of ai_can_use_weapon_ engine function with the HOOK_CANUSEWEAPON hook bool CombatAI::ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode) { bool result = fo::func::ai_can_use_weapon(source, weapon, hitMode); return sf::CanUseWeaponHook_Invoke(result, source, weapon, hitMode); } - +*/ static long drugUsePerfFixMode; void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source) { diff --git a/sfall/Game/combatAI.h b/sfall/Game/combatAI.h index 5129ca0f..5e4a62e2 100644 --- a/sfall/Game/combatAI.h +++ b/sfall/Game/combatAI.h @@ -15,7 +15,7 @@ class CombatAI { public: static void init(); - static bool ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode); + //static bool ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode); static void __stdcall ai_check_drugs(fo::GameObject* source); }; diff --git a/sfall/Modules/HookScripts/CombatHs.cpp b/sfall/Modules/HookScripts/CombatHs.cpp index fcda0800..ca64fbba 100644 --- a/sfall/Modules/HookScripts/CombatHs.cpp +++ b/sfall/Modules/HookScripts/CombatHs.cpp @@ -670,13 +670,13 @@ static void __declspec(naked) CanUseWeaponHook() { retn; } } - +/* bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode) { return (HookScripts::HookHasScript(HOOK_CANUSEWEAPON)) ? CanUseWeaponHook_Script(result, source, weapon, hitMode) : result; } - +*/ //////////////////////////////////////////////////////////////////////////////// void Inject_ToHitHook() { @@ -721,7 +721,7 @@ void Inject_CombatDamageHook() { // 0x423DE7, // compute_explosion_on_extras() 0x423E69, // compute_explosion_on_extras() 0x424220, // attack_crit_failure() - 0x4242FB, // attack_crit_failure() + 0x4242FB // attack_crit_failure() }); MakeCall(0x423DEB, ComputeDamageHook); // compute_explosion_on_extras() - fix for the attacker } diff --git a/sfall/Modules/HookScripts/CombatHs.h b/sfall/Modules/HookScripts/CombatHs.h index 941447ec..d9fc6c45 100644 --- a/sfall/Modules/HookScripts/CombatHs.h +++ b/sfall/Modules/HookScripts/CombatHs.h @@ -26,6 +26,6 @@ int __fastcall AmmoCostHook_Script(DWORD hookType, fo::GameObject* weapon, DWORD long CalcApCostHook_Invoke(fo::GameObject* source, long hitMode, long isCalled, long cost, fo::GameObject* weapon); //void FindTargetHook_Invoke(fo::GameObject* targets[], fo::GameObject* attacker); //fo::GameObject* BestWeaponHook_Invoke(fo::GameObject* bestWeapon, fo::GameObject* source, fo::GameObject* weapon1, fo::GameObject* weapon2, fo::GameObject* target); -bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode); +//bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode); } diff --git a/sfall/Modules/HookScripts/MiscHs.cpp b/sfall/Modules/HookScripts/MiscHs.cpp index 1805558f..787e2ed9 100644 --- a/sfall/Modules/HookScripts/MiscHs.cpp +++ b/sfall/Modules/HookScripts/MiscHs.cpp @@ -634,21 +634,30 @@ cancelEnc: static long __stdcall RollCheckHook_Script(long roll, long chance, long bonus, long randomChance, long calledFrom) { long hookType; switch (calledFrom - 5) { - case 0x42388E: // compute_attack_ - // compute_spray_ - case 0x4234D1: hookType = 1; break; // single and burst attack hit event - // compute_spray_ - case 0x42356C: hookType = 2; break; // burst attack bullet hit event - // skill_result_ - case 0x4AAB29: hookType = 3; break; // common skill check event - // skill_use_ - case 0x4AB3B6: hookType = 4; break; // SKILL_REPAIR - case 0x4AB8B5: hookType = 5; break; // SKILL_DOCTOR - // skill_check_stealing_ // SKILL_STEAL - case 0x4ABC9F: hookType = 6; break; // source stealing check event - case 0x4ABCE6: hookType = 7; break; // target stealing check event (fail for success stealing) + case 0x42388E: // compute_attack_ + case 0x4234D1: // compute_spray_ + hookType = 1; // single and burst attack hit event + break; + case 0x42356C: // compute_spray_ + hookType = 2; // burst attack bullet hit event + break; + case 0x4AAB29: // skill_result_ + hookType = 3; // common skill check event + break; + case 0x4AB3B6: // skill_use_ + hookType = 4; // SKILL_REPAIR + break; + case 0x4AB8B5: // skill_use_ + hookType = 5; // SKILL_DOCTOR + break; + case 0x4ABC9F: // skill_check_stealing_ + hookType = 6; // SKILL_STEAL - source stealing check event + break; + case 0x4ABCE6: // skill_check_stealing_ + hookType = 7; // SKILL_STEAL - target stealing check event (fail for success stealing) + break; default: - return roll; // unsupported hook + return roll; // unsupported hook } BeginHook(); diff --git a/sfall/Modules/HookScripts/ObjectHs.cpp b/sfall/Modules/HookScripts/ObjectHs.cpp index ed79db1e..22103e7a 100644 --- a/sfall/Modules/HookScripts/ObjectHs.cpp +++ b/sfall/Modules/HookScripts/ObjectHs.cpp @@ -375,14 +375,14 @@ void __declspec(naked) critter_adjust_rads_hack() { using namespace Fields; __asm { cmp dword ptr [eax + protoId], PID_Player; // critter.pid - jne isNotDude; + jne notDude; push ecx; call AdjustRads_Script; // ecx - critter, edx - amount pop ecx; mov ebx, eax; // old/new amount mov edx, ds:[FO_VAR_obj_dude]; xor eax, eax; // for continue func -isNotDude: +notDude: retn; } } diff --git a/sfall/Modules/PartyControl.cpp b/sfall/Modules/PartyControl.cpp index 3e0b944f..a13d2c28 100644 --- a/sfall/Modules/PartyControl.cpp +++ b/sfall/Modules/PartyControl.cpp @@ -77,8 +77,8 @@ static struct DudeState { struct PartySneakWorking { fo::GameObject* object; - unsigned long sneak_queue_time; - long sneak_working; + DWORD sneak_queue_time; + DWORD sneak_working; }; static std::vector partySneakWorking; @@ -867,7 +867,7 @@ void PartyControl::init() { // Display party member's current level & AC & addict flag if (IniReader::GetConfigInt("Misc", "PartyMemberExtraInfo", 0)) { - dlogr("Applying display NPC extra info patch.", DL_INIT); + dlogr("Applying display extra info patch for party members.", DL_INIT); HookCall(0x44926F, gdControlUpdateInfo_hook); Translate::Get("sfall", "PartyLvlMsg", "Lvl:", levelMsg, 12); Translate::Get("sfall", "PartyACMsg", "AC:", armorClassMsg, 12);