how to do a different reload when no ammo
Posted: Tue Dec 10, 2024 4:03 pm
Hello, I'm using decorate for the first time and having some issues with it, I'm doing a shotgun that has to be manually pumped with altfire, the thing is, pump shotguns have to be pumped when you reload and have no ammo chambered, since it removes the spent shell and chambers the next one in. I'm having issues with it, right now it doesnt need to pump if it has already been pumped before the reload.
What am I doing wrong?
Code: Select all
actor InsertedShell : ammo
{
Inventory.Amount 8
Inventory.MaxAmount 8
}
actor PumpShot : inventory
{
Inventory.Amount 0
Inventory.MaxAmount 1
}
actor DukeShotgun : Shotgun
{
Scale 0.5
AttackSound "rrwm/weapons/shotgun/fire"
Inventory.Icon "OSH2A0"
Inventory.PickupSound "rrwm/weapons/shotgun/pickup"
Inventory.PickupMessage "Picked up a Duke shotgun."
Weapon.AmmoType "InsertedShell"
Weapon.AmmoType2 "Shell"
Weapon.AmmoUse 0
Weapon.Ammouse2 0
Weapon.AmmoGive 0
Weapon.AmmoGive2 16
Weapon.SlotNumber 3
Weapon.Kickback 100
+Weapon.NoAlert
+WEAPON.NOAUTOFIRE
States(Actor)
{
Spawn:
OSH2 A -1
Stop
}
States(Weapon)
{
Select:
OSHT A 1 A_Raise
Loop
Deselect:
OSHT A 1 A_Lower
Loop
Ready:
OSHT A 1 A_WeaponReady(WRF_ALLOWRELOAD)
Loop
Fire:
OSHT B 0 A_jumpifinventory("PumpShot",1,"DryFire")
TNT1 A 0 A_Jumpifinventory("InsertedShell",1,1)
Goto DryFire
TNT1 A 0 A_AlertMonsters
OSHT B 2 BRIGHT A_FireBullets (9.6, 1, 7, 5, "BulletPuff")
OSHT B 0 A_SetPitch(Random(pitch-4,pitch-6))
OSHT B 0 A_Quake(5,5,0,50)
OSHT B 2 BRIGHT A_TAKEINVENTORY("InsertedShell",1)
OSHT A 1 Offset(0,60)
OSHT A 1 Offset(0,45)
OSHT A 1 Offset(0,36)
OSHT A 1 A_giveinventory("PumpShot",1)
Goto Ready
AltFire:
TNT1 A 0 A_jumpifinventory("Pumpshot",1,1)
Goto Ready
OSHT E 2 A_StartSound("rrwm/weapons/shotgun/pump1", CHAN_WEAPON)
OSHT F 4
OSHT E 2 A_StartSound("rrwm/weapons/shotgun/pump2", CHAN_WEAPON)
OSHT DC 2
OSHT A 3 A_TAKEINVENTORY("PumpShot",1)
Goto Ready
Flash:
TNT1 A 2 A_Light1
TNT1 A 2 A_Light2
TNT1 A 0 A_Light0
Stop
DryFire:
TNT1 A 0 A_AlertMonsters
OSHT A 5 A_StartSound("rrwm/weapons/shotgun/dryfire", CHAN_WEAPON)
Goto Ready
Reload:
TNT1 A 0 A_JumpIfInventory("InsertedShell",8,"Ready")
TNT1 A 0 A_JumpIfInventory("Shell",1,1)
goto Ready
TNT1 A 0 A_Jumpifinventory("InsertedShell",1,1)
TNT1 A 0 A_Jumpifinventory("InsertedShell",0,"ReloadPump")
OSHT B 0 A_TAKEINVENTORY("Shell",1)
OSHT I 2 A_StartSound("rrwm/weapons/shotgun/reload", CHAN_WEAPON)
OSHT I 1 A_giveinventory("InsertedShell",1)
OSHT JK 4
Goto Ready
ReloadPump:
OSHT B 4 A_giveinventory("PumpShot",1)
OSHT B 0 A_TAKEINVENTORY("Shell",1)
OSHT I 2 A_StartSound("rrwm/weapons/shotgun/reload", CHAN_WEAPON)
OSHT I 1 A_giveinventory("InsertedShell",1)
OSHT JK 4
Goto Reload
}
}