actor Slenderman : G2_Ghost
{
	speed 5
	height 56
	radius 15
	scale 0.13
	+LOOKALLAROUND
	-FLOORCLIP
	+FLOORHUGGER
	painchance 32
	CameraHeight 64
	States
	{
		Dance:
			WRAT AAAAAAAAAAAAAAA 1 A_SetAngle(angle+25)
			WRAT A 0 ThrustThingZ(0,20,0,0)
			WRAT AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SetAngle(angle+25)
			loop
		Spawn:
			WRAT A 2 A_Look
			loop
		See:
		SeeGo:
			WRAT A 3 A_JumpIf(ACS_NamedExecutewithResult("ghost_getSeenCount") > 0,"Seen")
		SeeMove:
			WRAT A 0 A_JumpIf(ACS_NamedExecuteWithResult("gd_chase") <= 0, "See.Regular")
			Goto See.Continue
		See.Regular:
			WRAT A 0 A_Chase
			Goto See.Continue
		See.Continue:
			WRAT A 0 A_JumpIfTargetInLOS("See")
			WRAT A 0 A_JumpIfCloser(800,"TryPush")
			goto See
		TryPush:
			WRAT A 0 A_Jump(10,"Push")
			goto See
		Push:
			WRAT AAA 0 A_SpawnItemEx("SlenderPusher",0,0,50,28,0,0, random(0,35) * 10)
			goto Camp
		Camp:
			WRAT A 0 A_FaceTarget
			WRAT AAA 0 A_SpawnItemEx("SlenderPusher",0,0,50,28,0,0, random(0,35) * 10)
			WRAT AA 2 A_JumpIf(ACS_NamedExecutewithResult("ghost_getSeenCount") > 0,"Seen")
			WRAT A 0 A_JumpIfCloser(400,"Camp")
			WRAT A 0 A_Jump(5,"See")
			WRAT A 0 A_JumpIfCloser(1000,"Camp")
			
			goto See
		Seen:
			WRAT A 0
			WRAT A 0 A_Stop
			WRAT A 0 A_FaceTarget
		Seen2:
			WRAT A 0
			WRAT A 5 //A_PlaySound("GHOULISH3")
			WRAT A 10 A_Stop
			WRAT A 1 A_JumpIf(ACS_NamedExecutewithResult("ghost_getSeenCount") > 0,"Seen")
			WRAT A 0
			goto See
		Pain:
			WRAT A 0
			goto Seen2
		Pain.Fire:
			WRAT A 1
			WRAT A 1 ACS_NamedExecuteWithResult("ghost_igniteMe")
			goto Seen2
	}
}

actor SlenderPusher
{
	+MISSILE
	//+SERVERSIDEONLY
	height 2
	radius 2
	
	damage 0
	+THRUACTORS
	
	States
	{
		Spawn:
		TNT1 A 3
		stop
		Death:
		TNT1 A 1
		TNT1 A 1 A_RadiusThrust(384,64)
		XDeath:
		TNT1 A 0
		stop
	}
}

actor DanceSlenderman : Slenderman {
	States {
		Spawn:
			THRD A 0
			THRD A 0
			goto Dance
	}
}

actor SlendermanVs : Slenderman {
	-FLOORHUGGER
	+THRUACTORS
	States {
		Dance:
			WRAT AAAAAAAA 1 A_SetAngle(angle+66)
			WRAT A 0 A_JumpIf(ACS_NamedExecuteWithResult("vs_step"), "See")
			loop
		Spawn:
			WRAT A 2
		See:
			WRAT A 3 A_JumpIf(ACS_NamedExecutewithResult("ghost_getSeenCount") > 0,"Seen")
			WRAT A 0 ACS_NamedExecuteWithResult("vs_step")
			goto See
		Seen:
			WRAT A 0
			WRAT A 0 ACS_NamedExecuteWithResult("vs_disableControl")
			WRAT A 0 A_Stop
			WRAT A 0 A_FaceTarget
		Seen2:
			WRAT A 35 A_Stop
			WRAT A 1 A_JumpIf(ACS_NamedExecutewithResult("ghost_getSeenCount") > 0,"Seen")
			WRAT A 0
			WRAT A 0 ACS_NamedExecuteWithResult("vs_enableControl")
			goto See
		Pain:
			WRAT A 0
			goto Seen
		Pain.Fire:
			WRAT A 1
			WRAT A 1 ACS_ExecuteWithResult(607)
			goto Seen
	}
}


actor Slenderclaus : Slenderman {

}