

//***Che a new monster, a microcacodemon created using Project Brutality's Watcher sprites

// One of the escalation options for the cacodemon is spawning as 8 caclets instead

// health 1/8th cacodemon's
// fire rate is nerfed but still way higher that 1/8th cacodemon's
// using cooldown counter to decrease the fire rate


// PB watcher is orange, with a red eye and bleeds red
// Caclet is red with an orange eye and bleeds blue
// I had to recolor all death frames by hand in The GIMP,
// saved them at different ranges to allow for PB cross-compatibility
// WATC I..O -> KYCA I..O
// WAT4 A..G -> KYCA P..V
// WAT5 A..G -> KYCA B..H

// KYCA A - a single-frame fatality, doomguy's arm up to the elbow where caclet's eye had been.
// KYCA W - a burned corpse
// KYCA X - freeze death

// BD cacodemon: scale 0.9 radius 24 height 56
// FBD calclet: radius 12 height 28 (2x2x2 = 8 fit inside caco's hitbox), sprite size 40x40 -> 32x32 = Scale 0.8

// See also FBD_ExtremePunchedCaclet in FBD_Throwed.txt,
// BurningCaclet in BURN.txt,
// FrozenCaclet in Frozen.txt
// PermafrostCaclet in Permafrost.txt
// and RipCaclet in GOREGROUPS.txt


ACTOR FBD_Caclet 17799
{
	//$category "FBD Monsters"
	Game Doom
	Monster
	bloodtype "Blue_Blood", "BlueFBD_SawBlood", "BlueFBD_SawBlood"
	bloodcolor "Blue"
	
	Translation "16:47=30:47", "232:235=181:187", "208:223=168:182", "168:183=208:223"
	
	Species "Cacodemons"

    damagefactor "Crush", 10.0
	DamageFactor "SSG", 10.0 
	DamageFactor "Shotgun", 2.5
	
	damagefactor "ExplosiveImpact", 3.0 damagefactor "Shrapnel", 3.0
	damagefactor "GibRemoving", 0.0 damagefactor "HangingHook", 0
	
	DamageFactor "CauseSplash", 0.0 DamageFactor "CauseObjectsToSplashSlime", 0.0 DamageFactor "CauseObjectsToSplashNukage", 0.0
	DamageFactor "CauseObjectsToSplashBlood", 0.0 DamageFactor "CauseObjectsToSplashLava", 0.0
	
	
	Radius 12
	Height 28
	Mass 50
	Scale 0.8
	Speed 12
	Health 50
    GibHealth 25	
	PainChance 128
	
	+FLOAT 
	+NOGRAVITY
	+FORCEXYBILLBOARD
	+NOICEDEATH
	
	SeeSound "caclet/act"
	PainSound "caclet/pain"
	DeathSound "caclet/death"
	ActiveSound "caclet/act"
	Tag "$CACLET" // Caclet / Какёныш
	Obituary "$OB_CACLET"
	// HitObituary is meaningles because *all* BD melee attacks are implemented as missile attacks
	
	
	
	DeathHeight 4
	BurnHeight 0
	
	PainChance "Argent", 255
	DamageFactor "Argent", 1.0
	
	PainChance "Bullet792", 160 // machineguns and snip[er rifles not aimed
	PainChance "SniperBullet", 255 // sniper rifle aimed // meaningles as it does 70 damage while we have 50 max hp
	
	damagefactor "Killme", 1.0 // AOE broadcasted by captured marines
	PainChance "Killme", 255	
	
	PainChance "Ice", 255

	PainChance "Avoid", 192 // nearly impossible to hit with a rocket
	damagefactor "Avoid", 1.0	
	
	var int user_item_no;
	var int user_cooldown;
	var int user_sleeping;
	
	States
	{

		Spawn:
			WATC A 1 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster")
			Goto Stand
		Stand:
			WATC A 1 A_SetUserVar("user_sleeping", 1)
			Goto StandContinue
		StandContinue:
			WATC A 10 A_Look
			Loop
	
		Pain.Ice:
			"----" A 20 A_Pain
			Goto See
		
		WaitTargetsFatalityOut:
			WATC H 1 A_PlaySound("caclet/act", CHAN_VOICE) // no dedicated sight sound!
			WATC H 1 A_FaceTarget
			WATC H 6 A_Recoil(3)
		WTF2:
			WATC H 6
			WATC H 6 ACS_NamedExecuteWithResult("CacoJumpWtf")	
			Loop
			
		Pain.Avoid: // inflicted by the tracer "Alerter" fired by: the vanilla bfg9000; the revenant launcher; the minigun when beginning to spin up; the rocket launcher. 
			TNT1 A 0
			TNT1 A 0 HealThing(1)
			TNT1 A 0 A_JumpIf(user_sleeping, "Flatfooted") // dont dodge if unaware
			
			
			TNT1 A 0 ACS_NamedExecuteWithResult("JumpAvoidLeftOrRight") // relies on pseudorandom rather than random
			WATC H 1
			Wait // repeat the last frame until update comes from the server
		  
		AvoidLeft:
			WATC H 1 A_FaceTarget
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)
			TNT1 A 0 ThrustThing(angle*256/360+192, 18, 0, 0)
			WATC HHAAAA 1  
			Goto Missile
		
		AvoidRight:
			WATC H 1 A_FaceTarget
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)
			TNT1 A 0 ThrustThing(angle*256/360+64, 18, 0, 0)
			WATC HHAAAA 1 
			Goto Missile
		
		Flatfooted:
			TNT1 A 0 A_FaceTarget
			TNT1 A 0 A_SetUserVar("user_sleeping", 0)
			TNT1 A 0 A_PlaySound("caclet/pain", CHAN_VOICE)
			WATC HHAAAA 4 
			Goto See
		
		Idle:
			WATC A 1 A_ClearTarget
			TNT1 A 0 A_SetUserVar("user_sleeping", 1)
			TNT1 A 0 A_SetUserVar("user_cooldown", 0)
			Goto SearchPlayer
		SearchPlayer:
			TNT1 A 0 A_JumpIfInventory("EnemyMemory", 1, 2) // this causes to clear target on the second loop
			TNT1 A 0 A_ClearTarget
			TNT1 A 0 A_TakeInventory("EnemyMemory", 40)
			WATC A 10 A_Look
			TNT1 A 0 A_SetAngle(angle - 30)
			WATC A 10 A_Look
			TNT1 A 0 A_SetAngle(angle + 30)
			WATC A 10 A_Look
			TNT1 A 0 A_SetAngle(angle + 30)
			WATC A 10 A_Look
			TNT1 A 0 A_SetAngle(angle - 30)
			
			TNT1 A 0 A_PlaySound("caclet/act", CHAN_VOICE)
			
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			
			TNT1 A 0 A_Jump(128, "SearchPlayer")
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			WATC A 0 A_Wander
			WATC A 2 A_Look
			Loop
			
		See:
			TNT1 A 0
	
			TNT1 A 0 A_SetUserVar("user_sleeping", 0)
			
			TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "ChasePlayer")
			TNT1 A 0 A_JumpIfInTargetLOS("SeeContinue", 0, JLOSF_DEADNOJUMP)
			TNT1 A 0 A_CheckSight("See2")
			
		SeeContinue:	
			WATC A 2 A_Chase
			WATC AA 2 A_Chase ("","")
			TNT1 A 0 A_JumpIfTargetInLOS("Melee", 190, JLOSF_DEADNOJUMP, 99, 0)
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			
			Loop
			
		See2:
			WATC AAAAAA 2 A_Chase
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			TNT1 A 0 A_JumpIfInventory("EnemyMemory", 25, "Idle")
			TNT1 A 0 A_GiveInventory("EnemyMemory", 1)
			Goto See
		
		ForgetQuicker:
			WATC AAAAAA 2 A_Chase
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			TNT1 A 0 A_JumpIfInventory("EnemyMemory", 25, "Idle")
			TNT1 A 0 A_GiveInventory("EnemyMemory", 4)
			WATC AAAAAA 2 A_Wander
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			TNT1 A 0 A_JumpIfInventory("EnemyMemory", 25, "Idle")
			TNT1 A 0 A_GiveInventory("EnemyMemory", 4)
			Goto See

		ChasePlayer:
			WATC A 2 A_Chase("", "")
			TNT1 A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), "ForgetQuicker")
			// the Hexen boss dodging only works closer than 640 anyway(hardcoded in C++)
			TNT1 A 0 A_JumpIfInTargetLOS("Dance", 30, JLOSF_DEADNOJUMP | JLOSF_CLOSENOSIGHT, 600, 128)
			TNT1 A 0 A_JumpIfInventory("Token_CacletDancing", 1, "Dance")
			
		NoDance:	
			WATC A 2 A_Chase
			WATC AA 2 A_Chase ("","")
			//***Che: oops, tries biting through walls
			//TNT1 A 0 A_JumpIfCloser(99, "Melee")
			TNT1 A 0 A_JumpIfTargetInLOS("Melee", 190, JLOSF_DEADNOJUMP, 99, 0)
			TNT1 A 0 A_TakeInventory("EnemyMemory", 5)	
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			TNT1 A 0 A_JumpIfTargetInLOS("ChasePlayer")
			Goto See2
			
		ChargeUpDancing: // without this, their reaction is *too* good!
			TNT1 A 0 A_GiveInventory("Token_CacletDancing", 1)
			TNT1 A 0 A_JumpIfInventory("Token_CacletDancing", 4, "Dance")
			Goto NoDance
			
		Dance:
			// caclets have no limit to their dodging, they use charging up instead
			TNT1 A 0 A_TakeInventory("Token_CacletDancing", 1)
			WATC A 2 A_Chase
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)
			WATC A 2 A_Chase ("","", CHF_FASTCHASE) // hexen boss dodging
			WATC A 2 A_Chase ("","")
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			TNT1 A 0 A_JumpIfTargetInLOS("Melee", 190, JLOSF_DEADNOJUMP, 99, 0)
			TNT1 A 0 A_TakeInventory("EnemyMemory", 10)
			TNT1 A 0 A_JumpIfTargetInLOS("ChasePlayer")
			Goto See2
			
		DanceThenMissile:
			WATC A 2 A_FaceTarget
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)
			WATC AA 2 A_Chase ("","MissileAfterAvoid", CHF_FASTCHASE) // hexen boss dodging
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)
			WATC A 2 A_Recoil(2)
			WATC AA 2 A_Chase ("","MissileAfterAvoid", CHF_FASTCHASE) // hexen boss dodging
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			WATC A 2 A_Recoil(3)
			WATC AA 2 A_Chase ("","MissileAfterAvoid", CHF_FASTCHASE) // hexen boss dodging
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)			
			WATC A 2 A_FaceTarget
			WATC AA 2 A_Chase ("","MissileAfterAvoid", CHF_FASTCHASE) // hexen boss dodging
			TNT1 A 0 ThrustThingZ(0, CallAcs("FBD_PseudoRandom", 0, 7), CallAcs("FBD_PseudoRandom", 0, 1), 1)
			TNT1 A 0 A_SetUserVar("user_cooldown", user_cooldown > 0 ? user_cooldown - 1 : user_cooldown)
			WATC A 2 A_Recoil(1)
			WATC AA 2 A_Chase ("","MissileAfterAvoid", CHF_FASTCHASE) // hexen boss dodging
			WATC A 2 A_Recoil(1)
			WATC AA 2 A_Chase ("","MissileAfterAvoid", CHF_FASTCHASE) // hexen boss dodging
			TNT1 A 0 A_JumpIfTargetInLOS("Melee", 190, JLOSF_DEADNOJUMP, 99, 0)
			TNT1 A 0 A_TakeInventory("EnemyMemory", 10)
			TNT1 A 0 A_JumpIfTargetInLOS("MissileAfterAvoid")
			Goto ChasePlayer
			
		Missile:
			TNT1 A 0
			
			// Kinslayer check:	
			TNT1 A 0 A_JumpIf(!CheckClass("FBD_Caclet", AAPTR_TARGET, true), 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("FBD_InfightFriendlyFireOn")	
			
	
			TNT1 A 0 A_TakeInventory("EnemyMemory", 30)
			TNT1 A 0 A_JumpIfCloser(140, "Melee")
			
			TNT1 A 0 A_FaceTarget
			
			TNT1 A 0 A_JumpIf(user_cooldown > 0, "Dance")
			
			TNT1 A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), "MissileAfterAvoid")
			TNT1 A 0 A_Jump (198, "MissileAfterAvoid") // only 23% probability to side-dash before attacking. BUT in case of our target being a player, we already perform aggressive side-dashing in our Dance state, into which we get if in player's 30-degree frontal segment (those checks don't give a flying crap about *vertical* aim, purely 2d!)
			
			// the Hexen boss dodging only works closer than 640 anyway (hardcoded in C++)
			TNT1 A 0 A_JumpIfCloser(600, "Avoid")
			
			Goto MissileAfterAvoid
		
		Avoid:
			
			TNT1 A 0 A_JumpIfInTargetInventory("IsPlayer", 1, "AvoidPlayer")
			
			WATC A 6 A_Chase ("","", CHF_FASTCHASE) // hexen boss dodging //A_FastChase
			NULL A 0 A_FaceTarget
			WATC A 6 A_Chase ("","", CHF_FASTCHASE) // hexen boss dodging //A_FastChase
			NULL A 0 A_FaceTarget
			WATC A 6 A_Chase ("","", CHF_FASTCHASE) // hexen boss dodging //A_FastChase
			NULL A 0 A_FaceTarget
			WATC A 6 A_Chase ("","", CHF_FASTCHASE) // hexen boss dodging //A_FastChase


			Goto MissileAfterAvoid
			
		AvoidPlayer:
			
			TNT1 A 0 A_JumpIfInTargetLOS("DanceThenMissile", 30, JLOSF_DEADNOJUMP | JLOSF_CLOSENOSIGHT, 700, 180)
			Goto ChasePlayer
			
		MissileAfterAvoid:	
			
			// BCD and EFG are *completely* identical except glowing eye and mouth
			// allows the trick of "flickering charge" :D
			
			// caclet has a *very* long powering up sequence!
			
			TNT1 A 0 A_PlaySound("caclet/charging_his_shot", CHAN_VOICE) // so that going into pain interrupts it - im so clever
			WATC B 6 //A_FaceTarget
			WATC E 1 BRIGHT //***TODO: give 'im a brightmap instead!
			WATC C 6 //A_FaceTarget
			WATC F 1 BRIGHT
			
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				TNT1 A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				TNT1 A 0 A_JumpIfTargetInLOS(2)
				TNT1 A 0 A_Jump(256, 2)
				TNT1 A 0 A_FaceTarget
			
			WATC D 4
			WATC G 1 BRIGHT
			WATC D 3
			WATC G 1 BRIGHT
			WATC D 2
			WATC G 1 BRIGHT
			WATC D 2
			WATC G 1 BRIGHT
			
			TNT1 A 0 A_SetUserVar("user_cooldown", 32) // cooldown is set in the middle - no cooldown if interrupted early!
			
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				TNT1 A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				TNT1 A 0 A_JumpIfTargetInLOS(2)
				TNT1 A 0 A_Jump(256, 2)
				TNT1 A 0 A_FaceTarget
				
			WATC D 2
			WATC G 2 BRIGHT
			WATC D 2
			WATC G 2 BRIGHT
			WATC D 2
			WATC G 2 BRIGHT
			WATC D 2
			WATC G 2 BRIGHT

				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				TNT1 A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				TNT1 A 0 A_JumpIfTargetInLOS(2)
				TNT1 A 0 A_Jump(256, 2)
				TNT1 A 0 A_FaceTarget

			WATC D 1
			WATC G 3 BRIGHT
			WATC D 1
			WATC G 3 BRIGHT
			WATC D 1
			WATC GG 3 BRIGHT
			WATC D 1
			WATC GG 3 BRIGHT
				
			// not autoaimed
			WATC G 4 BRIGHT A_CustomMissile("FBD_CacoBall", 10, 0, angle, CMF_ABSOLUTEANGLE | CMF_OFFSETPITCH | CMF_SAVEPITCH)
			Goto See
			
		Melee:
			TNT1 A 0
			
			TNT1 A 0 A_JumpIfInTargetInventory("GoFatality", 1, "WaitTargetsFatalityOut")
			
			// Kinslayer check:	
			TNT1 A 0 A_JumpIf(!CheckClass("FBD_Caclet", AAPTR_TARGET, true), 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("FBD_InfightFriendlyFireOn")	

			TNT1 A 0 A_Facetarget
			WATC B 4 A_Recoil(-5)
			TNT1 A 0 A_PlaySound("cheb/caco_omnom", CHAN_VOICE) // demon/melee from doom, sped up and filtered. 0.4s duration.
				// the voice channel so that it is interruptable by pain			
			WATC C 4 
			WATC D 6 		
			TNT1 A 0 A_CustomMissile("CacletBite", 17, 0, 0, 0) // the bite itself plays "imp/melee" if it connects
			WATC AA 4
			Goto See
		
		Pain:
			WATC H 3
			WATC H 3 A_Pain
			TNT1 A 0 A_Jump(128, "Avoid")
			WATC H 3
			Goto See
			
		Pain.Argent:
			TNT1 A 0 HealThing(25)
			TNT1 A 0 ACS_NamedExecuteWithResult("DisplayArgentDischarge", 12, 25, 0)	
			
			WATC H 3 A_Pain
			WATC HHH 3
			WATC HH 8 A_Pain
			TNT1 A 0 A_JumpIfTargetInLOS("Missile")
			Goto See				

		Pain.Kick:
		Pain.HeavyImpact:
			TNT1 A 0 A_FaceTarget
			WATC H 3 A_Recoil(15)
			WATC H 3 A_Pain
			WATC H 10
			Goto See
			
		Pain.Cut:
		Pain.Saw:
			TNT1 A 0 A_Stop
			WATC HH 6
			Goto See
			
		Pain.KillMe:
		Pain.Taunt:
			TNT1 A 0 HealThing(1)
			Goto Missile			

		Raise:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx("StandaloneBlueRezSfx",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
			KYCA M 8 A_UnSetFloorClip
			KYCA LKJI 8
			TNT1 A 0 ACS_NamedExecuteWithResult("FBD_CustomizeOnRez") // it runs OnRezMapScript
				// if the map prpvides one
			Goto See
			
		FallbackRaise: // we were put into this state by the superarchvile AOE raising, our height is hopelessly kaput and we have to spawn a substitute
			"----" A 0 A_GiveInventory("RezzingNow")
			"----" A 0 A_ChangeFlag("CORPSE", 0)
			"----" A 0 A_ChangeFlag("COUNTKILL", 0)
			"----" A 0 A_ChangeFlag("SHOOTABLE", 0)
			"----" A -1 ACS_NamedExecuteWithResult("FallbackRezMkII", 2010) // see _mob_list.xlsx
			Stop
			
		FallbackRezSuccess:
			TNT1 A 0 A_SpawnItemEx("StandaloneBlueRezSfx",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			TNT1 A 30
			Stop			

		Crush:
			TNT1 A 0
			TNT1 A 0
			TNT1 AAAAAA 0 A_SpawnItem("BodyRemovalThing")
			TNT1 A 1 A_XScream
			TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
			TNT1 A -1 // be rezzable
			Stop			

		Death.KillMe:
		Death.Taunt:
		Death.Avoid:
		Death:
		Death.Electric:
		Death.CCFT:
			TNT1 A 0
			TNT1 A 0 A_scream 
			TNT1 AAA 0 A_CustomMissile ("Blue_FlyingBlood", 15, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 0 A_Jump(128, "DeathV2")
		DeathV1:	
			KYCA IIIJJJKKK 2
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx("FBD_DeadCaclet1", 0,0,0, momx,momy,momz, 0, SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY)
			TNT1 A 30
			Stop

		DeathV2:
			KYCA BBBCCCDDD 2
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx("FBD_DeadCaclet2", 0,0,0, momx,momy,momz, 0, SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY)
			TNT1 A 30
			Stop

		Death.Fatality:
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_Pain
			TNT1 A 0 A_JumpIfIntargetInventory("FistsSelected", 1, 1)
			Goto Death.SSG
			TNT1 A 0 A_GiveToTarget("GoFatality", 1)
			TNT1 A 0 A_FaceTarget
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", 5, 5)
			
			TNT1 A 0 A_Jump(128, "DeathFatality2")
			TNT1 A 0 A_GiveToTarget("ErsatzFatalityBlue", 1)
			TNT1 A 0 A_CustomMissile ("FBD_ExtremePunchedCaclet", 4, 0, random (175, 185), 2, random (10, 20))
			
			TNT1 A 30 A_ChangeFlag("CORPSE", 0) // without at least 8 tics delay, scripts runs ownerless
			
			Stop
			//TNT1 AAAAAAA 0
		DeathFatality2:
			TNT1 A 0 A_scream
			TNT1 A 0 A_GiveToTarget("CacletFatality", 1)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0) // without at least 8 tics delay, scripts runs ownerless
			TNT1 A 0 ACS_NamedExecuteWithResult("DropFatalityBonuses", 5, 5)
			Stop


		Death.ExplosiveImpact:
		Death.FriendlyExplosion:
			TNT1 A 0
			TNT1 A 0 A_Jump(128, "Death")
		XDeath:
		Death.Saw:
		Death.Cut:
		Death.Disintegrate:
		Death.Explosives: // direct rocket hit
		Death.Bfg10k:
			TNT1 A 0 A_XScream
			TNT1 A 0 A_NoBlocking
			// RipCaclet is a gore spawner supporting sfx auto-balancing. 
			// Angles given here do nothing, it spams its pieces all around 360
			TNT1 A 0 A_CustomMissile ("RipCaclet", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			
			TNT1 A -1 //***Che: Gibbed monsters -- ONLY the gibbed monsters -- may use this
				//   to auto-respawn on nightmare and be raised by viles.
				// Employing this on a destructible corpse results in that corpse
				//   respawning on nightmare as a corpse (or worse, as a burning hollering demon)
				// If a monster's death state spawns a destructible corpse,
				//   the respawning/raising is relegated to that corpse
				//   and the monster MUST use Stop instead
			Stop

		
		Death.Bullet762:
		Death.Minigun:
		Death.Blast:
			TNT1 A 0
			TNT1 A 0 A_Jump(192, "Death") 			
		Death.SSG:
		Death.Railgun:
		Death.SniperBullet:
			TNT1 A 0
			TNT1 A 0 A_FaceTarget
			KYCA P 1 A_XScream
			TNT1 AAAAAA 0 A_CustomMissile ("BlueBloodMist", 25, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 50))
			TNT1 AAAAAA 0 A_CustomMissile ("BlueBloodMist", 25, 0, random (160, 200), 2, random (20, 40))
			TNT1 AA 0 A_CustomMissile ("XDeath2Blue", 12, 0, random (140, 230), 2, random (30, 60))
			TNT1 AA 0 A_CustomMissile ("XDeath3Blue", 12, 0, random (140, 230), 2, random (30, 60))
			TNT1 AA 0 A_CustomMissile ("XDeath4Blue", 12, 0, random (140, 230), 2, random (30, 60))
			KYCA P 1 A_Recoil(4)
			KYCA R 2 //A_Scream
			
			// donut splattered against wall -- or after a SSG
			TNT1 A 0 A_SpawnItemEx("FBD_DeadCaclet5",0,0,0, momx,momy,momz, 0,SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
			
		Death.Plasma: 
		XDeath.Electric:
		Death.GreenFire: // knight / baron / duke fireball
			TNT1 A 0
			TNT1 A 0 A_Jump(192, "DeathCrispy") 
		Death.SuperPlasma:
		Death.Plasma2:
			TNT1 A 0
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 AAA 0 A_CustomMissile ("BurnParticles", 16, 0, random (0, 180), 2, random (0, 180))
			TNT1 A 0 A_SpawnItemEx("CharredMeatsplosionBlueSmall", 0,0,0)
			TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
			TNT1 A -1 // be rezzable
			Stop			

		Death.Fire:
		Death.Flames:
			TNT1 A 0
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 AAAA 0 A_CustomMissile ("PlasmaSmoke", 24, 0, random (0, 180), 2, random (0, 180))
			TNT1 A 0 A_SpawnItemEx("BurningCaclet",0,0,0, momx,momy,momz, 0,SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop		

		Death.Burn:
			TNT1 A 0
			TNT1 A 0 A_Jump(192, "DeathCrispy") 
		DeathBurnMild:
			"----" A 0
			"----" A 0 A_Scream
			"----" A 0 A_NoBlocking
			"----" A 0 A_Playsound("props/redfire", CHAN_7)
			"----" A 1 A_Jump(256, "DeathV1", "DeathV2")
			Wait
			
		DeathCrispy:
			TNT1 A 0
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx("FBD_CrispyCaclet",0,0,0, momx,momy,momz, 0,SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY,0)
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop

		Death.DHFT: // duke melee attack
		Death.BHFT: //baron melee attack:
		Death.ExtremePunches:
			TNT1 A 0
			TNT1 A 0 A_XScream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile ("FBD_ExtremePunchedCaclet", 0, 0, random (175, 185), 2, random (10, 20))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop

		Death.Ice:
		Death.Freeze:
		Death.Frost:
			TNT1 A 0
			TNT1 A 0 A_StopSound(CHAN_VOICE) 
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx ("FrozenCaclet",0,0,0, momx,momy,momz, 0,SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY,0) 
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
			
		Death.IOS_Frost:
			TNT1 A 0
			TNT1 A 0 A_StopSound(CHAN_VOICE) 
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx ("PermaFrostCaclet",0,0,0, momx,momy,momz, 0,SXF_NOCHECKPOSITION | SXF_ABSOLUTEVELOCITY,0) 
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
	}
}

ACTOR CacletRaisedByVile: FBD_Caclet {
	+NOPAIN
	-FLOORCLIP
	States {
		Spawn:
			TNT1 A 0 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster")
			
			TNT1 A 0 A_ChangeFlag("NOPAIN", 1)			
			KYCA MLKJI 8
			TNT1 A 0 A_ChangeFlag("NOPAIN", 0)
			TNT1 A 0 ACS_NamedExecuteWithResult("FBD_CustomizeOnRez") // it runs OnRezMapScript
				// if the map prpvides one
			Goto See		

	}
}

ACTOR FBD_DeadCaclet1: FBD_CurbstompedMarine
{
	Radius 12 //***Che otherwise raising failures //12
	Height 12
	Scale 0.8
	+SHOOTABLE
	-SOLID
	+NOTELEPORT
	+MOVEWITHSECTOR
	+CORPSE
	bloodtype "Blue_Blood", "BlueFBD_SawBlood", "BlueFBD_SawBlood"
	bloodcolor darkblue
	Mass 100
	Health 80
	damagefactor "CrushedBodies", 500.0
	States
    {
		//***Che
		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", 2010), "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 ("CacletRaisedByVile",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, 27, 0, 0) // "CacletRaisedByVile
			"----" A -1 ACS_NamedExecuteWithResult("FallbackRezMkII", 2010) // see _mob_list.xlsx
			Stop
		OnRezSfx:
			// knight, baron, duke, belphegor and cacodemon corpses must replace this method with one that has appropriate blood color
			TNT1 AAAAA 3 A_CustomMissile ("BlueBloodMist", 20, 0, random (0, 360), 2, random (30, 90))
			TNT1 AAAAAAA 3 A_CustomMissile ("BlueBloodMistSmall", 20, 0, random (0, 360), 2, random (30, 90))
			TNT1 A 30
			Stop			
		//***Che // this is a descendant of FBD_CurbstompedMarine, which is neither a missile nor a monster
		Spawn:
			KYCA L 2 A_CheckFloor("Land")
			Loop
		Land: 
			KYCA M 6 A_SetFloorClip
			TNT1 AAA 0 A_CustomMissile ("BlueGuts", 0, 0, random (0, 360), 2, random (0, 160))
			KYCA N 0 A_SetFloorClip
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			KYCA 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 A_SpawnItem ("BlueGrowingBloodPool", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			KYCA O 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			
			//***Che: prevent the game engine from auto-respawning this 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)	
			KYCA O -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
		LandOnLava: // used by descendant classes
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("CharredMeatsplosionBlueSmall")
			
			//***Che: prevent the game engine from auto-respawning this 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:
		Death.cut:
		Death.ExplosiveImpact:
		Death.FriendlyExplosion:
		Death.Bfg10k:
		Death.CrushedBodies:
		Crush:
		XDeath:
			TNT1 A 0 A_SetFloorClip
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_CustomMissile ("RipCaclet", 0, 0, random (0, 360), CMF_AIMDIRECTION, random (0, 160))
			TNT1 A 30 A_ChangeFlag("CORPSE", 0)
			Stop
		Death.Plasma: 
		Death.Plasma2:
		Death.Electric:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece3", random (-45, 45), random (-45, 35))
		
			TNT1 A 0 A_SpawnItemEx("CharredMeatsplosionBlueSmall", 0,0,0)
			
			//***Che: prevent the game engine from auto-respawning this 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_NamedExecuteWithResult("RespawnCorpseAfter60sIfNightmare")
			Stop
			
		DeathCharredMeatsplode:	
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx("CharredMeatsplosionBlueSmall", 0,0,0)
			
			//***Che: prevent the game engine from auto-respawning this 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_NamedExecuteWithResult("RespawnCorpseAfter60sIfNightmare")
			Stop
			

		Death.Fire: 
		Death.Burn: 
		Death.Flames:
			TNT1 A 0 A_Scream
			TNT1 A 0 A_NoBlocking
			TNT1 A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_SpawnItem("BarrelExplosionSmokeColumn")
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece", random (-15, 15), random (-15, 15))
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece2", random (-35, 35), random (-35, 35))
			TNT1 AA 0 A_SpawnItemEx("TinyBurningPiece3", random (-45, 45), random (-45, 35))
			TNT1 A 0 ACS_NamedExecuteWithResult("BurnedCorpseSmoke") 
			//***Che: prevent the game engine from auto-respawning this 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)
			KYCA W -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
	}
}


ACTOR FBD_DeadCaclet2: FBD_DeadCaclet1
{
	States
	{
		Spawn:
			KYCA E 2 A_CheckFloor("Land")
			Loop
		Land: 
			KYCA F 6 A_SetFloorClip
			TNT1 AAA 0 A_CustomMissile ("BlueGuts", 0, 0, random (0, 360), 2, random (0, 160))
			KYCA G 0 A_SetFloorClip
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			KYCA G 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 A_SpawnItem ("BlueGrowingBloodPool", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			KYCA H 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			
			//***Che: prevent the game engine from auto-respawning this 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)	
			KYCA H -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
	}
}


ACTOR FBD_DeadCaclet3: FBD_DeadCaclet1 // face smashed in but no donut at any stage
{
	States
	{
		Spawn:
			KYCA R 2 A_CheckFloor("Land")
			Loop
		Land: 
			KYCA U 6 A_SetFloorClip
			TNT1 AAA 0 A_CustomMissile ("BlueBloodMistSmall", 0, 0, random (0, 360), 2, random (0, 160))
			KYCA U 0 A_SetFloorClip
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			KYCA U 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 A_SpawnItem ("BlueGrowingBloodPool", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			KYCA V 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			
			//***Che: prevent the game engine from auto-respawning this 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)	
			KYCA V -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
			
		Death.Fire: 
		Death.Burn: 
		Death.Flames:
		LandOnLava:
			TNT1 A 0
			Goto Death.Plasma
			
	}
}

ACTOR FBD_DeadCaclet4: FBD_DeadCaclet3 // splattered flat against floor or ceiling
{
	States
	{
		Spawn:
			KYCA U 2 A_CheckFloor("Land")
			Loop
		Land: 
			KYCA U 6 A_SetFloorClip
			TNT1 AAA 0 A_CustomMissile ("BlueBloodMistSmall", 0, 0, random (0, 360), 2, random (0, 160))
			KYCA U 0 A_SetFloorClip
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			KYCA U 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 A_SpawnItem ("BlueGrowingBloodPool", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			KYCA V 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			
			//***Che: prevent the game engine from auto-respawning this 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)	
			KYCA V -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
	}
}

ACTOR FBD_DeadCaclet5: FBD_DeadCaclet3 // donut splattered against wall -- or after a SSG death
{
	States
	{
		Spawn:
			KYCA S 2 A_CheckFloor("Land")
			Loop
		Land: 
			KYCA T 6 A_SetFloorClip
			TNT1 AAA 0 A_CustomMissile ("BlueBloodMistSmall", 0, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_SetFloorClip
		Stay: // ancestor's Pain.Kick, Pain.ExplosiveImpact and Pain.Trample redirect here after z-thrusting the actor
			KYCA T 5 
			TNT1 A 0 A_CheckFloor("Slide")  // if this goes before the non-zero frame, we have an infinite loop!
			Loop
		Slide:
			KYCA U 5
			TNT1 A 0
			TNT1 A 0 A_JumpIf(momx != 0 || momy != 0, "Slide")

			TNT1 A 0 A_SpawnItem ("BlueGrowingBloodPool", 1)
			TNT1 A 0 ACS_NamedExecuteAlways("FBD_CheckFloorIsLava_V", 0, 0, 0, 0) // also spawns smoke for 30 tics if succeeds
			KYCA V 30
			TNT1 A 0 A_JumpIf(user_floor_is_lava, "LandOnLava")	
			
			//***Che: prevent the game engine from auto-respawning this 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)	
			KYCA V -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop		
	}
}

ACTOR FBD_CrispyCaclet: FBD_DeadCaclet3
{
	Translation "250:254=107:111", "4:4=106:106", "16:21=0:0", "37:47=0:0", "16:36=5:8", "168:191=107:111", "232:235=236:239", "128:143=5:8", "144:151=236:239", "5:8=0:0", "48:79=109:111", "80:111=5:8", "192:197=106:109", "208:223=73:78"
	States
	{
		Spawn:
			WATC G 1 NODELAY ACS_NamedExecuteWithResult("BurnedCorpseSmoke")
			TNT1 A 0 A_Playsound("props/redfire", CHAN_7)
		Fall:
			WATC G 2 A_CheckFloor("Land")
			Loop
		Land: 
			KYCA W 6 A_SetFloorClip
			
			//***Che: prevent the game engine from auto-respawning this 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)	
			KYCA W -1 ACS_NamedExecuteAlways("RespawnCorpseAfter60sIfNightmare", 0, 0, 0, 0)
			Stop
		
		Death:
		Death.cut:
		Death.ExplosiveImpact:
		Death.FriendlyExplosion:
		Death.Bfg10k:
		Death.CrushedBodies:
		Crush:
		XDeath:			
			Goto DeathCharredMeatsplode	
			
	}
}
		
			
ACTOR CacletBite: ImpAttack
{
    +THRUGHOST
    Damage 4
}			