From 6f7eededfb72cda08bb28f6624bc9104f73c24d0 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 17 Apr 2024 20:16:15 -0400 Subject: [PATCH] - fix harmony grenade not working --- .../static/filter/harmony/decorate.txt | 45 ------------- .../static/filter/harmony/zscript.txt | 3 +- .../harmony/zscript/decorate_replacement.zs | 65 +++++++++++++++++++ 3 files changed, 67 insertions(+), 46 deletions(-) create mode 100644 wadsrc_extra/static/filter/harmony/zscript/decorate_replacement.zs diff --git a/wadsrc_extra/static/filter/harmony/decorate.txt b/wadsrc_extra/static/filter/harmony/decorate.txt index 3b3102b1f..94178aeb4 100644 --- a/wadsrc_extra/static/filter/harmony/decorate.txt +++ b/wadsrc_extra/static/filter/harmony/decorate.txt @@ -1274,51 +1274,6 @@ actor HarmonyBackpack : Backpack replaces Backpack scale 0.30 } -actor TimeBombWeapon : Weapon replaces BFG9000 -{ - scale 0.30 - weapon.kickback 100 - weapon.selectionorder 2800 - weapon.ammouse 1 - weapon.ammogive 2 - weapon.ammotype "TimeBombAmmo" - inventory.pickupmessage "$GOTBFG9000" - inventory.icon "BFUGA0" - +WEAPON.NOAUTOFIRE - +WEAPON.NOAUTOAIM - states - { - Select: - BFGG A 1 A_Raise - loop - Deselect: - BFGG A 1 A_Lower - loop - Ready: - BFGG A 1 A_WeaponReady - loop - Fire: - SHT2 A 3 - SHT2 A 7 A_CheckReload - SHT2 B 1 A_BFGSound - SHT2 B 7 - SHT2 C 6 - SHT2 D 7 A_FireBFG - SHT2 E 7 - SHT2 F 7 A_Light0 - SHT2 H 6 A_Light0 - SHT2 A 5 A_Refire - goto Ready - Flash: - BFGF A 11 bright A_Light1 - BFGF B 6 bright A_Light2 - SHTG E 0 A_Light0 - stop - Spawn: - BFUG A -1 - stop - } -} // The player should start with the hand grenades weapon, but no ammo. // TimeBombWeapon is used as the pickup which should only be picked up once // in multi player. diff --git a/wadsrc_extra/static/filter/harmony/zscript.txt b/wadsrc_extra/static/filter/harmony/zscript.txt index 8e78ae8c0..de34b25c0 100644 --- a/wadsrc_extra/static/filter/harmony/zscript.txt +++ b/wadsrc_extra/static/filter/harmony/zscript.txt @@ -1,2 +1,3 @@ version "4.5" -#include "zscript/harm_sbar.zs" \ No newline at end of file +#include "zscript/harm_sbar.zs" +#include "zscript/decorate_replacement.zs" diff --git a/wadsrc_extra/static/filter/harmony/zscript/decorate_replacement.zs b/wadsrc_extra/static/filter/harmony/zscript/decorate_replacement.zs new file mode 100644 index 000000000..24b82350a --- /dev/null +++ b/wadsrc_extra/static/filter/harmony/zscript/decorate_replacement.zs @@ -0,0 +1,65 @@ +class TimeBombWeapon : Weapon replaces BFG9000 +{ + default + { + scale 0.30; + weapon.kickback 100; + weapon.selectionorder 2800; + weapon.ammouse 1; + weapon.ammogive 2; + weapon.ammotype "TimeBombAmmo"; + inventory.pickupmessage "$GOTBFG9000"; + inventory.icon "BFUGA0"; + +WEAPON.NOAUTOFIRE; + +WEAPON.NOAUTOAIM; + } + + states + { + Select: + BFGG A 1 A_Raise; + loop; + Deselect: + BFGG A 1 A_Lower; + loop; + Ready: + BFGG A 1 A_WeaponReady; + loop; + Fire: + SHT2 A 3; + SHT2 A 7 A_CheckReload; + SHT2 B 1 A_BFGSound; + SHT2 B 7; + SHT2 C 6; + SHT2 D 7 A_FireGrenade; + SHT2 E 7; + SHT2 F 7 A_Light0; + SHT2 H 6 A_Light0; + SHT2 A 5 A_Refire; + goto Ready; + Flash: + BFGF A 11 bright A_Light1; + BFGF B 6 bright A_Light2; + SHTG E 0 A_Light0; + stop; + Spawn: + BFUG A -1; + stop; + } + + action void A_FireGrenade() + { + if (player == null) + { + return; + } + Weapon weap = player.ReadyWeapon; + if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite) + { + if (!weap.DepleteAmmo (weap.bAltFire, true, weap.ammouse1)) + return; + } + + SpawnPlayerMissile("BFGBall", angle, nofreeaim:sv_nobfgaim); + } +}