diff --git a/artifacts/mods/gl_partycontrol.int b/artifacts/mods/gl_partycontrol.int index 5843a228..83280fac 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 9e251afe..09dcd535 100644 --- a/artifacts/mods/gl_partycontrol.ssl +++ b/artifacts/mods/gl_partycontrol.ssl @@ -12,7 +12,7 @@ NOTE: this script requires compiler from sfall modderspack with -s option (short circuit evaluation) - version 1.3 + version 1.4 */ @@ -44,8 +44,12 @@ variable dudeLightInt, dudeLightDist; +// returns non-zero for a controlled NPC procedure AllowControl(variable pid) begin - return ((pidList == 0 or scan_array(pidList, pid bwand 0xFFFFFF) != -1) and (party_member_obj(pid))); + if (pidList) then begin + return scan_array(pidList, pid bwand 0xFFFFFF) != -1; + end + return party_member_obj(pid); end procedure SetLight(variable critter, variable lInt, variable lDist) begin @@ -99,6 +103,10 @@ procedure CombatTurn_Handler begin level := has_trait(TRAIT_PERK, real_dude_obj, perkID); if (level) then critter_add_trait(critter, TRAIT_PERK, perkID, level); end + // special handling if dude has Jinxed trait/perk + if (has_trait(TRAIT_TRAIT, real_dude_obj, TRAIT_jinxed) or has_trait(TRAIT_PERK, real_dude_obj, PERK_jinxed_perk)) then begin + critter_add_trait(critter, TRAIT_PERK, PERK_jinxed_perk, 1); + end intface_redraw; obj_set_light_level(critter, 100, 4); @@ -138,6 +146,8 @@ procedure CombatTurn_Handler begin level := has_trait(TRAIT_PERK, real_dude_obj, perkID); if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level); end + // special handling for Jinxed + critter_rm_trait(critter, TRAIT_PERK, PERK_jinxed_perk, -1); end if (status < 0) then begin @@ -152,6 +162,7 @@ procedure GameModeChange_Handler begin inControl := false; npcControl := 0; move_to(dude_obj, dude_tile, dude_elevation); + DEBUGMSG("Move to dude after NPC control.") end end diff --git a/artifacts/sfall.dat b/artifacts/sfall.dat index 241cfa53..28537126 100644 Binary files a/artifacts/sfall.dat and b/artifacts/sfall.dat differ diff --git a/artifacts/sfall_ru.dat b/artifacts/sfall_ru.dat index 48a2cba1..b6a41bea 100644 Binary files a/artifacts/sfall_ru.dat and b/artifacts/sfall_ru.dat differ diff --git a/artifacts/sfall_zh.dat b/artifacts/sfall_zh.dat index 2c739770..cbed484f 100644 Binary files a/artifacts/sfall_zh.dat and b/artifacts/sfall_zh.dat differ