ACTOR ShotgunSpawner : CustomInventory Replaces Shotgun
{
  +INVENTORY.ALWAYSPICKUP
  Inventory.PickupMessage "$GOTSHOTGUN"
  Inventory.PickupSound "WPICK"
  Scale 0.82
  States
  {
  Spawn:
    SHOT A 1
	SHOT A -1
    Stop
  Pickup:
    TNT1 A 0 A_GiveInventory("Shell", 4)
	TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "Pickup2")
    TNT1 A 0 A_GiveInventory("64Shotgun", 1)
    Stop
  Pickup2:
    TNT1 A 1
    TNT1 A 0 A_GiveInventory("64ShotgunTactical", 1)
    Stop
  }
}




Actor 64Shotgun : DoomWeapon
{
  Weapon.SelectionOrder 1300
  Weapon.AmmoUse 1
  Weapon.AmmoGive 0
  Weapon.AmmoType "Shell"
  Inventory.PickupMessage "$GOTSHOTGUN"
  Obituary "$OB_MPSHOTGUN"
  Tag "$TAG_SHOTGUN"
  Weapon.BobStyle "Smooth"
  Scale 0.87
  states
  {

  Ready:
	SHTG A 1 A_WeaponReady
	TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
	Loop
	
  Select:
	TNT1 AAAAA 1 A_Raise
	TNT1 AAAAAAAAAA 0 A_Raise
	Goto SelectAnimation

 SelectAnimation:
	SHTS A 1
	TNT1 A 0 A_JumpIfInventory("IsTacticalClass", 1, "ReplaceTactical")
	SHTS BCD 1
	Goto Ready


 ReplaceTactical:
    SHTS A 1
    TNT1 A 0 A_GiveInventory("64ShotgunTactical", 1)
	TNT1 A 0 A_TakeInventory("64Shotgun", 1)
    Goto Ready		
	
 Deselect:
	SHTS DCBA 1
	TNT1 AAAAAAAAAA 0 A_Lower
	TNT1 A 1 A_Lower
	Wait
	
  Fire:
    SHTG A 1
	
	TNT1 AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,40)
	TNT1 AAAAA 0 A_FireCustomMissile("Tracer", random(-3,3), 0, -1, -12, 0, random(-5,5))
	SHTG A 0 A_FireBullets (4.0, 4.0, 8, 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)
    SHTG BCDEFG 1
	TNT1 A 0 A_FireCustomMissile("ShotCaseSpawn",0,0,-4,-4)
	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
	
	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	
  }
}