diff --git a/artifacts/config_files/sfall-mods.ini b/artifacts/config_files/sfall-mods.ini index 47b22af4..8de4d0fc 100644 --- a/artifacts/config_files/sfall-mods.ini +++ b/artifacts/config_files/sfall-mods.ini @@ -43,6 +43,9 @@ Mode=0 ;Set a comma delimited list of perk IDs for perks to be inherited from the player during the combat control PerksList=0,73 +;Set to 1 to allow the player to gain a positive reputation when killing NPCs while controlling other critters +GainReputation=0 + ;Choose a notification box to display the name of the controlled critter above the interface bar ;Must be between 5 and (4 + the value of BoxBarCount in ddraw.ini) ;For sfall 4.1.6+ the number for the notification box is set automatically, so just use any value diff --git a/artifacts/mods/gl_partycontrol.int b/artifacts/mods/gl_partycontrol.int index 2fbc6be8..39b0e1c3 100644 Binary files a/artifacts/mods/gl_partycontrol.int and b/artifacts/mods/gl_partycontrol.int differ diff --git a/artifacts/mods/gl_partycontrol.ssl b/artifacts/mods/gl_partycontrol.ssl index d56bd3b7..32f4eae4 100644 --- a/artifacts/mods/gl_partycontrol.ssl +++ b/artifacts/mods/gl_partycontrol.ssl @@ -26,10 +26,10 @@ procedure CombatTurn_Handler; procedure GameModeChange_Handler; procedure InventoryMove_Handler; procedure InvenWield_Handler; +procedure SetGlobalVar_Handler; variable controlMode, - noCheckArray, pidList, perksList, lightInt, lightDist, npcControl, displayName, displayNameColor, isShowTag, @@ -157,6 +157,16 @@ procedure InvenWield_Handler begin end end +procedure SetGlobalVar_Handler begin + if (npcControl and get_sfall_arg == GVAR_PLAYER_REPUTATION and obj_pid(dude_obj) != PID_PLAYER) then begin + variable value := global_var(GVAR_PLAYER_REPUTATION); + if (get_sfall_arg > value) then begin + set_sfall_arg(1, value); + set_sfall_return(value); + end + end +end + procedure start begin if (game_loaded and sfall_ver_major >= 4) then begin //variable configSection := "CombatControl"; @@ -199,6 +209,10 @@ procedure start begin register_hook_proc(HOOK_GAMEMODECHANGE, GameModeChange_Handler); register_hook_proc(HOOK_INVENTORYMOVE, InventoryMove_Handler); register_hook_proc(HOOK_INVENWIELD, InvenWield_Handler); + + if (GetConfig("CombatControl", "GainReputation", 0) == 0) then begin + register_hook_proc(HOOK_SETGLOBALVAR, SetGlobalVar_Handler); + end end else begin exit; end