I can't get the thing to consume ammo. I've compared its code to other weapons that are still working properly but can't figure out why it won't use any ammo when fired:
Code: Select all
Actor FusionRifle : Weapon
{
Radius 20
Height 16
Inventory.PickupSound "misc/w_pkup"
Inventory.PickupMessage "You got the Fusion Rifle!"
Obituary "%o was fused by %k"
weapon.ammotype "Cell"
weapon.ammogive 100
weapon.ammouse 5
weapon.kickback 100
States
{
Spawn:
STPP A -1
Loop
Ready:
STPO AAABBBCCC 1 Bright A_WeaponReady
Loop
Deselect:
STPO E 1 A_Lower
Loop
Select:
STPO E 1 A_Raise
Loop
Fire:
STPO F 0 Bright A_GunFlash
STPO F 0 Bright A_FireCustomMissile("FusionShot", Random(0,1),0,0)
STPO F 0 Bright A_FireCustomMissile("FusionShot", Random(0,1),0,15)
STPO F 0 Bright A_FireCustomMissile("FusionShot", Random(0,1),0,-15)
STPO F 0 Bright A_FireCustomMissile("FusionShot", Random(0,1),0,45)
STPO F 0 Bright A_FireCustomMissile("FusionShot", Random(0,1),0,-45)
STPO F 0 Bright A_FireCustomMissile("FusionShot", Random(0,1),0,30)
STPO F 0 Bright A_FireCustomMissile("FusionShot", Random(0,1),0,-30)
STPO GH 3 Bright
STPO E 4
STPO D 6 A_ReFire
Goto Ready
Flash:
TNT1 A 1 A_Light1
TNT1 A 1 A_Light2
TNT1 A 1 A_Light1
TNT1 A 1 A_Light0
Stop
}
}
actor FusionShot
{
Radius 13
Height 8
Speed 20
Damage 10
Scale 1.0
RENDERSTYLE Add
PROJECTILE
Decal PlasmaScorchLower
states
{
Spawn:
FS03 AB 10 BRIGHT A_SpawnItemEx("FusionTrail", 0, 0, 0, 0, 0, 0, Random(-10, 10), 128)
Loop
Death:
FS03 HIJG 3 BRIGHT
Stop
}
}
actor FusionTrail
{
Radius 4
Height 8
Speed 0
Damage 0
Scale 1.0
RENDERSTYLE Add
PROJECTILE
states
{
Spawn:
TNT0 A 2
FS03 FG 6 BRIGHT A_FadeOut
Stop
}
}
(I'm testing with v1.5.6 [r1346].)