
ACTOR ShotgunAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 8
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 8
   Inventory.Icon "RIFLA0"
}


Actor HasUsedShell : Inventory
{
inventory.maxamount 1
}

Actor 64ShotgunTACTICAL : DoomWeapon
{
  Weapon.SelectionOrder 13
  Weapon.AmmoUse1 0
  Weapon.AmmoGive1 0
  Weapon.AmmoType1 "Shell"
  
  Weapon.AmmoUse2 0
  Weapon.AmmoGive2 0
  Weapon.AmmoType2 "ShotgunAmmo"
  Inventory.PickupMessage "$GOTSHOTGUN"
  Obituary "$OB_MPSHOTGUN"
  +WEAPON.CHEATNOTWEAPON
  Tag "$TAG_SHOTGUN"
  Scale 0.87
  states
  {

  Ready:
	SHTG A 1 A_WeaponReady
	TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
	TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
	Loop
	
 NoAmmo:
   SHTG A 10
   TNT1 A 0 A_PlaySound("DRYFIRE")
   Goto Ready
	
  Select:
	TNT1 AAAAA 1 A_Raise
	TNT1 AAAAAAAAAA 0 A_Raise
	Goto SelectAnimation

 SelectAnimation:
	SHTS A 1
	TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, 1)
	Goto ReplaceTactical
	SHTS BCD 1
	Goto Ready
	
 ReplaceTactical:
    SHTS A 1
    TNT1 A 0 A_GiveInventory("64Shotgun", 1)
	TNT1 A 0 A_TakeInventory("64ShotgunTactical", 1)
    Goto Ready		
	
 Deselect:
	SHTS DCBA 1
	TNT1 AAAAAAAAAA 0 A_Lower
	TNT1 A 1 A_Lower
	Wait
	
  Fire:
    SHTG A 1
	TNT1 A 0 A_jumpIfInventory("HasUsedShell", 1, "PumpNewShell")
	TNT1 A 0 A_JumpIfInventory("ShotgunAmmo", 1,1)
	Goto Reload
	TNT1 A 0 A_TakeInventory("ShotgunAmmo", 1)
	TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,40)
	TNT1 A 0 A_giveInventory("HasUsedShell", 1)
	TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-5,5))
	SHTG A 0 A_FireBullets (2.0, 2.0, 9, 7, "ShotgunPuff")
	TNT1 A 0 A_PlaySound("SGFIRE", 1)
	TNT1 A 0 A_ZoomFactor(0.95)
    SHTF AB 1 BRIGHT
	TNT1 A 0 A_ZoomFactor(1.0)
    SHTF C 3 A_SetPitch (pitch-2)
    SHTF D 1 A_SetPitch (pitch+0.8)
    SHTF E 1 A_SetPitch (pitch+0.6)
    SHTG A 1 A_SetPitch (pitch+0.4)
    SHTG A 1 A_SetPitch (pitch+0.2)
	
	TNT1 A 0 A_JumpIfInventory("ShotgunAmmo", 1,1)
	Goto Reload
	
    SHTG BCDEFG 1
	TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
	TNT1 A 0 A_TakeInventory("HasUsedShell", 1)
	TNT1 A 0 A_PlaySound("STGNPUMP", 4)
	SHTG HIJKLMMLKJ 1
	SHTG IHGFEDCB 1
	TNT1 A 0 A_Refire
    Goto Ready
  Spawn:
	SHOT A 1
	SHOT A -1
	Loop
	
	
		Reload:
		SHTG A 1
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",8,64)
        TNT1 A 0 A_JumpIfInventory("Shell",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0
        SHTG BCDEFG 1  A_JumpIfInventory("Kicking",1,"DoKick")
		
	InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("ShotgunAmmo",8,"FinishReload")
		TNT1 A 0 A_JumpIfInventory("Shell",1,3)
		Goto Ready
        TNT1 AAAAA 0
		
		TNT1 A 0 A_Giveinventory("ShotgunAmmo",1)
		TNT1 A 0 A_Takeinventory("Shell",1)
		SHTR AB 1
		SHTR C 1 A_PlaySound("inshell")
		SHTR DEFG 1 A_JumpIfInventory("Kicking",1,"DoKick")
		Goto InsertBullets
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		
		TNT1 A 0 A_Refire
        Goto Ready
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		
		TNT1 A 0 A_Refire
        Goto Ready
		
	FinishReload:
	    SHTG G 1
		TNT1 A 0 A_jumpIfInventory("HasUsedShell", 1, "PumpNewShell")
	    SHTG FEDCBA 1  A_JumpIfInventory("Kicking",1,"DoKick")
		Goto Ready
		
	PumpNewShell:	
	SHTG EFG 1
	TNT1 A 0 A_TakeInventory("HasUSedShell", 1)
	TNT1 A 0 A_PlaySound("STGNPUMP", 4)
	SHTG HIJKLMMLKJ 1
	SHTG IHGFEDCB 1
	TNT1 A 0 A_Refire
	Goto Ready
	
	
	DoKick:
	    TNT1 A 0
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 A_jumpifinventory("Stamina",20,4)
		TNT1 A 0 A_Print("Not enough stamina!", 1)
		TNT1 A 0 A_PlaySound("Tired", 2)
		Goto Ready
		TNT1 AAA 0
		TNT1 A 0 A_TakeInventory("Stamina", 20)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		NULL A 0 A_JumpIf (pitch > 32, "LowKickChecker1")
		Goto InitializeNormalKick
		
		LowKickChecker1:
		TNT1 A 0
	    NULL A 0 A_JumpIf (pitch > 90, "InitializeNormalKick")
		RIFF A 0 A_FireCustomMissile("KickAttackDetectDowned", 0, 0, 0, 0)
		
		InitializeNOrmalKick:
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KICK H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK I 1
		KICK GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto SelectAnimation
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK BCD 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KICK H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK I 1
		KICK GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto SelectAnimation
	
	AirKick:
	    TNT1 A 0
		TNT1 A 0 A_TakeInventory("Stamina", 20)
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		Goto SelectAnimation
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		Goto SelectAnimation	
  }
}