ACTOR SguyShield : Rifle
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "BDPistolAmmo"
	Weapon.AmmoType2 "MeatAmmo"
	Weapon.SelectionOrder 9999
	+WEAPON.CHEATNOTWEAPON
	+WEAPON.NO_AUTO_SWITCH
	States
	{
	Ready:
		SSHG A 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("MeatAmmo", 40, "Destroy")
		TNT1 A 0 A_SpawnItemEx("MeatShield", 16, -11, 0, 0)
        Loop

	Select:
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
	    TNT1 A 0 A_TakeInventory("MeatAmmo", 100)
		TNT1 A 0 A_Raise
		SSHG A 1 offset(0,40)
		SSHG A 1 offset(0,48)
		Goto LoadBullets

	LoadBullets:
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",16,"Ready")
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDPistolAmmo",1)
		TNT1 A 0 A_Giveinventory("BDDualPistolAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip1",1)
		Goto LoadBullets

	Fire:
	    TNT1 A 0
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo", 1, 1)
		Goto AltFire
		TNT1 A 0 A_FireCustomMissile("DistantFireSoundPistol", random(-1,1), 0, 0, -12, 0, random(-1,1))
		TNT1 A 0 A_PlaySound("pfire")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",32,-4,28)
		SSHF A 2 BRIGHT A_FireBullets (1.8, 1.4, -1, 14, "WeakPuff", FBF_NORANDOM)
		TNT1 A 0 A_SpawnItemEx("MeatShield", 16, -11, 0, 0)
		TNT1 A 0 A_ZoomFactor(0.99)
        TNT1 A 0 A_FireCustomMissile("DecorativeTracer",random(-1,1),0,8,0,0,random(-1,1))
		PI2G A 0 A_Takeinventory("BDPistolAmmo",1)
		PI2G A 0 A_Takeinventory("BDDualPistolAmmo",1)
		PI2G A 0 A_FireCustomMissile("PistolCaseSpawn",5,0,16,-4)
		SSHF B 2
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_SpawnItemEx("MeatShield", 16, -11, 0, 0)
		SSHF C 2
		TNT1 A 0 A_SpawnItemEx("MeatShield", 16, -11, 0, 0)
		SSHG A 1
		TNT1 A 0 A_Refire
		Goto Ready

	Deselect:
    AltFire:
		GRZ2 D 1 offset(-4, 32)
        GRZ2 D 1 offset(-9, 33)
        GRZ2 D 1 offset(-16, 34)
        GRZ2 D 2 offset(-24, 35)
        GRZ2 D 3 offset(-36, 48)
        GRZ2 D 1 offset(-24, 35)
        GRZ2 B 1 offset(-16, 34)
        GRZ2 B 1 offset(-9, 33)
        GRZ2 B 1 offset(-1, 32)
        TNT1 A 0 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_FireCustomMissile("ThrowedShotgunguy", 0, 0, 0, 0)
		TNT1 A 0 A_TakeInventory("GoSpecial",1)
        TNT1 A 0 A_TakeInventory("GotMeatShield", 1)
        TNT1 A 0 A_TakeInventory("HasSguyShield",1)
        TNT1 A 0 A_Giveinventory("Punching",1)
        THEF BCD 4
        TNT1 A 0 A_TakeInventory("SguyShield",1)
        Stop

 	Spawn:
		8876 A -1
		Stop

	Destroy:
	    TNT1 A 0
		TNT1 A 0 A_SpawnItem("ShotgunguyHeadExplode", 0, 50)
		SSHG DEFGHII 5
		TNT1 A 0 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_FireCustomMissile("ThrowedShotgunguyNoHead", 0, 0, 0, 0)
		TNT1 A 0 A_TakeInventory("GoSpecial",1)
        TNT1 A 0 A_TakeInventory("GotMeatShield", 1)
        TNT1 A 0 A_TakeInventory("HasSguyShield",1)
        TNT1 A 0 A_Giveinventory("Punching",1)
        THEF BCD 4
        TNT1 A 0 A_TakeInventory("SguyShield",1)
        Stop
	}
}

ACTOR ThrowedShotgunguy: ThrowedZman
{
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Playsound("Shotgunguy/death", 1)
	Flying:
        X722 H 2
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		X722 GFEDCBA 2
		Loop

    Death:
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CheckCeiling("HitCeil")
		TNT1 A 0 A_JumpIfHealthLower(-40, "Death.Gibs")
		TNT1 A 0 A_JumpIfHealthLower(1, "Death.Shotgun")
		X722 H 2
		NULL AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL A 0 A_CustomMissile ("ThrowedShotgunguyRicochet", 0, 0, 0, 2, 38)
		Stop

	HitCeil:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL A 0 A_CustomMissile ("ThrowedShotgunguyRicochet", 0, 0, 0, 2, -5)
		Stop

	Crashing:
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem("DeadShotgunguy")
		TNT1 A 3
		Stop

	Death.Melee:
	Death.Fatality:
	Death.ExtremePunches:
	Death.Kick:
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		NULL A 0 A_CustomMissile ("ThrowedShotgunguyRicochet", 0, 0, 180, 2, 32)
		Stop

	Death.Gibs:
	Death.Explosive:
	Death.Shotgun:
		TNT1 A 0
		TNT1 AAAAA 0 A_CustomMissile ("SuperWallRedBlood", 40, 0, random (0, 360), 2, random (-15, 15))
		TNT1 AAAAAAAAA 0 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))
		TNT1 A 0 A_CustomMissile ("XDeathSergeantHeadOnXDeath", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("XDeathArm1", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 AAA 0 A_CustomMissile ("SuperGoreSpawner", 30, 0, random (0, 360), 2, random (30, 60))
		TNT1 AAAA 0 A_CustomMissile ("XDeath2b", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 AAAA 0 A_CustomMissile ("XDeath3b", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece2", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece1", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("XDeathOrgan1", 24, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("XDeathOrgan2", 24, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("XDeathHalfShotgunguyNoArmNoHead", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 AAAAAAA 0 A_CustomMissile ("Guts", 32, 0, random (0, 360), 2, random (60, 90))
		TNT1 A 0 A_CustomMissile ("XDeathSargeLeg2", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("GibSargeBoot", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_SpawnItem ("BigBloodSpot")
		TNT1 A 1
		TNT1 AAAAAA 0 A_CustomMissile ("BloodMistExtraBig", 30, 0, random (0, 360), 2, random (40, 90))
		Stop
	}
}



ACTOR ThrowedShotgunguyRicochet: ThrowedShotgunguy
{
    +BOUNCEONWALLS
	+THRUGHOST
	+BOUNCEONACTORS
	WallBounceFactor 0.6
	Speed 10
	States
	{
	Spawn:
        X722 H 2
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		X722 GFEDCBA 2
		Loop
    Death:
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_JumpIfHealthLower(-40, "Death.Gibs")
		TNT1 A 0 A_JumpIfHealthLower(1, "Death.Shotgun")
	Goto Crashing
	}
}

ACTOR ThrowedShotgunguyNoHead: ThrowedZman
{
	States
	{
	Spawn:
		TNT1 A 0
	Flying:
        X722 P 2
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		X722 ONMLKJI 2
		Loop

    Death:
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CheckCeiling("HitCeil")
		TNT1 A 0 A_JumpIfHealthLower(-40, "Death.Gibs")
		TNT1 A 0 A_JumpIfHealthLower(1, "Death.Shotgun")
		X722 P 2
		NULL AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL A 0 A_CustomMissile ("ThrowedShotgunguyNoHeadRicochet", 0, 0, 0, 2, 38)
		Stop

	HitCeil:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL A 0 A_CustomMissile ("ThrowedShotgunguyNoHeadRicochet", 0, 0, 0, 2, -5)
		Stop

	Crashing:
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem("DeadShotgunguySOSLL")
		TNT1 A 3
		Stop

	Death.Melee:
	Death.Fatality:
	Death.ExtremePunches:
	Death.Kick:
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		NULL A 0 A_CustomMissile ("ThrowedShotgunguyNoHeadRicochet", 0, 0, 180, 2, 32)
		Stop

	Death.Gibs:
	Death.Explosive:
	Death.Shotgun:
		TNT1 A 0
		TNT1 AAAAA 0 A_CustomMissile ("SuperWallRedBlood", 40, 0, random (0, 360), 2, random (-15, 15))
		TNT1 AAAAAAAAA 0 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))
		TNT1 A 0 A_CustomMissile ("XDeathArm1", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 AA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 AAA 0 A_CustomMissile ("SuperGoreSpawner", 30, 0, random (0, 360), 2, random (30, 60))
		TNT1 AAAA 0 A_CustomMissile ("XDeath2b", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 AAAA 0 A_CustomMissile ("XDeath3b", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece2", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece1", 15, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("XDeathOrgan1", 24, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("XDeathOrgan2", 24, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("XDeathHalfShotgunguyNoArmNoHead", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 AAAAAAA 0 A_CustomMissile ("Guts", 32, 0, random (0, 360), 2, random (60, 90))
		TNT1 A 0 A_CustomMissile ("XDeathSargeLeg2", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_CustomMissile ("GibSargeBoot", 32, 0, random (0, 360), 2, random (10, 90))
		TNT1 A 0 A_SpawnItem ("BigBloodSpot")
		TNT1 A 1
		TNT1 AAAAAA 0 A_CustomMissile ("BloodMistExtraBig", 30, 0, random (0, 360), 2, random (40, 90))
		Stop
	}
}
ACTOR ThrowedShotgunguyNoHeadRicochet: ThrowedShotgunguyNoHead
{
    +BOUNCEONWALLS
	+THRUGHOST
	+BOUNCEONACTORS
	WallBounceFactor 0.6
	Speed 10
	States
	{
	Spawn:
        X722 P 2
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		X722 ONMLKJI 2
		Loop
    Death:
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_JumpIfHealthLower(-40, "Death.Gibs")
		TNT1 A 0 A_JumpIfHealthLower(1, "Death.Shotgun")
	Goto Crashing
	}
}

ACTOR ThrowedSergeant2: ThrowedShotgunguy
{
    +NOGRAVITY
}

ACTOR ExtremePunchedShotgunguy: ThrowedShotgunguy
{
	Speed 30
	+THRUGHOST
	States
	{
	Spawn:
        SPO4 ZZ 2 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 90))
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		Loop
    Death:
		TNT1 A 0
		TNT1 A 0 A_CheckFloor("Floor")
		TNT1 A 0 A_CheckCeiling("Floor")
		TNT1 A 0 A_SetAngle(angle-180)
		TNT1 A 0 A_Stop
		TNT1 A 0 A_ChangeFlag("LOWGRAVITY", 1)
		TNT1 AA 0 A_CustomMissile ("XDeath2", 32, 0, random (170, 190), 2, random (0, 0))
		TNT1 AA 0 A_CustomMissile ("XDeath3", 32, 0, random (170, 190), 2, random (0, 0))
		TNT1 A 0 A_SpawnItem("Muchblood2", 0, 40)

	    TNT1 AAA 0 A_CustomMissile ("Guts", 32, 0, random (150, 210), 2, random (0, 40))
		TNT1 AA 0 A_CustomMissile ("XDeathArm1", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 A 0 A_CustomMissile ("ShotgunguyHeadExplode", 32, 0, random (170, 190), 2, random (0, 40))
        TNT1 A 0 A_XScream
		TNT1 A 0 A_NoBlocking
        SZD1 EEEEEFF 6
		TNT1 A 0 A_ChangeFlag("LOWGRAVITY", 0)
		SZD1 GH 6
		TNT1 A 0 A_SpawnItem ("GrowingBloodPool")
		TNT1 A 0 A_SpawnItem("DeadShotgunguySZD1H")
		TNT1 A -1
        Stop

	Floor:
		TNT1 AA 0 A_CustomMissile ("XDeath1", 35, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_Recoil(-30)
		SPO4 ABCD 4
		SPO4 EFGHIJ 4 A_JumpIf((MomY == 0), "DSFStop")
		Goto DSFStop+1

	DSFStop:
		TNT1 A 0 A_SpawnItem("Ploft3")
		TNT1 A 0 A_Stop
		TNT1 A 0 A_SpawnItem ("GrowingBloodPool")
		TNT1 A 0 A_CustomMissile ("SuperWallRedBlood", 2, 0, random (170, 190), 2, random (0, 0))
		TNT1 A 0 A_SpawnItem("DeadShotgunguySPO4J")
		TNT1 A -1
		Stop
	}
}