Skip to content

Commit

Permalink
Fixed death anims for overriden damage types (closes #8)
Browse files Browse the repository at this point in the history
- Reduce log spam
  • Loading branch information
phobos2077 committed May 26, 2024
1 parent b9c4306 commit dfb0d65
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion docs/ecco_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
-=== CHANGELOG ===-

v0.9.6:
> AI:
> Combat & AI:
- increased called (aimed) shot frequency of all enemies
- added weapon drop effects to certain levels of critical hits
- reduced minimum INT requirements for AI called shots to include many Gun-weilding NPC's in FO2
- fixed bugged death animations for molotovs and 40mm IC grenades

> Healing:
- replaced default FirstAid/Doctor/Repair skill usage with fully-featured scripted implementation
Expand Down
2 changes: 0 additions & 2 deletions docs/todo.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
for 0.9.6:
- make sure all healing options are properly balanced
- final script to force AI to use called shots more frequently
- investigate reload death anim bug
- playtest


Expand Down
5 changes: 5 additions & 0 deletions extra/installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ en.InstallNull=Uncheck all

en.CMain=EcCo Gameplay Overhaul mod
en.CAICalledShots=More frequent called shots by NPC's
en.CCriticals=Critical hit table improvements
en.CCarryUnspentAP=Carry up to 2 unspent AP to next round
en.CRemoveBonusRoF=Removal of Bonus Rate of Fire perk
en.CThrowingMeleeDmg=Apply Melee Damage stat to Throwing weapons
Expand All @@ -89,6 +90,7 @@ ru.InstallNull=Ничего не выбирать

ru.CMain=EcCo - переработка геймплея
ru.CAICalledShots=Более частые прицельные атаки ИИ
ru.CCriticals=Улучшения таблицы критических повреждений
ru.CCarryUnspentAP=Перенос части непотраченных ОД на следующих ход
ru.CRemoveBonusRoF=Удаление перка "Бонус скорострельности"
ru.CThrowingMeleeDmg=Применять урон ближнего боя к метательному оружию
Expand Down Expand Up @@ -116,6 +118,7 @@ Name: "custom"; Description: "{cm:InstallCustom}"; Flags: iscustom
Name: "main"; Description: "{cm:CMain}"; Types: full custom; Flags: fixed
;Name: "option"; Description: "{cm:COptions}"; Types: full
Name: "ai_called_shots"; Description: "{cm:CAICalledShots}"; Types: full
Name: "criticals"; Description: "{cm:CCriticals}"; Types: full
Name: "carry_unspent_ap"; Description: "{cm:CCarryUnspentAP}"; Types: full
Name: "remove_bonus_rof"; Description: "{cm:CRemoveBonusRoF}"; Types: full
Name: "throwing_melee_dmg"; Description: "{cm:CThrowingMeleeDmg}"; Types: full
Expand Down Expand Up @@ -167,6 +170,8 @@ Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "MovieTimer_artimer4"; String
;Filename: "{app}\ddraw.ini"; Section: "Misc"; Key: "CheckWeaponAmmoCost"; String: "1"; Components: combat

Filename: "{app}\mods\ecco\combat.ini"; Section: "AI"; Key: "called_tweaks"; String: "0"; Components: not ai_called_shots
Filename: "{app}\mods\ecco\combat.ini"; Section: "CRITICALS"; Key: "enable_tweaks"; String: "0"; Components: not criticals
Filename: "{app}\mods\ecco\combat.ini"; Section: "CRITICALS"; Key: "drop_flag_fix"; String: "0"; Components: not criticals
Filename: "{app}\mods\ecco\combat.ini"; Section: "APCOST"; Key: "carry_unspent_ap"; String: "0"; Components: not carry_unspent_ap
Filename: "{app}\mods\ecco\combat.ini"; Section: "THROWING"; Key: "apply_melee_dmg"; String: "0"; Components: not throwing_melee_dmg
Filename: "{app}\mods\ecco\combat.ini"; Section: "MONSTER_PARTS"; Key: "enable"; String: "0"; Components: not monster_parts
Expand Down
4 changes: 3 additions & 1 deletion scripts_src/_pbs_main/gl_pbs_damage_mod.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,9 @@ procedure deathanim2_handler begin
dmgTypeNew := get_weapon_damage_type_override(weapon);
if (dmgTypeNew == -1) then return;

deathAnim := death_anims_maximum[dmgTypeNew] if is_in_array(deathAnim, death_anims_maximum) else death_anims_normal[dmgTypeNew];
deathAnim := get_array(get_death_anims_maximum, dmgTypeNew)
if is_in_array(deathAnim, get_death_anims_maximum)
else get_array(get_death_anims_normal, dmgTypeNew);

// Check if animation actually exists.
if not validate_critter_anim(target, deathAnim) then begin
Expand Down
7 changes: 4 additions & 3 deletions scripts_src/_pbs_main/gl_pbs_traps.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ procedure combatdamage_hook;
2) Loads INI variables.
3) Implements triggering traps in real-time (start proc) and turn-based (movecost_hook proc).
4) Implements hotkey to place trap.
5) Fixes death animation for trap kills (doesn't include traps.h)

Other scripts for traps:
test2.int - skill-based interactions with assembled traps on the ground
hs_deathanim2.int - fixes death animation for trap kills (doesn't include traps.h)

@author phobos2077

Expand Down Expand Up @@ -329,7 +329,7 @@ end
// TODO: use or remove
procedure ondeath_hook begin
variable critter := get_sfall_arg;
debug_log_fmt("ondeath: %d, lastTarget: %d", critter, pbs_trap_last_target);
// debug_log_fmt("ondeath: %d, lastTarget: %d", critter, pbs_trap_last_target);

if (critter and critter == pbs_trap_last_target) then begin
pbs_trap_last_target_dead := true;
Expand All @@ -346,13 +346,14 @@ procedure deathanim2_hook begin
damage := get_sfall_arg;
animID := get_sfall_arg;

debug_msg("deathanim2: wpn: "+weaponPID+", att: "+sprintf("%X",obj_art_fid(attacker))+", targ: "+target+", dam: "+damage+", anim: "+animID+", pbs_trap_last_target: "+pbs_trap_last_target);
//debug_msg("deathanim2: wpn: "+weaponPID+", att: "+sprintf("%X",obj_art_fid(attacker))+", targ: "+target+", dam: "+damage+", anim: "+animID+", pbs_trap_last_target: "+pbs_trap_last_target);

// Override death animation when critter_dmg function is used from a trap
if (obj_art_fid(attacker) == 0x20001F5 and pbs_trap_last_target == target and animID == ANIM_chunks_of_flesh) then begin
pbs_trap_last_target_dead := true;
set_sfall_return(ANIM_fall_front);
set_sfall_arg(4, ANIM_fall_front);
debug_log_fmt("deathanim2: forcing ANIM_fall_front for %s", obj_name(target));
return;
end
end
Expand Down

0 comments on commit dfb0d65

Please sign in to comment.