// *** MODIFIED BY CHEBMASTER
// I mark most important places modified by me with //***Che -- unless I forget to.
















actor BigGibBase
{   Radius 10
    Height 10
	+CLIENTSIDEONLY
    +NOTELEPORT
    +MOVEWITHSECTOR
	+DONTSPLASH
	+NOBLOCKMONST
	-NOBLOCKMAP
	+GHOST
	+THRUACTORS
	+FLOORCLIP
	+SLIDESONWALLS
	+FORCEXYBILLBOARD
	+NOTAUTOAIMED
	DamageFactor "CauseObjectsToSplash", 0.0
	DamageFactor "GibRemoving", 0.5
	//+SOLID
	-SOLID
	+SHOOTABLE
	damagefactor "Crush", 50.0
	damagefactor "Shrapnel", 100.0
    damagefactor "Plasma", 20.0
	 damagefactor "TeleportRemover", 1000.0
	 painchance "Flames", 0
	 painchance "Fire", 0
	 painchance "Burn", 0
	 painchance "KillMe", 0
	 damagefactor "Kick", 3.0
	damagefactor "SuperKick", 3.0
	damagefactor "Headkick", 0.0
	damagefactor "ExtremePunches", 2.0
    Mass 1000
    Health 100
    damagefactor "Blood", 0.0    damagefactor "Green_BLood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    damagefactor "Trample", 5000.0
	damagefactor "Saw", 40.0
	damagefactor "Cut", 40.0
	damagefactor "Water", 0.0
	painchance 255
	States    {
		Spawn:
			TNT1 A 1900 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		   Loop 
		 
		 NoColision:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			Goto Rest
			
		Rest:
			TNT1 A 1
			TNT1 A -1
			Stop
		   
		Death:
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			 TNT1 AAA 0 A_CustomMissile ("XDeathSkinPiece2", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			 TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			 TNT1 AA 0 A_CustomMissile ("SmallSuperGore", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 170))
			 TNT1 AA 0 A_CustomMissile ("BloodMistBig", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			Stop
		Death.plasma:
		Death.Electric:
		Death.Burn:
		Death.Fire:
		Death.Flames:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_Jump(128, "DeathFire2")
			TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)
			TNT1 A 0
			Stop
		
		DeathFire2:
			TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat3", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)
			TNT1 A 0
			Stop
		Death.Trample:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
		Death.Crush:
		Death.Stomp:
		Death.SuperPunch:
		Death.ExtremePunches:
			 TNT1 AAA 0 A_CustomMissile ("XDeath1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 30))
			 TNT1 AAAA 0 A_CustomMissile ("FBD_Bloodmist", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 30))
			 TNT1 AAAAAAA 0 A_CustomMissile ("XDeathSkinPiece2", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 30))
			 TNT1 AAAA 0 A_CustomMissile ("XDeathSkinPiece1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 130))
			 TNT1 A 0 A_PlaySOund("misc/xdeath5", 1)
			 TNT1 A 0 A_PlaySOund("misc/xdeath3", 3)
			 TNT1 A 0 A_PlaySOund("misc/xdeath2", 2)
			 TNT1 A 0 A_SpawnItem("SplatteredSmall")
			 XMT2 I 1
			 XMT2 I -1
			 Stop
		Death.TeleportRemover:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOCLIP", 1)
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 1)
			TNT1 A 0 A_NoBlocking
			Stop	 
		Death.GibRemoving:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOCLIP", 1)
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 1)
			TNT1 A 0 A_NoBlocking
			Stop
		
		Death.Desintegrate:
			 TNT1 A 0
			 TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodFake", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 90))
			 TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 7, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 60))
			 TNT1 A 0 A_CustomMissile ("BloodMistSmall", 7, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 60))
			 Stop
		LandOnLava: //***Che
			TNT1 A 0
		Goto Death.Burn
		Death.Freeze: //***Che
		Death.Ice:
		Death.Frost:
		Death.IOS_Frost:
			TNT1 A 0 A_PlaySound ("ice/shatter")
			TNT1 AAA 0 A_CustomMissile ("XIceChunk1", 8, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XIceChunk2", 8, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XIceChunk3", 8, 0, random (0, 360), 2, random (40, 120))
			TNT1 A 1
			Stop		
		
		 }}

actor FBD_LimbBase: BigGibBase
{   Radius 6
    Height 10
    Mass 1000
    Painchance 256
    Health 35
    +FORCEXYBILLBOARD
	+DONTSPLASH
	+SHOOTABLE
	-CLIENTSIDEONLY
	+NOBLOCKMONST
	//+SOLID
	+THRUACTORS
	+FLOORCLIP
	damagefactor "Crush", 50.0
    DeathSound "misc/xdeath5"
    damagefactor "Blood", 0.0    damagefactor "Green_BLood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    //damagefactor "Plasma", 99000.0
    damagefactor "Trample", 2.0
	damagefactor "Kick", 9.0
	damagefactor "Explosive", 0.1
	damagefactor "ExplosiveImpact", 9.1
	//***Che
	DamageFactor "FriendlyExplosion", 9.1
	
	damagefactor "Shrapnel", 100.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	damagefactor "Plasma", 20.0
	painchance 255
	States    {
		Spawn:
			TNT1 A 1900 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			Loop 
			
		LandOnLava: //***Che: this default stub method produces *four* carbon lumps, 
					// one small and three tiny
			CARB Y 1 // small carbon lump	
			TNT1 AAA 0 A_SpawnItemEx("CarbonChunkLandingOnLava", random(-7, 7), random(-7, 7))
			TNT1 A 0 A_QueueCorpse
			CARB Y -1
			Stop	
    }}
		
		
actor GreenFBD_LimbBase: FBD_LimbBase
{		
		BloodType "Green_Blood", "GreenFBD_SawBlood", "GreenFBD_SawBlood"
		BloodColor "DarkGreen"
		States
		{
		Death:
  	    TNT1 AAAAAAA 0 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 180), 2, random (0, 180))
		TNT1 A 1 A_CustomMissile ("XDeath1Green", 5, 5, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("XDeath2bGreen", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
        TNT1 AA 0 A_SpawnItem ("Green_BloodSpot", 0, 1)
        XDT3 BCDEFGH 3
	Death.Crush:	Death.Stomp:	Death.SuperPunch:	Death.ExtremePunches:  Death.Trample:
  	     TNT1 A 1 A_CustomMissile ("XDeath1Green", 5, 5, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("XDeath2bGreen", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("XDeath3bGreen", 5, -5, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
		 TNT1 AAAA 0 A_SpawnItemEx("Green_BloodSpot", 0, 0, 0, 0, 0, 0, random (0, 360))
		 CRSB C 9009
		 Stop  
		Stop
		
	Vanish:	
	Donothing:
		TNT1 A 0
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_Fall
		Stop
		}
}

ACTOR FBD_TinyGib
{
    Radius 2
    Height 8
	Speed 6
	Mass 1
    gravity 0.5
    Scale 0.8
	Decal BrutalBloodSplat
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
    +MISSILE
    +FORCEXYBILLBOARD
	+DONTSPLASH
	+NOBLOCKMONST
    seesound "bloood"
    deathsound "bloood"
    States
    {
		Spawn:
			TNT1 A 1
			Loop
		LandOnLava: //***Che
			CARB X 1	//smallest carbon lump
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
			TNT1 A 0 A_QueueCorpse
			CARB X -1
			Stop			
    }
}



ACTOR XDeathGuts: XDeath2
{
    //***Che: sprites XME4* were last seen in BDv20b, removed in BDv21. 
	// I had to bring them back when working on this.
	Scale 1.1
    SeeSound "misc/xdeath5"
    DeathSound "misc/xdeath3"
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        XME4 AAAABBBBCCCCDDDD 2
        Loop
    Death:
        //***Che
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		TNT1 AAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		XME4 E 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
        TNT1 A 0 A_QueueCorpse
		XME4 E 9009
        Stop
	LandOnLava: //***Che: this produced *four* carbon lumps, one small and three tiny
		CARB Y 1 // small carbon lump	
		TNT1 AAA 0 A_SpawnItemEx("CarbonChunkLandingOnLava", random(-7, 7), random(-7, 7))
		TNT1 A 0 A_QueueCorpse
		CARB Y -1
		Stop		
    }
}


ACTOR CameraShake: XDeath2
{
    SeeSound "none"
    DeathSound "none"
    Decal "None"
    Gravity 1.0
    Speed 1
    States
    {
    Spawn:
        TNT1 A 0
        Goto Death
    Death:
        TNT1 A 1
		//***Che there seems to be a bug in Zandronum that focuses the effect on the *player* instead of the activator
		TNT1 A 0 A_JumpIf(CallACS("GetDistanceToClosestPlayer") > 1000, 1)

	    EXPL A 0 Radius_Quake (4, 24, 0, 15, 0)
        TNT1 A 15
        Stop
    }
}


ACTOR CameraShakeMinor: CameraShake
{
    States
    {
    Spawn:
        TNT1 A 0
        Goto Death
    Death:
        TNT1 A 1
		//***Che there seems to be a bug in Zandronum that focuses the effect on the *player* instead of the activator
		TNT1 A 0 A_JumpIf(CallACS("GetDistanceToClosestPlayer") > 1000, 1)	    
		EXPL A 0 Radius_Quake (4, 24, 0, 15, 0)
        TNT1 A 3
        Stop
    }
}


/////////////////
//ARMS
/////////////////


ACTOR XDeathArm1
{
    Radius 8
    Height 8
    Scale 1.1
	Speed 8
	Mass 1
    gravity 0.5
	Decal BrutalBloodSplat
	BounceFactor 0.2
	wallbouncefactor 0.2
	BounceCount 3
	+DOOMBOUNCE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
    +MISSILE
	+EXPLODEONWATER
	+SKYEXPLODE
	
	//***Che: this flag was missing causing various failures with archvile deaths
	// (the flying arm was blocking arm-less dying archvile from being spawned)
	+THRUACTORS
	
	+NOBLOCKMONST
	
	-DONTSPLASH
    seesound "bloood"
    deathsound "bloood"
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		XARM AEBCFDG 5 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
	    XDT5 I 1
        XDT5 I 0 A_SpawnItem("Gib_Arm")
        Stop
    }
}

actor Gib_Arm: FBD_LimbBase
{
    Scale 1.1
    States
    {
    Spawn:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		XDT5 I 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		//***Che:
		//XDT5 I -1
		//Stop
		Goto Fly
	Fly:
		TNT1 A 0 A_CheckFloor("Rest") 
		XDT5 I 5
		Loop	
	Rest:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		XDT5 I 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		TNT1 A 0 A_QueueCorpse
		XDT5 I 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		XDT5 I -1
		Stop	
    Death.plasma: Death.Burn: Death.Flames:	
	Death.Electric:
	Death.Bfg10k: //***Che changed damage type from extreme to custom
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_CustomMissile ("XDeathBurnedArm", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)     
		Stop
    Death:    
		TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		TNT1 A 0 A_CustomMissile ("GibHand", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GibArmPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		Stop
	Death.Kick:
	Death.Melee:
	Death.SuperPunch:
	    XDT5 I 1 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("XDeathArm1", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
		Stop
	Pain:
	TNT1 A 0
	TNT1 A 0 ThrustThingZ(0,20,0,1)
	XARM ABCD 3
	Goto Spawn
	
	Death.ExplosiveImpact:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
	TNT1 A 0 ThrustThingZ(0,30,0,1)
	XARM A 6
	XARM ABCDABCDABCD 6 A_CheckFloor("Landz")
	Goto Landz
	Landz:
	XDT5 I 0 A_SpawnItem("Gib_Arm")
	Stop
}}

ACTOR XDeathArm1Kicked: XDeathArm1
{
+ACTIVATEMCROSS
+ACTIVATEIMPACT
+CANUSEWALLS
    States
    {
    Spawn:
	    TNT1 A 0 A_ChangeFlag("NOCLIP", 1)
	    XARM A 2
		TNT1 A 0 A_ChangeFlag("NOCLIP", 0)
		TNT1 A 0
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		XARM ABCD 6 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Goto Spawn+3
	}
}

actor GibArmPart: FBD_TinyGib
{
    Scale 1.0
    States
    {
		Spawn:
			XDT5 Z 1
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			XDT5 Z -1
			Stop
		Death:
			//***Che
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XDT5 Z 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		Passive:
			XDT5 Z 1
			Loop
		LandOnLava: //***Che: overriding tiny carbon lump with small carbon lump
			CARB Y 1	
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
			TNT1 A 0 A_QueueCorpse
			CARB Y -1
			Stop	
}}

actor GibHand: FBD_TinyGib
{
    Scale 1.0
    States
    {
	Spawn:
		XDT5 Y 1
		TNT1 A 0 A_QueueCorpse
		XDT5 Y -1
       Stop
    Death:
		//***Che
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		XDT5 Y 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
	Passive:
		XDT5 Y 1
       Loop
}}


ACTOR XDeathArm2: XDeathArm1
{
	Speed 10
}


ACTOR XDeathBullArm1: XDeathArm1
{
    Scale 1.0
    Speed 10
	Gravity 0.4
	BounceFactor 0.4
	wallbouncefactor 0.2
	+SKYEXPLODE
	Species "Marines"
	+THRUSPECIES
	BounceCount 5
	Radius 10
    States
    {
    Spawn:
        TNT1 A 0
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		HND8 ABCDEFGH 3 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
    Death.plasma: Death.Burn: Death.Flames:	
	Death.Electric:
	Death.Bfg10k: //***Che changed damage type from extreme to custom	
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_CustomMissile ("XDeathBurnedDemonArm", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)        Stop
	Death:
        HND8 I 1
        HND8 A 0 A_SpawnItem("Gib_DemonArm",0,0,0,1)
        Stop	
    }
}


ACTOR XDeathDemonArm: XDeathBullArm1
{
    Scale 1.0
}

actor Gib_DemonArm: FBD_LimbBase
{
    Scale 1.0
    States
    {
    Spawn:
		HND8 GH 2
		TNT1 A 0 A_QueueCorpse
		Goto Spawn1
	
	Spawn1:
		//***Che:
		//HND8 I 1
		//HND8 I -1
		HND8 I 5 A_CheckFloor("Rest")
		Loop
	Rest:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		HND8 I 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		TNT1 A 0 A_QueueCorpse
		HND8 I -1
		Stop
	LandOnLava: //***Che
		TNT1 A 0 
		TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
		HND8 I Random(20, 40)
		TNT1 A 0 A_CustomMissile ("GibDemonHand", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GibDemonArmPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		TNT1 A 0
		Stop			
    Death:    
		TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		TNT1 A 0 A_CustomMissile ("GibDemonHand", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GibDemonArmPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		Stop
	Death.Kick:
	Death.Melee:
	Death.SuperPunch:
	    HND8 AA 1 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("XDeathBullArm1Kicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
		Stop
		
	Pain:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0,20,0,1)
		HND8 ABCDEFGH 2
		Goto Spawn1
	
	Death.ExplosiveImpact:
		TNT1 A 0
		TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
		TNT1 A 0 ThrustThingZ(0,30,0,1)
		HND8 A 5
		HND8 ABCDEFGHABCDEFGHABCDEFGH 5 A_CheckFloor("Landz")
		Goto Landz
		Landz:
	
		XDT5 I 0 A_SpawnItem("Gib_DemonArm")
		Stop	
}}


ACTOR XDeathBullArm1Kicked: XDeathBullArm1
{
+ACTIVATEMCROSS
+ACTIVATEIMPACT
+CANUSEWALLS
}

actor GibDemonArmPart: FBD_TinyGib
{
    Scale 1.0
    States
    {
	Spawn:
		HND8 Z 1
		TNT1 A 0 A_QueueCorpse
		HND8 Z -1
		Stop
    //***Che
	Death:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		HND8 Z 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
	Passive:
		HND8 Z 1
		Loop
	LandOnLava:
		CARB A 1 // override default with a small chared meat, because demon arm is meaty	
		TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
		TNT1 A 0 A_QueueCorpse
		CARB A -1
		Stop
}}

actor GibDemonHand: FBD_TinyGib
{
    Scale 0.9
    States
    {
	Spawn:
		HND8 Y 1
		TNT1 A 0 A_QueueCorpse
		HND8 Y -1
		Stop
    Death:
		//***Che
		//HND8 Y 1
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		HND8 Y 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		TNT1 A 0 A_QueueCorpse
		HND8 Y -1
		Stop
	LandOnLava:
		CARB Y 1	
		TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
		TNT1 A 0 A_QueueCorpse
		CARB Y -1
		Stop		
}}






ACTOR XDeathImpArm: XDeathArm1
{
    Scale 1.1
    Speed 8
	Gravity 0.4
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			HND4 ABCDEFGH 4 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death.plasma:
		Death.Electric:
		Death.Bfg10k: //***Che changed damage type from extreme to custom	
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_CustomMissile ("XDeathBurnedImpArm", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)        Stop
		Death:
			HND4 X 1
			HND4 X 0 A_SpawnItem("Gib_ImpArm",0,0,0,1)
			Stop
    }
}

actor Gib_ImpArm: FBD_LimbBase
{
    Scale 1.1
    States
    {
    Spawn:
        HND4 X 1
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor3", 0, 0, 0, 0)
		//***Che
		Goto Fly
	Fly:	
		TNT1 A 0 A_CheckFloor("Land") 
		HND4 X 5
		Loop
	Land:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		HND4 X 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
		TNT1 A 0 A_QueueCorpse
		HND4 X -1
		Stop
	NoCOlision:
		HND4 X 1
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
		HND4 X -1
        Stop
		
	Death.plasma: Death.Burn: Death.Flames:	
	Death.Electric:
	Death.Bfg10k: //***Che changed damage type from extreme to custom
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_CustomMissile ("XDeathBurnedImpArm", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)        Stop
    Death:    
    TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
    TNT1 A 0 A_CustomMissile ("GibImpHand", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
    TNT1 A 0 A_CustomMissile ("GibImpArmPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
Stop
Stop
	Death.Kick:
	Death.Melee:
	Death.SuperPunch:
	    HND4 AA 1 A_FaceTarget
		TNT1 A 0 A_CustomMissile ("XDeathImpArm", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
		Stop
	
	Pain:
	TNT1 A 0
	TNT1 A 0 ThrustThingZ(0,20,0,1)
	HND4 ABCDEFGH 3
	Goto Spawn
	
	Death.ExplosiveImpact:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
	TNT1 A 0 ThrustThingZ(0,30,0,1)
	HND4 X 5
	HND4 ABCDEFGHABCDEFGHABCDEFGH 5 A_CheckFloor("Landz")
	Goto Landz
	Landz:
	XDT5 I 0 A_SpawnItem("Gib_ImpArm")
	Stop	
}}

actor GibImpArmPart: FBD_TinyGib
{
    Scale 1.1
    States
    {
	Spawn:
        HND4 Z 1
		TNT1 A 0 A_QueueCorpse
		HND4 Z -1
       Stop
    Death:
		//***Che
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType")
		HND4 Z 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		
        HND4 Z 1
		TNT1 A 0 A_QueueCorpse
		HND4 Z -1
       Stop
}}

actor GibImpHand: FBD_TinyGib
{
    Scale 0.8
    States
    {
	Spawn:
		HND4 Y 1
		TNT1 A 0 A_QueueCorpse
		HND4 Y -1
       Stop
    Death:
		//***Che
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType")
		HND4 Y 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")

        HND4 Y 1
		TNT1 A 0 A_QueueCorpse
		HND4 Y -1
       Stop
}}


ACTOR XDeathHalfImpUpperPart32
{
    Radius 2
    Height 2
    Scale 1.1
	Speed 6
	Gravity 0.3
	Mass 4
	Decal BrutalBloodSplat
	BounceFactor 0.2
	wallbouncefactor 0.2
	+MISSILE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
    States
    {
    Spawn:
        //TNT1 A 0 A_SpawnItem("Brutal_LiquidBlood",0,0,0,1)
		HND4 IJKLMNOPQ 3 A_CustomMissile("Brutal_LiquidBlood",0,0,0,1)
		Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		TNT1 AAA 0 A_spawnItem("Blood", 0, 10)
        HND4 Q 1 A_SpawnItem("Gib_HalfImpUpperPart32",0,0,0,1)
        TNT1 A 0
        Stop
    }
}

actor Gib_HalfImpUpperPart32: BigGibBase
{
	damagefactor "ExplosiveImpact", 5.0
	damagefactor "Kick", 5.0
    States
    {
		Spawn:
			HND4 Q 1
			//***Che
			Goto Fly2
		Fly2:	
			TNT1 A 0 A_CheckFloor("Rest") 
			HND4 Q 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor3", 0, 0, 0, 0)
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			HND4 Q 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death")
			TNT1 A 0 A_QueueCorpse
			HND4 Q -1
			Stop	   
		Death.ExplosiveImpact:
		Death.Explosive:
		Death.Kick:
		Death.SuperPunches:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			Goto Fly
		Fly:	
			HND4 IJKLMNOPQ 3 A_CheckFloor("Land")
			Loop
		Land:	
			HND4 Q 1 A_SpawnItem("Gib_HalfImpUpperPart32",0,0,0,1)
			Stop 
		
		Death:
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			TNT1 A 0 A_CustomMissile ("XDeathImpArm", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			Stop
		
		}}	 




/////////////////////
//LEGS
/////////////////////

ACTOR XDeathZombieLeg: XDeathArm1
{
    Scale 1.1
    Speed 8
	Gravity 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		LEG1 ABCDEFGH 5 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
        LEG1 A 1
		LEG1 E 0 A_SpawnItem("Gib_ZombieLeg1")
        Stop
    }
}


actor Gib_ZombieLeg1: FBD_LimbBase
{
    Scale 1.1
    States
    {
    //Spawn:
	//LEG1 I 1
	//TNT1 A 0 A_QueueCorpse
	//LEG1 I 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	//LEG1 I -1
    //   Stop
	//***Che
	Spawn:
		TNT1 A 0
		LEG1 I 1
		LEG1 I 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		Goto Fly
	Fly:	
		TNT1 A 0 A_CheckFloor("Land") 
		LEG1 I 5
		Loop
	Land:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		LEG1 I 3
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		LEG1 I 0 A_QueueCorpse
		LEG1 I -1
		Stop
	LandOnLava:	
		CARB E 1	
		TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
		TNT1 A 0 A_CustomMissile ("XDeathBurnedLeg", 2, 0, random (0, 360), 2, 270)
		CARB E 0
		Stop		
    Death.plasma:
	Death.Electric:
	Death.Bfg10k: //***Che changed damage type from extreme to custom
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
		TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
		 TNT1 A 0 A_CustomMissile ("XDeathBurnedLeg", 2, 0, random (0, 360), 2, 270)        Stop
    Death:    
		TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		TNT1 A 0 A_CustomMissile ("GibZombieLegPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		TNT1 A 0 A_CustomMissile ("GibZombieBoot", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
		Stop
	Death.Kick:
	Death.Melee:
	Death.SuperPunch:
			LEG1 EE 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathZombieLeg", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop
		
	Pain:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0,20,0,1)
		LEG1 ABCDEFGH 2
		Goto Spawn
		
	Death.ExplosiveImpact:
		TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
		TNT1 A 0 ThrustThingZ(0,30,0,1)
		LEG1 A 5
		LEG1 ABCDEFGHABCDEFGHABCDEFGH 5 A_CheckFloor("Landz")
		Goto Landz
		Landz:
		XDT5 I 0 A_SpawnItem("Gib_ZombieLeg2")
		Stop
			
}}

actor GibZombieLegPart: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG1 Z 1
			TNT1 A 0 A_QueueCorpse
			LEG1 Z -1
				   Stop
		Death:
		//***Che
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG1 Z 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		
			LEG1 Z 1
			TNT1 A 0 A_QueueCorpse
			LEG1 Z -1
			Stop
		LandOnLava: 
			CARB A 1 // overriding the default tiny carbon lump with a small charred meat
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
			TNT1 A 0 A_QueueCorpse
			CARB A -1
			Stop			
	}
}

actor GibZombieBoot: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG1 Y 1
			TNT1 A 0 A_QueueCorpse
			LEG1 Y -1
				   Stop
		Death:
			//***Che
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG1 Y 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			
			LEG1 Y 1
			TNT1 A 0 A_QueueCorpse
			LEG1 Y -1
			Stop
	}
}


ACTOR XDeathZombieLeg2: XDeathZombieLeg
{
    Speed 8
	Gravity 0.4
	BounceFactor 0.4
	wallbouncefactor 0.2
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		LEG1 ABCDEFGH 5 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
	    LEG1 J 1
	    TNT1 A 0 A_SpawnItem("Gib_ZombieLeg2")
        Stop
    }
}


actor Gib_ZombieLeg2: Gib_ZombieLeg1
{
    States
    {
		//Spawn:
		//	LEG1 J 1
		//	TNT1 A 0 A_QueueCorpse
		//	LEG1 A 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		//	LEG1 J -1
		//	Stop
		//***Che
		Spawn:
			TNT1 A 0
			LEG1 J 1
			TNT1 A 0 A_QueueCorpse
			LEG1 J 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Land") 
			LEG1 J 5
			Loop
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG1 J 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			LEG1 J 0 A_QueueCorpse
			LEG1 J -1
			Stop			
}}

ACTOR XDeathZombieLegKicked: XDeathZombieLeg
{
+ACTIVATEMCROSS
+ACTIVATEIMPACT
}




ACTOR XDeathImpLeg: XDeathArm1
{
    Scale 1.1
    Speed 8
	Gravity 0.4
	BounceFactor 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		LEG4 ABCDEFGH 5 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
        LEG4 I 1
        LEG4 I 0 A_SpawnItem("Gib_ImpLeg")
        Stop
		
    }
}

actor Gib_ImpLeg: FBD_LimbBase
{
    Scale 1.1
    States
    {
		//Spawn:
		//	LEG4 I 1
		//	TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor3", 0, 0, 0, 0)
		//	TNT1 A 0 A_QueueCorpse
		//	LEG4 I -1
		//	Stop
		//***Che
		Spawn:
			TNT1 A 0
			LEG4 I 1
			TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor3", 0, 0, 0, 0)
			TNT1 A 0 A_QueueCorpse
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			LEG4 I 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG4 I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			LEG4 I -1
			Stop			
		NoCOlision:
			LEG4 I 1
			TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			LEG4 I -1
			Stop
		Death.plasma: 
		Death.Electric:
		Death.Burn: 
		Death.Flames:
		Death.Bfg10k: //***Che changed damage type from extreme to custom		
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_CustomMissile ("XDeathBurnedImpLeg", 2, 0, random (0, 360), 2, 270)        Stop
		Death:    
			TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 A 0 A_CustomMissile ("GibImpLegPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_CustomMissile ("GibImpPaw", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
			Stop
		Death.Kick:
		Death.Melee:
		Death.SuperPunch:
			LEG4 A 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathImpLeg", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop
			
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			LEG4 ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			LEG4 A 5
			LEG4 ABCDEFGHABCDEFGHABCDEFGH 5 A_CheckFloor("Landz")
			Goto Landz
		Landz:
			XDT5 I 0 A_SpawnItem("Gib_ImpLeg")
			Stop		
}}

actor GibImpLegPart: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG4 Z 1
			TNT1 A 0 A_QueueCorpse
			LEG4 Z -1
			Stop
		Death:
			//***Che
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG4 Z 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			
			LEG4 Z 1
			TNT1 A 0 A_QueueCorpse
			LEG4 Z -1
			Stop
		LandOnLava:
			CARB Y 1 // overriding default tiny carbon lump with small carbon lump
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
			TNT1 A 0 A_QueueCorpse
			CARB Y -1
			Stop			
}}

actor GibImpPaw: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG4 Y 1
			TNT1 A 0 A_QueueCorpse
			LEG4 Y -1
		   Stop
		Death:
			//***Che
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG4 Y 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			
			LEG4 Y 1
			TNT1 A 0 A_QueueCorpse
			LEG4 Y -1
		   Stop
}}

ACTOR XDeathBullLeg12: XDeathArm1
{
    Scale 1.1
    Speed 8
	Gravity 0.4
	BounceFactor 0.4
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		LEG8 ABCDEFGH 4 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
	    LEG8 I 1
	    LEG8 I 0 A_SpawnItem("Gib_DemonLeg")
        Stop
    }
}

actor Gib_DemonLeg: FBD_LimbBase
{
    Scale 1.1
    States
    {
		Spawn:
			LEG8 GH 2
			TNT1 A 0 A_QueueCorpse
			Goto Spawn1
		Spawn1:
			LEG8 I 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			//***Che
			LEG8 I 5 //-1
			//Stop
			TNT1 A 0 A_CheckFloor("Rest")
			Loop
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType")
			LEG8 I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			LEG8 I -1
			Stop   
		   
		Death.plasma:
		Death.Electric:		
		Death.Burn:
		Death.Fire:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_CustomMissile ("XDeathBurnedDemonLeg", 2, 0, random (0, 360), 2, 270)
			Stop
		Death:    
			TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 A 0 A_CustomMissile ("GibDemonLegPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_CustomMissile ("GibDemonPaw", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
			Stop
		Death.Kick:
		Death.Melee:
		Death.SuperPunch:
			LEG8 A 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathBullLeg12", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop
			
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			LEG8 ABCDEFGH 2
			Goto Spawn1
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			LEG8 A 5
			LEG8 ABCDEFGH 5
			XDT5 I 0 A_SpawnItem("Gib_DemonLeg")
			Stop
}}

actor GibDemonLegPart: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG8 Z 1
			Loop
		Death:
			//LEG8 Z 1
			//Loop
			//***Che
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG8 Z 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			LEG8 Z 1
			TNT1 A 0 A_QueueCorpse
			LEG8 Z -1
			Stop
		LandOnLava:
			CARB A 1 // leg is meaty, overriding the default tiny carbon lump with small charred meat
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
			TNT1 A 0 A_QueueCorpse
			CARB A -1
			Stop			
}}

actor GibDemonPaw: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG8 Y 1
			Loop
		Death:
			//LEG8 Y 1
			//Loop
			//***Che
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG8 Y 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			LEG8 Y 1
			TNT1 A 0 A_QueueCorpse
			LEG8 Y -1
			Stop
		LandOnLava:
			CARB Y 1	
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
			TNT1 A 0 A_QueueCorpse
			CARB Y -1
			Stop			
}}







ACTOR XDeathSargeLeg1: XDeathArm1
{
    Scale 1.1
    Speed 8
	Gravity 0.4
	BounceFactor 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		LEG2 ABCDEFGH 5 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
        LEG2 A 1
	    LEG2 A 0 A_SpawnItem("Gib_SargeLeg")
        Stop
    }
}

actor Gib_SargeLeg: FBD_LimbBase
{
    Scale 1.1
    States
    {
		Spawn:
			LEG2 I 1
			TNT1 A 0 A_QueueCorpse
			LEG2 A 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)

			//***Che
			//LEG2 I -1
			//Stop
			Goto Spawn1
		Spawn1:
			LEG2 I 5
			TNT1 A 0 A_CheckFloor("Rest")			
			Loop
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType")
			LEG2 I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			LEG2 I -1
			Stop  			
			
		Death.plasma:
		Death.Electric:		
		Dath.Burn:
		Death.Fire:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
			 TNT1 A 0 A_CustomMissile ("XDeathBurnedLeg", 2, 0, random (0, 360), 2, 270)        Stop
		Death:    
			TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 A 0 A_CustomMissile ("GibSargeLegPart", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_CustomMissile ("GibSargeBoot", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
			Stop
		Death.Kick:
		Death.Melee:
		Death.SuperPunch:
			LEG2 A 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathSargeLeg1", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop
			
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			LEG2 ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			LEG2 ABCDEFGH 5
			XDT5 I 0 A_SpawnItem("Gib_SargeLeg")
			Stop	
		
		}}

actor GibSargeLegPart: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG2 Z 1
			Loop
		Death:
			//***Che
			//LEG2 Z 1
			//Loop
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG2 Z 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			LEG2 Z -1
			Stop
		LandOnLava:
			CARB Y 1 // overriding tiny carbon lump with a small carbon lump	
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-5, 5), random(-5, 5))
			TNT1 A 0 A_QueueCorpse
			CARB Y -1
			Stop			
}}

actor GibSargeBoot: FBD_TinyGib
{
    Scale 1.1
    States
    {
		Spawn:
			LEG2 Y 1
			Loop
		Death:
			//***Che
			//LEG2 Y 1
			//Loop
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			LEG2 Y 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			LEG2 Y -1
			Stop
}}



ACTOR XDeathSargeLeg2: XDeathArm1
{
    Scale 1.1
    Speed 8
	Gravity 0.4
	BounceFactor 0.4
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			LEG2 ABCDEFGH 5 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			LEG2 E 1
			LEG2 E 1 A_SpawnItem("Gib_SargeLeg2")
			Stop
    }
}

actor Gib_SargeLeg2: Gib_SargeLeg
{
    Scale 1.1
    States
    {
		Spawn:
			LEG2 J 1
			TNT1 A 0 A_QueueCorpse
			LEG2 J 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			//***Che
			//LEG2 J -1
			//Stop
			Goto Spawn1
		Spawn1:
			LEG2 J 5
			TNT1 A 0 A_CheckFloor("Rest")			
			Loop
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType")
			LEG2 J 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			LEG2 J -1
			Stop 			
	}
}






ACTOR XDeathChainLeg: XDeathArm1
{
    Speed 8
	Gravity 0.4
	BounceFactor 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		LEG3 ABCDEFGH 5
		Loop
	Death:
	    LEG3 A 1
	    LEG3 A 0 A_SpawnItem("Gib_ChainLeg")
        Stop
    }
}

actor Gib_ChainLeg: FBD_LimbBase
{
    States
    {
		Spawn:
			LEG3 I 1
			TNT1 A 0 A_QueueCorpse
			LEG3 I 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)

			//***Che
			//LEG3 I -1
			//Stop
			Goto Spawn1
		Spawn1:
			LEG3 I 5 
			TNT1 A 0 A_CheckFloor("Rest")
			Loop
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType")
			LEG3 I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			LEG2 I -1
			Stop  			
		
		Death.plasma:
		Death.Electric:		
		Death.Burn:
		Death.Fire:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece2", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-15, 15), random (-15, 15))
			TNT1 A 0 A_CustomMissile ("XDeathBurnedLeg", 2, 0, random (0, 360), 2, 260)        Stop
		Death:    
			TNT1 AAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Stop
		Death.Kick:
		Death.Melee:
		Death.SuperPunch:
			LEG3 A 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathChainLeg", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop
}}



ACTOR XDeathChainArm: XDeathArm1
{
    Speed 8
	Gravity 0.4
	BounceFactor 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		HND3 ABCDEFGH 5
		Loop
	Death:
	    HND3 A 1
	    HND3 A 0 A_SpawnItem("Gib_ChainArm")
        Stop
    }
}

actor Gib_ChainARm: Gib_Arm
{
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			HND3 E 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_Jump (128, "Spawn2")
			//***Che
			//HND3 E -1
			//Stop
			Goto Fly
		Spawn2:
			HND3 A 1
			//HND3 A -1
			//Stop
			Goto Fly1
		Fly:
			TNT1 A 0 A_CheckFloor("Rest") 
			HND3 E 5
			Loop
		Fly1:
			TNT1 A 0 A_CheckFloor("Rest1") 
			HND3 A 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			HND3 E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			TNT1 A 0 A_QueueCorpse
			HND3 E 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			HND3 E -1
			Stop			
		Rest1:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			HND3 A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			TNT1 A 0 A_QueueCorpse
			HND3 A 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			HND3 A -1
			Stop			
			
		Death:    
			TNT1 AAAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Stop
		Death.Kick:
		Death.Melee:
		Death.SuperPunch:
			HND3 A 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathChainArm", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop
		}}




//////////////
//GUTS
//////////////


ACTOR XDeathStomach: XDeathArm1
{
	-DOOMBOUNCE
	BounceFactor 0.0
	Speed 2
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			XSTO A 24 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			XSTO EEEEEEEEE 0 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 180), CMF_AIMDIRECTION, random (0, 180))
			//***Che
			// 1. is missile, goes to Death on collision
			// 2. is not actually a stomach but a *big* pile of intestines
			//XSTO E 1
			//TNT1 A 0 A_QueueCorpse
			//XSTO E -1
			//Stop
			Goto Fall
		Fall:
			TNT1 A 0
			TNT1 A 0 A_CheckFloor("Land") 
			XSTO A 5
			Loop			
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XSTO E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_QueueCorpse
			XSTO E -1 
			Stop
		LandOnLava:
			CARB W 1 // new sprite: burned pile of intestines	
			TNT1 AAA 0 A_SpawnItemEx("CarbonChunkLandingOnLava", random(-7, 7), random(-7, 7))
			TNT1 A 0 A_QueueCorpse
			CARB W -1
			Stop			
    }
}


ACTOR XDeathHalfMarine
{
    Radius 8
    Height 8
    Speed 4
	Mass 8
	BounceFactor 0.2
	BounceCount 3
	+DOOMBOUNCE
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
    DeathSound "misc/xdeath1"
	Decal BrutalBloodSplat
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
        HPLA A 12 A_CustomMissile("Brutal_FlyingBloodTrail",0,0,180,2)
        Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        HPLA A 0 A_SpawnItem("HalfMarineGib",0,0,0,1)
        Stop
    }
}

actor HalfMarineGib: BigGibBase
{
    States
    {
		Spawn:
			HPLA A 1
			TNT1 A 0 A_QueueCorpse
			HPLA A 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_CustomMissile ("ArterialBloodSPray", 6, -10, 45, 2, random (0, 60))
			//***Che
			//HPLA A -1
			//Stop
			Goto Fly
		Fly:	
			TNT1 A 0
			TNT1 A 0 A_CheckFloor("Rest") 
			HPLA A 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			HPLA A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			HPLA A -1
			Stop			
	}}


ACTOR XDeathHalfImp
{
    Radius 8
    Height 8
    Speed 7
	Mass 8
	BounceFactor 0.2
	+DOOMBOUNCE
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
    DeathSound "misc/xdeath1"
	Decal BrutalBloodSplat
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
        TROG K 12 A_CustomMissile("Brutal_FlyingBloodTrail",0,0,180,2)
        Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        TROG K 0 A_SpawnItem("HalfImpGib",0,0,0,1)
        Stop
    }
}


actor HalfImpGib: BigGibBase
{
    States
    {
		Spawn:
		   TROG K 1
		   TNT1 A 0 A_QueueCorpse
		   TROG K 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		   TNT1 A 0 A_CustomMissile ("ArterialBloodSPray", 6, -10, 45, 2, random (0, 60))
		   
		   //***Che
		   //TROG L -1
		   //Stop    
		   Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			TROG K 1
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			TROG L 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death") // no burning death specified, just explode into gore and let that gore deal with lava
			TNT1 A 0 A_QueueCorpse
			TROG L -1
			Stop		   
		Death:  
			TNT1 A 0 A_CustomMissile ("XDeathImpHead", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathImpArm", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathHalfImpUpperPart32", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 60))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall", 0, 10)
			Stop
	   }}


ACTOR XDeathHalfZombieman
{
    Radius 8
    Height 8
    Scale 1.0
	Speed 6
	Mass 4
	Decal BrutalBloodSplat
	BounceFactor 0.2
	+DOOMBOUNCE
	+MISSILE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		POSX F 12
		Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        POSX F 1 A_SpawnItem("Gib_HalfZombieman",0,0,0,1)
        TNT1 A 0
        Stop
    }
}

actor Gib_HalfZombieMan: BigGibBase
{
    States
    {
		Spawn:
			POSX Q 1
			TNT1 A 0 A_QueueCorpse
			POSX Q 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_CustomMissile ("ArterialBloodSPray", 6, -10, 45, 2, random (0, 60))
			
			
			//***Che
			//POSX Q -1
			//Stop  
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			POSX Q 1
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			POSX Q 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death") // no burning death specified, just explode into gore and let that gore deal with lava
			TNT1 A 0 A_QueueCorpse
			POSX Q -1
			Stop			
	   
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathZombiemanHead", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall", 0, 10)
			TNT1 AA 0 A_CustomMissile ("XDeathArm1", 6, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 90))
			Stop
	   }}
	   
	   
	   

ACTOR XDeathHalfSergeant2: XDeathHalfZombieman
{
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		SZD1 I 12
		Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        SZD1 I 1 A_SpawnItem("Gib_HalfSergeant2",0,0,0,1)
        TNT1 A 0
        Stop
    }
}

actor Gib_HalfSergeant2: BigGibBase
{
    States
    {
		Spawn:
			SZD1 J 1
			TNT1 A 0 A_QueueCorpse
			SZD1 J 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_CustomMissile ("ArterialBloodSPray", 6, -10, 45, 2, random (0, 60))
			
			//***Che
			//SZD1 J -1
			//Stop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			SZD1 J 1
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			SZD1 J 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death") // no burning death specified, just explode into gore and let that gore deal with lava
			TNT1 A 0 A_QueueCorpse
			SZD1 J -1
			Stop			
	   
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathSergeantHead", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall", 0, 10)
			TNT1 AA 0 A_CustomMissile ("XDeathArm1", 6, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 90))
			Stop
	   }}
	   	   

ACTOR XDeathHalfZombiemanNoArmNoHead
{
    Radius 8
    Height 8
    
	Speed 10
	Gravity 0.7
	Mass 4
	Decal BrutalBloodSplat
	BounceFactor 0.01
	+DOOMBOUNCE
	+MISSILE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
	Scale 1.3
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		POSX GHIJKLMN 4
		Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        TNT1 AAA 0 A_SpawnItem("Blood", 0, 5)
		TNT1 A 0 A_SpawnItem("Gib_HalfZombiemanNoArmNoHead",0,0,0,1)
        Stop
    }
}

actor Gib_HalfZombieManNoArmNoHead: BigGibBase
{
	Scale 1.3
    States
    {
		Spawn:
			POSX O 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//POSX O -1
			//Stop
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			POSX O 1
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			POSX O 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death") // no burning death specified, just explode into gore and let that gore deal with lava
			TNT1 A 0 A_QueueCorpse
			POSX O -1
			Stop			
		   
		Death:
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			Stop
	   }}	 
	   




ACTOR XDeathHalfShotgunguyNoArmNoHead
{
    Radius 8
    Height 8
    
	Speed 10
	Gravity 0.7
	Mass 4
	Decal BrutalBloodSplat
	BounceFactor 0.01
	+DOOMBOUNCE
	+MISSILE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
	Scale 1.3
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		SPSX GHIJKLMN 4
		Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        TNT1 AAA 0 A_SpawnItem("Blood", 0, 5)
		TNT1 A 0 A_SpawnItem("Gib_HalfShotgunguyNoArmNoHead",0,0,0,1)
        Stop
    }
}

actor Gib_HalfShotgunguyNoArmNoHead: BigGibBase
{
Scale 1.3
    States
    {
		Spawn:
			SPSX O 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//SPSX O -1
			//Stop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			SPSX O 1
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			SPSX O 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death") // no burning death specified, just explode into gore and let that gore deal with lava
			TNT1 A 0 A_QueueCorpse
			SPSX O -1
			Stop			
	   
		Death:
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			Stop
	}
}	


ACTOR XDeathHalfZombiemanDown
{
    Radius 8
    Height 8
    Scale 1.1
	Speed 6
	Mass 4
	Decal BrutalBloodSplat
	BounceFactor 0.2
	+DOOMBOUNCE
	+MISSILE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		POSX D 12
		Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        POSX E 0 A_SpawnItem("GibHalfZombiemanDown",0,0,0,1)
        Stop
    }
}

actor GibHalfZombiemanDown: BigGibBase
{
    States
    {
		Spawn:
			POSX E 1
			POSX E 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_QueueCorpse
			//***Che
			//POSX E -1
		   //Loop    
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			POSX E 1
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			POSX E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn") // no death specified at all, using default explosion into burning chunks of meat
			TNT1 A 0 A_QueueCorpse
			POSX E -1
			Stop
	   
	   }}



ACTOR XDeathHalfSergeant
{
    Radius 8
    Height 8
    Speed 7
	Mass 8
	BounceFactor 0.2
	+DOOMBOUNCE
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
    DeathSound "misc/xdeath1"
	Decal BrutalBloodSplat
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			SP2X F 12 A_CustomMissile("BloodTrails",0,0,180,2)
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			SP2X G 0 A_SpawnItem("GibHalfSergeant",0,0,0,1)
			Stop
    }
}



ACTOR XDeathHalfZombieman2
{
    Radius 8
    Height 8
    Speed 7
	Mass 8
	BounceFactor 0.2
	+DOOMBOUNCE
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
    DeathSound "misc/xdeath1"
	Decal BrutalBloodSplat
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			PP2X F 12 A_CustomMissile("BloodTrails",0,0,180,2)
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			
			//***Che
			//PP2X G -1
			//Stop
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			PP2X G 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_QueueCorpse
			PP2X G -1
		LandOnLava:
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			TNT1 A 0
			Stop
    }
}

actor GibHalfSergeant: BigGibBase
{
    States
    {
		Spawn:
			TNT1 A 0
			SP2X G 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_QueueCorpse
			//***Che
			//SP2X G -1
		   //Loop    
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			SP2X G 1
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			SP2X G 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death") // no burning death specified, just explode into gore and let that gore deal with lava
			TNT1 A 0 A_QueueCorpse
			SP2X G -1
			Stop		   
		   
		 Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathSergeantHead", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			Stop
	   }}

ACTOR RipUndeadMarine
{
    Radius 8
    Height 8
    Speed 4
	Mass 8
	BounceFactor 0.2
	+DOOMBOUNCE
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
    DeathSound "misc/xdeath1"
	Decal BrutalBloodSplat
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			UDM3 E 4 A_CustomMissile("Brutal_FlyingBloodTrail",0,0,180,2)
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			
			//***Che
			UDM3 E Random(35,100)	
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			UDM3 E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death")
			UDM3 E 9009
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random (-15, 15), random (-15, 15))
			TNT1 AAA 0 A_CustomMissile ("XDeathBurnedMeat", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)
			TNT1 AAA 0 A_CustomMissile ("XDeathBurnedMeat3", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)		
			TNT1 A 0
			Stop
		
			
    }
}

ACTOR XDeathHalfSkeleton
{
    Radius 8
    Height 8
    Speed 9
	Mass 8
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
    DeathSound "misc/xdeath1"
	Decal BrutalBloodSplat
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			SKEX F 12 A_CustomMissile("Brutal_FlyingBloodTrail",0,0,180,2)
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			SKEX F 0 A_SpawnItem("GibHalfSkeleton",0,0,0,1)
			Stop
    }
}

actor GibHalfSkeleton: BigGibBase
{
	Radius 8
	damagefactor "Kick", 12.0
	damagefactor "ExtremePunches", 12.0
	damagefactor "Melee", 12.0
	damagefactor "Fatality", 12.0
    States
    {
		Spawn:
			TNT1 A 0
			SKEX F 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//SKEX F -1
			//Stop 
			Goto Fly
		Fly:	
			TNT1 A 0
			TNT1 A 0 A_CheckFloor("Rest") 
			SKEX F 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			SKEX F 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava") 
			TNT1 A 0 A_QueueCorpse
			SKEX F -1
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-16, 16), random(-16, 16)) // start smoking
			SKEX F 70 // two second delay
			Goto Death // no burning death specified, just explode into gore and let that gore deal with lava
			
			   
		Death.Trample:
	    Death:
		   TNT1 A 0 A_NoBlocking
			TNT1 AAA 0 A_CustomMissile ("RevenantDust", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 AAAA 0 A_CustomMissile ("RevenantDust2", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 A 0 A_CustomMissile ("XDeathRevenantHead", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 150))
			TNT1 A 0 A_CustomMissile ("RevenantBonesFast", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 150))
			TNT1 AA 0 A_CustomMissile ("RevenantArm", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 150))
			TNT1 AA 0 A_CustomMissile ("MetalShard1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 160))
			TNT1 AA 0 A_CustomMissile ("MetalShard2", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 160))
			TNT1 AA 0 A_CustomMissile ("MetalShard3", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 160))
			TNT1 AAA 0 A_CustomMissile ("RevenantBones", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 150))
			TNT1 AAA 0 A_CustomMissile ("RevenantPiece", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 150))
			TNT1 A 0 A_SpawnItem("HellishMissileLauncher")
			Stop
		}}


ACTOR XDeathArchVile
{
    Radius 8
    Height 8
	Speed 12
	Mass 1
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
    +NOTELEPORT
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
	+MISSILE
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		VILP A 4 A_CustomMissile("BloodTrails",0,0,180,2)
		Loop
	Death:
        VILP B 0
	    VILP B 0 A_SpawnItem("GibArchVile",0,0,0,1) // 1 = transfer translation
		Stop
    }
}

actor GibArchVile: BigGibBase
{
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//VILP B -1
			//Stop    
			VILP B 1
			Goto Falling
		Falling:	
			TNT1 A 0
			TNT1 A 0 A_CheckFloor("Passivate") 
			VILP B 5
			Loop			
		Passivate:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			VILP B 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava") 
			VILP B -1
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-16, 16), random(-16, 16)) // start smoking
			VILP B 70 // two second delay
			Goto Death // no burning death specified, just explode into gore and let that gore deal with lava
			
		Death:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 AA 0 A_SpawnItem("MuchBlood", 0, 32)
			//TNT1 A 0 A_CustomMissile ("XDeathArchvileArm", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 120))
			TNT1 A 0 A_SpawnItemEx ("XDeathArchvileArm", 0,0,12, random(-5,5),random(-5,5),random(3,5), 0,SXF_TRANSFERTRANSLATION,0)
			//TNT1 A 0 A_CustomMissile ("XDeathArchvileHead", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 120))
			TNT1 A 0 A_SpawnItemEx ("XDeathArchvileHead", 0,0,12, random(-5,5),random(-5,5),random(3,5), 0,SXF_TRANSFERTRANSLATION,0)	
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath2b", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 120))
			TNT1 AAA 0 A_CustomMissile ("XDeath3b", 12, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 120))
			Stop
		}}


ACTOR XDeathArchvileLeg: XDeathArm1
{
    Scale 1.1
    Speed 6
	Gravity 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		DIAG IJKLMNOP 4 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
        DIAG J 1
		DIAG E 0 A_SpawnItem("Gib_ArchvileLeg",0,0,0,1) // 1 = transfer translation
        Stop
    }
}


actor Gib_ArchvileLeg: FBD_LimbBase
{
    Scale 1.1
    States
    {
		Spawn:
			DIAG Q 1
			TNT1 A 0 A_QueueCorpse
			DIAG Q 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			
			//***Che
			//DIAG Q -1
		   //Stop
			DIAG Q 1
			Goto Falling
		Falling:	
			TNT1 A 0
			TNT1 A 0 A_CheckFloor("Passivate") 
			DIAG Q 5
			Loop			
		Passivate:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			DIAG Q 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			DIAG Q -1
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 AAA 0 A_SpawnItemEx("BloodDropLandingOnLava", random(-16, 16), random(-16, 16)) // short lived smoking fires
			DIAG Q 35 // one second delay
			Goto Death.Burn // the basic BigGibBase::Death.Burn , spawns small fires and burned meat		   
		
		Death.Kick:
		Death.Melee:
		Death.SuperPunch:
			DIAG JJ 1 A_FaceTarget
			//TNT1 A 0 A_CustomMissile ("XDeathArchvileLeg", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_SpawnItemEx ("XDeathArchvileLeg", 0,0,5, -6,random(-1,1),random(3,5), 0,SXF_TRANSFERTRANSLATION,0)	
			Stop
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			DIAG IJKLMNOP 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			DIAG J 2
			DIAG KLMNOPIJKLMNOPIJKLMNOP 5 A_CheckFloor("Landz")
			Goto Landz
		Landz:
			DIAG J 0 A_SpawnItem("Gib_ArchvileLeg",0,0,0,1) // 1 = transfer translation
			Stop
			
}}



ACTOR XDeathArchvileArm: XDeathArm1
{
    Scale 1.1
    Speed 6
	Gravity 0.4
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			DIAG ABCDEFGH 4 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			DIAG GF 2
			DIAG E 0 A_SpawnItemEx("Gib_ArchvileArm",0,0,0, 0,0,0, 0,SXF_TRANSFERTRANSLATION)
			Stop
    }
}


actor Gib_ArchvileArm: FBD_LimbBase
{
    Scale 1.1
    States
    {
		Spawn:
			DIAG R 1
			TNT1 A 0 A_QueueCorpse
			DIAG R 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			
			//**Che
			//DIAG R -1
			//Stop
			DIAG R 35
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			DIAG R 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			DIAG R -1
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 AAA 0 A_SpawnItemEx("BloodDropLandingOnLava", random(-16, 16), random(-16, 16)) // short lived smoking fires
			DIAG R 90 // delay
			Goto Death.Burn			
		Death.Burn:
		Death.Plasma:
		Death.Electric:
		Death.Fire:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			CARB V 1 // new sprite: burned archvile arm
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-16, 16), random(-16, 16))
			CARB V -1
			Stop
		
		Death.Kick:
		Death.Melee:
		Death.SuperPunch:
			DIAG FG 2 A_FaceTarget
			//TNT1 A 0 A_CustomMissile ("XDeathArchvileArm", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_SpawnItemEx ("XDeathArchvileArm", 0,0,5, -6,random(-1,1),random(3,5), 0,SXF_TRANSFERTRANSLATION,0)	
			Stop
		
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			DIAG ABCDEFGHFG 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			DIAG FG 2
			DIAG ABCDEFGHABCDEFGHFG 5 A_CheckFloor("Landz")
			Goto Landz
		Landz:
			DIAG J 0 A_SpawnItemEx("Gib_ArchvileArm",0,0,0, 0,0,0, 0,SXF_TRANSFERTRANSLATION)
			Stop
			
	}
}


ACTOR SpiderLeg
{
    Radius 8
    Height 8
	Speed 12
	Mass 1
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
	+DOOMBOUNCE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
	SeeSound "misc/xdeath5"
    DeathSound "misc/xdeath3"
	BounceFactor 0.3
	BounceCount 3
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		XDSL ABCDEFGH 2
		Loop
	Death:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
	    XDSL I -1
		Stop
    }
}


ACTOR DyingDemon
{
    Radius 8
    Height 8
    Speed 0
	Mass 6
    +NOBLOCKMAP
    +NOTELEPORT
    +MOVEWITHSECTOR
    +DONTSPLASH
    +CLIENTSIDEONLY
    +FORCEXYBILLBOARD
    States
    {
    Spawn:
		SARH AAA 4 A_SpawnItem ("MuchBlood", 0, 50)
		SARH BBB 4 A_SpawnItem ("MuchBlood", 0, 40)
		SARH CCC 4 A_SpawnItem ("MuchBlood", 0, 30)
		SARH DDDDDDDDDDDDDDD 4 A_SpawnItem ("MuchBlood", 0, 20)
        TNT1 A 0 A_SpawnItem ("DeadDemonNoHead", 1)
        Stop
    }
}










ACTOR GenericHKGib1: XDeathArm1
{
    Scale 0.9
    Speed 5
	BounceFactor 0.4
	BounceCount 3
	+CLIENTSIDEONLY
	Gravity 0.8
	
	//***Che
	Translation "168:191=112:127", "16:47=123:127" // added for the carbonized chunk - which includes red blood
    States
    {
		Spawn:
			GG71 A 4 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GG71 A -1
			//Stop
			Goto Fall
		Fall:
			GG71 A 5 A_CheckFloor("Land") 
			Loop
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GG71 A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GG71 A -1 
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GG71 A Random(10, 40)
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			CARB B 1	
			TNT1 A 0 A_QueueCorpse
			CARB B -1
			Stop			
    }
}

ACTOR GenericHKGib2: GenericHKGib1
{
	Scale 1.2
    States
    {
		Spawn:
			GG71 B 4 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GG71 B -1
			//Stop
			Goto Fall
		Fall:
			GG71 B 5 A_CheckFloor("Land") 
			Loop
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GG71 B 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GG71 B -1 
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GG71 B Random(10, 40)
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			CARB B 1	
			TNT1 A 0 A_QueueCorpse
			CARB B -1
			Stop			
    }
}

ACTOR GenericHKGib3: GenericHKGib1
{
	Scale 0.8
    States
    {
		Spawn:
			GG71 C 4 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GG71 C -1
			//Stop
			Goto Fall
		Fall:
			GG71 C 5 A_CheckFloor("Land") 
			Loop
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GG71 C 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GG71 C -1 
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GG71 C Random(10, 40)
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			CARB B 1	
			TNT1 A 0 A_QueueCorpse
			CARB B -1
			Stop			
    }
}

ACTOR GenericHKGib4: GenericHKGib1
{
	Scale 0.7
    States
    {
		Spawn:
			GG71 D 4 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GG71 D -1
			//Stop
			Goto Fall
		Fall:
			TNT1 A 0
			GG71 D 5 A_CheckFloor("Land") 
			Loop
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GG71 D 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GG71 D -1 
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GG71 D Random(10, 40)
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			CARB B 1	
			TNT1 A 0 A_QueueCorpse
			CARB B -1
			Stop			
    }
}


ACTOR GenericBaronGib1: GenericHKGib1
{
	Scale 1.0
    States
    {
		Spawn:
			GG71 E 4 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GG71 E -1
			//Stop
			Goto Fall
		Fall:
			TNT1 A 0
			GG71 E 5 A_CheckFloor("Land") 
			Loop
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GG71 E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GG71 E -1 
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GG71 E Random(10, 40)
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			CARB B 1	
			TNT1 A 0 A_QueueCorpse
			CARB B -1
			Stop	
    }
}

ACTOR GenericBaronGib1b: GenericBaronGib1
{
	YScale 0.8
	XScale -1.0
}


ACTOR GenericBaronGib2: GenericHKGib1
{
	Scale 1.0
    States
    {
		Spawn:
			GG71 F 4 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GG71 F -1
			//Stop
			Goto Fall
		Fall:
			GG71 F 5 A_CheckFloor("Land") 
			Loop
		Land:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GG71 F 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GG71 F -1 
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GG71 F Random(10, 40)
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			CARB B 1	
			TNT1 A 0 A_QueueCorpse
			CARB B -1
			Stop			
    }
}


ACTOR GenericBaronGib2b: GenericBaronGib2
{
	YScale 1.1
	XScale -1.0
}



ACTOR XDeathHellKnightArm: XDeathArm1
{
    Scale 1.0
    Speed 5
	BounceFactor 0.4
	BounceCount 3
    States
    {
    Spawn:
        TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		GHKA ABCDEFGH 3 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
	    TNT1 A 0
		TNT1 A 0 A_SpawnItem("Gib_HellKnightArm")
		TNT1 A 0 A_SpawnItem ("Green_BloodSpot", 0, 1)
        Stop
    }
}

actor Gib_HellKnightArm: GreenFBD_LimbBase
{
    Scale 1.1
	Health 50
    States
    {
		Spawn:
			GHKA I 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GHKA I 1900
			//TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			//GHKA I -1
			//Stop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			GHKA I 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GHKA I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GHKA I 1900
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			GHKA I -1
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GHKA I Random(10,40) // pause
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death // no burning death specified, just explode into gore and let that gore deal with lava
			
		   
		Death:   
			TNT1 A 0 A_NoBlocking
			TNT1 AA 0 A_CustomMissile ("Green_BLood", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 AA 0 A_CustomMissile ("Xdeath1Green", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 90))
			TNT1 AA 0 A_CustomMissile ("GenericHKGib4", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 90))
			Stop
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			GHKA ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
		Death.Kick: Death.SuperPunches: Death.Melee:
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			GHKA A 5
			GHKA ABCDEFGHABCDEFGH 5 A_CheckFloor("Landz")
			Goto Landz
		Landz:
			XDT5 I 0 A_SpawnItem("Gib_HellKnightArm")
			Stop	
		
		
		} }



ACTOR XDeathHellKnightLeg: XDeathArm1
{
    Scale 1.1
    Speed 6
	BounceFactor 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Green_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		GHKL ABCDEFG 3 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
	    TNT1 A 0
		TNT1 A 0 A_SpawnItem("Gib_HellKnightLeg")
		TNT1 A 0 A_SpawnItem ("Green_BloodSpot", 0, 1)
		Stop
    }
}

actor Gib_HellKnightLeg: GreenFBD_LimbBase
{
    Scale 1.1
	Health 80
    States
    {
		Spawn:
			GHKL I 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GHKL A 1900
			//TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			//GHKL A -1
			//Stop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			GHKL I 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GHKL I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GHKL I 1900
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			GHKL I -1
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GHKL I Random(10,40) // pause
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death // no burning death specified, just explode into gore and let that gore deal with lava

		   
		Death:   
			TNT1 A 0 A_NoBlocking
			TNT1 AA 0 A_CustomMissile ("Green_BLood", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 AA 0 A_CustomMissile ("Xdeath1Green", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 90))
			TNT1 A 0 A_CustomMissile ("GenericHKGib1", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 90))
			TNT1 A 0 A_CustomMissile ("GenericHKGib2", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 90))
			Stop
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			GHKL ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
		Death.Kick: Death.SuperPunches: Death.Melee:
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,40,0,1)
			GHKL A 5
			GHKL ABCDEFGHABCDEFGH 5 A_CheckFloor("Landz")
			Goto Landz
		Landz:
			XDT5 I 0 A_SpawnItem("Gib_HellKnightLeg")
			Stop	
}}





ACTOR XDeathHellKnightTorso: XDeathArm1
{
    Scale 1.0
    Speed 6
	BounceFactor 0.4
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		GHKT ABCDEFGH 3 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
        TNT1 A 0
		TNT1 A 0 A_SpawnItem("Green_BLood")
	    GHKT G 1
        HNDC A 0 A_SpawnItem("Gib_HellKnightTorso",0,0,0,1)
        Stop
    }
}

actor Gib_HellKnightTorso: GreenFBD_LimbBase
{
    Scale 1.0
	Health 100
    States
    {
		Spawn:
			GHKT I 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//GHKT I 1900
			//TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			//GHKT I -1
			//Stop 
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			GHKT I 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GHKT I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GHKT I 1900
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			GHKT I -1
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GHKT I Random(60,80) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death // no burning death specified, just explode into gore and let that gore deal with lava
		
			
		Death:    
			TNT1 A 0 A_NoBlocking
			TNT1 AAA 0 A_CustomMissile ("XDeath1Green", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("MuchBloodGreen", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath2bGreen", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath3bGreen", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathOrgan1Green", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			TNT1 A 0 A_CustomMissile ("XDeathOrgan2Green", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			TNT1 A 0 A_CustomMissile ("GenericHKGib3", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			TNT1 A 0 A_CustomMissile ("XDeathHellKnightArm", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			Stop
}}



ACTOR XDeathBaronofHellTorso: XDeathArm1
{
    Scale 1.3
    Speed 6
	BounceFactor 0.4
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		GORD ABCD 4 A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
		Loop
	Death:
        TNT1 A 0 A_SpawnItem ("Green_BloodSpot", 0, 1)
	    GORD E 1
        HNDC A 0 A_SpawnItem("Gib_BaronofHellTorso",0,0,0,1)
        Stop
    }
}

actor Gib_BaronofHellTorso: GreenFBD_LimbBase
{
    Scale 1.3
	Health 120
    States
    {
		Spawn:
			
			//***Che
			//GORD E 1900 A_SpawnItem ("Green_BloodSpot", 0, 1)
			//Loop
			GORD E 1
			TNT1 A 0 A_QueueCorpse
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			GORD E 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GORD E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GORD E 1900
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			GORD E -1
			Stop
		LandOnLava:
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			GORD E Random(60,80) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death // no burning death specified, just explode into gore and let that gore deal with lava

		
		Death:    
			TNT1 A 0 A_NoBlocking
			TNT1 AAA 0 A_CustomMissile ("XDeath1Green", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("MuchBloodGreen", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath2bGreen", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath3bGreen", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathOrgan1Green", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			TNT1 A 0 A_CustomMissile ("XDeathOrgan2Green", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			TNT1 AA 0 A_CustomMissile ("GenericBaronGib1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			TNT1 A 0 A_CustomMissile ("GenericBaronGib2", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 80))
			Stop
}}








ACTOR XDeathMancubusArm: XDeathArm1
{
    +SKYEXPLODE
	-CLIENTSIDEONLY
    Scale 1.1
    Speed 6
	Gravity 0.4
	BounceFactor 0.4
    States
    {
    Spawn:
        TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		MANA ABCDEFG 3
		Loop
   	Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    HND8 A 0
        HND8 A 0 A_SpawnItem("FlameCannon",0,0,0,1)
        Stop
    }
}



ACTOR XDeathZombieManHead: XDeathBullArm1
{
	-CLIENTSIDEONLY
	SeeSound "HEDBON"
	DeathSound "HEDBON"
	PainSound "HEDBON"
	Radius 6
	Height 6
	-NOBLOCKMAP
	+NORADIUSDMG
	Health 1
    Scale 1.0
    States
    {
	Spawn:
	Spawn1:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		TNT1 A 0 A_JumpIf(momz == 0, "Death")
		XHE2 AB 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
		TNT1 A 0 A_ChangeFlag("THRUSPECIES", 0)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 1)
		XHE2 CDEFGH 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
		Loop
   	Death:
	    XHE2 E 1
		TNT1 A 0 A_JumpIfHealthLower(0, "Death2")
        XHE2 E 1 A_SpawnItem("ZombieManHead",0,0,0,1)
        Stop
	
	Death2:
        TNT1 A 0
		TNT1 A 0 A_SpawnItem("ZombiemanHeadExplode")
        Stop
}
}


Actor XDeathZombiemanHeadBeheaded: XDeathZombieManHead
{
Speed 5
Gravity 0.5
}


Actor XDeathZombiemanHeadOnXDeath: XDeathZombieManHead
{
States
{
Spawn:
TNT1 A 1
TNT1 A 0 A_jump(96, "ExplodeOnAir")
Goto Spawn1
ExplodeOnAir:
TNT1 A 0
TNT1 A 0 A_SpawnItem("ZombiemanHeadExplode")
Stop
}}

actor ZombiemanHead: FBD_LimbBase
{
	damagefactor "Kick", 99.0
	damagefactor "Melee", 99.0
	damagefactor "SuperPunch", 99.0
	damagefactor "Stealth", 0.0
	-CLIENTSIDEONLY
	+SHOOTABLE
	-THRUACTORS
	+LOOKALLAROUND
	-COUNTKILL
	damagefactor "Crush", 50.0
	damagefactor "Kick", 9000.0
	damagefactor "HeadKick", 9000.0
	damagefactor "Pick", 999.0
    Radius 10
	Mass 60
	Health 40
    Scale 1.1
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3")
			TNT1 A 0 A_Chase("","")
//***Che		
//		Spawn1:
//			XHE2 C 1
//			XHE2 C -1
//			Stop
//		Spawn2:
//			XHE2 G 1
//			XHE2 G -1
//			Stop
//		Spawn3:
//			XHE2 H 1
//			XHE2 H -1
//			Stop
		Spawn1:
			XHE2 C 5
			TNT1 A 0 A_CheckFloor("Rest1") 
			Loop
		Spawn2:
			XHE2 G 5
			TNT1 A 0 A_CheckFloor("Rest2") 
			Loop
		Spawn3:
			XHE2 H 5
			TNT1 A 0 A_CheckFloor("Rest3") 
			Loop
		Rest1:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE2 C 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava1")
			XHE2 C -1
			Stop
		Rest2:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE2 G 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava2")
			XHE2 G -1
			Stop
		Rest3:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE2 H 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava3")
			XHE2 H -1
			Stop		
		LandOnLava1:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE2 C Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma
		LandOnLava2:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE2 G Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma
		LandOnLava3:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE2 H Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma
			
			
		
		Death.Trample:
			Death.Stomp:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
			TNT1 A 0 A_Jump(256, "Death")
			Goto Death
	
		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ZombiemanHeadExplode")
			Stop
		Crush:
			TNT1 AAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			CRS1 B 5
			CRS1 B 9009
			Stop
		Death.plasma:
		Death.Electric:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("XDeathBurnedSkull", 2, 0, random (0, 360), CMF_AIMDIRECTION, 270)
			EXPL A 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0
			Stop
		Death.Kick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 AAAA 0 A_SpawnItemEx("Blood", 0, 0, 10)
			TNT1 A 0 A_CustomMissile ("XDeathZombieManHeadKicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
		Death.Melee:
		Death.SuperPunch:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_GiveToTarget("ShotgunguyHead", 1)
			Stop
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathZombieManHeadKicked2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop	
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			XHE2 ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			XHE2 ABCD 6
			XDT5 I 0 A_SpawnItem("ZombiemanHead")
			Stop

}}


ACTOR XDeathZombieManHeadKicked: XDeathZombieManHead
{
-BOUNCEONACTORS
Species "Marines"
Damage 4
Speed 14
}


ACTOR XDeathZombieManHeadKicked2: XDeathZombieManHeadKicked
{
Damagetype "HeadKick"
Speed 8
}



ACTOR XDeathSergeantHead: XDeathZombieManHead
{
    States
    {
	Spawn:
	Spawn1:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		TNT1 A 0 A_JumpIf(momz == 0, "Death")
		XHE1 AB 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
		TNT1 A 0 A_ChangeFlag("THRUSPECIES", 0)
		TNT1 A 0 A_ChangeFlag("SHOOTABLE", 1)
		XHE1 CDEFGH 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
		Loop
   	Death:
	    XHE1 E 1
		TNT1 A 0 A_JumpIfHealthLower(0, "Death2")
        XHE1 E 1 A_SpawnItem("SergeantHead",0,0,0,1)
        Stop
	
	Death2:
        TNT1 A 0
		TNT1 A 0 A_SpawnItem("ShotgunguyHeadExplode")
        Stop
		
}
}


Actor XDeathSergeantHeadBeheaded: XDeathSergeantHead
{
Speed 5
Gravity 0.5
}

Actor XDeathSergeantHeadOnXDeath: XDeathSergeantHead
{
States
{
Spawn:
TNT1 A 1
TNT1 A 0 A_jump(96, "ExplodeOnAir")
Goto Spawn1
ExplodeOnAir:
TNT1 A 0
TNT1 A 0 A_SpawnItem("ShotgunguyHeadExplode")
Stop
}}

actor SergeantHead: ZombieManHead
{
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_GiveInventory("IsPickable", 1)
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem("Brutal_BloodSpot")
			TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3")
		
//***Che		
//		Spawn1:
//			XHE1 C 1
//			XHE1 C -1
//			Stop
//		Spawn2:
//			XHE1 G 1
//			XHE1 G -1
//			Stop
//		Spawn3:
//			XHE1 H 1
//			XHE1 H -1
//			Stop
		Spawn1:
			XHE1 C 5
			TNT1 A 0 A_CheckFloor("Rest1") 
			Loop
		Spawn2:
			XHE1 G 5
			TNT1 A 0 A_CheckFloor("Rest2") 
			Loop
		Spawn3:
			XHE1 H 5
			TNT1 A 0 A_CheckFloor("Rest3") 
			Loop
		Rest1:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE1 C 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava1")
			XHE1 C -1
			Stop
		Rest2:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE1 G 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava2")
			XHE1 G -1
			Stop
		Rest3:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE1 H 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava3")
			XHE1 H -1
			Stop		
		LandOnLava1:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE1 C Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma
		LandOnLava2:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE1 G Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma
		LandOnLava3:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE1 H Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma



		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ShotgunguyHeadExplode")
			Stop
		Death.Kick:
			XHE2 EE 0 A_FaceTarget
			TNT1 AAAA 0 A_SpawnItemEx("Blood", 0, 0, 10)
			TNT1 A 0 A_CustomMissile ("XDeathSergeantHead", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathSergeantHead2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop		
		Pain:	
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			XHE1 ABCDEFGH 2
			Goto Spawn
		
		Death.Melee:
		Death.SuperPunch:
		death.pick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_GiveToTarget("ShotgunguyHead", 1)
			Stop
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			XHE1 ABCDEFGH 3
			XDT5 I 0 A_SpawnItem("SergeantHead")
			Stop	
	}
}



ACTOR XDeathSergeantHead2: XDeathSergeantHead
{
	Damagetype "HeadKick"
	Speed 8
}



actor SergeantHeadThrown: XDeathSergeantHead
{
	+BOUNCEONACTORS
	Damage (random (30, 40))
	DamageType "Kick"
	-CLIENTSIDEONLY
	Speed 20
	Gravity 0.4
	wallbouncefactor 0.2
}


ACTOR XDeathChaingunguyHead: XDeathBullArm1
{
	-CLIENTSIDEONLY
	BounceCount 3
	SeeSound "HEDBON"
	DeathSound "HEDBON"
	PainSound "HEDBON"
	Radius 6
    Scale 1.0
    States
    {
	Spawn:
	Spawn1:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		TNT1 A 0 A_JumpIf(momz == 0, "Death")
		CHHE AB 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
		TNT1 A 0 A_ChangeFlag("THRUSPECIES", 0)
		CHHE CDEFGH 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
		Loop
   	Death:
	    XHE2 E 0
        XHE2 E 0 A_SpawnItem("ChaingunguyHead",0,0,0,1)
        Stop
}
}



Actor XDeathChaingunguyHeadBeheaded: XDeathChaingunguyHead
{
	Speed 5
	Gravity 0.5
}


Actor XDeathChaingunguyHeadOnXDeath: XDeathChaingunguyHead
{
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_jump(96, "ExplodeOnAir")
			Goto Spawn1
		ExplodeOnAir:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ChaingunguyHeadExplode")
			Stop
	}
}

actor ChaingunguyHead: ZombiemanHead
{
	damagefactor "Kick", 9.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	-CLIENTSIDEONLY
	+SHOOTABLE
	+SOLID
	+THRUACTORS
	damagefactor "Crush", 50.0
    Radius 10
    
	Mass 60
	Health 40
    Scale 1.1
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_Jump(256, "Spawn1", "SPawn2")
//***Che			
//		Spawn1:
//		   CHHE A -1
//		   Stop
//		Spawn2:  
//		   CHHE E -1
//		   Stop
		Spawn1:
			CHHE A 5
			TNT1 A 0 A_CheckFloor("Rest1") 
			Loop
		Spawn2:
			CHHE E 5
			TNT1 A 0 A_CheckFloor("Rest2") 
			Loop
		Rest1:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			CHHE A 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava1")
			CHHE A -1
			Stop
		Rest2:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			CHHE E 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava2")
			CHHE E -1
			Stop
		LandOnLava1:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			CHHE A Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma
		LandOnLava2:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			CHHE E Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma
			
		   
		   
		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ChaingunguyHeadExplode")
			Stop
		Death.Trample:
		Crush:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
			TNT1 AAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			CRS1 B 5
			CRS1 B 9009
			Stop
		Death.plasma:
		Death.Electric:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("XDeathBurnedSkull", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			EXPL A 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0
			Stop
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			CHHE EE 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathChaingunguyHeadKicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
			
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathChaingunguyHeadKicked2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop	
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			CHHE ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			CHHE ABCDEFGH 3
			XDT5 I 0 A_SpawnItem("ChaingunguyHead")
			Stop

}}


ACTOR XDeathChaingunguyHeadKicked: XDeathChaingunguyHead
{
	-BOUNCEONACTORS
	Damage 4
	Speed 13
}


ACTOR XDeathChaingunguyHeadKicked2: XDeathChaingunguyHeadKicked
{
	Damagetype "HeadKick"
	Speed 8
}



ACTOR XDeathImpHead: XDeathChaingunguyHead
{

    States
    {
		Spawn:
		Spawn1:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			XHE4 AB 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
			TNT1 A 0 A_ChangeFlag("THRUSPECIES", 0)
			XHE4 CDEFGH 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			XHE4 E 1
			XHE4 E 1 A_SpawnItem("GibImpHead",0,0,0,1)
			Stop
	}
}


Actor XDeathImpHeadBeheaded: XDeathImpHead
{
	Speed 5
	Gravity 0.5
}

Actor XDeathImpHeadOnXDeath: XDeathImpHead
{
	States
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_jump(96, "ExplodeOnAir")
			Goto Spawn1
		ExplodeOnAir:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpHeadExplode")
			Stop
}}

Actor GibImphead: ZombieManHead
{
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem("Brutal_BloodSpot")
			TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3")
		
//***Che		
//		Spawn1:
//			XHE4 C 1
//			XHE4 C -1
//			Stop
//		Spawn2:
//			XHE4 G 1
//			XHE4 G -1
//			Stop
//		Spawn3:
//			XHE4 H 1
//			XHE4 H -1
//			Stop
		Spawn1:
			XHE4 C 5
			TNT1 A 0 A_CheckFloor("Rest1") 
			Loop
		Spawn2:
			XHE4 G 5
			TNT1 A 0 A_CheckFloor("Rest2") 
			Loop
		Spawn3:
			XHE4 H 5
			TNT1 A 0 A_CheckFloor("Rest3") 
			Loop
		Rest1:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE4 C 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava1")
			XHE4 C -1
			Stop
		Rest2:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE4 G 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava2")
			XHE4 G -1
			Stop
		Rest3:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE4 H 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava3")
			XHE4 H -1
			Stop		
		LandOnLava1:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE4 C Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death // has no Death.Plasma 
		LandOnLava2:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE4 G Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death
		LandOnLava3:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE4 H Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death


		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpHeadExplode")
			Stop
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			XHE4 EE 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathImpHead", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
		
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathImpHead2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop	
			
			
			
			
		Pain:	
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			XHE4 ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			XHE4 ABCDEFGH 3
			XDT5 I 0 A_SpawnItem("GibImpHead")
			Stop	

}}

ACTOR XDeathImpHead2: XDeathImpHead
{
	Damagetype "HeadKick"
	Speed 8
}


/////////////



ACTOR XDeathArchvileHead: XDeathChaingunguyHead
{
Speed 5

    States
    {
		Spawn:
		Spawn1:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			VILP CD 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
			TNT1 A 0 A_ChangeFlag("THRUSPECIES", 0)
			VILP EFGHIJ 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			VILP I 2
			VILP J 2 A_SpawnItem("ArchvileHead",0,0,0,1) // 1 = transfer translation
			Stop
	}
}


Actor XDeathArchvileHeadBeheaded: XDeathArchvileHead
{
	Speed 5
	Gravity 0.5
}

actor ArchvileHead: ZombieManHead
{
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem("Brutal_BloodSpot")
			VILP J 1
			
			//***Che
			//VILP J -1
			//Stop
			//
			//Stop
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem("Brutal_BloodSpot")
			VILP J 1
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			VILP J 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			VILP J 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			VILP J -1
			Stop
		LandOnLava:
			TNT1 AAAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			VILP J Random(35,70) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			
			// a copy-paste of the Death state with blood mist removed
			TNT1 A 0 A_Stop
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("Brains2", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains3", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("SmallBrainPieceFast", random (5, 15), random (5, -5), random (170, 190), CMF_AIMDIRECTION, random (-10, 10))
			TNT1 AAAAA 0 A_CustomMissile ("SmallBrainPiece", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("Teeth", 1, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 A 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			CARB Y -1			
			
		Death:
			TNT1 A 0
			TNT1 A 0 A_Stop
			TNT1 A 0 A_NoBlocking
			TNT1 AAAAA 0 A_CustomMissile ("BloodMistBig", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAA 0 A_CustomMissile ("FBD_FlyingBlood", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 A 0 A_CustomMissile ("Brains2", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains3", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("SmallBrainPieceFast", random (5, 15), random (5, -5), random (170, 190), CMF_AIMDIRECTION, random (-10, 10))
			TNT1 AAAAA 0 A_CustomMissile ("SmallBrainPiece", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("Teeth", 1, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 A 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			VILP K -1
			Stop
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			VILP JJ 1 A_FaceTarget
			
			//TNT1 A 0 A_CustomMissile ("XDeathArchvileHead", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_SpawnItemEx ("XDeathArchvileHead", 0,0,5, -6,random(-1,1),random(3,5), 0,SXF_TRANSFERTRANSLATION,0)	
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
		
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			//TNT1 A 0 A_CustomMissile ("XDeathArchvileHead2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_SpawnItemEx ("XDeathArchvileHead2", 0,0,5, -6,random(-1,1),random(3,5), 0,SXF_TRANSFERTRANSLATION,0)	
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop		
			
		Pain:	
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			VILP CDEFGHIJ 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			VILP CDEFGHIJ 3
			VILP I 0 A_SpawnItem("ArchvileHead",0,0,0,1) // 1 = transfer translation
			Stop	

	}
}


ACTOR XDeathArchvileHead2: XDeathArchvileHead
{
	Damagetype "HeadKick"
	Speed 8
}



ACTOR XDeathHellKnightHead: XDeathBullArm1
{
	-CLIENTSIDEONLY
    Scale 1.0
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			HKHE ABCDEFGH 3
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Green_BloodSpot", 0, 1)
			HKHE E 1
			HKHE E 1 A_SpawnItem("HellKnightHead",0,0,0,1)
			Stop
	}
}




actor HellKnightHead: GreenFBD_LimbBase
{
	damagefactor "Kick", 9.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	damagefactor "Headkick", 9000.0
	-CLIENTSIDEONLY
	+SHOOTABLE
	-NOBLOCKMAP
	+SOLID
	+THRUACTORS
	damagefactor "Crush", 50.0
    Radius 10
	Mass 60
	Health 60
    Scale 1.0
    States
    {
		Spawn:
			HKHE G 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor3", 0, 0, 0, 0)
			
			//***Che
			//HKHE G 1900
			//TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Vanish")
			//HKHE G -1
			//Stop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			HKHE G 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			HKHE G 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			HKHE G -1
			Stop
		LandOnLava:
			TNT1 AAAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			HKHE G Random(35,70) // pause
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death			
	
			
		Death:
			TNT1 A 0 A_SpawnItem("HellKnightHeadExplode", 0, 10)
			Stop
	   
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			HKHE DD 1 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathHellKnightHeadKicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
		
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathHellKnightHeadKicked2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop		
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			HKHE ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 0)
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			HKHE ABCDEFGH 3
			HKHE H 0 A_SpawnItem("HellKnightHead")
			Stop

}}


ACTOR XDeathHellKnightHeadKicked: XDeathHellKnightHead
{
	-BOUNCEONACTORS
	Damage 4
	Speed 13
	BounceFactor 0.4
}

ACTOR XDeathHellKnightHeadKicked2: XDeathHellKnightHeadKicked
{
	Damagetype "HeadKick"
	Speed 8
}






ACTOR XDeathPinkyDemonHead: XDeathBullArm1
{
	-CLIENTSIDEONLY
	Speed 10
    Scale 1.3
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			DEMH AB 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
			TNT1 A 0 A_ChangeFlag("THRUSPECIES", 0)
			DEMH CDEFGH 3// A_CustomMissile("ShortWallRedBlood", 0, 0, 0, 2)//
			Loop
		Death:
			DEMH I 1
			DEMH I 1 A_SpawnItem("PinkyDemonHead",0,0,0,1)
			Stop
	}
}





actor PinkyDemonHead: ZombiemanHead
{
	damagefactor "Kick", 9.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	-CLIENTSIDEONLY
    Radius 10
    
	Mass 60
	Health 60
    Scale 1.5
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			DEMH I 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			
			//***Che
			//DEMH I -1
			//Loop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			DEMH I 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			DEMH I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			DEMH I -1
			Stop
		LandOnLava:
			TNT1 AAAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			DEMH I Random(35,70) // pause
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Plasma			
			
			
		Death.Trample:
		Crush:
		Death:
			TNT1 A 0 A_CustomMissile ("PinkyHeadExplode", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			Stop
		Death.plasma:
		Death.Electric:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat2", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			EXPL A 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0
			Stop
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
		   DEMH A 1 A_Pain
			DEMH A 1 A_FaceTarget
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathPinkyDemonHeadKicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
		
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathPinkyDemonHeadKicked2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop	
			
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			DEMH ACEGI 3
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			DEMH ABCDEFGH 3
			DEMH I 0 A_SpawnItem("PinkyDemonHead")
			Stop

}}



ACTOR XDeathPinkyDemonHeadKicked: XDeathPinkyDemonHead
{
	-BOUNCEONACTORS
	Damage 4
	Speed 13
	Scale 1.3
	BounceFactor 0.4
}


ACTOR XDeathPinkyDemonHeadKicked2: XDeathPinkyDemonHeadKicked
{
	Damagetype "HeadKick"
	Speed 8
}





ACTOR XDeathBaronHead5: XDeathBullArm1
{
	-CLIENTSIDEONLY
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			XHE5 ABCDEFGH 3
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Green_BloodSpot", 0, 1)
			XHE5 A 1
			XHE5 A 1 A_SpawnItem("BaronHead",0,0,0,1)
			Stop
	}
}



actor BaronHead: HellKnightHead
{
	damagefactor "Kick", 9.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	-CLIENTSIDEONLY
    Radius 10
    
	Mass 60
	Health 60
    Scale 1.2
    States
    {
		Spawn:
			XHE5 A 1
			TNT1 A 0 A_QueueCorpse
			XHE5 A 1 A_SpawnItem ("Green_BloodSpot", 0, 1)
			
			
			
			//***Che
			//XHE5 A -1
			//Loop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			XHE5 A 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE5 A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			XHE5 A -1
			Stop
		LandOnLava:
			TNT1 AAAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			XHE5 A Random(35,70) // pause
			TNT1 A 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death
			

		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("BaronOfHellHeadExplode", 0, 5)
			Stop
		
		Death.plasma:
		Death.Electric:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("XDeathBurnedSkull", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			EXPL A 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0
			Stop
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			XHE5 A 1 A_Pain
			XHE5 A 1 A_FaceTarget
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathBaronHeadKicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
		
		Death.Headkick:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			XHE2 EE 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("XDeathBaronHeadKicked2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 30))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop	
		
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			XHE5 ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			XHE5 ABCDEFGH 3
			XHE5 I 0 A_SpawnItem("XDeathBaronHead5")
			Stop

}}


ACTOR XDeathBaronHeadKicked: XDeathBaronHead5
{
	-BOUNCEONACTORS
	Damage 4
	Speed 13
	BounceFactor 0.4
}



ACTOR XDeathBaronHeadKicked2: XDeathBaronHeadKicked
{
	Damagetype "HeadKick"
	Speed 8
}








ACTOR XDeathRevenantHead: XDeathBullArm1
{
	-CLIENTSIDEONLY
    Scale 1.0
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			XHE6 ABCD 6
			Loop
		Death:
			XHE6 A 1
			XHE6 A 1 A_SpawnItem("RevenantHead",0,0,0,1)
			Stop
	}
}




actor RevenantHead: FBD_LimbBase
{
	damagefactor "Kick", 9.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	BloodType "RevenantBlood"
	DamageFactor "HeadKick", 999.0
	-CLIENTSIDEONLY
    Radius 10
    
	Mass 60
	Health 60
    Scale 1.0
    States
    {
		Spawn:
			XHE6 B 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//XHE6 B -1
			//Stop
			XHE6 B 1
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			XHE6 B 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE6 B 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.plasma")
			XHE6 B -1
			Stop
			
			
			
		Death.Trample:
		Crush:
			TNT1 AAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			CRS1 B 5
			CRS1 B 9009
			Stop
		Death.plasma:
		Death.Electric:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("XDeathBurnedSkull", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			EXPL A 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0
			Stop
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			XHE6 A 1 A_Pain
			XHE6 A 1 A_FaceTarget
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathRevenantHeadKicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop
			
			
		Death.HeadKick:
			XHE6 A 1 A_Pain
			XHE6 A 1 A_FaceTarget
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathRevenantHeadKicked3", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			Stop	
			
			
			
		Death:	
			TNT1 A 0 A_NoBlocking
			TNT1 AAA 0 A_CustomMissile ("LSpart1", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("LSpart3", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("LSpart2", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			TNT1 AAAA 0 A_CustomMissile ("Brains1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			TNT1 AAAAAA 0 A_CustomMissile ("SmallBrainPiece", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			Stop
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			XHE6 ABCD 3
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			Goto Fly293
		Fly293:
			XHE6 ABCD 6
			TNT1 A 0 A_JumpIf(momz == 0, "Land293")
			//***Che: Loop was missing
			Loop
		Land293:
			XHE6 I 0 A_SpawnItem("XDeathRevenantHead")
			Stop

}}


ACTOR XDeathRevenantHeadKicked: XDeathRevenantHead
{
	-BOUNCEONACTORS
	Damage 4
	Speed 13
	BounceFactor 0.4
}

ACTOR XDeathRevenantHeadKicked2: XDeathRevenantHead
{
	+BOUNCEONACTORS
	+NOEXTREMEDEATH
	Damage 15
	Speed 24
	BounceFactor 0.2
}

ACTOR XDeathRevenantHeadKicked3: XDeathRevenantHead
{
	Damagetype "HeadKick"
	Speed 8
}







ACTOR XDeathMancubusHead: XDeathBullArm1
{
-CLIENTSIDEONLY
    Scale 0.9
    States
    {
	Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		TNT1 A 0 A_JumpIf(momz == 0, "Death")
		XHE7 ABCDEFGH 3
		Loop
   	Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    XHE7 A 1
        XHE7 A 1 A_SpawnItem("MancubusHead",0,0,0,1)
        Stop
}
}



actor MancubusHead: ZombiemanHead
{
	damagefactor "Kick", 9.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	-CLIENTSIDEONLY
    Radius 10
    
	Mass 120
	Health 60
    Scale 0.9
    States
    {
		Spawn:
			TNT1 A 0	
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem("Brutal_BloodSpot")
			TNT1 A 0 A_JUmp(128, "Spawn2")

//***Che			
//		Spawn1:
//			XHE7 B -1
//			Stop
//		   
//		Spawn2:
//			XHE7 G -1
//			Stop
		Spawn1:
			XHE7 B 5
			TNT1 A 0 A_CheckFloor("Rest1") 
			Loop
		Spawn2:
			XHE7 G 5
			TNT1 A 0 A_CheckFloor("Rest2") 
			Loop
		Rest1:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE7 B 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			XHE7 B -1
			Stop
		Rest2:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XHE7 G 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			XHE7 G -1
			Stop
		LandOnLava:
			TNT1 A 0
			XHE7 G Random(30,90)
			Goto Death.Plasma



		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("MancubusHeadExplode", 0, 10)
			Stop
		Death.Trample:
		Crush:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
			TNT1 AAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail5", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (60, 140))
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			CRS1 B 5
			CRS1 B 9009
			Stop
		Death.plasma:
		Death.Electric:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("XDeathBurnedSkull", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			EXPL A 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
			TNT1 A 0
			Stop
		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			XHE7 A 1 A_Pain
			XHE7 A 1 A_FaceTarget
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathMancubusHeadKicked", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
			
			
		Death.HeadKick:
			XHE7 A 0 A_Pain
			XHE7 A 0 A_FaceTarget
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathMancubusHeadKicked2", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop	
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			XHE7 ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			XHE7 ABCDEFGH 3
			XHE7 I 0 A_SpawnItem("MancubusHead")
			Stop

}}



ACTOR XDeathMancubusHeadKicked: XDeathMancubusHead
{
	-BOUNCEONACTORS
	Damage 4
	Speed 13
	BounceFactor 0.4
}


ACTOR XDeathMancubusHeadKicked2: XDeathMancubusHeadKicked
{
	Damagetype "HeadKick"
	Speed 4
}


ACTOR XDeathMancubusLeg: XDeathBullArm1
{
-CLIENTSIDEONLY
    Scale 1.2
	Speed 8
    States
    {
	Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		TNT1 A 0 A_JumpIf(momz == 0, "Death")
		MAN4 ABCDEFGH 3
		Loop
   	Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
	    MAN4 B 1
        MAN4 B 1 A_SpawnItem("GibMancubusLeg",0,0,0,1)
        Stop
}
}



actor GibMancubusLeg: FBD_LimbBase
{
	damagefactor "Kick", 9.0
	damagefactor "Melee", 9.0
	damagefactor "SuperPunch", 9.0
	-CLIENTSIDEONLY
	
    Radius 10
    
	Mass 120
	Health 60
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0	
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem("Brutal_BloodSpot")
			TNT1 A 0 A_JUmp(128, "Spawn2")
		
//***Che		
//		Spawn1:
//			MAN4 I 1
//			MAN4 I -1
//			Stop
//		 Spawn2:
//			MAN4 G 1
//			MAN4 G -1
//			Stop
		Spawn1:
			MAN4 I 5
			TNT1 A 0 A_CheckFloor("Rest1") 
			Loop
		Spawn2:
			MAN4 G 5
			TNT1 A 0 A_CheckFloor("Rest2") 
			Loop
		Rest1:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			MAN4 I 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava1")
			MAN4 I -1
			Stop
		Rest2:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			MAN4 G 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava2")
			MAN4 G -1
			Stop
		LandOnLava1:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			MAN4 I Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Burn
		LandOnLava2:
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			MAN4 G Random(20,40) // pause
			TNT1 AA 0 A_CustomMissile("PlasmaSmoke",0,0,180,2)
			Goto Death.Burn



		Death.Melee:
		Death.SuperPunch:
		Death.Kick:
			MAN4 A 1 A_Pain
			MAN4 A 1 A_FaceTarget
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathMancubusleg", 5, 0, random (170, 190), CMF_AIMDIRECTION, random (20, 40))
			TNT1 A 0 A_PlaySound("misc/xdeath5", 1)
			TNT1 A 0 A_PlaySound("FOOTWALL", 3)
			TNT1 A 20
			Stop
		
		Pain:
			TNT1 A 0
			TNT1 A 0 ThrustThingZ(0,20,0,1)
			MAN4 ABCDEFGH 2
			Goto Spawn
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,50,0,1)
			MAN4 ABCDEFGH 3
			MAN4 I 0 A_SpawnItem("GibMancubusLeg")
			Stop

}}





ACTOR XDeathMancubusTOrso: XDeathBullArm1
{
	-CLIENTSIDEONLY
    Scale 1.2
	Speed 8
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			MANA IJKLMNO 3
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			MANA B 0
			MANA B 0 A_SpawnItem("GibMancubusTorso",0,0,0,1)
			Stop
	}
}



actor GibMancubusTorso: BigGibBase
{
	-CLIENTSIDEONLY
    Radius 10
    
	Mass 120
	Health 120
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0	
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem("Brutal_BloodSpot")
			MANA QRSTQRSTQRSTQRSTQRSTQRSTQRST 1
			
			//***Che
			//MANA T -1
			//Stop
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			MANA T 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			MANA T 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Death.Burn")
			MANA T -1
			Stop			
}}



//***Che: im not touching cyberdemons gibs. Because he is so badass even his meat won't fry

ACTOR XDeathCyberdemonHead: XDeathBullArm1
{
	-CLIENTSIDEONLY
	+SKYEXPLODE
	-DOOMBOUNCE
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			XHE8 ABCDEFGH 3 A_CustomMissile ("FBD_FlyingBlood", 1, 0, random (0, 360), CMF_AIMDIRECTION, random (20, 40))
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			XHE8 B 1
			XHE8 B 1 A_SpawnItemEx("CyberdemonHead",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonHead",0,0,0,1)
			Stop
	}
}


actor CyberdemonHead: FBD_LimbBase
{
	-CLIENTSIDEONLY
	DamageFactor "Headkick", 0.0
    Radius 20
	Mass 220
	Health 100
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			XHE8 C 1
			XHE8 C -1
			Stop
			
		Death:
		Death.Trample:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
		Crush:
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			
			TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodMistBig", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAAAA 0 A_CustomMissile ("FBD_FlyingBlood", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAA 0 A_CustomMissile ("Brains6Big", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("Brains7Big", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 A 0 A_Stop
			XHE8 I 10
			XHE8 I -1
			Stop
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			XHE8 ABCDEFGH 3
			//***Che have to support scalability and palette shifts (tyrant, chad, devastator, e2m8 boss)
			XHE8 B 0 A_SpawnItemEx("CyberdemonHead",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonHead")
			Stop
	}
}



ACTOR XDeathCyberdemonTorso: XDeathBullArm1
{
	-CLIENTSIDEONLY
	+SKYEXPLODE
	-DOOMBOUNCE
    Scale 1.4
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			CYGT ABCDEFGH 3 A_CustomMissile ("FBD_FlyingBlood", 1, 0, random (0, 360), CMF_AIMDIRECTION, random (20, 40))
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			CYGT B 1
			CYGT B 1 A_SpawnItemEx("CyberdemonTorso",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonTorso",0,0,0,1)
			Stop
	}
}


actor CyberdemonTorso: FBD_LimbBase
{
-CLIENTSIDEONLY
    Radius 20
	Mass 220
	Health 100
    Scale 1.4
    States
    {
		Spawn:
			TNT1 A 0
			CYGT B 1
			TNT1 A 0 A_QueueCorpse
			CYGT B -1
			Stop
			
		Death:
		Death.Trample:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
		Crush:
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			
			TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodMistBig", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAAAA 0 A_CustomMissile ("FBD_FlyingBlood", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 A 0 A_Stop
			TNT1 I 10
			TNT1 I -1
			Stop
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			CYGT ABCDEFGH 3
			XHE8 B 0 A_SpawnItemEx("CyberdemonTorso",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonTorso")
			Stop
	}
}


ACTOR XDeathCyberdemonPiece: XDeathBullArm1
{
	-CLIENTSIDEONLY
	+SKYEXPLODE
	-DOOMBOUNCE
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			CYGP ABCDEFGH 3 A_CustomMissile ("FBD_FlyingBlood", 1, 0, random (0, 360), CMF_AIMDIRECTION, random (20, 40))
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			CYGP B 1
			CYGP B 1 A_SpawnItemEx("CyberdemonPiece",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonPiece",0,0,0,1)
			Stop
	}
}


actor CyberdemonPiece: FBD_LimbBase
{
	-CLIENTSIDEONLY
    Radius 20
	Mass 220
	Health 100
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0
			CYGP E 1
			TNT1 A 0 A_QueueCorpse
			CYGP E -1
			Stop
			
		Death:
		Death.Trample:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
		Crush:
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			
			TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodMistBig", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAAAA 0 A_CustomMissile ("FBD_FlyingBlood", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 A 0 A_Stop
			TNT1 I 10
			TNT1 I -1
			Stop
		
		Death.ExplosiveImpact:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 ThrustThingZ(0,30,0,1)
		CYGP ABCDEFGH 3
		CYGP B 0 A_SpawnItemEx("CyberdemonPiece",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonPiece")
		Stop
	}
}




ACTOR XDeathCyberdemonARm: XDeathBullArm1
{
	-CLIENTSIDEONLY
	+SKYEXPLODE
	-DOOMBOUNCE
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			CYGA ABCDEFGH 3 A_CustomMissile ("FBD_FlyingBlood", 1, 0, random (0, 360), CMF_AIMDIRECTION, random (20, 40))
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			CYGA B 1
			CYGA B 1 A_SpawnItemEx("CyberdemonArm",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonArm",0,0,0,1)
			Stop
	}
}


actor CyberdemonArm: FBD_LimbBase
{
	-CLIENTSIDEONLY
    Radius 20
	Mass 220
	Health 100
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0
			CYGA C 1
			TNT1 A 0 A_QueueCorpse
			CYGA C -1
			Stop
			
		Death:
		Death.Trample:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
		Crush:
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			
			TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodMistBig", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAAAA 0 A_CustomMissile ("FBD_FlyingBlood", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 A 0 A_Stop
			TNT1 I 10
			TNT1 I -1
			Stop
		
		Death.ExplosiveImpact:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ThrustThingZ(0,30,0,1)
			CYGA ABCDEFGH 3
			CYGA B 0 A_SpawnItemEx("CyberdemonArm",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION | SXF_TRANSFERSCALE | SXF_TRANSFERTRANSLATION,0)	//A_SpawnItem("CyberdemonArm")
			Stop
	}
}



ACTOR XDeathCyberdemonGun: XDeathBullArm1
{
	-CLIENTSIDEONLY
	+SKYEXPLODE
	-DOOMBOUNCE
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			TNT1 A 0 A_JumpIf(momz == 0, "Death")
			CYGG ABCDEFGH 3
			Loop
		Death:
			TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			CYGG B 1
			CYGG B 1 A_SpawnItem("CyberdemonGun",0,0,0,1)
			Stop
	}
}


actor CyberdemonGun: FBD_LimbBase
{
	-CLIENTSIDEONLY
    Radius 20
	Mass 220
	Health 100
    Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0
			CYGG E 1
			TNT1 A 0 A_QueueCorpse
			CYGG E -1
			Stop
			
		Death:
		Death.Trample:
			TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 6)
		Crush:
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			
			TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodMistBig", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAAAA 0 A_CustomMissile ("FBD_FlyingBlood", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 A 0 A_Stop
			TNT1 I 10
			TNT1 I -1
			Stop
		
		Death.ExplosiveImpact:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 ThrustThingZ(0,30,0,1)
		CYGG ABCDEFGH 3
		CYGG B 0 A_SpawnItem("CyberdemonGun")
		Stop
	}
	}




//***Che:: this one is also part of a bugfix unrelated to lava
// (INVISIBLE ARACHNOTRON BRAIN FIX)

// One of the two variations (the one that leaves a crawling brain)
//   relied on old sprites NAHA* that were removed in BDv21
ACTOR XDeathArachnotronHead: XDeath1
{
    Speed 12
	Gravity 0.9
	+DONTSPLASH
    DeathSound "none"
	SeeSound "none"
	+SKYEXPLODE
	Decal none
    Scale 1.0
    States
    {
		Spawn:
			NAHB ABCDEFGH 4 //NAHA ABCDEFGH 4 // use NAHB* instead
			Loop
		Death:
			TNT1 A 0
			//TNT1 A 0 A_Jump(128, "CleanDeath")
			TNT1 A 0 A_SpawnItem("CrawlingDyingSpider")
			Stop
		CleanDeath:
			TNT1 AAAAAAAAAAAA 0 A_CustomMissile ("SmallBrainPiece", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			NAHC IJKLMN 5
			
			//***Che: wtf am i doing upgrading a state that is NEVER used?
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			NAHC N 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			NAHC N -5
			Stop
		LandOnLava:
			TNT1 AAAAAAAAAAAA 0 A_CustomMissile ("SmallBrainPiece", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			CARB B -1
			Stop
    }
}









ACTOR BasicGib
{
	Radius 6
	Height 6
	+NOBLOCKMAP
	+CLIENTSIDEONLY
	Mass 50
	States
	{
		Spawn:
			TNT1 A 1
			Stop
	}
}




ACTOR BasicMarineGib1: BasicGib
{
	States
	{
	Spawn:
	TNT1 A 1
	TNT1 A 0 A_QueueCorpse
	TNT1 A 0 A_PlaySound("misc/xdeath5")
	TNT1 A 0 ThrustThingZ(0,40,0,1)
	TNT1 A 0 A_SetAngle(random(0, 359))
	TNT1 A 0 A_Recoil(3)
	XDMG A -1
	Stop
	}
}


ACTOR BasicMarineGib2: BasicGib
{
	States
	{
	Spawn:
	TNT1 A 1
	TNT1 A 0 A_QueueCorpse
	TNT1 A 0 A_PlaySound("misc/xdeath5")
	TNT1 A 0 ThrustThingZ(0,40,0,1)
	TNT1 A 0 A_SetAngle(random(0, 359))
	TNT1 A 0 A_Recoil(3)
	XDMG B -1
	Stop
	}
}


ACTOR BasicMarineGib3: BasicGib
{
	States
	{
	Spawn:
	TNT1 A 1
	TNT1 A 0 A_QueueCorpse
	TNT1 A 0 A_PlaySound("misc/xdeath5")
	TNT1 A 0 ThrustThingZ(0,40,0,1)
	TNT1 A 0 A_SetAngle(random(0, 359))
	TNT1 A 0 A_Recoil(3)
	XDMG C -1
	Stop
	}
}


ACTOR BasicMarineGib4: BasicGib
{
	States
	{
	Spawn:
	TNT1 A 1
	TNT1 A 0 A_QueueCorpse
	TNT1 A 0 A_PlaySound("misc/xdeath5")
	TNT1 A 0 ThrustThingZ(0,40,0,1)
	TNT1 A 0 A_SetAngle(random(0, 359))
	TNT1 A 0 A_Recoil(3)
	XDMG D -1
	Stop
	}
}


ACTOR XDeathHalfDemon
{
    Radius 8
    Height 8
    Scale 1.0
	Speed 6
	Mass 4
	Decal BrutalBloodSplat
	BounceFactor 0.2
	+DOOMBOUNCE
	+MISSILE
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
    +NOBLOCKMAP
    +NOTELEPORT
    States
    {
    Spawn:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
		SARC E 12
		Loop
    Death:
        TNT1 A 0 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
        SARC F 1 A_SpawnItem("Gib_HalfDemon",0,0,0,1)
        TNT1 A 0
        Stop
    }
}

actor Gib_HalfDemon: BigGibBase
{
    States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			SARC F 1 A_SpawnItem ("Brutal_BloodSpot", 0, 1)
			
			//***Che
			//SARC F -1
			//Stop   
			Goto Fly
		Fly:	
			TNT1 A 0 A_CheckFloor("Rest") 
			SARC F 5
			Loop			
		Rest:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			SARC F 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			SARC F -1
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-7, 7), random(-7, 7))
			SARC F Random(30,90)
			// a copy of the death state without blood mist
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeathSkinPiece2", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AA 0 A_CustomMissile ("XDeathDemonArm", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathPinkyDemonHead", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			Stop
			
			

		Death: 
		Death.Trample:
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeathSkinPiece2", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AaaA 0 A_CustomMissile ("BloodMistBig", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 90))
			TNT1 AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath3b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AAA 0 A_CustomMissile ("XDeath2b", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (50, 90))
			TNT1 AA 0 A_CustomMissile ("XDeathDemonArm", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathPinkyDemonHead", 2, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			Stop
	   }}
	   
	   
ACTOR XDeathSkinPiece1: Xdeath1
{
    Radius 2
    Height 2
    Speed 10
    Scale 1.0
	Mass 1
    SeeSound "none"
    DeathSound "none"
	Mass 1
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Underwater")
			XSKI A 4
			Loop
		Death:
			XSKI B 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//XSKI B -1
			//Stop
			//TNT1 A 1
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XSKI B 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_QueueCorpse
			XSKI B -1
			Stop
		LandOnLava:
			CARB X 1 //tiny carbon lump
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-4, 4), random(-4, 4))
			CARB X -1
			Stop			
			
		Underwater:
		Splash:
			Goto Death
	}
}	


ACTOR XDeathSkinPiece2: XDeathSkinPiece1
{
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Underwater")
			XSKI C 4
			Loop
		Death:
			XSKI D 1
			TNT1 A 0 A_QueueCorpse
			
			//***Che
			//XSKI D -1
			//Stop
			//TNT1 A 1
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XSKI D 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_QueueCorpse
			XSKI D -1
			Stop
		LandOnLava:
			CARB X 1
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-4, 4), random(-4, 4))
			CARB X -1
			Stop
			
			
		Underwater:
		Splash:
			Goto Death
			
	}
}	   











ACTOR XDeathPainElementalNew1: XDeath1
{
    Speed 12
	Gravity 0.4
    Decal BrutalBloodSplat
	SeeSound "misc/xdeath5"
    DeathSound "misc/xdeath5"
	Translation "64:72=133:142", "73:75=13:15", "76:79=236:239"
    Scale 1.1
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			CAGI ABCDEFGH 2 A_CustomMissile ("Brutal_FlyingBloodTrail", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 AAA 0 A_SpawnItem("Blood", 0, 5)
		//***Che	
		Falling:	
			TNT1 A 0 A_CheckFloor("SpawnFloor")
			CAGI Q 5
			Loop
			
			
		SpawnFloor:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			CAGI Q 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")	
			
			CAGI Q 9009
			TNT1 A 2
			Stop
		LandOnLava:
			CARB S 1
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-14, 14), random(-14, 14))
			CARB S -1
			Stop			
    }
}



ACTOR XDeathPainElementalNew2: XDeathPainElementalNew1
{
    Speed 12
	Gravity 0.6
    Decal BrutalBloodSplat
    Scale 1.1
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			CAGI IJKLMNOP 2 A_CustomMissile ("Brutal_FlyingBloodTrail", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			Loop
		Death:
			
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 AAA 0 A_SpawnItem("Blood", 0, 5)
		
		//***Che	
		Falling:	
			TNT1 A 0 A_CheckFloor("SpawnFloor")	
			CAGI R 5
			Loop

		SpawnFloor:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			CAGI R 5
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")	
			
			CAGI R 9009
			TNT1 A 2
			Stop
		LandOnLava:
			CARB T 1
			TNT1 AAA 0 A_SpawnItemEx("GoreLandingOnLava", random(-14, 14), random(-14, 14))
			CARB T -1
			Stop			
    }
}



ACTOR XDeathSpiderNew1: XDeathPainElementalNew1
{
    Scale 0.8
	Speed 7
}

ACTOR XDeathSpiderNew2: XDeathPainElementalNew2
{
    Scale 0.7
	Speed 7
}


ACTOR MancubusEyeballs //Eyeballs
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.5
	+DOOMBOUNCE
	+MISSILE
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
	+CLIENTSIDEONLY
	+THRUACTORS
	Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			MANE Y 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			MANE Y 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			MANE Y 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
		LandOnLava:
			CARB X 1
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-4, 4), random(-4, 4))
			CARB X -1
			Stop

			
		Rest:
			MANE Y 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
			
		DoNothing:
			TNT1 A 0
			Stop	
    }
}




ACTOR CacodemonEyeball //Eyeballs
{
    Radius 2
    Height 2
	Speed 9
	Mass 1
    +CLIENTSIDEONLY
	BounceFactor 0.5
	+DOOMBOUNCE
	+MISSILE
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
	+CLIENTSIDEONLY
	+THRUACTORS
	Scale 1.0
	
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			CCD5 ABCD 4
			Loop
		Death:
			CCD5 A 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			CCD5 A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
		LandOnLava:
			CARB X 1
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-4, 4), random(-4, 4))
			CARB X -1
			Stop			
			
		Rest:
			CCD5 A 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
			
		DoNothing:
			TNT1 A 0
			Stop	
    }
}



Actor ThrownCacodemonEyeBall: CacodemonEyeBall
{
	-THRUACTORS
	-CLIENTSIDEONLY
	Damage (random (4, 5))
	Damagetype "Kick"
	Speed 24
}


ACTOR Brains1 : BigGibBase //Random bloody piece
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
	BounceFactor 0.4
	Scale 0.5
	+DOOMBOUNCE
	+MISSILE
    +NOBLOCKMAP
    +NOTELEPORT
	+CLIENTSIDEONLY
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
    States
    {
		Spawn:
			TNT1 A 0
			Stop
		Death:
			XDT5 C 1
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			XDT5 C 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
		LandOnLava:
			CARB X 1
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-4, 4), random(-4, 4))
			CARB X -1
			Stop			
			
		Rest:
			TNT1 A 0
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_Jump(256, "Rest1", "Rest2")
		Rest1:
			XDT5 C 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			XDT5 C -1
			Stop
			
		Rest2:
			XDT5 C 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			XDT5 C -1
			Stop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}

ACTOR Brains2 : Brains1 //Teeth
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.4
	Scale 0.9
	+DOOMBOUNCE
	+MISSILE
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BRIB ABCD 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BRIB A 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BRIB A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
	
			
		Rest:
			TNT1 A 0
			TNT1 A 0 A_Jump(256, "Rest1", "Rest2")
		Rest1:
			BRIB A 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			BRIB A -1
			Stop
			
		Rest2:
			BRIB C 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			BRIB C -1
			Stop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}

ACTOR Brains3 : Brains1 //Eyeballs
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.5
	+DOOMBOUNCE
	+MISSILE
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
	Scale 0.8
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BRIB EFGH 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BRIB E 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BRIB E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
			
		Rest:
			TNT1 A 0
			TNT1 A 0 A_Jump(256, "Rest1", "Rest2", "Rest3", "Rest4")
		Rest1:
			BRIB E 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
			
		Rest2:
			BRIB F 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		Rest3:
			BRIB G 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
			
		Rest4:
			BRIB H 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}

ACTOR Brains4 : Brains1 //White skinned piece 1
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
	Scale 0.9
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
    +MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BRIB IJKL 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BRIN D 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BRIN D 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest			
			
		Rest:
			BRIN D 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop		
    }
}

ACTOR Brains5 : Brains1 //White skinned piece 2
{
    Radius 2
    Height 2
	Speed 6
	Scale 0.9
	Mass 1
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
    +MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BRIB IJKL 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BRIN E 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BRIN E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
			
		Rest:
			BRIN E 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop		
    }
}


ACTOR Brains6 : Brains1 //Brown skinned piece
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
	Scale 0.9
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
    +MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BRIB MNOP 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BRIN F 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BRIN F 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
			
		Rest:
			BRIN F 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}



ACTOR Brains6Big: Brains6 
{
	Scale 1.8
}


ACTOR Brains7 : Brains1 //Brown skinned teeth
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
	Scale 0.9
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
    +MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BRIB QRST 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BRIN G 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BRIN G 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
			
		Rest:
			BRIN G 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}

ACTOR Brains7Big: Brains7 
{
Scale 1.3
}


ACTOR Brains4GreenHair: Brains4 
{
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BR7B IJKL 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BR7N D 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BR7N D 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
			
		Rest:
			BR7N D 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
		TNT1 A 0
		Stop	
    }
}


ACTOR Brains4GreenHairBig: Brains4 
{
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BR7B ABCD 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BR7B A 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BR7B A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
			
		Rest:
			BR7B A 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}





ACTOR Brains4Blonde: Brains4 
{
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		BR8B IJKL 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
		Loop
	Death:
	    BR8B I 1
		TNT1 A 0 A_QueueCorpse
        TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
	    
		//***Che
		//Goto Rest
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
		BR8B I 3 // This obligatory pause here is why I cannot reuse one parent's state
		         // and be done with it. Any script you launch does not run instantly.
				 // On the other hand, if the state machine reaches a non -1 stop frame,
				 // any scripts launched by that specific mob are terminated!
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
		Goto Rest
		
	Rest:
        BR8B I 800
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
        Loop
	DoNothing:
	TNT1 A 0
	Stop	
    }
}


ACTOR Brains4BlondeBig: Brains4 
{
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BR8B ABCD 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BR8B A 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BR8B A 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
		Rest:
			BR8B A 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}


ACTOR BrainsSergeantHeadPiece: Brains4 
{
	Speed 2
	-DOOMBOUNCE
	Scale 1.0
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BR7B EFGH 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BR7B E 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BR7B E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest			
			
		Rest:
			BR7B E 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}


ACTOR BrainsImpHeadPiece: Brains4 
{
Speed 2
-DOOMBOUNCE
Scale 1.0
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			BR7N E 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			BR7N E 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			BR7N E 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest			
			
		Rest:
			BR7N E 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
		TNT1 A 0
		Stop	
    }
}

ACTOR BaronHeadPiece
{
    Radius 2
    Height 2
	Speed 6
	Mass 1
    Decal BrutalBloodSplat
    +CLIENTSIDEONLY
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
    +MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
	+FLOORCLIP
	Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			XHE5 IJKL 4 //A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			XHE5 I 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			PDG1 H 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
		LandOnLava:
			CARB Y 1
			TNT1 A 0 A_SpawnItemEx("GoreLandingOnLava", random(-4, 4), random(-4, 4))
			CARB Y -1
			Stop
			
		Rest:
			XHE5 I 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}


ACTOR PinkyJaw: BaronHeadPiece
{
	Scale 1.2
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			PDG1 ABCDEFGH 4 //A_CustomMissile ("BloodTr255", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			PDG1 H 2
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			PDG1 H 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest			
			
		Rest:
			PDG1 i 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
			TNT1 A 0
			Stop	
    }
}

ACTOR PinkyHeadPiece: BaronHeadPiece
{
 Translation "112:127=176:191"
 States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		XHE5 IJKL 4 //A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
		Loop
		}
}

ACTOR HellKnightHeadPiece: BaronHeadPiece
{
	Scale 1.0
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
			HKHE IJKL 4 //A_CustomMissile ("Green_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
			Loop
		Death:
			HKHE I 2
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
			
			//***Che
			//Goto Rest
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			HKHE I 3
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Rest
			
		Rest:
			HKHE I 800
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "DoNothing")
			Loop
		DoNothing:
		TNT1 A 0
		Stop	
    }
}

ACTOR HellKnightHeadPiece2: HellKnightHeadPiece
{
	XScale -1.0
}