//All the liquid gore stuff goes here.

//Hit puff actor

//An actor that will spawn multiple arterial blood actors
ACTOR ArterialBloodSpray
{
 Speed 0
 +CLIENTSIDEONLY
 +NOINTERACTION
    States
    {
     Spawn:
	 TNT1 A 0
	 TNT1 A 0 A_stop
		TNT1 AAAA 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 6
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 6
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 6
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 6
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 9
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 9
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 9
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 9
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 12
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 12
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 16
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
		TNT1 A 19
		TNT1 A 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, 0, 2, random (0, 60))
       Stop
    }
}

//Spawns giant blood decals all around the area. Used in Brutal Doom's BFG deaths.
Actor BloodSplinter
{
	+THRUACTORS
	+CLIENTSIDEONLY
	States
		{
			 Spawn:
			   TNT1 A 0
			   TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 0, 2, random (0, 35))
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 45, 2, random (0, 35))
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 90, 2, random (0, 35))
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 135, 2, random (0, 35))
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 180, 2, random (0, 35))
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 225, 2, random (0, 35))
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 270, 2, random (0, 35))
			   TNT1 A 0 A_CustomMissile ("GiantWallRedBlood", 40, 0, 315, 2, random (0, 35))
			   Stop

			Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		}
}

//Bloody footprints still requires the player to be edited to work.
//Gives the player an inventory item to indicate the feet are smeared.
ACTOR BootSmearerRed
{
	MONSTER
	-SOLID
	+THRUACTORS
	-COUNTKILL
	+LOOKALLAROUND
	-FRIENDLY
	Radius 0
	Height 0
	 states
	 {
	 Spawn:
		 TNT1 A 0
		 TNT1 A 1 A_Look
		 Goto See

	 See:
		 TNT1 AA 1 A_Chase("","")
		 TNT1 A 0 A_Die("LookForPlayer")
	 Death:
	 Death.LookForPlayer:
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 8 A_JumpIfCloser(60, "SmearBootsWithRedBlood")
		Stop
	SmearBootsWithRedBlood:
		TNT1 A 0 A_GiveToTarget("BootsSmearedWithRedBlood", 8)
		BPDL A 0
		Stop
	}
}

actor Brutal_Blood Replaces Blood
{
	Decal BrutalBloodSplat
	Renderstyle Translucent
	+FORCEXYBILLBOARD
	+THRUACTORS
	+CLIENTSIDEONLY
	Speed 0
	Scale 0.8
	Alpha 1.0
	Mass 999999
	 states
	 {
	  Spawn:
			BSPR A 0
			TNT1 A 0 A_CustomMissile ("SuperGoreMistTiny", 0, 0, random (0, 360), 2, random (0, 90))
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckBloodIntensity")
			TNT1 A 0
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			BSPR A 2
			TNT1 A 0 A_CustomMissile ("WaterBloodCHecker", 7, 0, random (0, 360), 2, random (30, 60))
		Spawn2:
			TNT1 A 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 60))
			TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (20, 90))
			Goto LowBlood
		Splash:
			BLOD A 0
			TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		LotsOfBlood:
		   TNT1 A 0
		   TNT1 AAAA 0 A_CustomMissile ("BloodMistSmall", 0, 0, random (0, 360), 2, random (0, 90))
		   TNT1 AAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 70))
		   TNT1 A 0 A_CustomMissile ("SuperWallRedBlood", 0, 0, random (0, 360), 2, random (-15, 15))
		   TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 90))
		   Goto LowBlood
		AbsurdBlood:
		   TNT1 A 2
		   TNT1 AAAA 0 A_CustomMissile ("SuperWallRedBlood", 0, 0, random (0, 360), 2, random (-15, 15))
		   TNT1 A 0 A_JumpIfInventory("AnimuGore", 1, "AnimuGore")
		   TNT1 AA 0 A_CustomMissile ("BloodMist", 0, 0, random (0, 360), 2, random (0, 90))
		   TNT1 AAA 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (10, 50))
		   TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (40, 60))
		   TNT1 A 0 A_CustomMissile ("BloodmistSmall", 7, 0, random (0, 360), 2, random (30, 90))
		   TNT1 A 0 A_CustomMissile ("SuperGoreMist", 0, 0, random (0, 360), 2, random (10, 90))
		   TNT1 AAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 70))
		   TNT1 AAA 0 A_CustomMissile ("BloodmistSpray", 0, 0, random (0, 360), 2, random (20, 90))
		   Goto LowBlood
		 AnimuGore:
		   TNT1 AAA 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (10, 50))
		   TNT1 A 0 A_CustomMissile ("SuperWallRedBlood", 0, 0, random (0, 360), 2, random (-15, 15))
		   TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (40, 60))
		   TNT1 AAAAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 70))
		   TNT1 AAAAAAAAA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (40, 80))
		   TNT1 A 0 A_CustomMissile ("SuperGoreSpawner", 0, 0, random (0, 360), 2, random (10, 90))
		   TNT1 AAAAA 0 A_CustomMissile ("BloodmistSpray", 0, 0, random (0, 360), 2, random (20, 90))
		   Goto LowBlood
		 LowBlood:
			TNT1 A 0
			TNT1 A 0 A_Jump(128, 2)
			TNT1 A 0 A_SetScale(-0.7, 0.8)
			TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
			BSPR BCDEFGHIJJ 1
			Stop

		SpawnPlayer:
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("SuperGoreMistTiny", 0, 0, random (0, 360), 2, 0)
			TNT1 A 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 60))
			TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (20, 90))
			TNT1 A 0 A_Jump(128, 2)
			TNT1 A 0 A_SetScale(-0.7, 0.8)
			TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
			BSPR BCDEFGHIJJ 1 BRIGHT
			Stop
	 }
}

ACTOR BloodDying : Brutal_Blood
{
 Speed 0
 +CLIENTSIDEONLY
 +NOINTERACTION
    States
    {
     Spawn:
	    TNT1 AAAA 2 A_CustomMissile ("Brutal_LiquidBlood2", 0, 0, random (0, 360), 2, random (20, 90))
		TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (20, 90))
       Stop
    }
}

//Dummy actor just to replace the bloodpuff made by projectiles
actor BloodSPlatterReplacer : Brutal_Blood Replaces BloodSplatter
{
	speed 4
}

actor BrainBlood : Brutal_Blood
{
	speed 4
}

//base bloodspot actor
ACTOR Brutal_BloodSpot
{
	radius 2
	height 2
	mass 1
	+NOTELEPORT
	+CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	+MOVEWITHSECTOR
	+FLOORCLIP
	+DONTSPLASH
	-SOLID
	+THRUACTORS
	Scale 0.5
	Decal BrutalBloodSplat
	states
	 {
	 Spawn:
		 TNT1 A 0
		 TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		 TNT1 A 1
		 TNT1 A 0 A_CheckFloor("SpawnNormally")
		 Goto Death

	  SpawnNormally:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckIfOverLiquid")
		TNT1 A 4
		TNT1 A 0 A_JumpIfInventory("IsOverBlood", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverWater", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverSlime", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverNukage", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverOrange", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPinaColada", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPurple", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverTar", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverMagenta", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverYava", 1, "Evap")
        TNT1 A 4
		TNT1 A 0 A_SpawnItemEx ("BootSmearerRed",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 A 0 A_Jump(255, "SpawnAFrameOnly", "SpawnBFrameOnly", "SpawnCFrameOnly", "SpawnDFrameOnly")
		SpawnAFrameOnly:
			BPDL A 800
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Death")
			Loop

		  FadeA:
			BPDL AAAA 1 A_FadeOut(0.05)
			Stop

		  SpawnBFrameOnly:
			BPDL B 800
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Death")
			Loop

		  FadeB:
			BPDL BBBB 1 A_FadeOut(0.05)
			Stop

		  SpawnCFrameOnly:
			BPDL C 800
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Death")
			Loop

		  FadeC:
			BPDL CCCC 1 A_FadeOut(0.05)
			Stop

		  SpawnDFrameOnly:
			BPDL D 800
			TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)
			TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Death")
			Loop

		  FadeD:
			BPDL DDDD 1 A_FadeOut(0.05)
			Stop

		WaterBloodSpot:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("WaterBloodSpot")
			Stop

		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop

		Evap:
			TNT1 A 0
			TNT1 A 0 A_CustomMissile("HitpuffSmoke", 2, 0, random (0, 360), 2, random (80, 90))
			Stop

		Death:
			TNT1 A 0
			TNT1 A 0 A_NoBlocking
			Stop
	}
}

ACTOR Brutal_OldBloodSpot : Brutal_BloodSpot
{
	Decal BrutalOldBloodSplat
}

//Base flying blood actor. Leaves bloodspots on the floor
ACTOR Brutal_FlyingBlood
{
   scale 0.5
   speed 4
   radius 8
   height 1
   Gravity 0.8
   Renderstyle Translucent
   Alpha 0.9
   Decal BrutalBlood
   Mass 1
   +MISSILE
   +CLIENTSIDEONLY
   +NOTELEPORT
   +NOBLOCKMAP
   +THRUACTORS
   +FORCEXYBILLBOARD
   +MOVEWITHSECTOR
   +DONTSPLASH
	States
    {
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Live")
		Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-0.6, 0.6)
			Goto live

		Spawn2:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-0.7, -0.7)
			Goto live

		Spawn3:
			TNT1 A 0
			TNT1 A 0 A_SetScale(0.6, -0.6)
			Goto live

		Live:
			BSPR ABCDEFGH 2
			TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
			BSPR I 100 A_JumpIf(waterlevel > 1, "Splash")
			Stop

		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		Death:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("blooddrop2")
			TNT1 A 0 A_CheckFloor("DeathFloor")
			TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
			TNT1 A 1
			Stop

		DeathFloor:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx ("Brutal_BloodSpot",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION |  SXF_TRANSFERTRANSLATION,0)
			TNT1 A 0 A_PlaySound("blooddrop2")
			TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
			XDT1 EFGHIJKL 2
			Stop

		NoSpawn:
			TNT1 A 0
			Stop
    }
}

//This is the actual blood driping from the ceiling actor
ACTOR BloodDripingFromCeiling: Brutal_FlyingBlood
{
	+THRUACTORS
	+CLIENTSIDEONLY
	+FORCEYBILLBOARD
	+TOUCHY
	+NOBLOCKMAP
	Alpha 0.9
	Gravity 1.0
	Radius 2
	Height 1
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(230, "NoSpawn")
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		BLUD Z 500
		Loop
	Death:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("blooddrop2")
		XDT1 EFGHIJKL 2
		Stop
	}
}

//This is a bigger and denser version of the blood drip, droped by sticky gibs
ACTOR BloodDripingFromCeilingBig: BloodDripingFromCeiling
{
	XScale 0.4
	YScale 1.0
	Gravity 0.8
    States
    {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(160, "NoSpawn")
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		BLUD Z 500
		Loop
	Death:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("blooddrop2")
		XDT1 EFGHIJKL 2
		Stop
    }
}

actor Bloodmist : Brutal_FlyingBlood
{
	+BOUNCEONWALLS
	+BOUNCEONCEILINGS
	scale 0.8
	radius 2
	height 2
	speed  8
	Gravity 0.6
	alpha 0.9
	 states
	 {
	Spawn:
			BLHT A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor4", 0 , 0, 0, 0)
			BLHT A 1
			TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Live")
	 Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-0.8, 0.8)
			Goto live

	Spawn2:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-0.9, -0.9)
			Goto live

	Spawn3:
			TNT1 A 0
			TNT1 A 0 A_SetScale(0.7, -0.7)
			Goto live

	 Live:
			BLHT ABCDEFGHI 3
			TNT1 A 0
			BLHT JJJJ 6 A_JumpIf(waterlevel > 1, "Splash")
			Stop

	Vanish:
		 TNT1 A 0
		 Stop

	Death:
		XDT1 FGHIJKL 2
		Stop

	}
}

actor BloodmistBig : Bloodmist
{
	scale    1
	speed    5
	GRAVITY 0.4

	states
	 {
	Spawn:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor4", 0 , 0, 0, 0)
			TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Live")
	 Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-1.1, 1.1)
			Goto live

	Spawn2:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-0.9, -0.9)
			Goto live

	Spawn3:
			TNT1 A 0
			TNT1 A 0 A_SetScale(1.0, -1.0)
			Goto live
		}
}

actor BloodmistChainsaw : Bloodmist
{
	Scale 0.4
	Alpha 0.9
	Gravity 0.5
	Decal BrutalBloodSuper
	Speed 9
	 states
		{
		Spawn:
			MSBL ABCDEFGH 1
			MSBL H 200
			Stop
		}
}

actor BloodmistExtraBig : Bloodmist
{
	scale    1.5
	speed    5
	GRAVITY 0.4

	states
	 {
	Spawn:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor4", 0 , 0, 0, 0)
			TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Live")
	 Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-1.6, 1.6)
			Goto live

	Spawn2:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-1.5, -1.6)
			Goto live

	Spawn3:
			TNT1 A 0
			TNT1 A 0 A_SetScale(1.4, -1.5)
			Goto live
		}
}

Actor BloodMistLarge: BloodMistBig
{
speed    6
}

actor BloodmistSmall : Bloodmist
{
	scale    0.5
	speed    8
	GRAVITY 1.0

	states
	 {
	Spawn:
			TNT1 A 0
			TNT1 A 0 ACS_NamedExecuteAlways("BDCHeckJanitor4", 0 , 0, 0, 0)
			TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Live")
	 Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-0.5, 0.5)
			Goto live

	Spawn2:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-0.4, -0.4)
			Goto live

	Spawn3:
			TNT1 A 0
			TNT1 A 0 A_SetScale(0.5, -0.6)
			Goto live
		}
}

//More wattery version
actor BloodmistSpray : Bloodmist
{
	scale    1.0
	Gravity 0.4
	 states
		{
		Spawn:
			BSPR ABCDEFGHIJJJJ 2
			Stop
		}
}

actor BloodmistSpraySmall : BloodmistSpray
{
	Speed 8
	Gravity 0.7
}

actor BloodmistXXXBig : Bloodmist
{
	scale   3.0
	speed    10
	GRAVITY 0.2

	states
	 {
	Spawn:
			TNT1 A 0
			TNT1 A 0 A_Jump(255, "Spawn1", "Spawn2", "Spawn3", "Live")
	 Spawn1:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-3.6, 3.6)
			Goto live

	Spawn2:
			TNT1 A 0
			TNT1 A 0 A_SetScale(-3.5, -3.6)
			Goto live

	Spawn3:
			TNT1 A 0
			TNT1 A 0 A_SetScale(3.2, -3.2)
			Goto live
		}
}

actor BloodmistXXBig : BloodmistXXXBig
{
	scale   3.0
	speed    12
}

actor Brutal_FlyingBloodFaster: Brutal_FlyingBlood
{
Speed 3
Scale 0.7
+BOUNCEONWALLS
 states
 {
  Spawn:
	  TNT1 A 0
	  TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
	   TNT1 A 0
	  TNT1 A 0 A_Jump(128, 2)
	  TNT1 A 0 A_SetScale (-0.7, 0.9)
	  BL8A ABCDEF 2
	  BL8A F 35
	  stop
 }
}

//Faster version used in some specific cases
ACTOR Brutal_FlyingBloodMuchFaster: Brutal_FlyingBlood
{
	 Scale 1.0
	 Speed 8
}

actor Brutal_FlyingBloodTrail
{
	scale 0.5
	mass 1
	Decal BrutalBloodSplat
	+MISSILE
	+NOTELEPORT
	+NOBLOCKMAP
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	+THRUACTORS
	+DONTSPLASH
	Gravity 0.4
	Speed 2
	states
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0
		TNT1 A 0 A_Jump(128, 2)
		TNT1 A 0 A_SetScale (-0.5, 0.6)
		BL8A ABCDE 1
		TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
		BL8A F 60
		stop

	Death:
		TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
		Stop

	Splash:
		BLOD A 0
		TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
		TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
		stop
	}
}

ACTOR BloodTr255: Brutal_FlyingBloodTrail { decal "none"}
ACTOR BloodTrails: Brutal_FlyingBloodTrail { decal "none"}
ACTOR Brutal_FlyingBloodTrail5: Brutal_FlyingBloodTrail { decal "none"}
ACTOR Brutal_FlyingBloodTrail8: Brutal_FlyingBloodTrail { decal "none"}

ACTOR Brutal_FlyingBloodFake: Brutal_FlyingBloodTrail
{
	scale 0.5
	speed 3
	Gravity 0.3
	Renderstyle Translucent
	Alpha 0.95
	+NOCLIP
    Mass 1
    States
    {
     Spawn:
		TNT1 A 0
	    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		BLOD KKKKKKKKKKKK 1 A_FadeOut(0.05)
        Stop
	Splash:
		BLOD A 0
		TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
		stop
	Death:
	    TNT1 A 10
		Stop
    }
}

ACTOR Brutal_FlyingBloodFakeNoDecal: Brutal_FlyingBloodFake { decal "none"}

//A decorative kind of flying blood spawned by arterial blood
ACTOR Brutal_LiquidBlood: Brutal_FlyingBlood
{
 speed 3
 scale 0.2
 gravity 0.6
 decal BrutalBloodSmearSmall
    States
    {
     Spawn:
	 TNT1 A 0
	 TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 1, 0, random (0, 360), 2, random (40, 90))
	 BLOD AAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItem("Brutal_LiquidBloodTrail")
	 Stop
	 Death:
  	   TNT1 A 0 A_PlaySound("blooddrop2")
	   XDT1 FGHIJKL 2
	   TNT1 A 0
       Stop
    }
}

//Faster version, leaves no decals. Used to prevent decal overflow
ACTOR Brutal_LiquidBlood2: Brutal_LiquidBlood
{
 speed 4
 scale 0.4
 gravity 0.6
 decal "None"
}

//This version leaves a bloodspot
ACTOR Brutal_LiquidBlood3: Brutal_FlyingBlood
{
Speed 3
    States
    {
	 Death:
  	   TNT1 A 0 A_PlaySound("blooddrop2")
	   TNT1 A 0 A_CheckFloor("SpawnFloor")
	   TNT1 A 4
	   Stop

	 SpawnFloor:
	   tnt1 a 0 A_SPawnItem("Brutal_BloodSpot")
	   XDT1 FGHIJKL 2
	   TNT1 A 0
       Stop
    }
}

//Very fast version
ACTOR Brutal_LiquidBloodFast: Brutal_LiquidBlood2
{
 speed 8
}

//Decorative trails
ACTOR Brutal_LiquidBloodTrail: Brutal_FlyingBlood
{
 scale 0.4
 gravity 0.4
    States
    {
     Spawn:
	  TNT1 A 0
      BRTL ABC 2
	  Stop
	 Death:
	  TNT1 A 0
      Stop
    }
}

//Large blood drips spawner, usually caused by huge chunks of meat getting stuck on the ceiling.
ACTOR CeilBloodLargeBloodSpawner: Brutal_FlyingBlood
{
	+NOGRAVITY
	+THRUACTORS
	+NOCLIP
	Scale 0.5
	 States
		{
		 Spawn:
			  TNT1 A 0
			  TNT1 A 1 A_SpawnItemEx ("DripingBloodLeavesSmallPool", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 4 A_SpawnItemEx ("BloodDripingFromCeilingBig", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 8 A_SpawnItemEx ("BloodDripingFromCeilingBig", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 12 A_SpawnItemEx ("BloodDripingFromCeiling", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 16 A_SpawnItemEx ("BloodDripingFromCeiling", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  stop
		}
}

//Launches bloodspots on the ceiling
ACTOR CeilBloodLauncher: Brutal_FLyingBlood
{
    +THRUACTORS
	-DOOMBOUNCE
	-SKYEXPLODE
	+BOUNCEONWALLS
    Speed 15
    Gravity 0.0
	Radius 1
	Height 1
	Decal BrutalBloodSplat
    States
		{
		 Spawn:
			TNT1 A 0
		    TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 A 3
			Stop
		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		 Death:
			TNT1 A 0
			TNT1 A 0 A_CheckCeiling("IsOnCeil")
			TNT1 A 0
			stop

		 IsOnCeil:
			TNT1 A 0
			TNT1 A 1 A_SpawnItem("CeilBloodSpot",0,0,0,1)
			Stop
		 Melee:
		 Xdeath:
			TNT1 A 1
			Stop
		}
}

//Longer version (for extreme deaths)
ACTOR CeilBloodLauncherLong: CeilBloodLauncher
{
    States
    {
		 Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 A 12
			Stop
    }
}

// The Ceil Blood Spot
actor CeilBloodSpot
{
	+MISSILE
	+CEILINGHUGGER
	-SKYEXPLODE
	+THRUACTORS
	+DONTSPLASH
	+NOBLOCKMAP
	Height 1
	Radius 2
	Mass 0
	Scale 0.5
	Gravity 0.0
	Decal BrutalBloodSplat
	Renderstyle Translucent
	Alpha 0.9
	states
	{
		Spawn:
		  BPDL A 1
		  TNT1 A 0 A_QueueCorpse
		  TNT1 A 0 A_SpawnItem ("DripingBloodLeavesSmallPool")
		  TNT1 A 0 A_SpawnItem ("CeilBloodTinyBloodSpawner")
		Live:
		  BPDL A 5 ThrustThingZ(0, 20, 0, 1)
		  Loop
		Death:
			TNT1 A 0
			Stop
			}
}

//Bigger version of a ceil blood spot, usually left by sticky gibs.
actor CeilBloodSpotLarge: CeilBloodSpot
{
	states
	{
		Spawn:
			BPDL A 1
			TNT1 A 0 A_QueueCorpse
			TNT1 A 0 A_SpawnItem ("DripingBloodLeavesSmallPool")
			TNT1 A 0 A_SpawnItem ("CeilBloodLargeBloodSpawner")
		Live:
			BPDL A 5 ThrustThingZ(0, 20, 0, 1)
			Loop
		Splash:
			BLOD A 0
			stop
			}
}

//Small blood drips spawner, usually caused by regular blood touching the ceiling.
ACTOR CeilBloodTinyBloodSpawner: Brutal_FlyingBlood
{
	+NOGRAVITY
	+THRUACTORS
	+NOCLIP
	 States
		{
		 Spawn:
			  TNT1 A 0
			  TNT1 A 1 A_SpawnItemEx ("DripingBloodLeavesSmallPool", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 4 A_SpawnItemEx ("BloodDripingFromCeiling", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 8 A_SpawnItemEx ("BloodDripingFromCeiling", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 12 A_SpawnItemEx ("BloodDripingFromCeiling", random (-5, 5), random (-5, 5), 0, 0, 0, -5)
			  TNT1 AAAAAAAAAAAAAA 16 A_SpawnItem ("BloodDripingFromCeiling")
			  stop
		}
}

actor DeadBlood
{
	Decal BrutalBloodSplat
	Renderstyle Translucent
	+FORCEXYBILLBOARD
	+THRUACTORS
	+CLIENTSIDEONLY
	+NOGRAVITY
	Scale 0.6
	Alpha 0.9
	Mass 999999
	Speed 1
	 states
	 {
	  Spawn:
			BSPR A 0
			TNT1 A 0 A_CustomMissile ("SuperGoreMistTiny", 0, 0, random (0, 360), 2, random (40, 90))
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckBloodIntensity")
			TNT1 A 0
			TNT1 A 0 A_PlaySound("misc/xdeath5")
			BSPR A 2
			TNT1 A 0 A_CustomMissile ("WaterBloodCHecker", 7, 0, random (0, 360), 2, random (30, 60))
		Spawn2:
			//TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 10, 0, random (0, 360), 2, random (40, 90))
			Goto LowBlood
		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood1", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		LotsOfBlood:
		   TNT1 A 0
		   TNT1 AAAA 0 A_CustomMissile ("BloodMistSmall", 10, 0, random (0, 360), 2, random (0, 90))
		   TNT1 AA 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (40, 90))
		   TNT1 A 0 A_CustomMissile ("SuperWallRedBlood", 0, 0, random (0, 360), 2, random (5, 15))
		   TNT1 AAAA 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 10, 0, random (0, 360), 2, random (40, 90))
		   Goto LowBlood
		AbsurdBlood:
		   TNT1 A 2
		   TNT1 AAAA 0 A_CustomMissile ("SuperWallRedBlood", 0, 0, random (0, 360), 2, random (-15, 15))
		   TNT1 A 0 A_JumpIfInventory("AnimuGore", 1, "AnimuGore")
		   TNT1 AA 0 A_CustomMissile ("BloodMist", 0, 0, random (0, 360), 2, random (0, 90))
		   TNT1 AAA 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (10, 50))
		   TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (40, 60))
		   TNT1 A 0 A_CustomMissile ("BloodmistSmall", 7, 0, random (0, 360), 2, random (30, 90))
		   TNT1 A 0 A_CustomMissile ("SuperGoreMist", 0, 0, random (0, 360), 2, random (10, 90))
		   TNT1 AAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 70))
		   TNT1 AAA 0 A_CustomMissile ("BloodmistSpray", 0, 0, random (0, 360), 2, random (20, 90))
		   Goto LowBlood
		 AnimuGore:
		   TNT1 AAA 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (10, 50))
		   TNT1 A 0 A_CustomMissile ("SuperWallRedBlood", 0, 0, random (0, 360), 2, random (-15, 15))
		   TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodMuchFaster", 7, 0, random (0, 360), 2, random (40, 60))
		   TNT1 AAAAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 70))
		   TNT1 AAAAAAAAA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (40, 80))
		   TNT1 A 0 A_CustomMissile ("SuperGoreSpawner", 0, 0, random (0, 360), 2, random (10, 90))
		   TNT1 AAAAA 0 A_CustomMissile ("BloodmistSpray", 0, 0, random (0, 360), 2, random (20, 90))
		   Goto LowBlood
		 LowBlood:
			TNT1 A 0
			TNT1 A 0 A_Jump(128, 2)
			TNT1 A 0 A_SetScale(-0.7, 0.8)
			BSPR ABCDEFGHIJ 1
			Stop

		SpawnPlayer:
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("SuperGoreMistTiny", 0, 0, random (0, 360), 2, 0)
			TNT1 A 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 60))
			TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (20, 90))
			BSPR ABCDEFGHIJ 1 BRIGHT
			Stop
	 }
}

Actor DripingBlood: BloodDripingFromCeiling {Alpha 0.9 Scale 1.0}

//This is the first drip spawned by the drip spawners, which leaves a small blood pool
ACTOR DripingBloodLeavesPool: BloodDripingFromCeiling
{
	+FORCEYBILLBOARD
	scale 0.3
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			BLUD Z 4
			Loop
		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		Death:
			TNT1 A 0
			TNT1 A 0 A_SpawnItem("MediumBloodSpot")
			TNT1 A 0 A_PlaySound("blooddrop2")
			XDT1 EFGHIJKL 2
			Stop
	}
}

//Just like above, but leaves a smaller pool
ACTOR DripingBloodLeavesSmallPool: DripingBloodLeavesPool
{
+FORCEYBILLBOARD
+DONTSPLASH
States
{
     Death:
	    TNT1 A 0
		TNT1 A 0 A_SpawnItem("MinuscleBloodSpot")
		TNT1 A 0 A_PlaySound("blooddrop2")
        XDT1 EFGHIJKL 2
        Stop
    }
}

Actor FireBlood : Brutal_Blood
{
	Decal "Scorch"
	Scale 1.0
	Alpha 1.0
	Mass 5
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrailDarker", 12, 0, random (160, 210), 2, random (40, 90))
		EXPL A 0 A_CustomMissile ("RealFlameTrailsSmall", 6, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_CustomMissile ("ExplosionParticleHeavy", 10, 0, random (0, 180), 2, random (40, 90))
		Stop
	}
}

actor GiantBloodSpot: Brutal_BloodSpot {Scale 1.1}

//A blood pool spawned by regular enemy deaths.
actor GrowingBloodPool: Brutal_BloodSpot
{
	var int user_bloodpoolsize;
	radius 1
	height 1
	mass 1
	Health 600
	+MISSILE
	+NOTELEPORT
	+FORCEXYBILLBOARD
	+MOVEWITHSECTOR
	+FLOORCLIP
	+DONTSPLASH
	-CLIENTSIDEONLY
	Scale 0.3
	Decal BrutalBloodSplat
		states
		 {
		 Spawn:
		  TNT5 A 1
		  TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		  TNT1 A 0 A_SpawnItemEx ("BootSmearerRed",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		  TNT5 A 2 A_QueueCorpse
		  TNT5 A 1 A_SetScale(0.33, 0.33)
		  TNT5 A 1 A_SetScale(0.36, 0.36)
		  TNT5 A 1 A_SetScale(0.39, 0.39)
		  TNT5 A 1 A_SetScale(0.42, 0.42)
		  TNT5 A 1 A_SetScale(0.45, 0.45)
		  TNT5 A 1 A_SetScale(0.48, 0.48)
		  TNT5 A 1 A_SetScale(0.50, 0.50)

		  TNT5 A 2 A_SetScale(0.53, 0.53)
		  TNT5 A 2 A_SetScale(0.56, 0.56)
		  TNT5 A 2 A_SetScale(0.59, 0.59)
		  TNT5 A 2 A_SetScale(0.62, 0.62)
		  TNT5 A 2 A_SetScale(0.65, 0.65)
		  TNT5 A 2 A_SetScale(0.68, 0.68)
		  TNT5 A 2 A_SetScale(0.70, 0.70)


		  TNT5 A 3 A_SetScale(0.73, 0.73)
		  TNT5 A 3 A_SetScale(0.76, 0.76)
		  TNT5 A 3 A_SetScale(0.79, 0.79)
		  TNT5 A 3 A_SetScale(0.82, 0.82)
		  TNT5 A 3 A_SetScale(0.85, 0.85)
		  TNT5 A 3 A_SetScale(0.88, 0.88)
		  TNT5 A 3 A_SetScale(0.90, 0.90)

		  TNT5 A 3 A_SetScale(0.93, 0.93)
		  TNT5 A 3 A_SetScale(0.96, 0.96)
		  TNT5 A 3 A_SetScale(0.99, 0.99)
		  TNT5 A 3 A_SetScale(1.02, 1.02)
		  TNT5 A 3 A_SetScale(1.05, 1.05)
		  TNT5 A 3 A_SetScale(1.08, 1.08)
		  TNT5 A 3 A_SetScale(1.11, 1.11)

		 Live:
		  TNT5 A 900
		  TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)
		  TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "Splash")
		  Loop
		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood1", 7, 0, random (0, 360), 2, random (30, 150))
			stop
	 }
}

actor BigBloodSpot: GiantBloodSpot { Scale 0.7}
actor MediumBloodSpot: GiantBloodSpot { Scale 0.4}
actor MediumBloodSpot2: GiantBloodSpot{ Scale 0.4}
actor MinuscleBloodSpot: Brutal_BloodSpot {Scale 0.25}

actor MediumOldBloodSpot: GiantBloodSpot
{
	Scale 0.4
	Decal BrutalOldBloodSplat
}

actor Player_Blood : Brutal_Blood
 {
  Scale 0.3
  States

	{
	Spawn:
		BLHT A 0
		MARN A 0 ACS_NamedExecuteAlways("CheckIfDM", 0, 0, 0, 0)//Check if Coop
		BLHT A 2
		TNT1 A 0 A_JumpIfInventory("DMGame", 1, "DM")
		TNT1 A 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 60))
		BLHT BCDEFG 1
	    BLHT HHHHHHHHHHH 1 A_FadeOut(0.1)
	    Stop

	DM:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 60))
		BLHT BCDEFG 1
		TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
	    BLHT HHHHHHHHHHH 1 A_FadeOut(0.1)
	    Stop
		}
}

actor Player_BloodSaw : Brutal_Blood
{
	Gravity 0.5
	Alpha 0.4
	-NOGRAVITY
	Scale 0.25
	States
	{
	Spawn:
		BLHT A 0
		MARN A 0 ACS_NamedExecuteAlways("CheckIfDM", 0, 0, 0, 0)//Check if Coop
		BLHT A 2
		TNT1 A 0 A_JumpIfInventory("DMGame", 1, "DM")
		BLHT BCDEFG 1
		BLHT GGGGGGGGGGGGGGGGGG 1 A_FadeOut(0.05)
		Stop

	DM:
		TNT1 A 0
		TNT1 A 0 A_RadiusGive("ChainsawHitRed", 128, RGF_PLAYERS, 1)
		TNT1 A 0 A_RadiusGive("PowerBloodOnVisor", 128, RGF_PLAYERS, 1)
		TNT1 A 0 A_RadiusGive("SawBloodOnVisor", 128, RGF_PLAYERS, 1)
		BLHT BCDEFG 1
		BLHT GGGGGGGGGGGGGGGGGG 1 A_FadeOut(0.05)
		Stop
	}
}

ACTOR PlayerFlyingBlood
{
	game Doom
	scale 0.75
	speed 7
	health 1
	radius 8
	height 1
	Decal BloodSuper
	+MISSILE
	+CLIENTSIDEONLY
	+NOTELEPORT
	+NOBLOCKMAP
	+FORCEXYBILLBOARD
	+EXPLODEONWATER
	States
	{
		Spawn:
			TNT1 A 0
			NULL A 0 A_JumpIf(waterlevel > 1, "Splash")
			XDT1 ABCD 4 A_SpawnItem("Brutal_FlyingBloodTrail",0,0,0,1)
			loop
		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		Death:
			NULL A 1 A_SpawnItem("Brutal_BloodSpot",0,0,0,1)
			XDT1 EFGHIJKL 3
			stop
	}
}

ACTOR RedBloodFootPrintLeft: GrowingBloodPool
{
	Scale 0.09
	+CLIENTSIDEONLY
	Alpha 1.0
	 states
	 {
	 Spawn:
	 Death:
	 Crash:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckIfOverLiquid")
		TNT1 A 4
		TNT1 A 0 A_JumpIfInventory("IsOverBlood", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverWater", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverSlime", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverNukage", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverOrange", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPinaColada", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPurple", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverTar", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverMagenta", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverYava", 1, "Evap")
		TNT1 A 4
		TNT1 A 0 A_CheckFloor("ShowUp")
		Stop
	ShowUp:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		BPDL A 200
		TNT1 A 0 A_JumpIfInventory("LowGraphicsMode", 1, "Splash")
		BPDL A -1
		Stop
	 }
}

ACTOR RedBloodFootPrintRight: GrowingBloodPool
{
Scale 0.09
+CLIENTSIDEONLY
 states
 {
	 Spawn:
	 Death:
	 Crash:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckIfOverLiquid")
		TNT1 A 4
		TNT1 A 0 A_JumpIfInventory("IsOverBlood", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverWater", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverSlime", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverNukage", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverOrange", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPinaColada", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPurple", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverTar", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverMagenta", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverYava", 1, "Evap")
		TNT1 A 4
		TNT1 A 0 A_CheckFloor("ShowUp")
		Stop
	ShowUp:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		BPDL A 200
		TNT1 A 0 A_JumpIfInventory("LowGraphicsMode", 1, "Splash")
		BPDL A -1
		Stop
 }
}

//Dummy actor just to replace the bloodpuff made by Hexen axe
actor SawBlood : Brutal_Blood Replaces AxeBlood
{
	-ALLOWPARTICLES
	Speed 1
	states
	{
	Spawn:
		TNT1 A 1
		TNT1 A 0 A_JumpIfInTargetInventory("HasCutingWeapon", 1, "HitSaw", AAPTR_TARGET)
		BSPR A 0
		TNT1 A 0 A_CustomMissile ("SuperGoreMistTiny", 0, 0, random (0, 360), 2, random (0, 90))
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckBloodIntensity")
		TNT1 A 0
		TNT1 A 0 A_PlaySound("misc/xdeath5")
		BSPR A 2
		TNT1 A 0 A_CustomMissile ("WaterBloodCHecker", 7, 0, random (0, 360), 2, random (30, 60))
	Spawn2:
		TNT1 A 0 A_CustomMissile ("Brutal_FlyingBlood", 7, 0, random (0, 360), 2, random (30, 60))
		TNT1 A 0 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (20, 90))
		Goto LowBlood

	HitSaw:
		TNT1 A 1
		TNT1 A 0 A_RadiusGive("ChainsawHitRed", 128, RGF_PLAYERS, 1)
		TNT1 A 0 A_RadiusGive("PowerBloodOnVisor", 128, RGF_PLAYERS, 1)
		TNT1 A 0 A_RadiusGive("SawBloodOnVisor", 128, RGF_PLAYERS, 1)
		TNT1 A 0 A_CustomMissile ("BloodmistChainsaw", -10, 0, random (0, 360), 2, random (60, 90))
		TNT1 A 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (40, 80))
		TNT1 A 0 A_CustomMissile ("ChainsawWallRedBlood", 0, 0, random (0, 360), 2, random (-10, 80))
		TNT1 A 0 A_PlaySound("CSAWFLESH")
		Stop
	}
}

//Big version spawned by XDeath animations of bigger enemies
ACTOR SplatteredLarge: Brutal_BloodSpot
{
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0 A_CheckFloor("Live")
		Goto Splash

		Live:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckIfOverLiquid")
		TNT1 A 4
		TNT1 A 0 A_JumpIfInventory("IsOverBlood", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverWater", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverSlime", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverNukage", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverOrange", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPinaColada", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPurple", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverTar", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverMagenta", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverYava", 1, "Evap")
		TNT1 A 4
		TNT1 A 0 A_SpawnItemEx ("BootSmearerRed",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		BPDL A -1
		Stop

		WaterBloodSpot:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("WaterBloodSpot")
		Stop
	}
}

//Big version spawned by XDeath animations
ACTOR SplatteredSmall: Brutal_BloodSpot
{
	states
	{
		Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		TNT1 A 0 A_CheckFloor("Live")
		Goto Splash

		Live:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckIfOverLiquid")
		TNT1 A 4
		TNT1 A 0 A_JumpIfInventory("IsOverBlood", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverWater", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverSlime", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverNukage", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverOrange", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPinaColada", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverPurple", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverTar", 1, "WaterBloodSpot")
		TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverMagenta", 1, "Evap")
		TNT1 A 0 A_JumpIfInventory("IsOverYava", 1, "Evap")
		TNT1 A 4
		TNT1 A 0 A_SpawnItemEx ("BootSmearerRed",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		BPDL A -1
		Stop

		WaterBloodSpot:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("WaterBloodSpot")
		Stop
	}
}

//Big blood mists
actor SuperGore
{
	Decal BloodSplat
	Alpha 0.6
	Renderstyle Translucent
	+FORCEXYBILLBOARD
	+GHOST
	+NOBLOCKMAP
	Gravity 0.01
	+DontSplash
	-EXPLODEONWATER
	-ALLOWPARTICLES
	+CLIENTSIDEONLY
	-NOGRAVITY
	+THRUACTORS
	+NOCLIP
	Gravity 0.2
	Scale 1.0
	Speed 1
	states
	{
		Spawn:
		BLOR A 1
		TNT1 A 0 A_RadiusGive("BloodOnVisor", 64, RGF_PLAYERS, 1)
		BLOR ABCDEFGHIJK 1 A_FadeOut(0.06)
		Stop
	}
}

actor BigSuperGore: SuperGore
{
Scale 2.0
Speed 4
}

actor GiantSuperGore: SuperGore
{
Scale 4.0
Speed 4
}

actor SmallSuperGore: SuperGore
{
Scale 1.0
}

Actor SuperGoreMist: SuperGore
{
Scale 1.5
Speed 1
+NOGRAVITY
}

actor SuperGoreMistSmall: SuperGore
{
Scale 1.0
}

//Used on bullet hit impacts
Actor SuperGoreMistTiny: SuperGore
{
Scale 0.4
Alpha 0.3
Speed 0
+NOGRAVITY
	 states
	 {
	  Spawn:
		BLOR ABCDEFGHIJK 1 A_FadeOut(0.03)
		Stop
	 }
}

//Spawners for the supergore thing
Actor SuperGoreSpawner
{
	Projectile
	+MISSILE
	+FORCEXYBILLBOARD
	+THRUACTORS
	+NOBLOCKMAP
	Decal BloodSuper
	radius 2
	height 2
	speed 15
	states
	{
	Spawn:
		TNT1 A 2
		TNT1 AAA 2 A_CustomMissile("SuperGore", 0, 0, random (0, 360), 2, random (30, 60))
		Stop
	Death:
	XDeath:
		TNT1 A 0
		Stop
	}
}

Actor SuperGoreSpawner2: SuperGoreSpawner
{
	states
	{
	Spawn:
		TNT1 A 3
		TNT1 AAAAAA 2 A_CustomMissile("SuperGore", 0, 0, random (0, 360), 2, random (30, 60))
		Stop
	}
}

Actor SuperGoreSpawner3: SuperGoreSpawner
{
	states
	{
	Spawn:
		TNT1 A 2
		TNT1 AAAAAAAAAAAAAAAAA 2 A_CustomMissile("SuperGore", 7, 0, random (0, 360), 2, random (30, 60))
		Stop
	}
}

actor UltraGore: SuperGore
{
	Scale 4.0
	Speed 1
	 states
	 {
	  Spawn:
		TNT1 A 0
		BLOR LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL 2 A_FadeOut(0.01)
		Stop
	 }
}

Actor UltraGoreSpawner: SuperGoreSpawner
{
	states
	{
	Spawn:
		TNT1 AAAAAAAAAA 3 A_CustomMissile("UltraGore", 7, 0, random (0, 360), 2, random (30, 60))
		Stop
	Death:
	XDeath:
		TNT1 A 0
		Stop
	}
}

//Blood actors spawned underwater
ACTOR Underblood1
{
	scale 1.4
	speed 1
	health 1
	radius 8
	height 1
	Gravity 0.9
	Renderstyle Translucent
	Alpha 0.2
	Decal BrutalBloodSplat
	+MISSILE
	+CLIENTSIDEONLY
	+NOTELEPORT
	+NOBLOCKMAP
	+FORCEXYBILLBOARD
	-DONTSPLASH
	+THRUACTORS
	Mass 1
		States
		{
		 Spawn:
		  BSP4 ABCDEFGHIJKLMNOPQRSTUVWXYZ 2
		  Stop
		}
}

//Shorter version
ACTOR Underblood2: Underblood1
{
 scale 0.7
 speed 0
    States
    {
     Spawn:
	 BSP4 ABCDEFGHIJKLMNOPQRSTUVWXYZ 1
	 Stop
    }
}
//Bigger version that moves, used for gibbing.
ACTOR Underblood3: Underblood1
{
 scale 2.2
 speed 2
 Alpha 0.3
}

//An invisible projectile only used to spawn bloodsplats on the walls, usually spawned by extreme deaths.
ACTOR WallRedBlood
{
	scale 0.6
	speed 7
	health 1
	radius 8
	height 1
	Gravity 0.7
	damage 0
	DamageType Blood
	Decal BrutalBloodSmear
   +MISSILE
   +CLIENTSIDEONLY
   +NOTELEPORT
   +NOBLOCKMAP
   +THRUACTORS
    States
    {
		Spawn:
			TNT1 A 0
		   TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 ABCD 1
			Stop
		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		 Death:
			TNT1 A 3
			stop
    }
}

ACTOR WallOldBlood
{
	scale 0.6
	speed 7
	health 1
	radius 8
	height 1
	Gravity 0.7
	damage 0
	DamageType Blood
	Decal BrutalOldBloodSmear
   +MISSILE
   +CLIENTSIDEONLY
   +NOTELEPORT
   +NOBLOCKMAP
   +THRUACTORS
    States
    {
		Spawn:
			TNT1 A 0
		   TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 ABCD 1
			Stop
		Splash:
			BLOD A 0
			TNT1 A 0 A_CustomMissile ("Underblood2", 7, 0, random (0, 360), 2, random (30, 150))
			stop
		 Death:
			TNT1 A 3
			stop
    }
}

//This one spawns a ridiculously bigger decal, used by BFG extreme deaths
ACTOR GiantWallRedBlood: WallRedBlood
{
 speed 32
 Gravity 0.1
 Decal BrutalBloodGiant
     States
		{
		 Spawn:
			TNT1 A 0
		   TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
		   TNT1 ABCD 1
		   Stop

		}
}

ACTOR ChainsawWallRedBlood: GiantWallRedBlood
{
 Decal BloodSplat
 speed 64
}

//Spawned by BD's kicked heads  to spawn blood decals and make the head bounce sound.
ACTOR ShortWallRedBlood: WallRedBlood
{
 speed 2
 Gravity 1
 Radius 24
 Height 12
     States
    {
     Spawn:
		TNT1 A 0
       TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
        TNT1 A 3
        Stop
	Death:
	    TNT1 AAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBloodFakeNoDecal", 0, 0, random (0, 360), 2, random (0, 90))
		TNT1 A 0 A_SpawnItem("Brutal_BloodSpot",0,0,0,1)
		TNT1 A 0 A_PlaySound("HEDBON")
	    TNT1 A 20
		Stop
	}
}

//This one spawns an even bigger decal
ACTOR SuperWallRedBlood: WallRedBlood
{
 speed 32
 Gravity 0.1
 Decal BrutalBloodSuper
     States
		{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 ABCD 1
			Stop
		}
}

ACTOR SuperWallOldBlood: WallOldBlood
{
 speed 32
 Gravity 0.1
 Decal BrutalOldBloodSuper
     States
		{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Splash")
			TNT1 ABCD 1
			Stop
		}
}

//a special flying blood actor that spawns muddy water pools over liquids
ACTOR WaterBloodCHecker
{
    Speed 4
    Scale 1.2
	Radius 1
	+MISSILE
	+EXPLODEONWATER
	+CLIENTSIDEONLY
	+DOOMBOUNCE
	BounceFactor 0.01
	Height 1
    SeeSound "none"
    DeathSound "none"
	Decal "none"
	States
    {
    Spawn:
	    TNT1 A 5
        Loop
    Death:
        TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BD_CheckIfOverLiquid")
		TNT1 A 4
		TNT1 A 0 A_JumpIfInventory("IsOverBlood", 1, "IsOverLiquid")
		TNT1 A 0 A_JumpIfInventory("IsOverWater", 1, "IsOverLiquid")
		TNT1 A 0 A_JumpIfInventory("IsOverSlime", 1, "IsOverLiquid")
		TNT1 A 0 A_JumpIfInventory("IsOverNukage", 1, "IsOverLiquid")
		TNT1 A 0 A_JumpIfInventory("IsOverOrange", 1, "IsOverLiquid")
		TNT1 A 0 A_JumpIfInventory("IsOverPinaColada", 1, "IsOverLiquid")
		TNT1 A 0 A_JumpIfInventory("IsOverPurple", 1, "IsOverLiquid")
		TNT1 A 0 A_JumpIfInventory("IsOverTar", 1, "IsOverLiquid")
        TNT1 A 4
        Stop

	IsOverLiquid:
		TNT1 A 1
		TNT1 A 0 A_SpawnItem ("WaterBloodSpot", 5)
		Stop
    }
}

//muddy water bloodspot actor
ACTOR WaterBloodSpot
{
+CLIENTSIDEONLY
+THRUACTORS
Radius 0
Height 0
Renderstyle Shaded
StencilColor "55 00 00"
Alpha 0.2
 states
 {
	Spawn:
		BPDL E 1 A_FadeOut(0.9)
		BPDL EEEEEEEEEEEEEEEEEEEE 4 A_FadeIn(0.02)
		BPDL E 100
		BPDL EEEEEEEEEEEEEEEEEEEE 4 A_FadeOut(0.02)
		Stop
 }
}
