Code: Select all
Pump2: // Ac!d's note : Go to InsertingShells ...
SHTN A 0
SHTN A 0 A_GiveInventory ("Pumping", 1)
SHTN A 0 A_GiveInventory ("GoSpecial", 1)
SHTN A 0 A_TakeInventory("Reloading", 1)
SHTN A 0 A_Takeinventory("Zoomed",1)
SHTN A 0 A_ZoomFactor(1.0)
SHTN FG 1
SHTN H 1 A_PlaySound("weapons/sgpump", 3)
SHTN IJ 1
SHTN KL 1
SHTN KJIH 1
SHTN A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
SHTN A 0 A_Takeinventory("ShotgunWasEmpty",1)
SHTN GFEDC 1 A_JumpIfInventory("Kicking",1,"DoKick")
Goto ReadyToFireAgain
ReloadWithNoAmmoLeft:
Reload:
SHTN A 0
SHTN A 0 A_TakeInventory("Reloading", 1)
SHTN A 0 A_JumpIfInventory("AmmoShell", 1, 2)
Goto NoAmmo
SHTN A 0
SHTN A 0 A_Takeinventory("Zoomed",1)
SHTN A 0 A_ZoomFactor(1.0)
SHTN A 1 A_WeaponReady
SHTN A 0 A_JumpIfInventory("ShotgunAmmo",9,"OkToFire")
SHTN A 0 A_JumpIfInventory("ShotgunAmmo", 1, "ReloadNormally")//Check if there is a shell in the chamber
SHTN A 0 A_GiveInventory("ShotgunWasEmpty", 1)//This means there is no shell in the chamber
ReloadNormally:
SHTN A 0 A_JumpIfInventory("AmmoShell",1,1)//If there is no reserve ammo, don't reload, go back to Ready
Goto Ready
SHTN A 0 A_JumpIfInventory("TurboReload", 1, "TurboReload")//Check if reloads are disabled.
SHTN B 1 A_GiveInventory ("Pumping", 1)
SHTN CDE 1
InsertingShells:
SHTN A 0
SHTN A 0 A_JumpIfInventory("AmmoShell",1,2)//if there are no more reserve shells, finish reload.
Goto Pump2 // Ac!d's note : This is the cause of the problem, there no check to notice if the shotgun was empty or not !
SHTN A 0
SHTN A 0 A_GiveInventory ("Pumping", 1)
SSHR A 0 A_TakeInventory("Reloading", 1)
SHTN A 0 A_JumpIfInventory("ShotgunAmmo",8,"CheckIfFinishReload")
SHTN A 0 A_Giveinventory("ShotgunAmmo",1)
SHTN A 0 A_Takeinventory("AmmoShell",1)
InsertShellAnimation:
SHTN A 0
SSHR AAABC 1
SSHR D 1 A_PlaySound("insertshell")
SSHR EF 1 A_WeaponReady(WRF_NOBOB)
SSHR A 0 A_JumpIfInventory("Reloading", 1, "Pump2")
SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKickReloading")
SHTN A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
SHTN A 0 A_JumpIfInventory("ShotgunAmmo",9,"FinishedInsertingShells")//If there are 8+1 shells, stop it immediately
Goto InsertingShells
CheckIfFinishReload:
SSHR A 1
SHTN A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "FinishedInsertingShells")//If shotgun was empty,
//Play the insert shell animation again, and insert the 9th shell
SHTN A 0 A_JumpIfInventory("AmmoShell",1,1)//if there are no more reserve shells, finish reload.
Goto Pump2
SHTN A 0 A_Giveinventory("ShotgunAmmo",1)
SHTN A 0 A_Takeinventory("AmmoShell",1)
Goto InsertShellAnimation
FinishedInsertingShells:
SHTN A 0 A_Takeinventory("Reloading",1)
SHTN A 0 A_JumpIfInventory("ShotgunWasEmpty", 1, "Pump2")
SHTN FEDCBA 1 A_WeaponReady
SHTN A 0 A_Takeinventory("Reloading",1)
Goto Ready