
Actor IsFiringPrimary : Inventory
{
  inventory.maxamount 1
}

Actor ShotgunBulletPuff : BulletPuff
{
}

Actor VortexPuff : BulletPuff
{
  RenderStyle Add
  Alpha 0.7
}

Actor VortexPuffSuper : BulletPuff
{
  RenderStyle Add
  Alpha 0.9
}

Actor MegaGibRemoving : Actor
{
  +NOBLOCKMAP
  +NOGRAVITY
  States
  {
  Spawn:
    TNT1 A 1
    Stop
  }
}

Actor BigRicoChet : FastProjectile
{
  +NOBLOCKMAP
  +NOGRAVITY
  +NOTELEPORT
  Speed 1
  States
  {
  Spawn:
    TNT1 A 4 A_FadeOut(0.2)
    Loop
  }
}

Actor D4AltMode : Inventory
{
inventory.maxamount 1
}

Actor IsD4Weapon : Inventory
{
 inventory.maxamount 1
}




ACTOR ShotgunUpgrade : Ammo
{
	Game Doom
	Inventory.PickupMessage "Picked up a Shotgun Upgrade."
	Inventory.Amount 1
	Inventory.MaxAmount 2
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 2
	//Inventory.Icon "CLIPA0"
	States
	{
	Spawn:
		CLIP A -1
		Stop
	}
}


ACTOR MachinegunUpgrade : Ammo
{
	Game Doom
	Inventory.PickupMessage "Picked up a Shotgun Upgrade."
	Inventory.Amount 1
	Inventory.MaxAmount 2
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 2
	//Inventory.Icon "CLIPA0"
	States
	{
	Spawn:
		CLIP A -1
		Stop
	}
}



Actor D4ShotgunSelected : Inventory
{
inventory.maxamount 1
}

Actor D4MachinegunSelected : Inventory
{
inventory.maxamount 1
}

Actor D4PlasmaSelected : Inventory
{
inventory.maxamount 1
}

Actor D4RocketSelected : Inventory
{
inventory.maxamount 1
}

Actor D4ChaingunSelected : Inventory
{
inventory.maxamount 1
}

Actor D4GaussSelected : Inventory
{
inventory.maxamount 1
}


Actor IsUpgradingWeapons : Inventory
{
inventory.maxamount 1
}







ACTOR PickD4UpgradeAttack: FastProjectile
{
	Radius 18
	Height 6
	DamageType DestroyUpgradeStation
	Projectile 
	+FORCEXYBILLBOARD
	+NOEXTREMEDEATH
	RenderStyle Add
	Alpha 0.6
    Damage (random(28,32))
    Speed 30
	//HitObituary "$OB_IMPHIT"
	SeeSound "none"
	DeathSound "none"
	Decal "none"
	States
	{
	Spawn:
		TNT1 A 1 BRIGHT
        TNT1 A 1 //A_PlaySound("weapons/gswing")
		Stop
	Death:
	XDEath:
			TNT1 A 0
			TNT1 A 0 A_CheckFloor("DeathOnGround")
		    PUFF A 0 A_PlaySound("player/cyborg/fist", 3)
			TNT1 A 0 A_SpawnItemEx ("PLOFT2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			EXPL AAAAAA 0 A_CustomMissile ("MeleeSmoke", 0, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0 A_GiveToTarget("KickHasHit", 1)
			TNT1 A 0 Radius_Quake (2, 6, 0, 5, 0)//(intensity, duration, damrad, tremrad, tid)
			
			TNT1 A 10
		Stop
	
	DeathOnGround:
			TNT1 A 0
		    PUFF A 0 A_PlaySound("player/cyborg/fist", 3)
			TNT1 A 0 A_SpawnItemEx ("PLOFT2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			EXPL AAAAAA 0 A_CustomMissile ("MeleeSmoke", 0, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0 Radius_Quake (2, 6, 0, 5, 0)//(intensity, duration, damrad, tremrad, tid)
			TNT1 A 0 A_Explode(10, 40, 0)
			TNT1 A 10
		Stop
	}
}



ACTOR D4Pistol : DoomWeapon
{
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Inventory.PickupMessage "You got the Plasma Pistol!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		D4PG A 1 A_WeaponReady
		//TNT1 A 0 A_JumpIfInventory("IsUpgradingWeapons",1,"UpgradeWeapons")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        //TNT1 A 0 A_JumpIfInventory("Reloading",1,"ChangeAltMode")
		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:
		D4PS CBA 0
		D4PG 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)
		D4PG AAAAAAAAA 0 A_Raise
		Select2:
		D4PS ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0 A_FireCustomMissile("PistolplasmaTracer", 0,0,9,-4,0,0)
		TNT1 A 0 A_PlaySound("BLFIRE01", 1)
		D4PF A 1 BRIGHT A_SetPitch(-0.4 + pitch)
		D4PF B 1
		D4PF CD 1 A_SetPitch(0.2 + pitch)
		D4PF EFFF 1 A_WeaponReady(1)
		TNT1 A 0 A_Refire
		Goto Ready
		
	AltFire:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("BCHARGE", 1)
		D4PG A 6
		TNT1 A 0 A_PlaySound("CHRGLOAD1", 1)
		D4PG A 12
		TNT1 A 0 A_PlaySound("CHRGCLIC", 3)
	
	AltHold:
		D4PC A 1 BRIGHT A_PlaySound("CHRGLOAD1", 1)
		D4PC ABCDABCD 1 BRIGHT
		TNT1 A 0 A_Refire
		TNT1 A 0 A_FireCustomMissile("PistolheavyplasmaTracer", 0,0,9,-4,0,0)
		TNT1 A 0 A_PlaySound("CHARGDF1", 1)
		D4PF A 1 BRIGHT A_SetPitch(-1.2 + pitch)
		D4PF B 1
		D4PF CD 1 A_SetPitch(0.6 + pitch)
		D4PF EFFFF 1 A_WeaponReady(1)
		TNT1 A 0 A_Refire
		Goto Ready
		
	Spawn:
		D4W1 A 1
		TNT1 A 0 A_SpawnItemEx("D4PistolOnTheFloor", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		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	
	}
}








Actor PistolplasmaTracer: FastProjectile
{
+BLOODSPLATTER 
-DONTSPLASH
speed 200
damage (random(15,20))
Species "Marines"
scale .2
RenderStyle Add
Alpha 0.9
radius 2
height 2
damagetype Normal
Decal "BulletPuff"
States
{

	Spawn:
		TNT1 A 1 BRIGHT A_SpawnItemEx("PistolplasmaTracerTrail", 0,               0,              2)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		Loop
	Death:
		TNT1 AAAAA 0 A_SpawnItem("BlueFlareSmall")
		TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
		BL1I ABCD 1 BRIGHT A_SpawnItem("BlueFlareSmall")
		TNT2 AA 3 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
}
}

actor PistolplasmaTracerTrail
{
    Scale 0.03
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        SPKB A 2 BRIGHT
        stop
    }
}



actor PistolplasmaTracerTrail2: PistolplasmaTracerTrail {    Alpha 0.85 }
actor PistolplasmaTracerTrail3: PistolplasmaTracerTrail {    Alpha 0.80 }
actor PistolplasmaTracerTrail4: PistolplasmaTracerTrail {    Alpha 0.75 }
actor PistolplasmaTracerTrail5: PistolplasmaTracerTrail {    Alpha 0.70 }
actor PistolplasmaTracerTrail6: PistolplasmaTracerTrail {    Alpha 0.65 }
actor PistolplasmaTracerTrail7: PistolplasmaTracerTrail {    Alpha 0.60 }
actor PistolplasmaTracerTrail8: PistolplasmaTracerTrail {    Alpha 0.55 }
actor PistolplasmaTracerTrail9: PistolplasmaTracerTrail {    Alpha 0.50 }
actor PistolplasmaTracerTrail10: PistolplasmaTracerTrail {    Alpha 0.45 }
actor PistolplasmaTracerTrail11: PistolplasmaTracerTrail {    Alpha 0.40 }
actor PistolplasmaTracerTrail12: PistolplasmaTracerTrail {    Alpha 0.35 }
actor PistolplasmaTracerTrail13: PistolplasmaTracerTrail {    Alpha 0.30 }
actor PistolplasmaTracerTrail14: PistolplasmaTracerTrail {    Alpha 0.25 }
actor PistolplasmaTracerTrail15: PistolplasmaTracerTrail {    Alpha 0.20 }
actor PistolplasmaTracerTrail16: PistolplasmaTracerTrail {    Alpha 0.15 }
actor PistolplasmaTracerTrail17: PistolplasmaTracerTrail {    Alpha 0.10 }
actor PistolplasmaTracerTrail18: PistolplasmaTracerTrail {    Alpha 0.05 }





















Actor PistolheavyplasmaTracer: FastProjectile
{
+BLOODSPLATTER 
-DONTSPLASH
speed 200
damage (random(80,90))
scale .6
RenderStyle Add
Alpha 0.9
radius 2
height 2
damagetype Plasma
Decal "BulletPuff"
States
{

	Spawn:
		TNT1 A 1 BRIGHT A_SpawnItemEx("PistolheavyplasmaTracerTrail", 0,               0,              2)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		Loop
	Death:
		TNT1 AAAAA 0 A_SpawnItem("BlueFlareSmall")
		TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaFireNonStatic", 2, 0, random (0, 360), 2, random (0, 180))
		TNT1 AAAAAAAAAAAA 0 A_CustomMissile ("BlueplasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
		BL1I ABCD 1 BRIGHT A_SpawnItem("BlueFlareSmall")
		TNT2 AA 3 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
}
}

actor PistolheavyplasmaTracerTrail
{
    Scale 0.2
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        SPKB A 2 BRIGHT
        stop
    }
}



actor PistolheavyplasmaTracerTrail2: PistolheavyplasmaTracerTrail {    Alpha 0.85 }
actor PistolheavyplasmaTracerTrail3: PistolheavyplasmaTracerTrail {    Alpha 0.80 }
actor PistolheavyplasmaTracerTrail4: PistolheavyplasmaTracerTrail {    Alpha 0.75 }
actor PistolheavyplasmaTracerTrail5: PistolheavyplasmaTracerTrail {    Alpha 0.70 }
actor PistolheavyplasmaTracerTrail6: PistolheavyplasmaTracerTrail {    Alpha 0.65 }
actor PistolheavyplasmaTracerTrail7: PistolheavyplasmaTracerTrail {    Alpha 0.60 }
actor PistolheavyplasmaTracerTrail8: PistolheavyplasmaTracerTrail {    Alpha 0.55 }
actor PistolheavyplasmaTracerTrail9: PistolheavyplasmaTracerTrail {    Alpha 0.50 }
actor PistolheavyplasmaTracerTrail10: PistolheavyplasmaTracerTrail {    Alpha 0.45 }
actor PistolheavyplasmaTracerTrail11: PistolplasmaTracerTrail {    Alpha 0.40 }
actor PistolheavyplasmaTracerTrail12: PistolheavyplasmaTracerTrail {    Alpha 0.35 }
actor PistolheavyplasmaTracerTrail13: PistolheavyplasmaTracerTrail {    Alpha 0.30 }
actor PistolheavyplasmaTracerTrail14: PistolheavyplasmaTracerTrail {    Alpha 0.25 }
actor PistolheavyplasmaTracerTrail15: PistolheavyplasmaTracerTrail {    Alpha 0.20 }
actor PistolheavyplasmaTracerTrail16: PistolheavyplasmaTracerTrail {    Alpha 0.15 }
actor PistolheavyplasmaTracerTrail17: PistolheavyplasmaTracerTrail {    Alpha 0.10 }
actor PistolheavyplasmaTracerTrail18: PistolheavyplasmaTracerTrail {    Alpha 0.05 }





ACTOR DualD4PeaShooter: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	//Weapon.SlotNumber 2
	//Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	//Weapon.AmmoUse2 0
	//Weapon.AmmoGive2 0
	//Weapon.AmmoType1 "RocketAmmo" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Pistols." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra Pistol." //Pickup message
    +WEAPON.NOAUTOAIM //Makes this weapon never autoaim, so recoil can work better
    //Scale 0.6 //Weapon's pickup sprite size
	+WEAPON.NOAUTOFIRE
	States
	{
	
	Spawn:
		D4W1 A 1
		TNT1 A 0 A_SpawnItemEx("D4PistolOnTheFloor", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		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_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)
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory("D4Pistol", 1, 1)
		Goto CantDualNow
		DWS2 ABCD 1
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
	
	CantDualNow:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("D4Pistol", 1)
		TNT1 A 0 A_TakeInventory("DualD4PeaShooter", 1)
		Stop
	
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		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")
		PI2G A 1 A_WeaponReady// Weapon is ready to fire
		//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
		Loop
		
	Flash:	//Right gun ready state
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		D4PG A 1
		TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, "DontFlash")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
		
		
	Deselect:
		TNT1 AAAAAA 0 A_Lower
		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 1 A_Lower //Makes player switch weapons faster
		Wait
	Select:
		TNT1 A 0 A_Raise //Makes the weapon always be selected fast
		Wait
	
	DryFire:
	    RK2G A 2 A_PlaySound("DRYFIRE", 1)
		RK2G A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		PI2G A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    RK2G A 0
		TNT1 A 0 A_FireCustomMissile("PistolplasmaTracer", random(-8,1), 0, -11, -4, 0, random(-1,2))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		PI2F A 1 BRIGHT
		TNT1 A 0 A_SetPitch(-0.45 + pitch)
		TNT1 A 0 A_PlaySound("BLFIRE01", 1)
		PI2F BCDEF 1 A_SetPitch(0.025 + pitch)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		PI2G AAA 1 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	
	DontFlash:
	    TNT1 A 1
		Goto Flash
	
	FireRightGun:
	    P2W1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_FireCustomMissile("PistolplasmaTracer", random(-1,8), 0, 11, -4, 0, random(-1,2))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		D4PF A 1 BRIGHT
		TNT1 A 0 A_SetPitch(-0.45 + pitch)
		TNT1 A 0 A_PlaySound("BLFIRE01", 1)
		D4PF BCDEF 1 A_SetPitch(0.025 + pitch)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		D4PG AAA 1 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    RKLG A 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		RKLG AAAAAAAAAAA 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		Goto Flash
		
		
	DoKick:
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 10
		FUCK F 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 G 1 A_PlaySound("FUCK", 2)
        FUCK HI 1 A_AlertMonsters
		FUCK J 15 A_Takeinventory("Taunting",1)
        FUCK IHGF 1
        TNT1 A 10
		Goto ReadyToFire
	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 ReadyToFire	
	Steady:
	TNT1 A 1
	Goto ReadyToFire			
	}
}


ACTOR D4Shotgun : DoomWeapon
{
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 8
	Weapon.AmmoType1 "Shell"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Shell"
	Weapon.AmmoType2 "ShotgunUpgrade"
	Inventory.PickupMessage "You got the Combat Shotgun!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		D4SG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("IsUpgradingWeapons",1,"UpgradeWeapons")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"ChangeAltMode")
		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
		
	ChangeAltMode:
		D4SG A 1
		TNT1 A 0 A_TakeInventory("Reloading", 1)
		TNT1 A 0 A_JumpIfInventory("ShotgunUpgrade", 1, 1)
		Goto NoUpgrades
		D4SG A 1
		TNT1 A 0 A_JumpIfInventory("ShotgunUpgrade", 2, 1)
		Goto NoUpgrades2
		D4SG A 1
		TNT1 A 0 A_JumpIfInventory("D4AltMode", 1, "ChangeAltMode2")
		TNT1 A 0 A_GiveInventory("D4AltMode", 1)
		TNT1 A 0 A_Print("Explosive Shells Selected.", 2)
		D4SS CBAFFFFFF 1
		D4SS ABC 1
		D4SF EFGH 1
		D4SG A 0 A_PlaySound("SHTGP1", 3)
		D4SF IJKLMMLKJIHGFE 1
		Goto Ready
		
	ChangeAltMode2:	
		D4SG A 1
		TNT1 A 0 A_TakeInventory("D4AltMode", 1)
		TNT1 A 0 A_Print("Burst Fire Mode Selected.", 2)
		D4SS CBAFFFFFF 1
		D4SS ABC 1
		D4SF EFGH 1
		D4SG A 0 A_PlaySound("SHTGP1", 3)
		D4SF IJKLMMLKJIHGFE 1
		Goto Ready
		
		
		
		
	Deselect:
		D4SS CBA 0
		TNT1 A 0 A_TakeInventory("IsD4Weapon", 1)
		TNT1 A 0 A_TakeInventory("D4ShotgunSelected", 1)
		TNT1 A 0 A_TakeInventory("D4AltMode", 1)
		D4SG 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)
		D4SG AAAAAAAAA 0 A_Raise
		Select2:
		D4SS ABC 1
		TNT1 A 0 A_GiveInventory("D4ShotgunSelected", 1)
		TNT1 A 0 A_GiveInventory("IsD4Weapon", 1)
		Goto Ready
		
	Fire:
		TNT1 AAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-12,0,random(-1,1))
		TNT1 A 0 A_FireBullets (3.0, 3.0, 7, 8, "ShotgunPuff")
		TNT1 A 0 A_PlaySound("SHTGF", 1)
		D4SF A 1 BRIGHT A_SetPitch(-4.0 + pitch)
		D4SF B 1
		D4SF CCD 1 A_SetPitch(1.0 + pitch)
		D4SG A 2 A_SetPitch(1.0 + pitch)
		D4SF EFGH 1
		TNT1 A 0 A_FireCustomMissile ("ShotCaseSpawn", 0, 0, 20, -8)
		D4SG A 0 //A_PlaySound("SHTGP1", 3)
		D4SF IJKLMMLKJIHGFE 1
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		D4SG A 2
		TNT1 A 0 A_Refire
		D4SG A 5 A_WeaponReady
		Goto Ready
		
	AltFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("ShotgunUpgrade", 1, 1)
		Goto NoUpgrades
		TNT1 A 0 A_JumpIfInventory("D4AltMode", 1, "AltFire2")
		TNT1 A 0 A_JumpIfInventory("Shell", 3, 1)
		Goto NoAmmo
		TNT1 AAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-12,0,random(-1,1))
		TNT1 A 0 A_FireBullets (3.0, 3.0, 7, 8, "ShotgunBulletPuff")
		TNT1 A 0 A_PlaySound("SHTGF", 1)
		D4SF A 1 BRIGHT A_SetPitch(-5.0 + pitch)
		D4SF B 1 A_TakeInventory("Shell", 1)
		D4SF CCD 1 A_SetPitch(1.0 + pitch)
		D4SG A 1
		
		
		TNT1 AAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-12,0,random(-1,1))
		TNT1 A 0 A_FireBullets (3.0, 3.0, 7, 8, "ShotgunPuff")
		TNT1 A 0 A_PlaySound("SHTGF", 1)
		D4SF A 1 BRIGHT A_SetPitch(-5.0 + pitch)
		D4SF B 1 A_TakeInventory("Shell", 1)
		D4SF CCD 1 A_SetPitch(1.0 + pitch)
		D4SG A 1
		
		TNT1 AAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-12,0,random(-1,1))
		TNT1 A 0 A_FireBullets (3.0, 3.0, 7, 8, "ShotgunPuff")
		TNT1 A 0 A_PlaySound("SHTGF", 1)
		D4SF A 1 BRIGHT A_SetPitch(-5.0 + pitch)
		D4SF B 1 A_TakeInventory("Shell", 1)
		D4SF CCD 1 A_SetPitch(1.0 + pitch)
		D4SG A 10 A_SetPitch(1.0 + pitch)
		

		
		
		D4SF EFGH 1
		TNT1 AAA 0 A_FireCustomMissile ("ShotCaseSpawn", 0, 0, 20, -8)
		D4SG A 0 A_PlaySound("SHTGP1", 3)
		D4SF IJKLMMLKJIHGFE 1
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		D4SG A 1
		TNT1 A 0 A_Refire
		D4SG A 5 A_WeaponReady
		Goto Ready	
		
	AltFire2:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Shell", 6, 1)
		Goto NoAmmo
		TNT1 A 0 A_TakeInventory("Shell", 6)
		TNT1 A 0 A_PlaySound("SHTGF", 1)
		TNT1 A 0 A_FireCustomMissile("ShotgunGrenade", random(-1,1),0,6,-2,0,random(-1,1))
		D4SF A 2 BRIGHT A_SetPitch(-4.0 + pitch)
		D4SF B 1
		D4SF CCD 1 A_SetPitch(1.0 + pitch)
		D4SG A 6 A_SetPitch(1.0 + pitch)
		D4SF EFGH 1
		TNT1 A 0 A_FireCustomMissile ("ShotCaseSpawn", 0, 0, 20, -8)
		D4SG A 0 //A_PlaySound("SHTGP1", 3)
		D4SF IJKLMMLKJIHGFE 1
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		D4SG A 2
		TNT1 A 0 A_Refire
		D4SG A 5 A_WeaponReady
		Goto Ready
		
	Spawn:
		D4W3 A -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	
	NoUpgrades:
		TNT1 A 0
		TNT1 A 0 A_Print("You have no upgrades for this weapon.", 2)
		Goto Ready
	NoUpgrades2:
		TNT1 A 0
		TNT1 A 0 A_Print("You don't have a level 2 upgrade for this weapon.", 2)
		Goto Ready	
	NoAmmo:
		TNT1 A 0
		TNT1 A 0 A_Print("You don't have enough ammo to use this weapon's alt fire.", 2)
		Goto Ready	
	UpgradeWeapons:
		TNT1 A 0 
		TNT1 A 0 A_TakeInventory("IsUpgradingWeapons", 1)
		NULL A 0 SetPlayerProperty(0,1,4)
		PK4P ABCDEFGH 2
		TNT1 A 6
		PUN3 ABCDE 1
        TNT1 A 0 A_PlaySound("weapons/gswing")
		PUN3 F 1
		RIFF AA 0 A_FireCustomMissile("PickD4UpgradeAttack", 0, 0, 0, -9)
		PUN3 GHI 1
		PUN3 JK 1
		NULL A 0 SetPlayerProperty(0,0,4)
		TNT1 A 12
		TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		Goto Select2	
	}
}









ACTOR ShotgunGrenade: Rocket2
{
	Radius 4
	Height 4
	Speed 40
	Damage 6
    Gravity 0.4
	Scale 0.5
	Renderstyle Add
	States
	{
	Spawn:
	    TNT1 A 0 A_SpawnItem ("CoolAndNewFlameTrails", 0, random( -2, 2))
		FR7X A 1 BRIGHT A_SpawnItem("RedFlareSmall",0,0)
		TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrail2", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 A_SpawnItem ("CoolAndNewFlameTrails")
		FR7X B 1 BRIGHT A_SpawnItem("RedFlareSmall",0,0)
		Loop
	}
}


ACTOR D4SSG : DoomWeapon
{
	Weapon.AmmoUse1 2
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "Shell"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Shell"
	Inventory.PickupMessage "You got the Super Shotgun!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		SSGG 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:
		SSGS CBA 0
		SSGG 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)
		SSGG AAAAAAAAA 0 A_Raise
		Select2:
		SSGS ABC 1
		Goto Ready
		
	Fire:
		TNT1 AAAAAAAAAAAAAA 0 A_FireCustomMissile("Tracer", random(-5,5),0,12,-12,0,random(-1,1))
		TNT1 A 0 A_firebullets (0,0,1,15,"shotpuff",0,240)
		TNT1 A 0 A_FireBullets (9.0, 4.0, 14, 8, "ShotgunPuff")
		TNT1 A 0 A_PlaySound("D4SSGF", 1)
		SSGF FA 1 BRIGHT A_SetPitch(-6.0 + pitch)
		SSGF B 1
		SSGF BCDE 1 A_SetPitch(3.0 + pitch)
		SSGG A 5
		SSGR ABCDEFG 1
		TNT1 AA 0 A_FireCustomMissile ("ShotCaseSpawn", 0, 0, 0, -8)
		SSGR G 2
		SSGR HIJKLMNOPQR 1
		SSGR STUCBA 1
		SSGG A 8 A_WeaponReady(1)
		TNT1 A 0 A_Refire
		Goto Ready
		
	Spawn:
		D4W3 B 1
		TNT1 A 0 A_SpawnItemEx("D4SSGOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		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	
	}
}

ACTOR D4DualSSG: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	Weapon.SlotNumber 2
	Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Shell" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Shotguns." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra SSG." //Pickup message
    +WEAPON.NOAUTOAIM //Makes this weapon never autoaim, so recoil can work better
    //Scale 0.6 //Weapon's pickup sprite size
	+WEAPON.NOAUTOFIRE
	States
	{
	
	Spawn:
		D4W3 B 1
		TNT1 A 0 A_SpawnItemEx("D4SSGOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		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_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)
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory("D4SSG", 1, 1)
		Goto CantDualNow
		DWS1 ABCD 1
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
		
	CantDualNow:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("D4SSG", 1)
		TNT1 A 0 A_TakeInventory("D4DualSSG", 1)
		Stop
	
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		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")
		SSG2 A 1 A_WeaponReady// Weapon is ready to fire
		//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
		Loop
		
	Flash:	//Right gun ready state
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		SSG1 A 1
		TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, "DontFlash")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
		
		
	Deselect:
		TNT1 AAAAAA 0 A_Lower
		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 1 A_Lower //Makes player switch weapons faster
		Wait
	Select:
		TNT1 A 0 A_Raise //Makes the weapon always be selected fast
		Wait
	
	DryFire:
	    SSG2 D 2 A_PlaySound("DRYFIRE", 1)
		SSG2 A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		SSG2 A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    SSG2 A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Shell", 2, 1)
		Goto DryFire
		TNT1 A 0 A_TakeInventory("Shell", 2)
		TNT1 A 0 A_ALertMonsters
		TNT1 A 0 A_firebullets (0,0,1,15,"shotpuff",0,240)
		TNT1 A 0 A_FireBullets (12.0, 5.0, 14, 8, "ShotgunPuff")
		TNT1 A 0 A_SetPitch(-12.0 + pitch)
		SSG2 BC 1 BRIGHT// A_FireBullets (4, 4, -1, 5, "HitPuff")
		
		TNT1 A 0 A_PlaySound("D4SSGF", 1)
		SSG2 DEFGHI 1 A_SetPitch(2.0 + pitch)
		SSG2 A 10
		SSG2 KLMN 1
		TNT1 A 15
		TNT1 AA 0 A_FireCustomMissile ("ShotCaseSpawn", 0, 0, -20, -8)
		TNT1 A 15
		SSG2 NMLK 1
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	
	DontFlash:
	    TNT1 A 1
		Goto Flash
	
	FireRightGun:
	    P2W1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_GiveInventory("IsFiringSecondary", 1)
		SSG1 A 0
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_JumpIfInventory("Shell", 2, 1)
		Goto DryFire2
		TNT1 A 0 A_TakeInventory("Shell", 2)
		TNT1 A 0 A_ALertMonsters
		TNT1 A 0 A_firebullets (0,0,1,15,"shotpuff",0,240)
		TNT1 A 0 A_FireBullets (12.0, 5.0, 14, 8, "ShotgunPuff")
		TNT1 A 0 A_SetPitch(-12.0 + pitch)
		SSG1 BC 1 BRIGHT// A_FireBullets (4, 4, -1, 5, "HitPuff")
		
		TNT1 A 0 A_PlaySound("D4SSGF", 1)
		SSG1 DEFGHI 1 A_SetPitch(2.0 + pitch)
		SSG1 A 10
		SSG1 KLMN 1
		TNT1 A 15
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 AA 0 A_FireCustomMissile ("ShotCaseSpawn", 0, 0, 20, -8)
		TNT1 A 15
		SSG1 NMLK 1
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    SSG1 D 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		SSG1 AAAAAAAAAAA 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		Goto Flash
		
	DoKick:
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 10
		FUCK F 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 G 1 A_PlaySound("FUCK", 2)
        FUCK HI 1 A_AlertMonsters
		FUCK J 15 A_Takeinventory("Taunting",1)
        FUCK IHGF 1
        TNT1 A 10
		Goto ReadyToFire
	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 ReadyToFire	
	Steady:
	TNT1 A 1
	Goto ReadyToFire		
	}
}


ACTOR D4Machinegun : DoomWeapon
{
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoType2 "MachinegunUpgrade"
	Inventory.PickupMessage "You got the Machinegun!"
	Obituary "$OB_MPMachinegun"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_Machinegun"
	States
	{
	Ready:
		MAGG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("D4AltMode",1,"Ready4")
		TNT1 A 0 A_JumpIfInventory("MachinegunUpgrade",1,"Ready3")
		TNT1 A 0 A_JumpIfInventory("IsUpgradingWeapons",1,"UpgradeWeapons")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"ChangeAltMode")
		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
		
	Ready2:
		MAGS A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("IsUpgradingWeapons",1,"UpgradeWeapons")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"ChangeAltMode")
		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
		
	Ready3:
		M2GG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("IsUpgradingWeapons",1,"UpgradeWeapons")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"ChangeAltMode")
		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
		
	Ready4:
		M3GG A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("IsUpgradingWeapons",1,"UpgradeWeapons")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"ChangeAltMode")
		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
		
	ChangeAltMode:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("Reloading", 1)
		TNT1 A 0 A_JumpIfInventory("D4AltMode", 1, "ChangeAltMode2")
		M2GG A 1
		TNT1 A 0 A_JumpIfInventory("MachinegunUpgrade", 1, 1)
		Goto NoUpgrades
		M2GG A 1
		TNT1 A 0 A_JumpIfInventory("MachinegunUpgrade", 2, 1)
		Goto NoUpgrades2
		M2GG A 1
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("D4AltMode", 1, "ChangeAltMode2")
		TNT1 A 0 A_GiveInventory("D4AltMode", 1)
		TNT1 A 0 A_Print("Micro missiles mode selected.", 2)
		M2GL CBA 1
		TNT1 A 4
		M3GL ABC 1
		Goto Ready4
		
	ChangeAltMode2:	
		M3GG A 1
		TNT1 A 0 A_TakeInventory("D4AltMode", 1)
		TNT1 A 0 A_Print("Tactical Scope Mode Selected.", 2)
		M3GL CBA 1
		TNT1 A 4
		M2GL ABC 1
		Goto Ready3
		
		
		
		
	Deselect:
		MAGL CBA 0
		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_TakeInventory("IsD4Weapon", 1)
		TNT1 A 0 A_TakeInventory("D4MachinegunSelected", 1)
		TNT1 A 0 A_TakeInventory("D4AltMode", 1)
		MAGG 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)
		TNT1 A 0 A_JumpIfInventory("D4AltMode",1,"Select4")
		TNT1 A 0 A_JumpIfInventory("MachinegunUpgrade",1,"Select3")
		MAGG AAAAAAAAA 0 A_Raise
		Select2:
		TNT1 A 0 A_JumpIfInventory("D4AltMode",1,"Select44")
		TNT1 A 0 A_JumpIfInventory("MachinegunUpgrade",1,"Select33")
		MAGL ABC 1
		TNT1 A 0 A_GiveInventory("D4MachinegunSelected", 1)
		TNT1 A 0 A_GiveInventory("IsD4Weapon", 1)
		Goto Ready
		
	Select3:
		TNT1 A 1 A_Raise
		M2GG AAAAAAAAA 0 A_Raise
		Select33:
		M2GL ABC 1
		TNT1 A 0 A_GiveInventory("D4MachinegunSelected", 1)
		TNT1 A 0 A_GiveInventory("IsD4Weapon", 1)
		Goto Ready3	
	
	Select4:
		TNT1 A 1 A_Raise
		M3GG AAAAAAAAA 0 A_Raise
		Select44:
		M3GL ABC 1
		TNT1 A 0 A_GiveInventory("D4MachinegunSelected", 1)
		TNT1 A 0 A_GiveInventory("IsD4Weapon", 1)
		Goto Ready4	
		
	Fire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
		TNT1 A 0 A_JumpIfInventory("D4AltMode",1,"Fire4")
		TNT1 A 0 A_JumpIfInventory("MachinegunUpgrade",1,"Fire3")
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-2,2),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (2.0, 2.0, 1, 10, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		MAGF A 1 BRIGHT A_SetPitch(-1.0 + pitch)
		MAGF B 1
		MAGF C 1 A_SetPitch(0.5 + pitch)
		MAGG A 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_Refire
		MAGG A 5 A_WeaponReady
		Goto Ready
	
	Fire3:
		TNT1 A 0
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-2,2),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (2.0, 2.0, 1, 10, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		M2GF A 1 BRIGHT A_SetPitch(-1.0 + pitch)
		M2GF B 1
		M2GF C 1 A_SetPitch(0.5 + pitch)
		M2GG A 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_Refire
		M2GG A 5 A_WeaponReady
		Goto Ready3
		
	Fire4:
		TNT1 A 0
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-2,2),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (2.0, 2.0, 1, 10, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		M3GF A 1 BRIGHT A_SetPitch(-1.0 + pitch)
		M3GF B 1
		M3GF C 1 A_SetPitch(0.5 + pitch)
		M3GG A 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_Refire
		M3GG A 5 A_WeaponReady
		Goto Ready4	
		
	Fire2:
		TNT1 A 0 A_FireCustomMissile("Tracer", 0,0,0,-6,0,0)
		TNT1 A 0 A_FireBullets (0.0, 0.0, 1, 10, "MachinegunBulletPuff")
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		MAGS A 1 BRIGHT A_SetPitch(-1.0 + pitch)
		MAGS B 1
		MAGS C 1 A_SetPitch(0.5 + pitch)
		MAGS A 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_Refire
		MAGS A 5 A_WeaponReady
		Goto Ready2	
		
	AltFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("MachinegunUpgrade", 1, 1)
		Goto NoUpgrades
		TNT1 A 0 A_JumpIfInventory("D4AltMode", 1, "AltFire2")
		TNT1 A 0 A_JumpIfInventory("Clip2", 3, 1)
		Goto NoAmmo
		
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"NoAim")
		TNT1 A 0 A_Giveinventory("Zoomed",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
        TNT1 A 0 A_ZoomFactor(2.0)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
        MAGA ABCD 1
        Goto Ready2
      NoAim:
        MAGA DCBA 1
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
        Goto Ready3
		MAGG A 5 A_WeaponReady
		Goto Ready3
		
	AltFire2:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Clip2", 12, 1)
		Goto NoAmmo
		
		TNT1 A 0 A_PlaySound("MICROOPN", 1)
		M3GA ABCDEF 1
		TNT1 A 0 A_PlaySound("MICREADY", 4)
		M3GA FFFFF 1
		
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_TakeInventory("Clip2", 2)
		TNT1 A 0 A_FireCustomMissile("MachinegunRocket", random(-2,2),0,9,-6,0,random(-1,1))
		M3GA G 2 BRIGHT A_SetPitch(-2.0 + pitch)
		M3GA H 1
		M3GA HH 1 A_SetPitch(1.0 + pitch)
		
		TNT1 A 0 A_PlaySound("MICRO2", 3)
		TNT1 A 0 A_TakeInventory("Clip2", 2)
		TNT1 A 0 A_FireCustomMissile("MachinegunRocket", random(-2,2),0,9,-6,0,random(-1,1))
		M3GA I 2 BRIGHT A_SetPitch(-2.0 + pitch)
		M3GA J 1
		M3GA JJ 1 A_SetPitch(1.0 + pitch)
		
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_TakeInventory("Clip2", 2)
		TNT1 A 0 A_FireCustomMissile("MachinegunRocket", random(-2,2),0,9,-6,0,random(-1,1))
		M3GA K 2 BRIGHT A_SetPitch(-2.0 + pitch)
		M3GA L 1
		M3GA LL 1 A_SetPitch(1.0 + pitch)
		
		TNT1 A 0 A_PlaySound("MICRO2", 3)
		TNT1 A 0 A_TakeInventory("Clip2", 2)
		TNT1 A 0 A_FireCustomMissile("MachinegunRocket", random(-2,2),0,9,-6,0,random(-1,1))
		M3GA M 2 BRIGHT A_SetPitch(-2.0 + pitch)
		M3GA N 1
		M3GA NN 1 A_SetPitch(1.0 + pitch)
		
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_TakeInventory("Clip2", 2)
		TNT1 A 0 A_FireCustomMissile("MachinegunRocket", random(-2,2),0,9,-6,0,random(-1,1))
		M3GA O 2 BRIGHT A_SetPitch(-2.0 + pitch)
		M3GA P 1
		M3GA PP 1 A_SetPitch(1.0 + pitch)
		
		TNT1 A 0 A_PlaySound("MICRO2", 3)
		TNT1 A 0 A_TakeInventory("Clip2", 2)
		TNT1 A 0 A_FireCustomMissile("MachinegunRocket", random(-2,2),0,9,-6,0,random(-1,1))
		M3GA Q 2 BRIGHT A_SetPitch(-2.0 + pitch)
		M3GA R 1
		M3GA RR 1 A_SetPitch(1.0 + pitch)
		
		TNT1 A 0 A_PlaySound("MICROEND", 4)
		M3GA EEDCBA 1
		Goto Ready4	
		
	Spawn:
		D4W4 A 1
		TNT1 A 0 A_SpawnItemEx("Machinegunonthefloordroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		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 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 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_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_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_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_Print("No Grenades Left.", 2)
		Goto Ready	
	NoUpgrades:
		TNT1 A 0
		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_Print("You have no upgrades for this weapon.", 2)
		Goto Ready
	NoUpgrades2:
		TNT1 A 0
		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_Print("You don't have a level 2 upgrade for this weapon.", 2)
		Goto Ready	
	NoAmmo:
		TNT1 A 0
		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_Print("You don't have enough ammo to use this weapon's alt fire.", 2)
		Goto Ready	
	UpgradeWeapons:
		TNT1 A 0 
		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_TakeInventory("IsUpgradingWeapons", 1)
		NULL A 0 SetPlayerProperty(0,1,4)
		PK4P ABCDEFGH 2
		TNT1 A 6
		PUN3 ABCDE 1
        TNT1 A 0 A_PlaySound("weapons/gswing")
		PUN3 F 1
		RIFF AA 0 A_FireCustomMissile("PickD4UpgradeAttack", 0, 0, 0, -9)
		PUN3 GHI 1
		PUN3 JK 1
		NULL A 0 SetPlayerProperty(0,0,4)
		TNT1 A 12
		TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		Goto Select2	
	}
}









ACTOR MachinegunRocket: RevenantMissile
{
	Radius 8
	Height 8
	Damage 12
	Scale 0.5
	Speed 45
	-NOEXTREMEDEATH
	-GHOST
	-THRUGHOST
	+SEEKERMISSILE
	Damagetype "ExplosiveImpact"
	Species "Marines"
	States
	{
	Spawn:
	    MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 ThrustThingZ(0,random(-3, 2),0,1)
		MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 ThrustThingZ(0,random(-3, 2),0,1)
		MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 ThrustThing(angle*256/360+64,random(-1, 1),1, 0)
		Loop
	}
}

ACTOR DualMachineguns: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip2" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Repeaters." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra Repeater." //Pickup message
    +WEAPON.NOAUTOAIM //Makes this weapon never autoaim, so recoil can work better
    //Scale 0.6 //Weapon's pickup sprite size
	+WEAPON.NOAUTOFIRE
	States
	{
	
	Spawn:
		D4W4 A 1
		TNT1 A 0 A_SpawnItemEx("Machinegunonthefloordroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		TNT1 A 1
		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_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)
		TNT1 A 0 A_JumpIfInventory("D4Machinegun", 1, 1)
		Goto CantDualNow
		DWS3 ABCD 1
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
	CantDualNow:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("D4Machinegun", 1)
		TNT1 A 0 A_TakeInventory("DualMachineguns", 1)
		Stop
		
	
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		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")
		MAG1 A 1 A_WeaponReady// Weapon is ready to fire
		//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
		Loop
		
	Flash:	//Right gun ready state
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		MAG2 A 1
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
		
		
	Deselect:
		TNT1 AAAAAA 0 A_Lower
		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 1 A_Lower //Makes player switch weapons faster
		Wait
	Select:
		TNT1 A 0 A_Raise //Makes the weapon always be selected fast
		Wait
	
	DryFire:
	    MAG1 A 2 A_PlaySound("DRYFIRE", 1)
		MAG1 A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		MAG1 A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    MAG2 A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Clip2", 1, 1)
		Goto DryFire
		TNT1 A 0 A_TakeInventory("Clip2", 1)
		TNT1 A 0 A_ALertMonsters
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,-12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,-6,-14)
		TNT1 A 0 A_FireBullets (4.0, 4.0, -1, 10, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		MAG1 B 1 BRIGHT A_SetPitch(-1.0 + pitch)
		MAG1 CDA 1 A_SetPitch(0.5 + pitch)
		
		
		MAG1 AAA 1 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	
	DontFlash:
	    TNT1 A 1
		Goto Flash
	
	FireRightGun:
	    P2W1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_GiveInventory("IsFiringSecondary", 1)
		SSG1 A 0
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_JumpIfInventory("Clip2", 1, 1)
		Goto DryFire2
		TNT1 A 0 A_TakeInventory("Clip2", 1)
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (4.0, 4.0, -1, 10, "MachinegunBulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		MAG2 B 1 BRIGHT A_SetPitch(-1.0 + pitch)
		MAG2 CDA 1 A_SetPitch(0.33 + pitch)
		
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		MAG2 AAA 1 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    MAG2 A 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		MAG2 AAAAAAAAAAA 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		Goto Flash
		
		
	DoKick:
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 10
		FUCK F 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 G 1 A_PlaySound("FUCK", 2)
        FUCK HI 1 A_AlertMonsters
		FUCK J 15 A_Takeinventory("Taunting",1)
        FUCK IHGF 1
        TNT1 A 10
		Goto ReadyToFire
	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 ReadyToFire	
	Steady:
	TNT1 A 1
	Goto ReadyToFire			
	}
}


ACTOR D4Repeater : DoomWeapon
{
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Scale 0.7
	Weapon.AmmoType1 "Clip2"
	Inventory.PickupMessage "You got the Repeater Rifle!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		RPTG 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:
		RPTS CBA 0
		RPTG 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)
		RPTG AAAAAAAAA 0 A_Raise
		Select2:
		RPTS ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (1.0, 1.0, 1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RPTF A 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RPTG A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (1.0, 1.0, 1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RPTF B 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RPTG A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (1.0, 1.0, 1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RPTF C 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RPTG A 1
		RPTF EF 1 A_SetPitch(0.5 + pitch)
		RPTG A 1 A_WeaponReady(1)
		TNT1 A 0 A_SetPitch(0.5 + pitch)
		RPTG A 6 A_WeaponReady(1)
		TNT1 A 0 A_Refire
		Goto Ready
		
	Spawn:
		D4W2 B 1
		TNT1 A 0 A_SpawnItemEx("RepeaterOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		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	
	}
}


ACTOR DualRepeaters: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip2" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Repeaters." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra Repeater." //Pickup message
    +WEAPON.NOAUTOAIM //Makes this weapon never autoaim, so recoil can work better
    //Scale 0.6 //Weapon's pickup sprite size
	+WEAPON.NOAUTOFIRE
	States
	{
	
	Spawn:
		D4W2 B 1
		TNT1 A 0 A_SpawnItemEx("RepeaterOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory("D4Repeater", 1, 1)
		Goto CantDualNow
		DWS4 ABCD 1
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
		
	CantDualNow:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("D4Repeater", 1)
		TNT1 A 0 A_TakeInventory("DualRepeaters", 1)
		Stop
	
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		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")
		RP1G A 1 A_WeaponReady// Weapon is ready to fire
		//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
		Loop
		
	Flash:	//Right gun ready state
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		RP2G A 1
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
		
		
	Deselect:
		TNT1 AAAAAA 0 A_Lower
		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 1 A_Lower //Makes player switch weapons faster
		Wait
	Select:
		TNT1 A 0 A_Raise //Makes the weapon always be selected fast
		Wait
	
	DryFire:
	    RP2G A 2 A_PlaySound("DRYFIRE", 1)
		RP2G A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		RP1G A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    RP2G A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Clip2", 3, 1)
		Goto DryFire
		TNT1 A 0 A_TakeInventory("Clip2", 3)
		TNT1 A 0 A_ALertMonsters
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,-12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,-6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP1F A 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP1G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,-12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,-6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP1F B 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP1G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,1-2,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,-6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP1F C 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP1G A 1
		RP1G BC 1 A_SetPitch(0.5 + pitch)
		RP1G A 1 A_SetPitch(0.5 + pitch)
		RP1G A 4
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	
	DontFlash:
	    TNT1 A 1
		Goto Flash
	
	FireRightGun:
	    P2W1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_GiveInventory("IsFiringSecondary", 1)
		SSG1 A 0
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_JumpIfInventory("Clip2", 3, 1)
		Goto DryFire2
		TNT1 A 0 A_TakeInventory("Clip2", 3)
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP2F A 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP2G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP2F B 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP2G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP2F C 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP2G A 1
		RP2G BC 1 A_SetPitch(0.5 + pitch)
		RP2G A 1 A_SetPitch(0.5 + pitch)
		RP2G A 4
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    RP1G A 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		RP1G AAAAAAAAAAA 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		Goto Flash
		
		
	DoKick:
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 10
		FUCK F 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 G 1 A_PlaySound("FUCK", 2)
        FUCK HI 1 A_AlertMonsters
		FUCK J 15 A_Takeinventory("Taunting",1)
        FUCK IHGF 1
        TNT1 A 10
		Goto ReadyToFire
	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 ReadyToFire	
	Steady:
	TNT1 A 1
	Goto ReadyToFire			
	}
}


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	
	}
}


ACTOR D4RocketLauncher : DoomWeapon
{
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "RocketAmmo"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "RocketAmmo"
	Inventory.PickupMessage "You got the Rocket Launcher!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		RKLG 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:
		RKLS CBA 0
		RKLG 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)
		RKLG AAAAAAAAA 0 A_Raise
		Select2:
		RKLS ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0 A_FireCustomMissile("Rocket", 0,1,12,-2,0,0)
		TNT1 A 0 A_PlaySound("RKFIR", 1)
		RKLF AB 1 BRIGHT A_SetPitch(-1.0 + pitch)
		RKLG BCDE 1 A_SetPitch(0.5 + pitch)
		RKLG FGHIJKLMNOPQRSTUVAA 1
		RKLG A 6 A_WeaponReady(1)
		TNT1 A 0 A_Refire
		Goto Ready
		
	Spawn:
		D4W5 A 1
		TNT1 A 0 A_SpawnItemEx("D4RLOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		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	
	}
}

ACTOR DualD4RocketLaunchers: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	Weapon.SlotNumber 2
	Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "RocketAmmo" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Rocket Launchers." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra Rocket Launcher." //Pickup message
    +WEAPON.NOAUTOAIM //Makes this weapon never autoaim, so recoil can work better
    //Scale 0.6 //Weapon's pickup sprite size
	+WEAPON.NOAUTOFIRE
	States
	{
	
	Spawn:
		D4W5 A 1
		TNT1 A 0 A_SpawnItemEx("D4RLOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory("D4RocketLauncher", 1, 1)
		Goto CantDualNow
		DWS5 ABCD 1
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
		
	CantDualNow:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("D4RocketLauncher", 1)
		TNT1 A 0 A_TakeInventory("DualD4RocketLaunchers", 1)
		Stop	
		
	
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		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")
		RK2G A 1 A_WeaponReady// Weapon is ready to fire
		//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
		Loop
		
	Flash:	//Right gun ready state
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		RKLG A 1
		TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, "DontFlash")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
		
		
	Deselect:
		TNT1 AAAAAA 0 A_Lower
		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 1 A_Lower //Makes player switch weapons faster
		Wait
	Select:
		TNT1 A 0 A_Raise //Makes the weapon always be selected fast
		Wait
	
	DryFire:
	    RK2G A 2 A_PlaySound("DRYFIRE", 1)
		RK2G A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		RK2G A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    RK2G A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("RocketAmmo", 1, 1)
		Goto DryFire
		TNT1 A 0 A_TakeInventory("RocketAmmo", 1)
		TNT1 A 0 A_ALertMonsters
		
		TNT1 A 0 A_FireCustomMissile("Rocket", random(-10,1), 0, -9, -4, 0, random(-1,4))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		RK2F AB 1 BRIGHT
		TNT1 A 0 A_SetPitch(-2.2 + pitch)
		TNT1 A 0 A_PlaySound("RKFIR", 1)
		RK2G BCDEFG 1 A_SetPitch(0.2 + pitch)
		RK2G A 1
		TNT1 A 0 A_JumpIfInventory("RocketAmmo", 1, 1)
		Goto DryFire
		RK2G HIJKLMNOPQRSTUVAA 1
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	
	DontFlash:
	    TNT1 A 1
		Goto Flash
	
	FireRightGun:
	    P2W1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_GiveInventory("IsFiringSecondary", 1)
		SSG1 A 0
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_JumpIfInventory("RocketAmmo", 1, 1)
		Goto DryFire2
		TNT1 A 0 A_TakeInventory("RocketAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("Rocket", random(-1,10), 0, 9, -4, 0, random(-1,4))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		RKLF AB 1 BRIGHT
		TNT1 A 0 A_SetPitch(-2.2 + pitch)
		TNT1 A 0 A_PlaySound("RKFIR", 1)
		RKLG BCDEFG 1 A_SetPitch(0.2 + pitch)
		RKLG A 1
		TNT1 A 0 A_JumpIfInventory("RocketAmmo", 1, 1)
		Goto DryFire2
		RKLG HIJKLMNOPQRSTUVAA 1
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    RKLG A 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		RKLG AAAAAAAAAAA 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		Goto Flash
		
		
	DoKick:
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 10
		FUCK F 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 G 1 A_PlaySound("FUCK", 2)
        FUCK HI 1 A_AlertMonsters
		FUCK J 15 A_Takeinventory("Taunting",1)
        FUCK IHGF 1
        TNT1 A 10
		Goto ReadyToFire
	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 ReadyToFire	
	Steady:
	TNT1 A 1
	Goto ReadyToFire			
	}
}


ACTOR D4PlasmaGun : DoomWeapon
{
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "Cell"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Cell"
	Inventory.PickupMessage "You got the Plasma Gun!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		PLRG 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:
		PLRS CBA 0
		PLRG AAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		TNT1 A 0 A_Takeinventory("HasPlasmaWeapon",1)
		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_Giveinventory("HasPlasmaWeapon",1)
		PLRG AAAAAAAAA 0 A_Raise
		Select2:
		PLRS ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0 A_FireCustomMissile("PlasmaBallWeak", random(-1,1),1,6,-3,0,random(-1,1))
		TNT1 A 0 A_PlaySound("PLMFIR", 1)
		PLRF A 1 BRIGHT A_SetPitch(-1.0 + pitch)
		PLRF BC 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_Refire
		PLRG A 6 A_WeaponReady(1)
		Goto Ready
		
	Spawn:
		D4W6 A 1
		TNT1 A 0 A_SpawnItemEx("D4PlasmagunOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		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	
	}
}

ACTOR PlasmaBallWeak: Plasma_Ball
{
	Damage 5
	SeeSound "PLSM9"
	Radius 4
	Height 4
}

ACTOR DualD4Plasmaguns: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	Weapon.SlotNumber 2
	Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Cell" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Plasma Guns." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra Plasma Gun." //Pickup message
    +WEAPON.NOAUTOAIM //Makes this weapon never autoaim, so recoil can work better
    //Scale 0.6 //Weapon's pickup sprite size
	+WEAPON.NOAUTOFIRE
	States
	{
	
	Spawn:
		D4W6 A 1
		TNT1 A 0 A_SpawnItemEx("D4PlasmagunOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory("D4PlasmaGun", 1, 1)
		Goto CantDualNow
		DWS6 ABCD 1
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
		
	CantDualNow:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("D4PlasmaGun", 1)
		TNT1 A 0 A_TakeInventory("DualD4Plasmaguns", 1)
		Stop	
		
	
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		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")
		PLR2 A 1 A_WeaponReady// Weapon is ready to fire
		//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
		Loop
		
	Flash:	//Right gun ready state
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		PLR1 A 1
		TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, "DontFlash")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
		
		
	Deselect:
		TNT1 AAAAAA 0 A_Lower
		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 1 A_Lower //Makes player switch weapons faster
		Wait
	Select:
		TNT1 A 0 A_Raise //Makes the weapon always be selected fast
		Wait
	
	DryFire:
	    PLR2 A 2 A_PlaySound("DRYFIRE", 1)
		PLR2 A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		PLR2 A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    PLR2 A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Cell", 1, 1)
		Goto DryFire
		TNT1 A 0 A_TakeInventory("Cell", 1)
		TNT1 A 0 A_ALertMonsters
		
		TNT1 A 0 A_FireCustomMissile("PlasmaBallWeak", random(-10,1), 0, -9, -4, 0, random(-1,4))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		TNT1 A 0 A_SetPitch(-1.0 + pitch)
		TNT1 A 0 A_PlaySound("PLMFIR", 1)
		PLR2 B 1 BRIGHT A_SetPitch(0.5 + pitch)
		PLR2 C 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		PLR2 AAA 1 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	
	DontFlash:
	    TNT1 A 1
		Goto Flash
	
	FireRightGun:
	    P2W1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_GiveInventory("IsFiringSecondary", 1)
		SSG1 A 0
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_JumpIfInventory("Cell", 1, 1)
		Goto DryFire2
		TNT1 A 0 A_TakeInventory("Cell", 1)
		TNT1 A 0 A_FireCustomMissile("PlasmaBallWeak", random(-1,10), 0, 9, -4, 0, random(-1,4))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		TNT1 A 0 A_SetPitch(-1.0 + pitch)
		TNT1 A 0 A_PlaySound("PLMFIR", 1)
		PLR1 B 1 BRIGHT
		PLR1 CD 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		PLR1 AAA 1 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    PLR1 A 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		PLR1 AAAAAAAAAAA 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		Goto Flash
		
		
	DoKick:
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 10
		FUCK F 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 G 1 A_PlaySound("FUCK", 2)
        FUCK HI 1 A_AlertMonsters
		FUCK J 15 A_Takeinventory("Taunting",1)
        FUCK IHGF 1
        TNT1 A 10
		Goto ReadyToFire
	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 ReadyToFire	
	Steady:
	TNT1 A 1
	Goto ReadyToFire			
	}
}


ACTOR D4VortexRifle : DoomWeapon
{
	Weapon.AmmoUse1 5
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "Cell"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Cell"
	Damagetype "Blast"
	Inventory.PickupMessage "You got the Vortex Rifle!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		VRTG 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
		
	Ready2:
		MAGS 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:
		VRTS CBA 0
		PLRG AAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		TNT1 A 0 A_Takeinventory("HasPlasmaWeapon",1)
		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)
		PLRG AAAAAAAAA 0 A_Raise
		Select2:
		VRTS ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Zoomed", 1, "Fire2")
		TNT1 A 0 A_RailAttack(90, 1, 1, "None", "Purple", 0, 0, "VortexPuff", 0, 0)
		TNT1 A 0 A_PlaySound("VRTRF", 1)
		VRTF ABC 1 BRIGHT A_SetPitch(-2.0 + pitch)
		VRTG BCDEAA 1 A_SetPitch(1.0 + pitch)
		VRTG A 10
		VRTG A 6 A_WeaponReady(1)
		Goto Ready
		
	Fire2:
		TNT1 A 0
		TNT1 A 0 A_RailAttack(150, 1, 1, "Purple", "Purple", 0, 0, "VortexPuffSuper", 0, 0)
		TNT1 A 0 A_PlaySound("VRTRF", 1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("D4AltMode",1)
		MASG BC 1 BRIGHT  A_SetPitch(-4.0 + pitch)
		VRTF ABC 1 BRIGHT  A_SetPitch(-1.0 + pitch)
		VRTG BCDEAA 1 A_SetPitch(2.0 + pitch)
		VRTG A 20
		VRTG A 6 A_WeaponReady(1)
		Goto Ready	
		
		
	AltFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Cell", 6, 1)
		Goto DoKick
		
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"NoAim")
		TNT1 A 0 A_Giveinventory("Zoomed",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
        TNT1 A 0 A_ZoomFactor(3.0)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
		TNT1 A 0 A_PlaySound("VRTRC", 1)
        VRTG EFG 1
        Goto Ready2
      NoAim:
        VRTG GFE 1
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
        Goto Ready
		VRTG A 5 A_WeaponReady
		Goto Ready	
		
	Spawn:
		D4W6 B 1
		Loop
		
	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	
	}
}


ACTOR D4BFG : DoomWeapon
{
	Weapon.AmmoUse1 50
	Weapon.AmmoGive1 100
	Weapon.AmmoType1 "Cell"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Cell"
	Inventory.PickupMessage "You got the Big Fucking Gun 9000! OH YEAH!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Cell",50,1)
		Goto ReadyNoAmmo
		BF4F ABDDBAA 1 BRIGHT 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
		
	ReadyNoAmmo:
		BF4G A 4 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")
		Goto Ready
		
		
	Steady:	
		TNT1 A 0
		TNT1 A 5
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
		
	
	Deselect:
		BF4S CBA 0
		BF4G 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_Giveinventory("HasPlasmaWeapon",1)
		BF4G AAAAAAAAA 0 A_Raise
		Select2:
		BF4S ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0 A_PlaySound("BFGCHARGE", 1)
		TNT1 A 0 A_PlaySound("PLSCHARG", 1)
		BF4F EFGHIJKLM 1 BRIGHT
		BF4C ABCDABCDABCD 1 BRIGHT
		TNT1 A 0 A_PlaySound("BFGFIRE", 1)
		TNT1 A 0 A_FireCustomMissile("D4BFGBall", 0,1,6,-3,0,0)
		BF4F M 1 BRIGHT A_SetPitch(-4.0 + pitch)
		BF4F NOPQ 1 BRIGHT A_SetPitch(1.0 + pitch)
		BF4G A 40
		TNT1 A 0 A_Refire
		BF4G A 10 A_WeaponReady(1)
		Goto Ready
		
	Spawn:
		D4W7 A -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	
	}
}






Actor D4BFGBall : SuperBFGBall
{
    +EXTREMEDEATH
	Damage 100
  Decal BFGLightning
	DeathSound "BFGEXPLO"
    DamageType Desintegrate
	Scale 0.7
	Speed 15
	Species "Marines"
	+THRUSPECIES
	+MTHRUSPECIES
  States
  {
  DM:
		TNT1 A 0
		TNT1 A 0 A_ChangeFLag("THRUSPECIES", 0)
		TNT1 A 0 A_ChangeFLag("MTHRUSPECIES", 0)
		Goto Spawn1
	
	Spawn:
		TNT1 A 0

 Spawn1:
    TNT1 A 0 A_SpawnItemEx("BFGFOG", 0, 0)
	TNT1 A 0 A_SpawnItem("D4BFGTracer")
    BFS1 A 1 BRIGHT A_SpawnItem("GreenFlareMedium",0,0)
    TNT1 A 0 A_SpawnItem("D4BFGTracer")
	BFS1 A 1 BRIGHT A_SpawnItemEx("BFGTrailParticle", Random(-13, 13), Random(-13, 13), Random(0, 18), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    TNT1 A 0 A_SpawnItemEx("BFGFOG", 0, 0)
	TNT1 A 0 A_SpawnItem("D4BFGTracer")
	BFS1 B 1 BRIGHT A_SpawnItem("GreenFlareMedium",0,0)
    TNT1 A 0 A_SpawnItem("D4BFGTracer")
	BFS1 B 1 BRIGHT A_SpawnItemEx("BFGTrailParticle", Random(-13, 13), Random(-13, 13), Random(0, 18), Random(1, 3), 0, (0.1)*Random(-10, 10), Random(-20, 20), 128)
    Loop
 
 Death:
    TNT1 A 0
    //TNT1 A 0 Radius_Quake(4,34,0,12,0)
	
	TNT1 A 0 Bright A_SpawnItem("GreenShockWave",0,0,0)
    //BFE1 A 0 A_SpawnItemEx("BFGDeathParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
    //BFE1 A 0 A_SpawnItemEx("BFGSuperParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
	EXPL AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("BFGBIGFOG", 0, 0, random (0, 360), 2, random (0, 360))
	EXPL AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("BFGDeathParticleFast", 0, 0, random (0, 360), 2, random (0, 360))
	EXPL AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("BFGDeathParticleSuperFast", 0, 0, random (0, 360), 2, random (0, 360))
	EXPL AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("BFGDeathParticleFast", 0, 0, random (0, 360), 2, random (0, 360))
	EXPL AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("BFGDeathParticleFast", 0, 0, random (0, 360), 2, random (0, 360))
    TNT1 A 0 A_SpawnItem("MegaGibRemoving")
	TNT1 A 0 A_Explode(80,300,0)
	TNT1 AAAAA 0 A_SpawnItem("D4BFGTracer")
	BFGB ABCDE 1 Bright A_SpawnItem("GreenFlare",0,0)
    BFGB F 1 Bright
	TNT1 A 0 A_SPawnItem("SuperBFGExtraGiant")
    BFGB GHIJK 1 Bright A_SpawnItem("GreenFlare",0,0)
    Stop
  }
}



actor D4BFGTracer
{
	+NOTARGET
Radius 10
Height 10
+NOTARGET
MaxTargetRange 1000
Damage 15
DamageType Desintegrate
	
	MONSTER
	+FRIENDLY
+NOGRAVITY
+NOTELEPORT
+NODAMAGETHRUST
+THRUGHOST
+NORADIUSDMG
+NOEXTREMEDEATH
+FORCERADIUSDMG
-BLOODSPLATTER
+BLOODLESSIMPACT 
	+DEHEXPLOSION
	+ACTIVATEMCROSS
	+MISSILEMORE
	+LOOKALLAROUND
	+MISSILEEVENMORE
	+THRUACTORS
	Speed 0
States
{
Spawn:
TNT1 A 1 A_Look
Goto See

See:
TNT1 AAAAAA 0 A_Chase
TNT1 AAAAAAA 1 A_Chase
TNT1 AAAAAAA 0 A_Chase
TNT1 A 0 A_NoBlocking
Stop

Missile:
TNT1 A 0 A_facetarget
TNT1 A 0 A_CustomMissile("BFGTrailMissile", 0)
TNT1 A 0 A_NoBlocking
TNT1 A 1
Stop
 }
}




Actor BFGTrailMissile: FastProjectile
{
+BLOODSPLATTER 
-DONTSPLASH
speed 200
damage (random(40,90))
DamageType Desintegrate
Species "Marines"
scale .6
RenderStyle Add
Alpha 0.9
radius 2
height 2
damagetype Normal
Decal "BulletPuff"
States
{

	Spawn:
		TNT1 A 1 BRIGHT A_SpawnItemEx("BFGDesintegrationTracerTrail", 0,               0,              2)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("BFGDesintegrationTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		Loop
	Death:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("PlasmaParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 AA 0 A_SpawnItem("GreenFlare",0,0)
		FRPG ABCDEFGH 1 BRIGHT
		Stop
}
}

actor BFGDesintegrationTracerTrail
{
    Scale 0.09
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        SPKG A 6 BRIGHT
        stop
    }
}



actor BFGDesintegrationTracerTrail2: BFGDesintegrationTracerTrail {    Alpha 0.85 }
actor BFGDesintegrationTracerTrail3: BFGDesintegrationTracerTrail {    Alpha 0.80 }
actor BFGDesintegrationTracerTrail4: BFGDesintegrationTracerTrail {    Alpha 0.75 }
actor BFGDesintegrationTracerTrail5: BFGDesintegrationTracerTrail {    Alpha 0.70 }
actor BFGDesintegrationTracerTrail6: BFGDesintegrationTracerTrail {    Alpha 0.65 }
actor BFGDesintegrationTracerTrail7: BFGDesintegrationTracerTrail {    Alpha 0.60 }
actor BFGDesintegrationTracerTrail8: BFGDesintegrationTracerTrail {    Alpha 0.55 }
actor BFGDesintegrationTracerTrail9: BFGDesintegrationTracerTrail {    Alpha 0.50 }
actor BFGDesintegrationTracerTrail10: BFGDesintegrationTracerTrail {    Alpha 0.45 }
actor BFGDesintegrationTracerTrail11: BFGDesintegrationTracerTrail {    Alpha 0.40 }
actor BFGDesintegrationTracerTrail12: BFGDesintegrationTracerTrail {    Alpha 0.35 }
actor BFGDesintegrationTracerTrail13: BFGDesintegrationTracerTrail {    Alpha 0.30 }
actor BFGDesintegrationTracerTrail14: BFGDesintegrationTracerTrail {    Alpha 0.25 }
actor BFGDesintegrationTracerTrail15: BFGDesintegrationTracerTrail {    Alpha 0.20 }
actor BFGDesintegrationTracerTrail16: BFGDesintegrationTracerTrail {    Alpha 0.15 }
actor BFGDesintegrationTracerTrail17: BFGDesintegrationTracerTrail {    Alpha 0.10 }
actor BFGDesintegrationTracerTrail18: BFGDesintegrationTracerTrail {    Alpha 0.05 }


ACTOR D4GaussCannon : DoomWeapon
{
	Weapon.AmmoUse1 15
	Weapon.AmmoGive1 50
	Weapon.AmmoType1 "Cell"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Cell"
	Inventory.PickupMessage "You got the Gauss Cannon!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		GCAG 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:
		GCAS CBA 0
		GCAG 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)
		GCAG AAAAAAAAA 0 A_Raise
		Select2:
		GCAS ABC 1
		Goto Ready
		
	Fire:
		GCAF ABCD 1 BRIGHT
		TNT1 A 0 A_PlaySound("GCANFIR", 1)
		TNT1 A 0 A_FireCustomMissile("GaussCannonShot", 0,1,6,-3,0,0)
		GCAF E 1 BRIGHT A_SetPitch(-4.0 + pitch)
		GCAF F 1 BRIGHT
		GCAF GHIJ 1 A_SetPitch(1.0 + pitch)
		GCAG A 15
		Goto Ready
		
	Spawn:
		D4W7 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	
	}
}


Actor GaussCannonShot: FastProjectile
{
+BLOODSPLATTER 
-DONTSPLASH
+RIPPER
speed 190
damage (random(40,50))
scale .9
RenderStyle Add
Alpha 0.9
radius 8
Decal Scorch
height 8
+FORCERADIUSDMG
+EXTREMEDEATH
Decal "Scorch"
States
{

	Spawn:
		TNT1 A 1 BRIGHT A_SpawnItemEx("gaussheavyplasmaTracerTrail", 0,               0,              2)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("gaussheavyplasmaTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_CustomMissile ("BluePlasmaFireNonStatic", 2, 0, random (0, 360), 2, random (0, 180))
		TNT1 AAA 0 A_CustomMissile ("BlueplasmaParticle", 0, 0, random (0, 360))
		Loop
	Death:
		TNT1 AAAAA 0 A_SpawnItem("BlueFlare")
		
		TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaFireNonStatic", 2, 0, random (0, 360), 2, random (0, 180))
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("BlueplasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_CustomMissile("BigRicoChet")
        TNT1 A 0 A_SpawnItemEx ("DetectFloorCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("DetectCeilCrater",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("UnderwaterExplosion",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_PlaySound("FAREXPL", 3)
		TNT1 A 0 A_SpawnItemEx ("RocketExplosion",0,0,13,0,0,0,0,SXF_NOCHECKPOSITION,0)
		EXPL AAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionSmokeFast22", 0, 0, random (0, 360), 2, random (0, 360))
		BL1I ABCD 1 BRIGHT A_SpawnItem("BlueFlare")
		TNT1 A 0 A_SpawnItemEx ("LiquidExplosionEffectSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_Explode(200, 20)
		Stop
}
}

actor gaussheavyplasmaTracerTrail
{
    Scale 0.4
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        SPKB A 2 BRIGHT
        stop
    }
}



actor gaussheavyplasmaTracerTrail2: gaussheavyplasmaTracerTrail {    Alpha 0.85 }
actor gaussheavyplasmaTracerTrail3: gaussheavyplasmaTracerTrail {    Alpha 0.80 }
actor gaussheavyplasmaTracerTrail4: gaussheavyplasmaTracerTrail {    Alpha 0.75 }
actor gaussheavyplasmaTracerTrail5: gaussheavyplasmaTracerTrail {    Alpha 0.70 }
actor gaussheavyplasmaTracerTrail6: gaussheavyplasmaTracerTrail {    Alpha 0.65 }
actor gaussheavyplasmaTracerTrail7: gaussheavyplasmaTracerTrail {    Alpha 0.60 }
actor gaussheavyplasmaTracerTrail8: gaussheavyplasmaTracerTrail {    Alpha 0.55 }
actor gaussheavyplasmaTracerTrail9: gaussheavyplasmaTracerTrail {    Alpha 0.50 }
actor gaussheavyplasmaTracerTrail10: gaussheavyplasmaTracerTrail {    Alpha 0.45 }
actor gaussheavyplasmaTracerTrail11: gaussheavyplasmaTracerTrail {    Alpha 0.40 }
actor gaussheavyplasmaTracerTrail12: gaussheavyplasmaTracerTrail {    Alpha 0.35 }
actor gaussheavyplasmaTracerTrail13: gaussheavyplasmaTracerTrail {    Alpha 0.30 }
actor gaussheavyplasmaTracerTrail14: gaussheavyplasmaTracerTrail {    Alpha 0.25 }
actor gaussheavyplasmaTracerTrail15: gaussheavyplasmaTracerTrail {    Alpha 0.20 }
actor gaussheavyplasmaTracerTrail16: gaussheavyplasmaTracerTrail {    Alpha 0.15 }
actor gaussheavyplasmaTracerTrail17: gaussheavyplasmaTracerTrail {    Alpha 0.10 }
actor gaussheavyplasmaTracerTrail18: gaussheavyplasmaTracerTrail {    Alpha 0.05 }

ACTOR UpgradeBot: SwitchableDecoration
{
    Radius 24
	Height 60
	+SOLID
	+USESPECIAL
	MONSTER
	-COUNTKILL
	+SHOOTABLE
	+LOOKALLAROUND
	-THRUACTORS
	+NOINFIGHTING
	MaxTargetRange 120
	+NOBLOOD
	Activation THINGSPEC_Activate | THINGSPEC_ThingTargets | THINGSPEC_NoDeathSpecial
	Mass 999999
	Speed 0
	health 1000
	+FLOATBOB
	+NOGRAVITY
	DamageFactor "DestroyUpgradeStation", 9999.0
	Scale 1.0
    States
    {
    Spawn:
	    UABB AB 2 BRIGHT
		Loop
	Spawn2:
		UABB CD 2 BRIGHT
		Loop
	
	Active:
		UABB A 1 
		TNT1 A 0 A_JumpIfInTargetInventory("IsD4Weapon", 1, 1)
		Goto CantUpgrade
		UABB A 1
		TNT1 A 0 A_JumpIfInTargetInventory("D4ShotgunSelected", 1, "UpgradeShotgun")
		TNT1 A 0 A_JumpIfInTargetInventory("D4MachinegunSelected", 1, "UpgradeMachinegun")
		UABB B 2
		Goto CantUpgrade
		Stop
	
	UpgradeShotgun:
		UABB A 1
		TNT1 A 0 A_JumpIfInTargetInventory("ShotgunUpgrade", 2, "MaxUpgrade")
		TNT1 A 0 A_GiveToTarget("ShotgunUpgrade", 1)
		TNT1 A 0 A_GiveToTarget("IsUpgradingWeapons", 1)
		UABB ABABABAB 2 BRIGHT
		Goto Spawn2
	
	UpgradeMachinegun:
		UABB A 1
		TNT1 A 0 A_JumpIfInTargetInventory("MachinegunUpgrade", 2, "MaxUpgrade")
		TNT1 A 0 A_GiveToTarget("MachinegunUpgrade", 1)
		TNT1 A 0 A_GiveToTarget("IsUpgradingWeapons", 1)
		UABB ABABABAB 2 BRIGHT
		Goto Spawn2
		
	CantUpgrade:
		TNT1 A 0
		TNT1 A 0 A_Print("This weapon can't be upgraded.", 2)
		TNT1 A 0 A_Noblocking
		TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
		TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
		TNT1 A 0 A_ChangeFlag("FLOATBOB", 0)
		TNT1 A 0 A_SpawnItemEx ("UpgradeBot", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
		TNT1 A 1
		TNT1 A -1
		Goto Spawn
		
	MaxUpgrade:
		TNT1 A 0
		TNT1 A 0 A_Print("This weapon already has all possible upgrades.", 2)
		TNT1 A 0 A_Noblocking
		TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
		TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
		TNT1 A 0 A_ChangeFlag("FLOATBOB", 0)
		TNT1 A 0 A_SpawnItem("UpgradeBot")
		TNT1 A 1
		TNT1 A -1
		Goto Spawn	
	
	Death:	
		UABB E 1
		TNT1 A 0 A_PlaySound("weapons/explode")
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		TNT1 AA 0 A_CustomMissile ("XJunk1", 55, 0, random (0, 360), 2, random (40, 150))
		TNT1 AA 0 A_CustomMissile ("XJunk2", 55, 0, random (0, 360), 2, random (40, 150))
		TNT1 AAAA 0 A_CustomMissile ("XJunk3", 55, 0, random (0, 360), 2, random (40, 150))
		TNT1 AAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 50, 0, random (0, 360), 2, random (0, 180))
        TNT1 AAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 50, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAAAAAAA 0 A_CustomMissile ("ExplosionParticleVeryFast", 50, 0, random (0, 360), 2, random (0, 360))
        TNT1 AAAAA 0 A_CustomMissile ("MediumExplosionFlames", 50, 0, random (0, 360), 2, random (0, 360))
        EXPL AAAAA 0 A_CustomMissile ("ExplosionSmokeFast22", 50, 0, random (0, 360), 2, random (0, 360))
		UABB E 1 A_FaceTarget
		TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
		TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
		TNT1 A 0 A_ChangeFlag("FLOATBOB", 0)
		TNT1 A 0 ThrustThingZ(0,25,0,1)
		UABB E 8 A_Recoil(3)
		UABB F -1
		Stop	
	}
}
ACTOR RepeaterOnTheFloor: CustomInventory
{
 scale 1.0
 radius 16
 height 16
 +THRUACTORS
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Repeater!"
    States
    {

	 Spawn:
		TNT1 A 0
		D4W2 B 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W2 B -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4Repeater", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4Repeater", 1)
		TNT1 A 0 A_GiveInventory("Clip2", 10)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualRepeaters", 1)
		TNT1 A 0 A_GiveInventory("Clip2", 10)
		Stop
    }
}


ACTOR RepeaterOnTheFloorDroped: RepeaterOnTheFloor
{
    States
    {

	 Spawn:
		D4W2 B 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W2 B -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4Repeater", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4Repeater", 1)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualRepeaters", 1)
		Stop	
    }
}





ACTOR D4PistolOnTheFloor: CustomInventory
{
 scale 1.0
 radius 16
 height 16
 +THRUACTORS
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Pistol!"
    States
    {

	 Spawn:
		TNT1 A 0
		D4W1 A 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W1 A -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4Pistol", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4Pistol", 1)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualD4PeaShooter", 1)
		Stop
    }
}


















ACTOR D4SSGOnTheFloor: CustomInventory
{
 scale 1.0
 radius 16
 height 16
 +THRUACTORS
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Super Shotgun!"
    States
    {

	 Spawn:
		TNT1 A 0
		D4W3 B 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W3 B -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4SSG", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4SSG", 1)
		TNT1 A 0 A_GiveInventory("Shell", 6)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("D4DualSSG", 1)
		TNT1 A 0 A_GiveInventory("Shell", 6)
		Stop
    }
}


ACTOR D4SSGOnTheFloorDroped: D4SSGOnTheFloor
{
    States
    {

	 Spawn:
		D4W2 B 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W2 B -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4SSG", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4SSG", 1)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("D4DualSSG", 1)
		Stop	
    }
}






ACTOR MachinegunOnTheFloor: CustomInventory
{
 scale 1.0
 radius 16
 height 4
 +THRUACTORS
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Machinegun!"
    States
    {

	 Spawn:
		D4W4 A 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W4 A -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4Machinegun", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4Machinegun", 1)
		TNT1 A 0 A_GiveInventory("Clip2", 20)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualMachineguns", 1)
		TNT1 A 0 A_GiveInventory("Clip2", 20)
		Stop
    }
}



ACTOR MachinegunOnTheFloorDroped: MachinegunOnTheFloor
{
    States
    {

	 Spawn:
		D4W4 A 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W4 A -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4Machinegun", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4Machinegun", 1)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualMachineguns", 1)
		Stop	
    }
}








ACTOR D4RLOnTheFloor: CustomInventory
{
 scale 1.0
 radius 16
 height 16
 +THRUACTORS
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Rocket Launcher!"
    States
    {

	 Spawn:
		TNT1 A 0
		D4W5 A 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W5 A -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4RocketLauncher", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4RocketLauncher", 1)
		TNT1 A 0 A_GiveInventory("RocketAmmo", 4)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualD4RocketLaunchers", 1)
		TNT1 A 0 A_GiveInventory("RocketAmmo", 4)
		Stop
    }
}


ACTOR D4RLOnTheFloorDroped: D4RLOnTheFloor
{
    States
    {

	 Spawn:
		D4W5 A 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W5 A -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4RocketLauncher", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4RocketLauncher", 1)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualD4RocketLaunchers", 1)
		Stop	
    }
}






ACTOR D4PlasmagunOnTheFloor: CustomInventory
{
 scale 1.0
 radius 16
 height 16
 +THRUACTORS
 damage 0
   Mass 1
   Inventory.PickupMessage "You got the Plasma Rifle!"
    States
    {

	 Spawn:
		TNT1 A 0
		D4W6 A 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W6 A -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4Plasmagun", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4Plasmagun", 1)
		TNT1 A 0 A_GiveInventory("Cell", 50)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualD4Plasmaguns", 1)
		TNT1 A 0 A_GiveInventory("Cell", 50)
		Stop
    }
}


ACTOR D4PlasmagunOnTheFloorDroped: D4PlasmagunOnTheFloor
{
    States
    {

	 Spawn:
		D4W6 A 10
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 0)
		D4W6 A -1
		Stop
	Pickup:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("D4Plasmagun", 1, "Pickup2")
		TNT1 A 0 A_GiveInventory("D4Plasmagun", 1)
		Stop
	Pickup2:
	    TNT1 A 0 A_GiveInventory("DualD4Plasmaguns", 1)
		Stop	
    }
}
