

ACTOR D4Chaingun : DoomWeapon
{
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 100
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip2"
	Inventory.PickupMessage "You got the Repeater Rifle!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		MIGG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		Loop
		
	Steady:	
		TNT1 A 0
		TNT1 A 5
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
		
	
	Deselect:
		MIGS CBA 0
		MIGG AAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Loop
	Select:
		TNT1 A 1 A_Raise
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_TakeInventory("IsFiringPrimary",1)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 A_GiveInventory("StopDualWield", 1)
		TNT1 A 0 A_Takeinventory("FistsSelected",1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 A_Takeinventory("TossGrenade",1)
		TNT1 A 0 A_Takeinventory("HasPlasmaWeapon",1)
		MIGG AAAAAAAAA 0 A_Raise
		Select2:
		MIGS ABC 1
		Goto Ready
		
	Fire:
		MIGG AABB 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (4.0, 4.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR1", 1)
		MIGF A 1 BRIGHT A_SetPitch(-0.4 + pitch)
		
		MIGG CD 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (4.0, 4.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR1", 1)
		MIGF B 1 BRIGHT A_SetPitch(-0.4 + pitch)
		
		MIGG AB 1 
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (4.0, 4.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR1", 1)
		MIGF A 1 BRIGHT A_SetPitch(-0.4 + pitch)
		MIGG CD 1
		
		MIGG AB 1
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (4.0, 4.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR1", 1)
		MIGF B 1 BRIGHT A_SetPitch(-0.4 + pitch)
		MIGG CD 1
		
		MIGG AB 1
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-3,3),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (6.0, 4.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR1", 1)
		MIGF A 1 BRIGHT A_SetPitch(-0.4 + pitch)
		MIGG CD 1
	Hold:
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (9.0, 9.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR1", 1)
		MIGF A 1 BRIGHT A_SetPitch(-0.9 + pitch)
		//MIGG B 1
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (9.0, 9.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR2", 3)
		MIGF B 1 BRIGHT //A_SetPitch(+0.4 + pitch)
		//MIGG D 1
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (12.0, 12.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR1", 5)
		MIGF A 1 BRIGHT A_SetPitch(+0.9 + pitch)
		//MIGG B 1
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-6,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (12.0, 12.0, 1, 9, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("CHNFIR2", 4)
		
		MIGF B 1 BRIGHT //A_SetPitch(+0.4 + pitch)
		//MIGG D 1
		
		TNT1 A 0 A_Refire
		TNT1 A 0 A_PlaySound("CHNEND2", 1)
		MIGG ABCD 1
		MIGG ABCDABBCCDDD 1
		TNT1 A 0 A_Refire
		Goto Ready
		
	Spawn:
		D4W4 B -1
		Stop
		
	DoKick:
		TNT1 A 0
		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")
		RIFF A 0 A_FireCustomMissile("KickAttackDetectDowned", 0, 0, 0, 0)
        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)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
    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)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
	
	AirKick:
	    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
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
		
	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
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2

    Taunt:
        TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		FUCK A 1
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 1 A_PlaySound("FUCK", 2)
        FUCK CD 1 A_AlertMonsters
		FUCK E 15 A_Takeinventory("Taunting",1)
        FUCK DCBA 1
		Goto Select2
	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Select2
	TossGrenade:	
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto NoGrenade
		GRTH ABCD 1
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_PLaySound ("GRNPIN")
		GRTH EEFG 1
		TNT1 A 0 A_PLaySound ("GRNTOSS")
		GRTH HI 1
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2,2), 0, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		GRTH JKLM 1
		TNT1 A 1 
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Select2
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.", 2)
		Goto Ready	
	}
}