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







//Mark-sensei once said:

//Didn't Pa1N said PB wouldn't be taking assets from BD's betas anymore?
//You assholes really have no respect, do you? Still willing to take beta assets from BD to stuff into your mod
//and make it look like you made it first.
//I mean, who else could be browsing this lump, at this time of the year, localized entirely
//at this dev build, besides PB devs?
//Go make your own mod, loosers.






// Bug fix for maggots in raging fire: see DECORATE.nomaggots
// NM = "no maggots"
// Relies on SPRITES/DOOM2WADRIPS/HDB?Y0 for original maggot-less corpses (overwritten by BD)





actor VeryDeadMarine: DeadMarine Replaces DeadMarine
{
	damagefactor "Avoid", 0.0
	damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0
	damagefactor "Shrapnel", 100.0 
	damagefactor "GibRemoving", 990.0
	+NOTAUTOAIMED
	+CLIENTSIDEONLY
	+FLOORCLIP
	Radius 0
	Game Doom
	States
	{
    Spawn:
	    TNT1 A 0
		TNT1 AAAAA 0 A_CustomMissile ("SuperWallRedBlood", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (5, 40))
		TNT1 AAAAAA 0 A_SpawnItemEx("Brutal_BloodSpot",random(64, -64),random(64, -64))
		TNT1 A 0 A_SpawnItem("MediumBloodSpot")
	    TNT1 A 0 A_CheckSight("Spawn2")
		TNT1 A 0
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("FBD_CurbstompedMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("AteMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("FBD_DeadRippedOffMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("FuckedMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("ADoomedSpaceMarine2",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 1 A_SpawnItemEx("ADoomedSpaceMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		TNT1 A 30 A_ChangeFlag("CORPSE", 0)
		Stop
		
    Spawn2:
		TNT1 A 0
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("FBD_CurbstompedMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("AteMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)	
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("FBD_DeadRippedOffMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("FuckedMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("ADoomedSpaceMarine2",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 1 A_SpawnItemEx("ADoomedSpaceMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		TNT1 A 30 A_ChangeFlag("CORPSE", 0)
		Stop
	Death:
		TNT1 A 30 A_ChangeFlag("CORPSE", 0)
		Stop
	}
}

actor VeryVeryDeadMarine: GibbedMarine Replaces GibbedMarine
{
	+CLIENTSIDEONLY
	damagefactor "Avoid", 0.0
	Game Doom
	States
	{
    Spawn:
	TNT1 A 0
	TNT1 AAAAA 0 A_CustomMissile ("SuperWallRedBlood", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (5, 40))
	TNT1 AAAAAAA 0 A_SpawnItemEx("Brutal_BloodSpot",random(64, -64),random(64, -64))
	TNT1 A 0 A_SpawnItem("MediumBloodSpot")
		TNT1 A 0 A_CheckSight("Spawn2")
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItem("GibDec")
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItem("GibDec")
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("VeryDeadCivilian",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 2 A_SpawnItem("GutsPile")
		TNT1 A 30 A_ChangeFlag("CORPSE", 0)
		Stop
		
	Spawn2:
		TNT1 A 0
		
		TNT1 A 0
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItem("GibDec")
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItem("GibDec")
		Goto Death
		TNT1 A 0 A_Jump(160,2)
		TNT1 A 1 A_SpawnItemEx("VeryDeadCivilian",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
		Goto Death
		TNT1 A 1 A_SpawnItem("GutsPile")
		TNT1 A 30 A_ChangeFlag("CORPSE", 0)
		Stop
	Death:
		TNT1 A 30 A_ChangeFlag("CORPSE", 0)
		Stop	
	}
}

actor VeryVeryDeadMarine2 : VeryVeryDeadMarine Replaces GibbedMarineExtra
{
	Game Doom
}


// renamed to try get cross-mod compatibility with project brutality
actor FBD_CurbstompedMarine: AbstractCorpse
// this is THE base ancestor class for 226 various corpse classes
//   TWO HUNDRED, CARL!
// note it is neither a monster nor a missile AND SHOULD STAY THAT WAY for the sfest status transfer to work.
{   
	Radius 16 //***Che: otherwise, raising failures galore! //10
    Height 6
    +NOTELEPORT
	damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0
    +MOVEWITHSECTOR
	+FLOORCLIP
	+FORCEXYBILLBOARD
	+SHOOTABLE
	+GHOST
	+NOTAUTOAIMED
	+NOTARGET
	+NEVERTARGET //***Che stop the fucking NPC marines from attacking fucking corpses!
	+CORPSE
	-THRUACTORS
	damagefactor "Crusher", 50.0
    Mass 1000
    Health 300
	PainChance 255
	damagefactor "TeleportRemover", 1000.0
	damagefactor "GibRemoving", 0.5
	damagefactor "Desintegrate", 990.0 // bfg9000 and Unmaker
	damagefactor "BFG", 990.0 // No sources of this! Because bfg10k has damage type "Extreme"
	damagefactor "CrushedBodies", 9999.00
	damagefactor "Headkick", 0.0
//	Mass 3000
	damagefactor "Kick", 3.0
	damagefactor "SuperKick", 3.0
	damagefactor "ExtremePunches", 2.0
	damagefactor "SuperPunch", 2.0
	damagefactor "ssg", 5000.0
	BloodType "DeadBlood", "FBD_SawBlood", "FBD_SawBlood"
	
	var int user_floor_is_lava;
	
	States
	{
	
	
/* P.S. This leads to glitches. Just NO Raise state.	
		Raise:
			// this ancestral class is not actually raiseable
			// but some of its death states, shared with its descendants,
			// invoke nightmare respawn via ACS script
			// (which simply puts the actor in its "Raise" state)
			TNT1 A 0
			TNT1 A 0 A_GiveInventory("RezzingNow")
			TNT1 A 0 A_ChangeFlag("CORPSE", 0)
			Goto Stay
*/			

		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			PLDH A 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			PLDH A 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			//TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)			
			PLDH A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop 
			//PLDH A 3000 
			//Loop 
/* see below
		Death.Burn:
		Death.Fire:
		Death.Flames:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItem("GoryAshes")
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
*/			
		Pain.Kick:
		Pain.ExplosiveImpact:
		//***Che
		Pain.FriendlyExplosion:
			"----" A 0
			"----" A 0 ThrustThingZ(0,25,0,1)
			"----" A 1 A_Jump(256, "Stay")
			Wait
			
		Pain.Trample:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("floorslimy")
			TNT1 A 0 ThrustThingZ(0,25,1,1)
			TNT1 A 0 A_Jump(256, "Stay") //"Spawn")
			Goto Death	
			
		Death:
			TNT1 A 0 A_SpawnItem("Gibz")
			TNT1 A 0 A_NoBlocking
			TNT1 AA 0 A_CustomMissile ("XDeath1", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath2b", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath3b", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAA 0 A_CustomMissile ("XDeathSkinPiece2", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("XDeathSkinPiece1", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAA 0 A_CustomMissile ("SmallSuperGore", 10, 0, random (0, 360), 2, random (10, 170))
			TNT1 AAAA 0 A_CustomMissile ("BloodMistSmall", 35, 0, random (0, 360), 2, random (40, 90))
			TNT1 AA 0 A_CustomMissile ("BloodMistBig", 15, 0, random (0, 360), 2, random (0, 60))
			TNT1 A 3 A_SpawnItem("MediumBLoodSpot", 0, 10)
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)		
			Stop
		  
		Death.plasma:
		Death.Electric:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_XScream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathBurnedMeat3", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			EXPL AAA 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 A 3
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)		
			Stop
		Death.TeleportRemover:
		Death.GibRemoving:
			TNT1 A 0
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("NOCLIP", 1)
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 1)
			Stop
			

			TNT1 AAAAA 0 A_CustomMissile ("XDeath1", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 30))
			TNT1 AA 0 A_CustomMissile ("XDeath2b", 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 AAAA 0 A_CustomMissile ("SmallSuperGore", 10, 0, random (0, 360), CMF_AIMDIRECTION, random (10, 30))
			TNT1 A 0 A_SpawnItem("SplatteredSmall")
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			XME2 L 1 A_ChangeFlag("CORPSE", 1)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
			 
		Death.Bfg10k: //***Che changed damage type from extreme to custom
		Death.Desintegrate:
			TNT1 A 0
			TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodFake", 0, 0, random (0, 360), 2, random (0, 90))
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 60))
			TNT1 AA 0 A_CustomMissile ("BloodMistSmall", 7, 0, random (0, 360), 2, random (30, 60))
			TNT1 A 0 A_SpawnItem("Gibz")
			TNT1 A 3 A_SpawnItem("MeatDeathSmall")
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)		
			Stop	
			 
			 
		
		Death.CrushedBodies: // AOE (8 in a radius of 10) inflicted by BodyRemovalThing, 
			// which is spawned by all monsters in the end of their Crush state, 
			// which they enter when crushed by ceiling
			
			TNT1 A 0 A_NoBlocking
			TNT1 AA 0 A_SpawnItem("MeatDeathSmall")
			
			TNT1 A 0 A_SetAngle(0)
			TNT1 A 0 bright A_CustomMissile ("SuperGoreSpawner2", 1, -40, random (0, 360), 2, random (25, 45))
			TNT1 A 0 bright A_CustomMissile ("SuperGoreSpawner2", 1, 40, random (0, 360), 2, random (25, 45))
			TNT1 A 0 A_CustomMissile ("XDeath1", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath2b", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath3b", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("BloodMistBig", 1, -40, random (0, 360), 2, random (30, 90))
			TNT1 AA 0 A_CustomMissile ("BloodMistBig", 1, 40, random (0, 360), 2, random (30, 90))
			TNT1 A 0 A_SetAngle(90)
			TNT1 A 0 bright A_CustomMissile ("SuperGoreSpawner2", 1, -40, random (0, 360), 2, random (25, 45))
			TNT1 A 0 bright A_CustomMissile ("SuperGoreSpawner2", 1, 40, random (0, 360), 2, random (25, 45))
			TNT1 A 0 A_CustomMissile ("XDeath1", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath2b", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeath3b", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("BloodMistBig", 1, -40, random (0, 360), 2, random (30, 90))
			TNT1 AA 0 A_CustomMissile ("BloodMistBig", 1, 40, random (0, 360), 2, random (30, 90))
			TNT1 A 0 A_SpawnItem ("CrushedRemains")
			TNT1 A 1
			TNT1 A 1 A_XScream
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)		
			Stop 
			
		//***Che
		LandOnLava:
			TNT1 A 0
			TNT1 AAA 0 A_SpawnItemEx("BloodDropLandingOnLava", random(-16, 16), random(-16, 16)) // short lived smoking fires, clientside
			TNT1 A 0 A_Jump(256, "Death.Burn") // descendants may (rarely) override Death.Burn
			Goto Death
		Death.Burn:
		Death.Fire:
		Death.Flames:
			TNT1 A 0 A_SpawnItemEx ("GoryAshesSafe",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			Goto Death.Plasma 
		Death.ExplosiveImpact:
		Death.FriendlyExplosion:
			TNT1 A 1 A_Jump(256, "Death")
			Wait // Zandronum client cycles the last frame waiting from a command from the server
	}
}

Actor FBD_CurbstompedMarineRaiseable: FBD_CurbstompedMarine {
	States
	{
		Raise:
			// note: the frame letter of the "----" (keep previous) sprite is ignored
			"----" A 0
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_NoBlocking // the raising code deep in C++ makes it solid
			"----" A 0 A_JumpIf(!CallAcs("EnoughSpaceToRezNormally", 2014), "FallbackRaise")
			// The vile had already copied his friendliness and target to this corpse.
			// A_SpawnItem(Ex) automatically copy friendliness
			//   and target, but only if both the spawner and the spawnee are monsters.
			"----" A 0 A_ChangeFlag("COUNTKILL", 0)
			"----" A 0 A_ChangeFlag("ISMONSTER", 1)
			"----" A 0 A_SpawnItemEx ("EvilMarineRaisedByVile",0,0,0, 0,0,0, 0,SXF_TRANSFERPOINTERS | SXF_NOCHECKPOSITION)
			"----" A 1 A_Jump(256, "OnRezSfx")
			Wait //Zandronum client repeats the last frame while it waits for a status update from the server
			
		FallbackRaise:
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_ChangeFlag("SHOOTABLE", 0)
			//"----" A -1 ACS_NamedExecuteAlways("FallbackRez", 0, 12, 0, 0) //"EvilMarineRaisedByVile"
			"----" A -1 ACS_NamedExecuteWithResult("FallbackRezMkII", 2014) // see _mob_list.xlsx
			Stop
	}
}

actor RappedMarine: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			XPL4 F 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			XPL4 F 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			XPL4 F -1 
			Stop
	}
}

actor AteMarine: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			XPL1 E 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			XPL1 E 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			XPL1 E -1
			Stop
		   
		Death:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_SpawnItem("RipGuts")
			PPOD A 0 A_SpawnItemEx("BasicMarineGib3", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			PPOD A 0 A_SpawnItemEx("BasicMarineGib4", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			TNT1 A 0 A_SpawnItemEx("FBD_DeadRippedOffMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}


actor FuckedMarine: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			XPL3 F 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			XPL3 F 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			XPL3 F -1
			Stop   

		Death:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_SpawnItem("RipGuts")
			PPOD A 0 A_SpawnItemEx("BasicMarineGib3", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			PPOD A 0 A_SpawnItemEx("BasicMarineGib4", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			TNT1 A 0 A_SpawnItemEx("FBD_DeadRippedOffMarineRight",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}
	   
	   
	   


actor FBD_DeadRippedOffMarine: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			XPL2 F 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			XPL2 F 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			XPL2 F -1 
			Stop
	   
		Death:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			PPOD A 0 A_SpawnItemEx("BasicMarineGib1", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			PPOD A 0 A_SpawnItemEx("BasicMarineGib2", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			TNT1 A 0 A_SpawnItem("Gibz")
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}


actor FBD_DeadRippedOffMarineRight: FBD_DeadRippedOffMarine
{
	States
	{
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			XPL2 L 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			XPL2 L 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			XPL2 L -1 
			Stop
	}
}

actor VeryDeadCivilian: FBD_CurbstompedMarine
{
    States
    {
		Raise:
			Stop // cancel state
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			DCIV A 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			DCIV A 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "IdleSFest")
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
			TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))
		Idle:
			DCIV A 42 
			// this, my friends, makes it NOT raiseable because of frames with duration >= 0
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-8, 8), random(-8, 8), random(0, 10))
			Loop
		IdleSFest:
			DCIV A 1
			DCIV A -1
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx ("GoryAshesSafe",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop		   
	}
}
	   
	   

actor MarineGotOwnedByImp: FBD_CurbstompedMarine
{
	Health 50
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			IPFP P 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			IPFP P 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			IPFP P -1 
			Stop
	   
		Death:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("MuchBlood2", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			PPOD A 0 A_SpawnItemEx("BasicMarineGib3", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			PPOD A 0 A_SpawnItemEx("BasicMarineGib4", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			TNT1 A 0 A_SpawnItemEx("FBD_DeadRippedOffMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}
	   
actor ADoomedSpaceMarine: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			PLAY N 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			PLAY N 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			PLAY N -1 
			Stop
		   
		Death:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 15, 0, random (0, 360), 2, random (0, 180))
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			TNT1 A 0 A_SpawnItemEx("AteMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0) // no slaughter optimizations for fatalized players, NOR for monsters fatalized by player
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)	
			Stop 
	}
}
	   
actor ADoomedSpaceMarine2: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			PLA9 N 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			PLA9 N 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			PLA9 N -1 
			Stop 
		Death:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItem("MeatDeathSmall")
			TNT1 A 0 A_CustomMissile ("XDeathArm1", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 180))
			TNT1 A 0 A_SpawnItemEx("AteMarine",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0) // no slaughter optimizations for fatalized players, NOR for monsters fatalized by player
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)	
			Stop
	   
	}
}

actor DeadHalfMarine: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			HPLA A 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			HPLA A 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			HPLA A -1 
			Stop
	}
}

actor GutsPile
{
    Radius 1
    Height 1
    States {
 //***Che
// Spawn:
//		TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
//		TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))
//		
//Goto Death
//Death:
//GUTS P 32
//TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-8, 8), random(-8, 8), random(0, 10))
//      Loop   

		Spawn:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava", 0, 0, 0, 0)
			GUTS P 30
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
			TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))
			Goto Passive
		Passive:
			GUTS P 32
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-8, 8), random(-8, 8), random(0, 10))
			Loop
		Death:
			TNT1 AAA 0 A_CustomMissile ("Guts", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		Death.Burn:	
		LandOnLava:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("CharredGutsPile", 0, 0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}	  
	  
	  
actor SuperDestroyedBody
{
    Radius 1
    Height 1
    States
    {
		//***Che
		Spawn:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava", 0, 0, 0, 0)
			GUTS P 30
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			Goto Passive
		Passive:
			GUTS P 32
			GUTS P -1
			Stop    
		Death.Burn:	
		LandOnLava:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("CharredGutsPile", 0, 0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}	
//    Spawn:
//		TNT1 A 0 
//		
//Goto Death
//Death:
//GUTS P 32
//GUTS P -1
//      Loop    
//	}
//}	  


actor GoryAshes
{
    Radius 1
    Height 1
    States
    {
		Spawn:
			Goto Death
		Death:
			TNT1 A 0 

			GIBD SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 6 A_CustomMissile ("BurnParticles", 8, 0, random (0, 180), 2, random (0, 180))
			GIBD SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 8 A_CustomMissile ("PlasmaSmoke", 8, 0, random (0, 180), 2, random (0, 180))
			GIBD S -1 
			Stop    
	}
}


	
actor GibDec
{
    Radius 1
    Height 1
    States
    {
		Spawn:
			TNT1 A 1 NODELAY  			
			//***Che
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava", 0, 0, 0, 0)

			//TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
			//TNT1 AA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))
			TNT1 A 0 A_Jump(256, "Cycle1", "Cycle2", "Cycle3", "Cycle4")
			Goto Cycle1
		LandOnLava:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx ("GoryAshesSafe",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			Stop
		Death: 
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx("HumanBBQ", 0, 0, 10) // remove flies by inflicting damage
			TNT1 A 0 A_CustomMissile ("XDeath3", random (25, 35), random (5, -5), random (160, 200), 2, random (-10, 10))
			TNT1 AA 0 A_CustomMissile ("XDeath2", random (25, 35), random (5, -5), random (160, 200), 2, random (-10, 10))
			TNT1 AAA 0 A_CustomMissile ("XDeath1", random (25, 35), random (5, -5), random (160, 200), 2, random (-10, 10))
			TNT1 A 3
			Stop
		
		Cycle1:
			GIBS Z 30
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Sfest1")
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
			TNT1 AA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))
		Live1:
			GIBS Z 65
			
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-12, 12), random(-12, 12), random(0, 10))
			Loop
		Sfest1:
			GIBS Z 1
			GIBS Z -1
			Stop
		Cycle2:
			GIBD A 30
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Sfest2")
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
			TNT1 AA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))		
		Live2:
			GIBD A 45
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-12, 12), random(-12, 12), random(0, 10))
			Loop
		Sfest2:
			GIBD A 1
			GIBD A -1
			Stop
		Cycle3:
			GIBD B 30
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Sfest3")
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
			TNT1 AA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))		
		live3:
			GIBD B 82
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-12, 12), random(-12, 12), random(0, 10))
			Loop
		Sfest3:
			GIBD B 1
			GIBD B -1
			Stop
		Cycle4:
			GIBD C 30
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Sfest4")
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 15))
			TNT1 AA 0 A_SpawnItem("GoreFlies", 0, random(0, 15))		
		Live4:
			GIBD C 62
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-12, 12), random(-12, 12), random(0, 10))
			Loop
		Sfest4:
			GIBD C 1
			GIBD C -1
			Stop
	}
}


// Dead on a stick ---------------

ACTOR DeadDeadStick: DeadStick Replaces DeadStick
{
	Health 200
	Mass 99999999
	Radius 16
	Height 64
	+SOLID
	+SHOOTABLE
	//DropItem "HealthPlusNoCount" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	DropItem "Stimpack" 128
	DropItem "Clips" 128
	DropItem "CLIP1Drop" 128
	DropItem "Shells" 128
    bloodtype "DeadBlood"
	damagefactor "Fire", 0.0
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    GibHealth 10
	
	//***Che: incorporating the nomaggots fix directly
	damagefactor "HumanBBQ", 500.0
	
	States
	{
		Spawn:
			POL1 A 0 // first, this line lets the editor display a proper sprite.
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			POL1 A 30  
						// second, a non-zero interval allows the spawning torches 
						// to run their mojo and kill us with their AOE attack
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap
			
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			TNT1 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			Goto Stand
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			
			TNT1 A 0 A_SpawnItemEx("DeadDeadStickNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop			
		Stand:
			POL1 A 45
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-8, 8), random(-8, 8), random(20, 60))
			Loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_Scream
			TNT1 A 0 A_CustomMissile ("ZombieXDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			CAPT N -1
			Stop
	}
	

}



// Still alive on a stick --------------------------------------------------

ACTOR DeadLiveStick: LiveStick Replaces LiveStick
{
	Health 200
	Mass 99999999
	Radius 16
	Height 64
    GibHealth 10
	+SOLID
	+SHOOTABLE
	DropItem "CLIP1Drop" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	DropItem "Stimpack" 128
	DropItem "Clips" 128
	DropItem "Shells" 128
	damagefactor "Fire", 0.0
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    bloodtype "DeadBlood"
	States
	{
		Spawn:
				TNT1 A 0
				Goto Stand
				TNT1 A 0 A_CHangeFlag("THRUACTORS", 1)
				TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 1)
				TNT1 A 0 A_Jump(256, "Spawn1", "Spawn1", "Spawn2", "Spawn2", "Spawn3", "Spawn3", "Spawn4", "Spawn4", "Spawn5", "Spawn6", "Spawn7", "Spawn8", "Spawn9", "Spawn10")
				Goto Spawn1
				
				
		Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive1",0,0)
			Stop
			
		Spawn2:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive2",0,0)
			Stop	
			
		Spawn3:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive1a",0,0)
			Stop
			
		Spawn4:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive2a",0,0)
			Stop
			
		Spawn5:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive1b",0,0)
			Stop
			
		Spawn6:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive1c",0,0)
			Stop
			
		Spawn7:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive1d",0,0)
			Stop
			
		
		Spawn8:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive2b",0,0)
			Stop
			
			
		Spawn9:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive2c",0,0)
			Stop
			
			
		Spawn10:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("ImpaledMarineAlive2d",0,0)
			Stop	
			
			TNT1 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			Goto Stand
		Stand:
			POL6 A 6
			POL6 B 8
			POL6 A 6
			POL6 B 8
			POL6 A 6
			POL6 B 8
			POL6 A 6
			POL6 B 8
			TNT1 A 0 A_SpawnItemEx ("DripingBlood", random (-5, 5), random (-5, 5), 20)
			Loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_Scream
			TNT1 A 0 A_CustomMissile ("ZombieXDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			CAPT N -1
			Stop
	}
}




ACTOR ImpaledMarineAlive1: DeadLiveStick
{
	Health 20
	Painchance 255
	damagefactor "Fire", 2.0
	height 60
	MONSTER
	+FRIENDLY
	-COUNTKILL
	deathheight 60 DamageFactor "Use", 0 DamageFactor "SSG", 9999.0
	Damagefactor "Melee", 0.1 DamageFactor "Kick", 0.1
	Health 50
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			Goto Stand
		Stand:
			POLF A 56
			TNT1 A 0 A_Jump(128, "Moan")
			Loop
			
		Moan:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("TorturedMarineBD", CHAN_VOICE)
			POLF ABABAB 5
			POLF A 10
			Goto Stand
		Death:
			TNT1 A 0 A_FAll
			TNT1 A 0 A_Scream
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_PlaySound("TorturedMarineDieBD", CHAN_VOICE)
			POLF C 4
			POLF C -1
			Stop
			
			
		Pain:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("TorturedMarinePain", CHAN_VOICE)
			POLF ABAB 2
			POLF ABABAB 5
			POLF A 16
			Goto Stand
			
		Death.Fire: 
		Death.Flames:
		Death.Burn:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("BIGSCRE", CHAN_VOICE)
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			POLF DEDEDEDEDEDE 3 A_SpawnItem("BurnParticles", 0, 20)
			POLF DEDEDEDEDEDEDEDEDE 3 A_SpawnItem("BurnParticles", 0, 20)
			TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AAA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			POLF FFFFFFFFF 4 A_SpawnItem("BurnParticles", 0, 20)
			TNT1 AAA 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AAAA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			POLF FFFFFFFFF 4 A_SpawnItem("BurnParticles", 0, 20)
			TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
			TNT1 AAA 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AAAA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			POLF F -1
			Stop
			
		Death.Explosives: 
		Death.ExplosiveIMpact:
		XDeath: 
		Death.SSG:
			NULL A 0 A_Takeinventory("Kicking",1)
			MARN A 0 A_GiveInventory("PlayerIsDead", 1)
			NULL A 0 ThrustThingZ(0,60,0,1)
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			PPOD A 0 A_SpawnItemEx("BasicMarineGib1", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			PPOD A 0 A_SpawnItemEx("BasicMarineGib2", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			PPOD A 0 A_SpawnItemEx("BasicMarineGib3", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			PPOD A 0 A_SpawnItemEx("BasicMarineGib4", 0, 0, 0, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION)
			NULL A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			MHEA B 0 A_ChangeFlag("THRUACTORS", 1)
			MHEA CD 0
			//MHEA E -1
			NULL A 0 A_CustomMissile ("XDeathArm1", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 90))
			NULL A 0 A_SpawnItem ("BigBloodSpot")
			NULL AAAAA 0 A_CustomMissile ("Guts", 32, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			XDMG E 1
			NULL AAAAAAAAAAAAAAA 0 A_CustomMissile ("SuperWallRedBlood", 40, 0, random (0, 360), CMF_AIMDIRECTION, random (-5, 5))
			NULL AAAAAA 0 bright A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), CMF_AIMDIRECTION, random (30, 180))
			XDMG E -1
			Stop	
	}
}



ACTOR ImpaledMarineAlive2: ImpaledMarineAlive1
{
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			Goto Stand
		Stand:
			POLF G 64
			TNT1 A 0 A_Jump(128, "Moan")
			Loop
			
		Moan:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("TorturedMarineBD", CHAN_VOICE)
			POLF GHGHGH 5
			POLF G 10
			Goto Stand
			
			
		Pain:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("TorturedMarinePain", CHAN_VOICE)
			POLF GHGH 2
			POLF GHGHGH 5
			POLF G 16
			Goto Stand
			
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_PlaySound("TorturedMarineDieBD", CHAN_VOICE)
			POLF I 4
			POLF J -1
			Stop
			
		Death.Fire: 
		Death.Flames:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_PlaySound("BIGSCRE", CHAN_VOICE)
			POLF KLKLKLKLKLKL 3 A_SpawnItem("BurnParticles", 0, 10)
			POLF KLKLKLKLKLKLKLKLKL 3 A_SpawnItem("BurnParticles", 0, 10)
			TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AAA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			POLF MMMMMMMMM 4 A_SpawnItem("BurnParticles", 0, 10)
			TNT1 AAA 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AAAA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			POLF MMMMMMMMM 4 A_SpawnItem("BurnParticles", 0, 10)
			TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
			TNT1 AAA 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AAAA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			POLF M -1
			Stop	
	}
}


Actor ImpaledMarineAlive2A: ImpaledMarineAlive2
{ XScale -1.0 YScale 1.0}
Actor ImpaledMarineAlive2b: ImpaledMarineAlive2
{Translation  "112:127=32:47", "48:79=64:79" }
Actor ImpaledMarineAlive2c: ImpaledMarineAlive2
{Translation "112:127=96:111" }
Actor ImpaledMarineAlive2d: ImpaledMarineAlive2
{translation "112:127=[0,128,192]:[0,0,0]" }


Actor ImpaledMarineAlive1A: ImpaledMarineAlive1
{ XScale -1.0 YScale 1.0}
Actor ImpaledMarineAlive1b: ImpaledMarineAlive1
{Translation  "112:127=32:47", "48:79=64:79" }
Actor ImpaledMarineAlive1c: ImpaledMarineAlive1
{Translation "112:127=96:111" }
Actor ImpaledMarineAlive1d: ImpaledMarineAlive1
{translation "112:127=[0,128,192]:[0,0,0]" }


ACTOR DeadBloodyTwitch: BloodyTwitch Replaces BloodyTwitch
{
	Radius 16
	Height 68
	Health 100
	Mass 99999999
	-SOLID
	+NOGRAVITY
	+SPAWNCEILING
	+SHOOTABLE
    GibHealth 10
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    bloodtype "DeadBlood"
	DropItem "CLIP1Drop" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	damagefactor "Fire", 0.0
	damagefactor "HumanBBQ", 500.0
	States
	{
		Spawn:
			GOR1 A 1
			
			//***Che: a check if it is hanging from the sky -- if it is, it transforms itself into rain
			// Was bugged to hell
			//TNT1 A 0 Thing_ChangeTID(0,728)
			//MARN A 0 ACS_ExecuteAlways(177, 0, 0, 0, 0)//Check if you are playing on an TVR!
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_DeadBloodyTwitchIsRain", 0, 0, 0, 0) 
			//***Che: see SCRIPTS\DYNAMICLEV.txt
			
			//GOR1 A 4
			//The fixed script uses delays, need to wait longer (and invisibal!)
			//TNT1 A 10
			
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			TNT1 A 10
			TNT1 A 0 A_JumpIfInventory("TVRRainVerification", 10, "Replacerain")	
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap	
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			Goto Stand
		Stand:
			GOR1 A 10
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
		Stand2:
			GOR1 B 15
			GOR1 C 8
			GOR1 B 6
			GOR1 A 10
			GOR1 B 15
			GOR1 C 8
			GOR1 B 6
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // if delayed in multiplayer
			TNT1 A 0 A_SpawnItemEx ("DripingBlood", random (-5, 5), random (-5, 5), 15)
			loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("DeadBloodyTwitchB")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		//***Che:
		Death.Fire:
		Death.Plasma:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
		Death.Electric:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("DeadBloodyTwitchBNM")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		ReplaceRain:
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_SpawnItem("TVRRainSpawner")
			Stop
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)

			//TNT1 A 0 A_SpawnItem("HumanBBQ1")
			//***Che
			TNT1 A 0 A_SpawnItem("DeadBloodyTwitchNM")
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}

ACTOR DeadBloodyTwitchB: DeadBloodyTwitch
{
	//DropItem "HealthPlusNoCount" 0
	//DropItem "HealthPlusNoCount" 0
	//DropItem "ArmorShardNoCount" 0
	//DropItem "ArmorShardNoCount" 0
	damagefactor "Fire", 0.0
	DropItem "CLIP1Drop" 128
    Health 100
	damagefactor "HumanBBQ", 500.0
    States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			GOR1 D 30 
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap
			
			//GOR1 D 15 //***Che: increasing delay before maggots spawning to lent nomaggots check time to run
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			GOR1 D 15
			Goto Stand
		Stand:
			GOR1 D 100
			TNT1 A 0 A_SpawnItemEx ("DripingBlood", random (-5, 5), random (-5, 5), 15)
			loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("DeadBloodyTwitchC")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			Stop
			
		//***Che:
		Death.Fire:
		Death.Plasma:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
		Death.Electric:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("DeadBloodyTwitchCNM")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop			
			
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			//TNT1 A 0 A_SpawnItem("HumanBBQ1")
			//***Che
			TNT1 A 0 A_SpawnItem("DeadBloodyTwitchBNM")
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop	
	}
}

ACTOR DeadBloodyTwitchC: DeadBloodyTwitchB
{
	-SHOOTABLE
	damagefactor "Fire", 0.0
    States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			GOR1 E 10 
					
		Stay:
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap
			GOR1 E 10
			loop
		//***Che:
		Death.Fire:
		Death.Plasma:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
		Death.Electric:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_SpawnItem("DeadBloodyTwitchBNM")
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop			
	}
}

// Meat 2 ------------------------------------------------------------------

ACTOR HangingBody: Meat2 Replaces Meat2
{
	Radius 16
	Height 84
	Health 100
	Mass 99999999
	+SOLID
	+NOGRAVITY
	+SPAWNCEILING
	+SHOOTABLE
    GibHealth 10
	damagefactor "Fire", 0.0
	DropItem "CLIP1Drop" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	//DropItem "ArmorShardNoCount" 128
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    bloodtype "DeadBlood"
	damagefactor "HumanBBQ", 500.0
	States
	{
		Spawn:
		    //TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			GOR2 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap			
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			GOR2 A 50
			
			Goto Stand
		Stand:
			GOR2 A 100
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 6), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("HangingPairOfLegs")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
			
		//***Che:
		Death.Fire:
		Death.Plasma:
		Death.Bfg10k: //***Che changed damage type from extreme to custom
		Death.Electric:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 6), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("HangingPairOfLegsNM")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			Stop		
		
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			//TNT1 A 0 A_SpawnItem("HumanBBQ1")
			TNT1 A 0 A_SpawnItem("HangingBodyNM")
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}

ACTOR HangingPairOfLegs: DeadBloodyTwitchB Replaces Meat4
{
    Health 100
	damagefactor "Fire", 0.0
	damagefactor "HumanBBQ", 500.0
    States
	{
		Spawn:
		    //TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			GOR2 B 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap				
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			GOR2 B 25
			Goto Stand
		Stand:
			GOR2 B 83
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("Meat2C")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		
		//***Che
		Death.Fire:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			HDB7 Y 1
			HDB7 Y -1
			Stop
		
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			//TNT1 A 0 A_SpawnItem("HumanBBQ1")
			//***Che
			TNT1 A 0 A_SpawnItem("HangingPairOfLegsNM")
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop	
	}
}

ACTOR NSHangingBody : HangingBody Replaces NonsolidMeat2
{
	Game Doom

}

ACTOR NSHangingPairOfLegs : HangingPairOfLegs Replaces NonsolidMeat4
{
	Game Doom

}

ACTOR Meat2C: DeadBloodyTwitchB
{
	-SHOOTABLE
	damagefactor "Fire", 0.0
    States
	{
	Spawn:
		GOR2 C 10
        loop
	}
}

// Meat 3 ------------------------------------------------------------------

ACTOR HangingDeadGuyNoLeg: Meat3 Replaces Meat3
{
	Radius 16
	Height 84
	Health 100
	Mass 99999999
	+SOLID
	+NOGRAVITY
	+SPAWNCEILING
	+SHOOTABLE
    GibHealth 10
	damagefactor "Fire", 0.0
	//DropItem "HealthPlusNoCount" 128
	//DropItem "HealthPlusNoCount" 128
	//DropItem "ArmorShardNoCount" 128
	//DropItem "ArmorShardNoCount" 128
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    bloodtype "DeadBlood"
	damagefactor "HumanBBQ", 500.0
	States
	{
	
		Spawn:
			//TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			GOR3 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			GOR3 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap				
			
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			GOR3 A 36
			Goto Stand
		Stand:
			GOR3 A 100
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop

		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItemEx ("HangingLeg",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			//TNT1 A 0 A_SpawnItem("HumanBBQ1")
			//***Che
			TNT1 A 0 A_SpawnItemEx("HangingDeadGuyNoLegNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}

ACTOR HangingLeg: DeadBloodyTwitchB Replaces Meat5
{
	Radius 16
	Height 52
	Health 100
	damagefactor "Fire", 0.0
	damagefactor "HumanBBQ", 500.0
    States
	{
		Spawn:
			//TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			GOR5 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap	
		
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			GOR5 A 15
			Goto Stand
		Stand:
			GOR5 A 100
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop
			
		Death:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 A 0 A_Scream
			TNT1 A 0 A_SpawnItem ("Meat3C")
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
			
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			//TNT1 A 0 A_SpawnItem("HumanBBQ1")
			//***Che
			TNT1 A 0 A_SpawnItemEx("HangingLegNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop	
	}
}

ACTOR Meat3C: DeadBloodyTwitchB
{
	Radius 16
	Height 84
	-SHOOTABLE
	damagefactor "Fire", 0.0
    States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
		Stay:
			//GOR3 C 10
			//loop
			GOR3 C 1
			GOR3 C -1
			Stop
	}
}

ACTOR NSHangingDeadGuyNoLeg : HangingDeadGuyNoLeg Replaces NonsolidMeat3
{
	Game Doom

}

ACTOR NSHangingLeg : HangingLeg Replaces NonsolidMeat5
{
	Game Doom

}

// Nonsolid bloody twitch --------------------------------------------------

ACTOR DeadNonsolidTwitch : DeadBloodyTwitch Replaces NonsolidTwitch
{
	Game Doom

}

// Hanging with no guts ----------------------------------------------------

ACTOR DeadHangNoGuts: HangNoGuts Replaces HangNoGuts
{
	Radius 20
	Height 90
	Health 50
	Mass 999999
	+SOLID
	+NOGRAVITY
	+SPAWNCEILING
	+SHOOTABLE
    GibHealth 30
	//***Che
	//damagefactor "Fire", 0.0
	damagefactor "Fire", 0.5
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
    bloodtype "DeadBlood"
	damagefactor "humanbbq", 500.0
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			HDB1 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap	

			TNT1 A 0 //A_JumpIf(CallAcs("GetIsSlaughterfestServerside"), "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAAAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			HDB1 A 15
			Goto Stand
		Stand:
			HDB1 ABCDABCDABCD 4 // maggots writhing animation
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-6, 6), random(-6, 6), random(10, 70))
			loop
		Death:
			TNT1 A 0 A_CustomMissile ("MeatDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", Random(0, 4), Random (0, 4))
			TNT1 AA 0 A_CustomMissile ("XDeathArm1", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 360))
			//TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "DeathNow")
			TNT1 A 0 //A_JumpIf(CallAcs("GetIsSlaughterfestServerside") || CallAcs("GetIsSlaughterfestClientside"), "DeathNow")
			TNT1 AAAAAAAAAAA 0 A_CustomMissile ("SpawnedMaggotDec2", random (0, 50), 0, random (0, 360), 2, random (0, 360))
			TNT1 AAAAAAAAAAA 0 A_CustomMissile ("SpawnedMaggotDec3", random (0, 50), 0, random (0, 360), 2, random (0, 360))
		DeathNow:	
			TNT1 A 0 A_explode(4, 60)
			TNT1 A 1 A_NoBlocking // drop items
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		 
		//***Che: adding death from fire killing all maggots
		Death.Fire:
			
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			//TNT1 A 0 A_SpawnItem("HumanBBQ1")
			//***Che
			TNT1 A 0 A_SpawnItemEx("DeadHangNoGutsNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}

// Hanging from bottom with no brain ---------------------------------------

ACTOR DeadHangBNoBrain: DeadHangNoGuts Replaces HangBNoBrain
{
	Radius 16
	Height 88
	States
	{
	
		 Spawn:
			//TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			HDB1 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap				
			
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 45))
			TNT1 AAAAA 0 A_SpawnItem("GoreFlies", 0, random(0, 45))
			HDB2 A 30
			Goto Stand
		Stand:
			HDB2 ABCDABCDABCD 4
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-6, 6), random(-6, 6), random(10, 70))
			//TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop
			
		//***Che
		Death.Fire:
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			TNT1 A 0 A_SpawnItemEx("DeadHangBNoBrainNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop	
	}
}

// Hanging from top, looking down ------------------------------------------

ACTOR DeadHangTLookingDown: DeadHangNoGuts Replaces HangTLookingDown
{
	Radius 16
	Height 64
	States
	{
		 Spawn:
			//TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			HDB3 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap				
			
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 25))
			TNT1 AAAA 0 A_SpawnItem("GoreFlies", 0, random(0, 25))
			HDB3 A 30
			Goto Stand
		Stand:
			HDB3 ABCDABCD 4
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-6, 6), random(-6, 6), random(10, 30))
			//TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop
		
		//***Che
		Death.Fire:
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			TNT1 A 0 A_SpawnItemEx("DeadHangTLookingDownNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop			
	 }
}

// Hanging from top, looking up --------------------------------------------

ACTOR DeadHangTLookingUp: DeadHangNoGuts Replaces HangTLookingUp
{
	Radius 16
	Height 64
	States
	{
		Spawn:
			//TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			HDB4 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap				
			
			
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 25))
			TNT1 AAAA 0 A_SpawnItem("GoreFlies", 0, random(0, 25))
			HDB4 A 30
			Goto Stand
		Stand:
			HDB4 ABCDCBDABCD 4
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-6, 6), random(-6, 6), random(10, 30))
			//TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop
		
		//***Che
		Death.Fire:
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			TNT1 A 0 A_SpawnItemEx("DeadHangTLookingUpNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop			
	}
}

// Hanging from top, skully ------------------------------------------------

ACTOR DeadHangTSkull: DeadHangNoGuts replaces HangTSkull
{
	Radius 16
	Height 64
	States
	{
		Spawn:
			//TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			HDB5 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap				
			
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 25))
			TNT1 AAAA 0 A_SpawnItem("GoreFlies", 0, random(0, 25))
			HDB5 A 30
			Goto Stand
		Stand:
			HDB5 ABCDABCDABCD 4
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-6, 6), random(-6, 6), random(10, 30))
			//TNT1 A 0 A_SpawnItemEx("DripingBlood", 0, 0, 15, 0, 0)
			loop
			
		//***Che
		Death.Fire:
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			TNT1 A 0 A_SpawnItemEx("DeadHangTSkullNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop				
	}
}

// Hanging from top without a brain ----------------------------------------

ACTOR DeadHangTNoBrain: DeadHangNoGuts Replaces HangTNoBrain
{
	Radius 16
	Height 64
    States
	{
		Spawn:
			//TNT1 A 0
			//***Che: replacing tnt1 a 0 with this line to allow NM replacement before spawning maggots:
			
			TNT1 A 0
			TNT1 A 0  
			  // if slaughtercount is over one fourth the slaughter limit (i.e. 300) five tics after this call
			HDB6 A 15
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq") // also go maggotless if slaughtermap				
			
			TNT1 A 0 A_SpawnItemEx("DripingBloodLeavesPool", 0, 0, 15, 0, 0)
			TNT1 A 0 A_SpawnItem("GoreFliesWsound", 0, random(0, 25))
			TNT1 AAAA 0 A_SpawnItem("GoreFlies", 0, random(0, 25))
			HDB6 A 30
			Goto Stand
		Stand:
			HDB6 ABCDCABABCDCAB 4
			TNT1 A 0 A_JumpIfInventory("IAmSfestMonster", 1, "Death.Humanbbq")
			TNT1 A 0 A_SpawnItemEX("MaggotSpawner", random(-6, 6), random(-6, 6), random(10, 30))
			loop
			
		//***Che
		Death.Fire:
		Death.Humanbbq:
			TNT1 A 0
			//***Che: A_NoBlocking makes it drop items! Which we do not want in this case. Replacing with resetting flags manually:
			//TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
			TNT1 A 0 A_ChangeFlag("SOLID", 0)
			TNT1 A 0 A_SpawnItemEx("DeadHangTNoBrainNM",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop				
	}
}


ACTOR DyingComando : AbstractCorpse // spawned from fatalities by: player, npc marines, evil marines
{
	Game Doom
	Radius 21
	Height 15
	Health 40
	PainSound "grunt/pain"
	PainChance 255
	Mass 999999
    +FORCEXYBILLBOARD
	-SOLID
	+SHOOTABLE
	Scale 1.0
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0  // makes the blood it emits go lo-res 
			  // if slaughtercount is over half the slaughter limit (i.e. 600) at the moment of spawning		
			CFTB AB 10
			Goto Suffer
			
		Raise:
			// note: the frame letter of the "----" (keep previous) sprite is ignored
			"----" A 0
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_NoBlocking // the raising code deep in C++ makes it solid
			"----" A 0 A_JumpIf(!CallAcs("EnoughSpaceToRezNormally", 2002), "FallbackRaise")
			// The vile had already copied his friendliness and target to this corpse.
			// A_SpawnItem(Ex) automatically copy friendliness
			//   and target, but only if both the spawner and the spawnee are monsters.
			"----" A 0 A_ChangeFlag("COUNTKILL", 0)
			"----" A 0 A_ChangeFlag("ISMONSTER", 1)
			"----" A 0 A_SpawnItemEx ("ChaingunGuyRaisedByVile",0,0,0, 0,0,0, 0,SXF_TRANSFERPOINTERS | SXF_NOCHECKPOSITION)
			"----" A 1 A_Jump(256, "OnRezSfx")
			Wait //Zandronum client repeats the last frame while it waits for a status update from the server
			
		FallbackRaise:
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_ChangeFlag("SHOOTABLE", 0)
			//"----" A -1 ACS_NamedExecuteAlways("FallbackRez", 0, 11, 0, 0) //"ChaingunGuyRaisedByVile"
			"----" A -1 ACS_NamedExecuteWithResult("FallbackRezMkII", 2022) // see _mob_list.xlsx
			Stop
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster			
			
			
		Suffer:
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 12
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 12
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 12
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 12
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 12
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 11
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 11
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 11
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 11
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 11
			TNT1 A 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Pain
			CFTB AB 11
			Goto Dead
		Dead:
			CFTB C 1
			TNT1 A 1 A_SpawnItemEx ("BrutalizedDeadChaingunGuy", 3,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		Death:
			CFTB D 1
			//TNT1 A 0 A_SpawnItemEx("HealthPlusFatalityBonus", 0,0,0, random (-1, 1),random (-1, 1),8, 0, SXF_ABSOLUTEVELOCITY | SXF_NOCHECKPOSITION) //A_SpawnItem ("CrueltyBonus5Health")
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", 5, 0, 0) // 0, health, armor, 0 -- rounded down to nearest 2
			TNT1 AAAAAAAAAA 0 A_CustomMissile ("FBD_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("Xdeath1", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 1 A_SpawnItemEx ("SuperBrutalizedDeadChaingunGuy", 3,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		XDeath:
			 //TNT1 A 0 A_SpawnItemEx ("XDeathChainHead", 50, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("ChainXDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("MuchBlood2", 50, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("MuchBlood", 50, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
	}
}


ACTOR DyingRevenant: AbstractCorpse
{
	Game Doom
	Radius 16
	Height 60
	Health 40
	Mass 999999
	-SOLID
	+SHOOTABLE
	Scale 1.0
    damagefactor "Blood", 0.0    damagefactor "GreenBlood", 0.0    damagefactor "BlueBlood", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0  damagefactor "Avoid", 0.0  damagefactor "Taunt", 0.0
	States
	{
		Spawn:
			FRVX A 1 
			Goto Suffer
		Suffer:
			FRVX AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 4 A_SpawnItem ("MuchBlood", 0, 40)
			Goto Death
		Death:
			FRVX B 8
			//FRVX C -1
			TNT1 A 0 A_SpawnItemEx("FatalizedSkeletonFRVXC",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			
			Stop
		XDeath:
			TNT1 A 3 A_CustomMissile ("SkeletonXDeath", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			TNT1 A -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
		Raise:
			// note: the frame letter of the "----" (keep previous) sprite is ignored
			"----" A 0
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_NoBlocking // the raising code deep in C++ makes it solid
			"----" A 0 A_ChangeFlag("NORADIUSDMG", 0) // this specific corpse is also immune to AOE, must remove the immunity
			"----" A 0 A_JumpIf(!CallAcs("EnoughSpaceToRezNormally", 2013), "FallbackRaise")
			// The vile had already copied his friendliness and target to this corpse.
			// A_SpawnItem(Ex) automatically copy friendliness
			//   and target, but only if both the spawner and the spawnee are monsters.
			"----" A 0 A_ChangeFlag("COUNTKILL", 0)
			"----" A 0 A_ChangeFlag("ISMONSTER", 1)
			"----" A 0 A_SpawnItemEx ("RevenantRaisedByVile",0,0,0, 0,0,0, 0,SXF_TRANSFERPOINTERS | SXF_NOCHECKPOSITION)
			"----" A 1 A_Jump(256, "OnRezSfx")
			Wait //Zandronum client repeats the last frame while it waits for a status update from the server
			
		FallbackRaise:
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_ChangeFlag("SHOOTABLE", 0)
			//"----" A -1 ACS_NamedExecuteAlways("FallbackRez", 0, 13, 0, 0) //"RevenantRaisedByVile"
			"----" A -1 ACS_NamedExecuteWithResult("FallbackRezMkII", 2013) // see _mob_list.xlsx
			Stop
	}
}











ACTOR ColonGibs2 Replaces ColonGibs
{
	Game Doom
	SpawnID 147
	Radius 20
	Height 4
	+NOBLOCKMAP
	+MOVEWITHSECTOR
	States
	{
		Vanilla:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItem("VanillaColonGibs")
			Stop
			
		Spawn:
			POB1 A 0
			POB1 A 0 ACS_NamedExecuteAlways("BDCheckDecorations", 0, 0, 0, 0)//Check if advanced decorations are disabled.
			POB1 A 1
			
		Stay:
			POB1 A 8
			TNT1 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			POB1 A -1
			Stop
	}
}



ACTOR SmallBloodPool2 Replaces SmallBloodPool
{
	Game Doom
	SpawnID 148
	Radius 20
	Height 1
	+NOBLOCKMAP
	+MOVEWITHSECTOR
	States
	{
		Vanilla:
			POB2 A 0 A_NoBlocking
			POB2 A 0 A_SpawnItem("VanillaSmallBloodPool")
			Stop
			
		Spawn:
			POB2 A 0
			POB2 A 0 ACS_NamedExecuteAlways("BDCheckDecorations", 0, 0, 0, 0)//Check if advanced decorations are disabled.
			POB2 A 1
			
		Stay:
			POB2 A 6
			TNT1 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			TNT1 A -1
			Stop
	}
}


ACTOR VanillaSmallBloodPool: SmallBloodPool
{
	States
	{
		Spawn:
			POB2 A 1
			POB2 A -1
			Stop
	}
}

ACTOR VanillaColonGibs: SmallBloodPool
{
	States
	{
		Spawn:
			POB1 A 1
			POB1 A -1
			Stop
	}
}

// brain stem lying on the ground ------------------------------------------

ACTOR BrainStem2 Replaces BrainStem
{
	Game Doom
	SpawnID 150
	Radius 20
	Height 4
	+NOBLOCKMAP
	+MOVEWITHSECTOR
	States
	{
		Spawn:
			BRS1 A 0
			BRS1 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			BRS1 A -1
			Stop
	}
}


ACTOR RealGibs2 Replaces RealGibs
{
	+DROPOFF
	+CORPSE
	+NOTELEPORT
	+DONTGIB
	States
	{
		Spawn:
			POL5 A 0
			POL5 A 0 A_SpawnItem("MediumBloodSpot",0,0)
			POL5 A -1
			Stop
	}
}

ACTOR Gibs2 : RealGibs2 Replaces Gibs
{
   Game Doom
   SpawnID 146
   ClearFlags
}











actor VeryFuckedUpRevenant: FBD_CurbstompedMarine
{
    States
    {
		Raise:
			// note: the frame letter of the "----" (keep previous) sprite is ignored
			"----" A 0
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_NoBlocking // the raising code deep in C++ makes it solid
			"----" A 0 A_ChangeFlag("NORADIUSDMG", 0) // this specific corpse is also immune to AOE, must remove the immunity
			"----" A 0 A_JumpIf(!CallAcs("EnoughSpaceToRezNormally", 2013), "FallbackRaise")
			// The vile had already copied his friendliness and target to this corpse.
			// A_SpawnItem(Ex) automatically copy friendliness
			//   and target, but only if both the spawner and the spawnee are monsters.
			"----" A 0 A_ChangeFlag("COUNTKILL", 0)
			"----" A 0 A_ChangeFlag("ISMONSTER", 1)
			"----" A 0 A_SpawnItemEx ("RevenantRaisedByVile",0,0,0, 0,0,0, 0,SXF_TRANSFERPOINTERS | SXF_NOCHECKPOSITION)
			"----" A 1 A_Jump(256, "OnRezSfx")
			Wait //Zandronum client repeats the last frame while it waits for a status update from the server
			
		FallbackRaise:
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_ChangeFlag("SHOOTABLE", 0)
			//"----" A -1 ACS_NamedExecuteAlways("FallbackRez", 0, 13, 0, 0) //"RevenantRaisedByVile"
			"----" A -1 ACS_NamedExecuteWithResult("FallbackRezMkII", 2013) // see _mob_list.xlsx
			Stop		
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			REVH L 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			REVH L 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)			
			REVH L -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
	}
}
	   
actor MarineFatalizedByRevenant: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			REFP K 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			REFP K 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			REFP K -1 
			Stop   
	}
}
	   
	   
actor CrushedRemains: FBD_CurbstompedMarine 
{
	-SHOOTABLE
	+CLIENTSIDEONLY
    States
    {
		//***Che
		Raise:
			Stop // cancel this state
				// everyone and their grandmother spawn this, we cannot know whose remains we are
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			CRS1 A 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			CRS1 A 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			CRS1 A -1 
			Stop    
	}
}
	   
	   
actor PlayerJustGotCutInHalf: FBD_CurbstompedMarine
{
    States
    {
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			XPL2 GHIJKL 5
		StayContinue:
			XPL2 L 5
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			XPL2 L 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			XPL2 L -1 A_SpawnItem("MediumBloodSpot")
			Stop    
	}
}
	   
	   
actor DeadNazi: FBD_CurbstompedMarine
{
	States
	{
		Raise:
			// note: the frame letter of the "----" (keep previous) sprite is ignored
			"----" A 0
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_NoBlocking // the raising code deep in C++ makes it solid
			"----" A 0 A_JumpIf(!CallAcs("EnoughSpaceToRezNormally", 2012), "FallbackRaise")
			// The vile had already copied his friendliness and target to this corpse.
			// A_SpawnItem(Ex) automatically copy friendliness
			//   and target, but only if both the spawner and the spawnee are monsters.
			"----" A 0 A_ChangeFlag("COUNTKILL", 0)
			"----" A 0 A_ChangeFlag("ISMONSTER", 1)
			"----" A 0 A_SpawnItemEx ("NaziRaisedByVile",0,0,0, 0,0,0, 0,SXF_TRANSFERPOINTERS | SXF_NOCHECKPOSITION)
			"----" A 1 A_Jump(256, "OnRezSfx")
			Wait //Zandronum client repeats the last frame while it waits for a status update from the server
			
		FallbackRaise:
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_ChangeFlag("SHOOTABLE", 0)
			//"----" A -1 ACS_NamedExecuteAlways("FallbackRez", 0, 14, 0, 0) //"NaziRaisedByVile"
			"----" A -1 ACS_NamedExecuteWithResult("FallbackRezMkII", 2012) // see _mob_list.xlsx
			Stop
		
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			NAZI L 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Stay") // not until the actor stops sliding		
		Land:	
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			NAZI L 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			//***Che: prevent the game engine from auto-respawning this gibbed corpse on nightmare as a corpse
			// while allowiing archviles raising it (they only check for the CORPSE flag)
			// and respawning via script on nightmare
			TNT1 A 0 A_ChangeFlag("CORPSE", 1)
			TNT1 A 0 A_ChangeFlag("ISMONSTER", 0)
			NAZI L -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
	}
}










Actor GoreFlies
{
	+NOGRAVITY
	+NOTONAUTOMAP
	+SHOOTABLE
	+NOBLOOD
	Health 1
	radius 1
	height 1
	
	//***Che
	DamageFactor "HumanBBQ", 500.0
	DamageFactor "Fire", 500.0
	DamageFactor "Flames", 500.0
	
	States
		{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInTargetInventory("IAmSfestMonster", 1, "Death")
			TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3", "Spawn4", "Spawn5", "Spawn6", "Spawn7", "Spawn8")
		
		Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(2.3, 2.0)
			Goto Live
			
		Spawn2:
			TNT1 A 4
			TNT1 A 0 A_SetScale(2.2, 2.2)
			Goto Live
			
		Spawn3:
			TNT1 A 7
			TNT1 A 0 A_SetScale(2.0, 1.6)
			Goto Live	
			
		Spawn4:
			TNT1 A 11
			TNT1 A 0 A_SetScale(2.0, 2.2)
			Goto Live
			
		
		Spawn5:
			TNT1 A 16
			TNT1 A 0 A_SetScale(-2.2, 2.0)
			Goto Live
			
		Spawn6:
			TNT1 A 24
			TNT1 A 0 A_SetScale(-2.2, 1.6)
			Goto Live
			
			
		Spawn7:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-2.0, 2.0)
			Goto Live
			
		
		Spawn8:
			TNT1 A 20
			TNT1 A 0 A_SetScale(-2.2, 1.8)
			Goto Live
			
		Live:
			GRFL ABCDEFGHIJKLMNOPQRSTUWVXYZ 1
			Loop
			
		Live2:
			GRFL ABCDEFGHIJKLMNOPQRSTUWVXYZ 1
			Loop	
			
		Death:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			Stop
	}
}



Actor GoreFliesWSound: GoreFlies
{
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInTargetInventory("IAmSfestMonster", 1, "Death")
			TNT1 A 0 A_PlaySound("FLEAS", 1, 1, 1)
			TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3", "Spawn4", "Spawn5", "Spawn6", "Spawn7", "Spawn8")
		
		Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(1.3, 2.0)
			Goto Live
		Death:
			TNT1 A 0
			TNT1 A 0 A_StopSound(1)
			TNT1 A 0 A_NoBlocking
			Stop
	}
}




Actor MaggotSpawner: GoreFlies
{
	+CLIENTSIDEONLY
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIfInTargetInventory("IAmSfestMonster", 1, "Death")
			TNT1 A 20
			TNT1 A 0 //A_JumpIf(CallAcs("GetIsSlaughterfestServerside") || CallAcs("GetIsSlaughterfestClientside"), "Death")
			TNT1 A 0 A_Jump(128, "Live")
			TNT1 A 20
			TNT1 A 0 A_SetScale(-1.0, 1.0)

		Live:
			GRMG ABCDCDCD 4
			TNT1 A 0 A_CustomMissile("SpawnedMaggotDec", 0, 0, 0, 2, 0)
			TNT1 A 0 A_NoBlocking
			Stop
		Death:
			TNT1 A 1
			Stop
	}
}



Actor SpawnedMaggotDec
{
	Height 1
	Radius 1
	Mass 0
	PROJECTILE
	+Missile
	+NoBlockMap
	+DontSplash
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	+THRUACTORS
	-NOGRAVITY
	Gravity 1.0
	Speed 0
	States
	{
		//***Che: making it lava-aware:
		Spawn:
		//Death:
			TNT1 A 0
			TNT1 A 0 //A_JumpIf(CallAcs("GetIsSlaughterfestClientside"), "Vanish")
			//TNT1 A 0 ACS_NamedExecuteAlways("SlaughtermapInitCorpseSingleplayer", 0, 0, 0, 0) // too short-lived to bother syncing in multiplayer			
			GRMG EF 4
			TNT1 A 0 //A_JumpIf(CallAcs("GetIsSlaughterfestClientside"), "Vanish") // calling ACS scripts is dirt cheap! No harm in doing it twice!
			GRMG GHIJKLKJIHGFEFGHIJKLKJIHGF 4
			Stop
		Death:
			TNT1 A 0 
			TNT1 A 0 A_JumpIfInTargetInventory("IAmSfestMonster", 1, "Vanish")		
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckFloorType", 0, 0, 0, 0)
			GRMG E 4
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "LandOnLava")
			GRMG FGHIJKLKJIHGFEFGHIJKLKJIHGF 4
			Stop
		LandOnLava:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx("BloodDropLandingOnLava", 0, 0)
			TNT1 A 0
			Stop
		Vanish:
			TNT1 A 0
			Stop
	}
}



Actor SpawnedMaggotDec2: SpawnedMaggotDec
{
	Gravity 0.5
	Speed 4
}



Actor SpawnedMaggotDec3: SpawnedMaggotDec
{
	Gravity 0.8
	Speed 6
}





ACTOR HumanBBQ1
{
	Radius 16
	Height 84
	Health 100
	Mass 99999999
	+SOLID
	+NOGRAVITY
	+SPAWNCEILING
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump(256, "Spawn1", "Spawn2", "Spawn3", "Spawn4")
		Spawn1:
			HDB7 A 1
			HDB7 A -1
			Stop
			
		Spawn2:
			HDB7 B 1
			HDB7 B -1
			Stop
			
		Spawn3:
			HDB7 C 1
			HDB7 C -1
			Stop
			
		Spawn4:
			HDB7 D 1
			HDB7 D -1
			Stop	
	}
}