// wonky physics
// coded by Aenima

// good god this shit is J A N K
// the sheer amount of commented-out code should tell you
// just how much fuckery and trial-and-error was done just
// to try to get this to work properly

// good luck to you if you're about to try to navigate
// through this file. a lot of this is dependent on
// stuff found in other DECORATE lumps so be aware of
// that.

ACTOR RagDoll
{
//PROJECTILE               
//+DOOMBOUNCE
//BounceFactor 0.2
//seesound "dspunch"
//+corpse
speed 0
mass 20
//+ROLLSPRITE
-SOLID
-NOBLOCKMAP
//+ghost
+shootable
+FRIENDLY
height 20//12
radius 8//20
health 300
+NOBLOCKMONST 
-NOGRAVITY
gravity 0.7
-NOBLOOD
+ACTIVATEMCROSS
	+FORCEXYBILLBOARD
deathsound "ragdoll/land"
  states
  {
  Crush:
    POL5 AAAAAAAA 1 A_SpawnItemEx ("Bloodsquirt3", 0,0,0, 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    POL5 A -1
    Stop
  Death:
	TNT1 A 0 //A_RemoveChildren
	TNT1 AAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160) 
	TNT1 A 0 Bright A_SpawnItemEx ("spinegib", 0,0,20, momx*1.01,momy*1.01,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0 Bright A_SpawnItemEx ("rightshouldergib", 0,-8,32, momx*1.01,momy*1.01,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0 Bright A_SpawnItemEx ("leftshouldergib", 0,8,32, momx*1.005,momx*1.005,0, random(0,90), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0 Bright A_SpawnItemEx ("lefthandgib", 0,12,16, 0,random(0,60)*0.18,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	TNT1 A 0 Bright A_SpawnItemEx ("righthandgib", 0,-12,16, 0,random(-60,0)*0.18,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	TNT1 CCCC 1 A_SpawnItemEx ("BetterBlood", 0,0,random(8,40), 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
	Stop
  }
}
ACTOR FakeRagDoll
{
PROJECTILE           
speed 0
mass 20
-SOLID
-NOBLOCKMAP
//+ghost
+shootable
+FRIENDLY
height 20
radius 8//20
health 300
+NOBLOCKMONST 
-NOGRAVITY
gravity 0.7
-NOBLOOD
	Damage 0
	+BLOODLESSIMPACT
	+NODAMAGE
	+NOTARGETSWITCH
deathsound "ragdoll/hit"
painsound "misc/null"
  Decal "BigBloodSplat"
	states
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_Pain
		Spawn2:
			TNT1 A 1 
			Loop
		Death:
		//Crash:
			TNT1 A 0 A_Stopsound
			TNT1 A 0 A_Scream
			NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-2,2),0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-25,25)*0.1,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			
			NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-2,2),0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-25,25)*0.1,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
		HitWall:
			TNT1 A 0 A_checkfloor("HitFloor")
			//TNT1 A 0 A_GiveToTarget("HitTheWall",1)//A_GiveToChildren("HitTheWall",1)
			//TNT1 A 0 A_KillMaster("Wall")
			Stop
		HitFloor:
			TNT1 AAAAAAAAAA 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			Stop
	}
}

actor FakeRagDollImp : FakeRagDoll
{
painsound "ragdoll/imp"
}
actor FakeRagDollPlayer : FakeRagDoll
{
painsound "ragdoll/player"
}
actor FakeRagDollPlayerFemale : FakeRagDoll
{
painsound "player/female/falling"
}
actor FakeRagDollPlayer2 : FakeRagDoll
{
painsound "goofyscr"
}
actor FakeRagDollZombie : FakeRagDoll
{
painsound "ragdoll/zombie"
}

actor FakeRagDollGreen : FakeRagDoll
{
	+NODAMAGE
    bloodcolor "green"
//seesound "knight/death"
	states
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("knight/death")
			Goto Prawn
		Prawn:
			TNT1 A 1 //A_SpawnItemEx("BetterBlood_BH",0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			Loop
		Death:
		//Crash:
			TNT1 A 0 A_Scream
			NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-2,2),0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-25,25)*0.1,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			
			NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-2,2),0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", 0,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    		NULL AAAA 0 A_SpawnItemEx ("bloodfling", random(-25,25)*0.1,0,0, 0,random(0,40)*0.1,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			
			TNT1 AAAAAAAAAA 1 //A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			Stop
	}
}

actor FakeRagDollGreen2 : FakeRagDollGreen
{
//seesound "baron/death"
	states
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("baron/death")
			Goto Prawn
	}
}
actor FacedownChecker : Inventory
{
  inventory.amount 1
  inventory.maxamount 1
}
actor HitTheWall : Inventory
{
  inventory.amount 1
  inventory.maxamount 1
}
ACTOR ragdollsmoke
{
+NOGRAVITY
-SOLID
-SHOOTABLE
  +CANNOTPUSH
  +NOTELEPORT
	+FORCEXYBILLBOARD
renderstyle translucent
scale 1.77//2.0
alpha 0.07
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 Thing_ChangeTID (0, 1330)
	LVAS GGG 3 A_ScaleVelocity(0.8)
	LVAS HHHIIIJJJ 3 A_ScaleVelocity(0.8)
	LVAS KKKKKK 2 A_FadeOut(0.01)
	stop
}
}

actor poisonpaincloud :  ragdollsmoke
{
scale 0.75
alpha 0.14
states
{
	Spawn:
	TNT1 A 0
	TNT1 A 0 Thing_ChangeTID (0, 1330)
	OXPL ABC 1 A_ScaleVelocity(0.8)
	OXPL DEF 1 A_ScaleVelocity(0.7)
	OXPL GGHHIIJJKKLL 1 A_FadeOut(0.01)
	stop
}
}

ACTOR ImpRagDoll : RagDoll
{
	states
	{
		Spawn:
			TROO H 0
			TROO H 0 ThrustThingZ(0, random(24,48), 0, 1)
			TROO H 0 A_SpawnItemEx ("FakeRagdollImp", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			TROO K 2
			TROO K 0 A_ChangeFlag("corpse",1)
			TROO K 0 A_Jump(128,"Midair2")
		Midair1:
			//TNT1 A 0 A_SetSpriteRotation(1)
			TROO K 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")  
			Loop
		Midair2:
			//TNT1 A 0 A_SetSpriteRotation(1)
			TRRO C 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		/*
		Pain: // breaks shit
			//TROO K 1
			TROO K 0 A_JumpIf((z - floorz)<9, "Crash")
			TROO K 0 A_Jump(128,"Midair2")
			Goto Midair1
		*/
		Crash:
			TROO L 0 A_Fall
			TROO L 0 A_UnSetShootable
			TROO L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			TNT1 A 0 A_JumpIfInventory("HitTheWall",1,"WallCrash")
			TROO K 0 A_Jump(128,"crashb")
			TROO LLLLLMMMMM 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			TROO M -1
			stop
		Crashb:
			TRRO DDDDDEEEEE 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			TRRO E -1
			stop
		Wallcrash:
			TROO YYYY 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			TROO Y -1
			Stop
		Wallsmack:
			TNT1 A 0 A_GiveInventory("HitTheWall",1)
			TNT1 A 0 A_Stop
			TNT1 A 0 A_LowGravity//A_NoGravity
			TROO V 16
			TNT1 A 0 A_Gravity
			TROO WX 6
		Wallfall:
			TROO X 6
			Loop
	}
}
ACTOR ZombiemanRagDoll : RagDoll
{
	states
	{
		Spawn:
			POSS H 0
			POSS H 0 ThrustThingZ(0, random(24,48), 0, 1)
			TROO H 0 A_SpawnItemEx ("FakeRagdollZombie", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			POSS I 2
			POSS K 0 A_ChangeFlag("corpse",1)
			POSS K 0 A_Jump(128,"Midair2")
			POSS K 0 A_Jump(64,"Midair3")
		Midair1: 
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			POSS J 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160) 
			Loop
		Midair2:
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			POSS K 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			Loop
		Midair3:
			POOS V 0 A_GiveInventory("facedownchecker",1)
			POOS VVVVV 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
		Midair3a:
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			POOS W 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			Loop
		Crash:
			TNT1 A 0 A_JumpIfInventory("HitTheWall",1,"Death")
			POSS L 0 A_Fall
			POSS L 0 A_UnSetShootable
			POSS L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			//TNT1 A 0 A_JumpIfInventory("HitTheWall",1,"WallCrash")
			POSS L 0 A_JumpIfInventory("facedownchecker",1,"Facedown")
			POSS LLLLLLLLLL 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160) 
			POSS L -1
			Stop
		Facedown:
			POOS XXYYZZZZZZ 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			POOS Z -1
			stop
		Wallsmack:
			TNT1 A 0 A_GiveInventory("HitTheWall",1)
			POSS M 0 A_NoGravity
			POSS MN 1
			Goto Death
		}
}
ACTOR ShotgunnerRagDoll : RagDoll
{
	states
	{
		Spawn:
			SPOS H 0
			SPOS H 0 ThrustThingZ(0, random(24,48), 0, 1)
			TROO H 0 A_SpawnItemEx ("FakeRagdollZombie", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			SPOS I 2
			SPOS K 0 A_ChangeFlag("corpse",1)
			SPOS IIIIIIII 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			SPOS JJJJJJJJ 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			SPOS JJJJJJJJ 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
		Midair:
			SPOS K 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		Crash:
			SPOS L 0 A_Fall
			SPOS L 0 A_UnSetShootable
			SPOS L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			TNT1 A 0 A_JumpIfInventory("HitTheWall",1,"WallCrash")
			SPOS LLLLLLLLLL 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			SPOS L -1
			stop	
		Wallsmack:
			TNT1 A 0 A_GiveInventory("HitTheWall",1)
			TNT1 A 0 A_Stop
			TNT1 A 0 A_LowGravity//A_NoGravity
			SPSS A 16
			TNT1 A 0 A_Gravity
			SPSS BC 6
		Wallfall:
			SPSS C 6
			Loop
		Wallcrash:
			SPSS ZZZZ 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			SPSS Z -1
			Stop
	}
}
ACTOR SSGerRagDoll : RagDoll
{
	states
	{
		Spawn:
			GPOS H 0
			GPOS H 0 ThrustThingZ(0, random(24,48), 0, 1)
			TROO H 0 A_SpawnItemEx ("FakeRagdollZombie", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			GPOS I 2
			GPOS I 0 A_ChangeFlag("corpse",1)
		Midair:
			GPOS I 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		Wallsmack:
			GPOS J 0 A_Stop
		Wallfall:
			GPOS J 2
			Loop
		Crash:
			GPOS K 2
			GPOS K 0 A_Fall
			GPOS L 0 A_UnSetShootable
			GPOS J 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			GPOS JJLLMMNNNN 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			GPOS N -1
			stop
	}
}
ACTOR PlayerRagDoll : RagDoll
{
health 9999
	states
	{
		Spawn:
			HEXD H 0
    		HEXD H 0 Thing_ChangeTID (0, 8888) 
			HEXD H 0 ThrustThingZ(0, random(24,48), 0, 1)
			TROO H 0 A_SpawnItemEx ("FakeRagdollPlayer", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			HEXD A 2
			HEXD AABBBBB 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
    		HEXD H 0 Thing_ChangeTID (0, 0) 
			HEXD CCCCCC 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			HEXD K 0 A_ChangeFlag("corpse",1)
		Midair:
			HEXD D 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		Wallsmack:
			//TNT1 A 0 A_GiveInventory("HitTheWall",1)
			TNT1 A 0 A_Stop
			TNT1 A 0 A_LowGravity//A_NoGravity
			RAGU A 16
			TNT1 A 0 A_Gravity
		Wallfall:
			RAGU B 6
			Loop
		Crash:
			HEXD E 0 A_Fall
			HEXD E 0 A_UnSetShootable
			HEXD E 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			HEXD EEEEEFFFFF 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			HEXD G -1
			stop
	}
}

ACTOR PlayerRagDollFemale : PlayerRagDoll
{
	states
	{
		Spawn:
			HEXD H 0
    		HEXD H 0 Thing_ChangeTID (0, 8888) 
			HEXD H 0 ThrustThingZ(0, random(24,48), 0, 1)
			TROO H 0 A_SpawnItemEx ("FakeRagdollPlayerFemale", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			HEXD A 2
			HEXD AABBBBB 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
    		HEXD H 0 Thing_ChangeTID (0, 0) 
			HEXD CCCCCC 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			HEXD K 0 A_ChangeFlag("corpse",1)
		Midair:
			HEXD D 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
	}
}
ACTOR PlayerRagDoll2 : PlayerRagDoll
{
health 9999
	states
	{
		Spawn:
			HEXD H 0
			HEXD H 0 ThrustThingZ(0, 100, 0, 0)
			TROO H 0 A_SpawnItemEx ("FakeRagdollPlayer2", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			HEXD A 2
			HEXD AABBBBB 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
    		HEXD H 0 Thing_ChangeTID (0, 0) 
			HEXD CCCCCC 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			HEXD K 0 A_ChangeFlag("corpse",1)
		    Goto Midair
	}
}
ACTOR DarkImpRagDoll : RagDoll
{
	states
	{
		Spawn:
			DIRK H 0
			DIRK H 0 ThrustThingZ(0, random(24,48), 0, 1)
			DIRK H 0 A_SpawnItemEx ("FakeRagdollImp", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER)//SXF_ISMASTER 
			DIRK K 2
			DIRK K 0 A_ChangeFlag("corpse",1)
		Midair:
			DIRK K 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			//DIRK K 0 A_CheckFloor("Crash")
			Loop
		Crash:
			DIRK L 0 A_Fall
			DIRK L 0 A_UnSetShootable
			DIRK L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			TNT1 A 0 A_JumpIfInventory("HitTheWall",1,"WallCrash")
			DIRK LLLLLMMMMM 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			DIRK M -1
			stop
		Wallcrash:
			DRKV PPPP 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			DRKV P -1
			Stop
		//Pain.Wall:
		//Death.Wall:
		Wallsmack:
			DIRK X 0 A_GiveInventory("HitTheWall",1)
			DIRK X 0 A_Stop
			DIRK X 0 A_LowGravity//A_NoGravity
			DIRK X 16
			DIRK X 0 A_Gravity
			DRKV MN 6
		Wallfall:
			DRKV O 6
			Loop
  Death:
	TNT1 A 0 A_RemoveChildren
	TNT1 AAAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160) 
	TNT1 A 0 Bright A_SpawnItemEx ("spinegib", 0,0,20, momx*1.01,momy*1.01,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("rightshouldergib", 0,-8,32, momx*1.01,momy*1.01,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("leftshouldergib", 0,8,32, momx*1.005,momx*1.005,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("lefthandgib", 0,12,16, 0,random(0,60)*0.18,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	//TNT1 A 0 Bright A_SpawnItemEx ("righthandgib", 0,-12,16, 0,random(-60,0)*0.18,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	TNT1 CCCC 1 A_SpawnItemEx ("BetterBlood", 0,0,random(8,40), 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	}
}
ACTOR DemonRagDoll : RagDoll
{
	states
	{
		Spawn:
			SARG H 0
			SARG H 0 ThrustThingZ(0, random(24,48), 0, 1)
			SARG H 0 A_Playsound("demon/pain")
			SARG H 0 A_SpawnItemEx ("FakeRagdoll", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			SARG I 2
			SARG J 0 A_ChangeFlag("corpse",1)
			SARG J 4
			SARG J 0 A_Jump(256,"midair","midair2","midair3")
			Goto Midair
		Midair:
			SARX A 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		Midair2:
			SARX C 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		Midair3:
			SARX D 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		Wallsmack:
			//TNT1 A 0 A_GiveInventory("HitTheWall",1)
			TNT1 A 0 A_Stop
			TNT1 A 0 A_LowGravity//A_NoGravity
			SARX B 16
			TNT1 A 0 A_Gravity
			SARG J 6
		Wallfall:
			SARG K 6
			Loop
		Crash:
			SARG L 0 A_Fall
			SARG L 0 A_UnSetShootable
			SARG L 0 A_Scream
			SARG LLLLL 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			SARG MMMMM 1 //A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			SARG N -1
			stop
  Death:
	TNT1 A 0 A_RemoveChildren
	TNT1 AAAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160) 
	TNT1 A 0 Bright A_SpawnItemEx ("spinegib", 0,0,20, momx*1.01,momy*1.01,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("rightshouldergib", 0,-8,32, momx*1.01,momy*1.01,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("leftshouldergib", 0,8,32, momx*1.005,momx*1.005,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("lefthandgib", 0,12,16, 0,random(0,60)*0.18,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	//TNT1 A 0 Bright A_SpawnItemEx ("righthandgib", 0,-12,16, 0,random(-60,0)*0.18,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	TNT1 CCCC 1 A_SpawnItemEx ("BetterBlood", 0,0,random(8,40), 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	}
}
ACTOR SpectreRagDoll : DemonRagDoll
{
Renderstyle "Fuzzy"
}
ACTOR BloodDemonRagDoll : RagDoll
{
	states
	{
		Spawn:
			SAR2 H 0
			SAR2 H 0 ThrustThingZ(0, random(24,48), 0, 1)
			SARG H 0 A_Playsound("demon/pain")
			SAR2 H 0 A_SpawnItemEx ("FakeRagdoll", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_SETMASTER) 
			SAR2 I 2
			SAR2 J 0 A_ChangeFlag("corpse",1)
			SAR2 J 4
		Midair:
			SAR2 K 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			TNT1 A 0 A_JumpIf(momx>-1 && momx<1 && momy>-1 && momy<1, "Wallsmack")
			Loop
		Wallsmack:
			//TNT1 A 0 A_GiveInventory("HitTheWall",1)
			TNT1 A 0 A_Stop
			//TNT1 A 0 A_LowGravity//A_NoGravity
			//SAR2 L 16
			//TNT1 A 0 A_Gravity
		Wallfall:
			SAR2 L 6
			Loop
		Crash:
			SAR2 L 0 A_Fall
			SAR2 L 0 A_UnSetShootable
			SAR2 L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			SAR2 LLLLL 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			SAR2 MMMMM 1 //A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			SAR2 N -1
			stop
  Death:
	TNT1 A 0 A_RemoveChildren
	TNT1 AAAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160) 
	TNT1 A 0 Bright A_SpawnItemEx ("spinegib", 0,0,20, momx*1.01,momy*1.01,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("rightshouldergib", 0,-8,32, momx*1.01,momy*1.01,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("leftshouldergib", 0,8,32, momx*1.005,momx*1.005,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION|SXF_ABSOLUTEMOMENTUM)
	//TNT1 A 0 Bright A_SpawnItemEx ("lefthandgib", 0,12,16, 0,random(0,60)*0.18,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	//TNT1 A 0 Bright A_SpawnItemEx ("righthandgib", 0,-12,16, 0,random(-60,0)*0.18,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	TNT1 CCCC 1 A_SpawnItemEx ("BetterBlood", 0,0,random(8,40), 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	}
}
ACTOR BaronRagDoll : RagDoll
{
	bloodcolor "green"
	+NODAMAGE
	states
	{
		Spawn:
			BTO2 H 0
			BTO2 H 0 ThrustThingZ(0, random(16,32), 0, 1)
			BTO2 H 0 A_SpawnItemEx ("FakeRagdollGreen2", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION) 
			BTO2 A 2
			BTO2 K 0 A_ChangeFlag("corpse",1)
		Midair:
			BTO2 A 1 A_SpawnItemEx("BetterBlood_BH",0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)//A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			Loop
		Crash:
			BTO2 L 0 A_Fall
			BTO2 L 0 A_UnSetShootable
			BTO2 L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			BTO2 BBBBBCCCCC 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			BTO2 D -1
			stop
		Death:
			TNT1 A 0 A_RemoveChildren
			TNT1 AAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE) 
			Stop
	}
}
ACTOR HKRagDoll : RagDoll
{
	bloodcolor "green"
	+NODAMAGE
	states
	{
		Spawn:
			BTO1 H 0
			BTO1 H 0 ThrustThingZ(0, random(16,32), 0, 1)
			BTO1 H 0 A_SpawnItemEx ("FakeRagdollGreen", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION) 
			BTO1 A 2
			BTO1 K 0 A_ChangeFlag("corpse",1)
		Midair:
			BTO1 A 1 A_SpawnItemEx("BetterBlood_BH",0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)//A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			Loop
		Crash:
			BTO1 L 0 A_Fall
			BTO1 L 0 A_UnSetShootable
			BTO1 L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			BTO1 BBBBBCCCCC 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			BTO1 D -1
			stop
		Death:
			TNT1 A 0 A_RemoveChildren
			TNT1 AAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE) 
			Stop
	}
}
ACTOR NaziRagDoll : RagDoll
{
	states
	{
		Spawn:
			SSWV H 0
			SSWV H 0 ThrustThingZ(0, random(24,48), 0, 1)
			SSWV H 0 A_SpawnItemEx ("FakeRagdoll", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION) 
			SSWV I 2
			SSWV J 0 A_ChangeFlag("corpse",1)
			SSWV J 4
		Midair:
			SSWV K 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			Loop
		Crash:
			SSWV L 0 A_Fall
			SSWV L 0 A_UnSetShootable
			SSWV L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			SSWV LLLLLMMMMM 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
			SSWV M -1
			stop
  Death:
	TNT1 A 0 A_RemoveChildren
	TNT1 AAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160) 
	TNT1 A 0 Bright A_SpawnItemEx ("spinegib", 0,0,20, momx*1.01,momy*1.01,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0 Bright A_SpawnItemEx ("rightshouldergib", 0,-8,32, momx*1.01,momy*1.01,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0 Bright A_SpawnItemEx ("leftshouldergib", 0,8,32, momx*1.005,momx*1.005,0, random(0,90), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0 Bright A_SpawnItemEx ("lefthandgib", 0,12,16, 0,random(0,60)*0.18,0, random(-90,0), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	TNT1 A 0 Bright A_SpawnItemEx ("righthandgib", 0,-12,16, 0,random(-60,0)*0.18,0, random(0,90), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
	TNT1 CCCC 1 A_SpawnItemEx ("BetterBlood", 0,0,random(8,40), 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
	}
}
ACTOR ChainguyRagDoll : RagDoll
{
	states
	{
		Spawn:
			CRIH H 0
			CRIH H 0 ThrustThingZ(0, random(24,48), 0, 1)
			CRIH H 0 A_SpawnItemEx ("FakeRagdollZombie", 0,0,0, momx,momy,momz, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION) 
			CRIH A 2
			CRIH B 0 A_ChangeFlag("corpse",1)
			CRIH B 4
		Midair:
			CRIH C 1 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160)  
			Loop
		Crash:
			CRIH L 0 A_Fall
			CRIH L 0 A_UnSetShootable
			CRIH L 0 A_Scream
			TNT1 A 0 A_ChangeVelocity(momx*0.33,momy*0.33,2.8, CVF_REPLACE)
			CRIH DDDDDEEEEE 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, 160)
			CRIH F -1
			stop
		Death:
			TNT1 A 0 A_RemoveChildren
			TNT1 AAAAAA 0 A_SpawnItemEx ("BloodFXSpawner", 0,0,random(0,40), 0,0,0, 0, 160) 
			TNT1 CCCC 1 A_SpawnItemEx ("BetterBlood", 0,0,random(8,40), 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
			Stop
	}
}