Skip to content

Commit 6f7eede

Browse files
- fix harmony grenade not working
1 parent 6226f03 commit 6f7eede

File tree

3 files changed

+67
-46
lines changed

3 files changed

+67
-46
lines changed

wadsrc_extra/static/filter/harmony/decorate.txt

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,51 +1274,6 @@ actor HarmonyBackpack : Backpack replaces Backpack
12741274
scale 0.30
12751275
}
12761276

1277-
actor TimeBombWeapon : Weapon replaces BFG9000
1278-
{
1279-
scale 0.30
1280-
weapon.kickback 100
1281-
weapon.selectionorder 2800
1282-
weapon.ammouse 1
1283-
weapon.ammogive 2
1284-
weapon.ammotype "TimeBombAmmo"
1285-
inventory.pickupmessage "$GOTBFG9000"
1286-
inventory.icon "BFUGA0"
1287-
+WEAPON.NOAUTOFIRE
1288-
+WEAPON.NOAUTOAIM
1289-
states
1290-
{
1291-
Select:
1292-
BFGG A 1 A_Raise
1293-
loop
1294-
Deselect:
1295-
BFGG A 1 A_Lower
1296-
loop
1297-
Ready:
1298-
BFGG A 1 A_WeaponReady
1299-
loop
1300-
Fire:
1301-
SHT2 A 3
1302-
SHT2 A 7 A_CheckReload
1303-
SHT2 B 1 A_BFGSound
1304-
SHT2 B 7
1305-
SHT2 C 6
1306-
SHT2 D 7 A_FireBFG
1307-
SHT2 E 7
1308-
SHT2 F 7 A_Light0
1309-
SHT2 H 6 A_Light0
1310-
SHT2 A 5 A_Refire
1311-
goto Ready
1312-
Flash:
1313-
BFGF A 11 bright A_Light1
1314-
BFGF B 6 bright A_Light2
1315-
SHTG E 0 A_Light0
1316-
stop
1317-
Spawn:
1318-
BFUG A -1
1319-
stop
1320-
}
1321-
}
13221277
// The player should start with the hand grenades weapon, but no ammo.
13231278
// TimeBombWeapon is used as the pickup which should only be picked up once
13241279
// in multi player.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
version "4.5"
2-
#include "zscript/harm_sbar.zs"
2+
#include "zscript/harm_sbar.zs"
3+
#include "zscript/decorate_replacement.zs"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
class TimeBombWeapon : Weapon replaces BFG9000
2+
{
3+
default
4+
{
5+
scale 0.30;
6+
weapon.kickback 100;
7+
weapon.selectionorder 2800;
8+
weapon.ammouse 1;
9+
weapon.ammogive 2;
10+
weapon.ammotype "TimeBombAmmo";
11+
inventory.pickupmessage "$GOTBFG9000";
12+
inventory.icon "BFUGA0";
13+
+WEAPON.NOAUTOFIRE;
14+
+WEAPON.NOAUTOAIM;
15+
}
16+
17+
states
18+
{
19+
Select:
20+
BFGG A 1 A_Raise;
21+
loop;
22+
Deselect:
23+
BFGG A 1 A_Lower;
24+
loop;
25+
Ready:
26+
BFGG A 1 A_WeaponReady;
27+
loop;
28+
Fire:
29+
SHT2 A 3;
30+
SHT2 A 7 A_CheckReload;
31+
SHT2 B 1 A_BFGSound;
32+
SHT2 B 7;
33+
SHT2 C 6;
34+
SHT2 D 7 A_FireGrenade;
35+
SHT2 E 7;
36+
SHT2 F 7 A_Light0;
37+
SHT2 H 6 A_Light0;
38+
SHT2 A 5 A_Refire;
39+
goto Ready;
40+
Flash:
41+
BFGF A 11 bright A_Light1;
42+
BFGF B 6 bright A_Light2;
43+
SHTG E 0 A_Light0;
44+
stop;
45+
Spawn:
46+
BFUG A -1;
47+
stop;
48+
}
49+
50+
action void A_FireGrenade()
51+
{
52+
if (player == null)
53+
{
54+
return;
55+
}
56+
Weapon weap = player.ReadyWeapon;
57+
if (weap != null && invoker == weap && stateinfo != null && stateinfo.mStateType == STATE_Psprite)
58+
{
59+
if (!weap.DepleteAmmo (weap.bAltFire, true, weap.ammouse1))
60+
return;
61+
}
62+
63+
SpawnPlayerMissile("BFGBall", angle, nofreeaim:sv_nobfgaim);
64+
}
65+
}

0 commit comments

Comments
 (0)