ACTOR Detect_CeilXDeath2
{
 game Doom
 scale 0.4
 speed 0
 health 1
 radius 1
 height 1
 Gravity 0.0
 damage 0
 Renderstyle Translucent
 Alpha 0.95
	DamageType Blood
   +MISSILE
   +CLIENTSIDEONLY
   +NOTELEPORT
   +NOBLOCKMAP
   +FORCEXYBILLBOARD
   +NODAMAGETHRUST
   -DONTSPLASH
   +NOGRAVITY
    States
    {
     Spawn:
	 TNT1 A 0
	 TNT1 A 0 ThrustThingZ(0,25,0,1)
	 TNT1 A 2
	 TNT1 A 0 A_SpawnItem("SmearingXDeath2", 0, -25)
	 Stop
	 Death:
	 TNT1 A 0
	 TNT1 A 0 A_CustomMissile ("CeilXDeath2Checker", -15, 0, 90, 2, 90)
  Stop
    }
}


ACTOR SmearingXDeath2
{
    Radius 2
    Height 2
	Speed 10
	Mass 1
	Scale 1.0
    +NOBLOCKMAP
    +NOTELEPORT
	+THRUGHOST
	+CLIENTSIDEONLY
    +DONTSPLASH
    +MOVEWITHSECTOR
	-DONTSPLASH
	+FORCEXYBILLBOARD
	+QUARTERGRAVITY
    States
    {
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
	TNT1 A 0 A_Recoil(-25)
	TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Spawn4")
	Goto Spawn1
	
	Spawn1:
	
	XME1 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn2:
	XME1 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn3:
	XME1 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn4:
	XME1 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGgg 1 A_CheckFloor("Rest")
	Goto Death
	
	Death:
	    TNT1 A 0
	    TNT1 A 0 A_SpawnItem("XDeath2NoStick")
        Stop
	Rest:
	XME1 E 1
		TNT1 A 0 ACS_ExecuteAlways(798, 0, 0, 0, 0)//Check Effects
		XME1 E 3
		TNT1 A 0 A_SpawnItem("Brutal_BloodSpot",0,0,0,1)
    Living:
	    XME1 E 600
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Vanish")
		Loop
	Vanish:
	    TNT1 A 5
		Stop
    }
}



ACTOR CeilXDeath2Checker: Brutal_FlyingXBlood
{
damagetype Blood
damage 0
Radius 0
Height 0
Speed 400

 Gravity 0.0
	Decal BrutalBloodSuper
    States
    {
     Spawn:
       TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        TNT1 A 4
        Stop
	Splash:
        BLOD A 0
        stop
     Death:
       TNT1 A 1 A_SpawnItem("CeilXDeath2",0,0,0,1)
        TNT1 A 5
        stop
     Xdeath:
	    TNT1 A 1
        Stop
    }
}

actor CeilXDeath2: Brutal_BloodSpot
{
+SPAWNCEILING
+MOVEWITHSECTOR
-DOOMBOUNCE
+NOGRAVITY
  +DontSplash
  +MISSILE
 Renderstyle Normal 
  Scale 1.1
states
{
Spawn:
Goto Crash
Death:
Crash:
TNT1 A 0
TNT1 A 0 A_JUmp (255, "Live1", "Live2", "Live3")
Goto Live1

  Live1:
  XME1 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
  Live2:
  XME1 FFFFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
  Live3:
  XME1 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
 Fall:
  TNT1 A 0 A_SpawnItem("XDeath2NoStick")
  stop
	Splash:
        BLOD A 0
        stop
    }
}


ACTOR XDeath2NoStick: XDeath1
{
    +CLIENTSIDEONLY
	+DONTSPLASH
    Speed 0
	Gravity 0.4
    DeathSound "misc/xdeath2"
	Decal BrutalBloodSplat
    Scale 1.1
	Radius 1
	Height 0
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0 A_CheckFloor("Death")
        XME1 H 3 //A_CustomMissile ("Brutal_FlyingXBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
        Loop
    Death:
        TNT1 AAAAAAA 0 A_CustomMissile ("Brutal_FlyingXBloodTrail5", 0, 0, random (0, 180), 2, random (0, 180))
         XME1 E 1
		 TNT1 A 0 A_QueueCorpse
		TNT1 A 0 ACS_ExecuteAlways(798, 0, 0, 0, 0)//Check Effects
		XME1 E 3
		TNT1 A 0 A_SpawnItem("Brutal_BloodSpot",0,0,0,1)
    Living:
	    XME1 E 600
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Vanish")
		Loop
	Vanish:
	    TNT1 A 5
		Stop
    }
}














ACTOR Detect_CeilXDeath3
{
 game Doom
 scale 0.4
 speed 0
 health 1
 radius 1
 height 1
 Gravity 0.0
 damage 0
 Renderstyle Translucent
 Alpha 0.95
	DamageType Blood
   +MISSILE
   +CLIENTSIDEONLY
   +NOTELEPORT
   +NOBLOCKMAP
   +FORCEXYBILLBOARD
   +NODAMAGETHRUST
   -DONTSPLASH
   +NOGRAVITY
    States
    {
     Spawn:
	 TNT1 A 0
	 TNT1 A 0 ThrustThingZ(0,35,0,1)
	 TNT1 A 2
	 TNT1 A 0 A_SpawnItem("SmearingXDeath3", 0, -25)
	 Stop
	 Death:
	 TNT1 A 0
	 TNT1 A 0 A_CustomMissile ("CeilXDeath3Checker", -15, 0, 90, 2, 90)
  Stop
    }
}


ACTOR SmearingXDeath3
{
    Radius 2
    Height 2
	Speed 10
	Mass 1
	Scale 1.0
    +NOBLOCKMAP
    +NOTELEPORT
	+THRUGHOST
	+CLIENTSIDEONLY
    +DONTSPLASH
    +MOVEWITHSECTOR
	-DONTSPLASH
	+FORCEXYBILLBOARD
	+QUARTERGRAVITY
    States
    {
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
	TNT1 A 0 A_Recoil(-25)
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
	TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Spawn4")
	Goto Spawn1
	
	Spawn1:
	XME2 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn2:
	XME2 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn3:
	XME2 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn4:
	XME2 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGgg 1 A_CheckFloor("Rest")
	Goto Death
	
	Death:
	    TNT1 A 0
	    TNT1 A 0 A_SpawnItem("XDeath3NoStick")
        Stop
	Rest:
	 XME1 E 1
	 TNT1 A 0 A_QueueCorpse
		TNT1 A 0 ACS_ExecuteAlways(798, 0, 0, 0, 0)//Check Effects
		XME2 E 3
		
		TNT1 A 0 A_SpawnItem("Brutal_BloodSpot",0,0,0,1)
    Living:
	    XME2 E 600
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Vanish")
		Loop
	Vanish:
	    TNT1 A 5
		Stop
    }
}


ACTOR CeilXDeath3Checker: Brutal_FlyingXBlood
{
damagetype Blood
damage 0
Radius 0
Height 0
Speed 400

 Gravity 0.0
	Decal BrutalBloodSuper
    States
    {
     Spawn:
       TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        TNT1 A 4
        Stop
	Splash:
        BLOD A 0
        stop
     Death:
       TNT1 A 1 A_SpawnItem("CeilXDeath3",0,0,0,1)
        TNT1 A 5
        stop
     Xdeath:
	    TNT1 A 1
        Stop
    }
}

actor CeilXDeath3: Brutal_BloodSpot
{
+SPAWNCEILING
+MOVEWITHSECTOR
-DOOMBOUNCE
+NOGRAVITY
  +DontSplash
  +MISSILE
  Scale 1.0
   Renderstyle Normal 
states
{
Spawn:
Goto Crash
Death:
Crash:
TNT1 A 0
TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
TNT1 A 0 A_JUmp (255, "Live1", "Live2", "Live3")
Goto Live1

  Live1:
  XME2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
  Live2:
  XME2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
  Live3:
  XME2 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
 Fall:
  TNT1 A 0 A_SpawnItem("XDeath3NoStick")
  stop
	Splash:
        BLOD A 0
        stop
    }
}


ACTOR XDeath3NoStick: XDeath1
{
    +CLIENTSIDEONLY
	+DONTSPLASH
    Speed 0
	Gravity 0.4
    DeathSound "misc/XDeath3"
	Decal BrutalBloodSplat
    Scale 1.0
	Radius 1
	Height 0
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0 A_CheckFloor("Death")
        XME2 H 3 //A_CustomMissile ("Brutal_FlyingXBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
        Loop
    Death:
        TNT1 AAAAAAA 0 A_CustomMissile ("Brutal_FlyingXBloodTrail5", 0, 0, random (0, 180), 2, random (0, 180))
        XME2 E 1
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 ACS_ExecuteAlways(798, 0, 0, 0, 0)//Check Effects
		XME2 E 3
		TNT1 A 0 A_SpawnItem("Brutal_BloodSpot",0,0,0,1)
    Living:
	    XME2 E 600
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Vanish")
		Loop
	Vanish:
	    TNT1 A 5
		Stop
    Splash:
        TNT1 A 1
		XME2 E 2002
        Stop
    }
}







ACTOR Detect_CeilXDeath4
{
 game Doom
 scale 0.4
 speed 0
 health 1
 radius 1
 height 1
 Gravity 0.0
 damage 0
 Renderstyle Translucent
 Alpha 0.95
	DamageType Blood
   +MISSILE
   +CLIENTSIDEONLY
   +NOTELEPORT
   +NOBLOCKMAP
   +FORCEXYBILLBOARD
   +NODAMAGETHRUST
   -DONTSPLASH
   +NOGRAVITY
    States
    {
     Spawn:
	 TNT1 A 0
	 TNT1 A 0 ThrustThingZ(0,35,0,1)
	 TNT1 A 2
	 TNT1 A 0 A_SpawnItem("XDeath4NoStick")
	 Stop
	 Death:
	 TNT1 A 0
	 TNT1 A 0 A_CustomMissile ("CeilXDeath4Checker", -15, 0, 90, 2, 90)
  Stop
    }
}




ACTOR CeilXDeath4Checker: Brutal_FlyingXBlood
{
damagetype Blood
damage 0
Radius 0
Height 0
Speed 400

 Gravity 0.0
	Decal BrutalBloodSuper
    States
    {
     Spawn:
       TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        TNT1 A 4
        Stop
	Splash:
        BLOD A 0
        stop
     Death:
       TNT1 A 1 A_SpawnItem("CeilXDeath4",0,0,0,1)
        TNT1 A 5
        stop
     Xdeath:
	    TNT1 A 1
        Stop
    }
}

actor CeilXDeath4: Brutal_BloodSpot
{
+SPAWNCEILING
+MOVEWITHSECTOR
-DOOMBOUNCE
+NOGRAVITY
  +DontSplash
  +MISSILE
  Scale 0.7
   Renderstyle Normal 
states
{
Spawn:
Goto Crash
Death:
Crash:
TNT1 A 0
TNT1 A 0 A_JUmp (255, "Live1", "Live2", "Live3")
Goto Live1

  Live1:
  XME3 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
  Live2:
  XME3 FFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
  Live3:
  XME3 FFFFFFFFFFFFFFFFFFFFFFFFFF 3 ThrustThingZ(0,35,0,1)
  Goto Fall
  
 Fall:
  TNT1 A 0 A_SpawnItem("XDeath4NoStick")
  stop
	Splash:
        BLOD A 0
        stop
    }
}


ACTOR XDeath4NoStick: XDeath1
{
    +CLIENTSIDEONLY
	+DONTSPLASH
    Speed 0
	Gravity 0.4
    DeathSound "misc/XDeath4"
	Decal BrutalBloodSplat
    Scale 0.7
	Radius 1
	Height 0
    States
    {
    Spawn:
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        XME3 ABCD 3 //A_CustomMissile ("Brutal_FlyingXBloodTrail", 0, 0, random (0, 360), 2, random (0, 360))
        Loop
    Death:
        TNT1 AAAAAAA 0 A_CustomMissile ("Brutal_FlyingXBloodTrail5", 0, 0, random (0, 180), 2, random (0, 180))
        TNT1 A 0 A_QueueCorpse
		XME3 E 2002
		
        Stop
    Splash:
        TNT1 A 1
		XME3 E 2002
        Stop
    }
}





ACTOR Detect_CeilBrain
{
 game Doom
 scale 0.4
 speed 0
 health 1
 radius 1
 height 1
 Gravity 0.0
 damage 0
 Renderstyle Translucent
 Alpha 0.95
	DamageType Blood
   +MISSILE
   +CLIENTSIDEONLY
   +NOTELEPORT
   +NOBLOCKMAP
   +FORCEXYBILLBOARD
   +NODAMAGETHRUST
   -DONTSPLASH
   +NOGRAVITY
    States
    {
     Spawn:
	 TNT1 A 0
	 TNT1 A 0 ThrustThingZ(0,35,0,1)
	 TNT1 A 2
	 TNT1 A 0 A_SpawnItem("SmearingBrain", 0, -20)
	 Stop
	 Death:
	 TNT1 A 0
	 TNT1 A 0 A_CustomMissile ("SmallBrainPiece", -15, 0, 90, 2, 90)
  Stop
    }
}

ACTOR SmearingBrain
{
    Radius 2
    Height 2
	Speed 10
	Mass 1
	Scale 0.5
    +NOBLOCKMAP
    +NOTELEPORT
	+THRUGHOST
	+CLIENTSIDEONLY
    +DONTSPLASH
    +MOVEWITHSECTOR
	-DONTSPLASH
	+FORCEXYBILLBOARD
	+QUARTERGRAVITY
    States
    {
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
	TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Spawn4")
	Goto Spawn1
	
	Spawn1:
	XDB5 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn2:
	XDB5 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn3:
	XDB5 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 1 A_CheckFloor("Rest")
	Goto Death
	
	Spawn4:
	XDB5 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 1 A_CheckFloor("Rest")
	Goto Death
	
	Death:
	Rest:
	    TNT1 A 0
		TNT1 A 0 A_QueueCorpse
	    TNT1 A 0 A_ChangeFlag("QUARTERGRAVITY", 0)
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		TNT1 A 0 A_CheckFloor("Sleep")
		XDB5 A 2 ThrustThingZ(0,-2,0,1)
		Loop
	Sleep:	
	    
        XDT5 B 2002
        Stop
	DoNothing:
	TNT1 A 0
	Stop
    }
}




ACTOR CeilBrain: SmearingBrain
{
    Radius 2
    Height 2
	Scale 0.5
    +NOBLOCKMAP
    +NOTELEPORT
	+THRUGHOST
	+CLIENTSIDEONLY
    +DONTSPLASH
    +MOVEWITHSECTOR
	+NOGRAVITY
    States
    {
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 1)
	TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Spawn4")
	Goto Spawn1
	
	Spawn1:
	XDB5 J 80
	Goto Death
	
	Spawn2:
	XDB5 K 120
	Goto Death
	
	Spawn3:
	XDB5 K 180
	Goto Death
	
	Spawn4:
	XDB5 J 240
	Goto Death
	
	Death:
	TNT1 A 0 A_CustomMissile("SmallBrainPieceJustFall", -8, 0, -90, 2, -90)
	Stop
    }
}