- Code: Select all • Expand view
ACTOR WinddownGun : Chaingun replaces Chaingun
TNT1 A 0 A_PlaySound("weapons/minigunup",5)
CHGG BABABA 2
CHGG BABABABABABABABA 1
TNT1 A 0 A_GunFlash
CHGG AB 1 BRIGHT A_FireBullets(5.6,0,1,5)
TNT1 A 0 A_JumpIfNoAmmo(2)
TNT1 A 0 A_ReFire
TNT1 A 0 A_PlaySound("weapons/minigundown",5)
CHGG ABABABABABAB 1
CHGG ABABABAB 2
CHGF A 1 A_Light1
CHGF B 1 A_Light2
As you see, the gun will go directly to its winddown if the shooter runs out of ammo, then it would put itself away as normal. However, if the player happens across more ammo before it finishes winding down, it won't put itself away. Then, the next time it's fired, it will jump past the windup and fire immediately. The same thing will happen if the player dies while shooting the gun and is brought back via the 'resurrect' console command.
This example WAD provides the means to test both scenarios. Grab the gun and fire it until it's empty, then pick up the bullet box before it finishes winding down. Alternatively, kill yourself in the slime pit or with the 'kill' console command while firing, then resurrect and keep firing.