actor LostSoulRB : LostSoul replaces LostSoul
{
	Speed 8
	Obituary "%o was spooked by a running lost soul."
	RenderStyle Normal
	-FLOAT
	-NOGRAVITY
	BounceSound "runball/footstep"
	WallBounceSound "runball/jump"
	states
	{
		Spawn:
		Idle:
			SKRN UVW 5 Bright A_LookEx(0, 0, 0, 0, 0, "SeeLoop")
			loop
		Jump:
			SKRN QR 4 Bright A_JumpIf(velz <= 0, "Fall")
			loop
		Fall:
			SKRN ST 4 Bright A_CheckFloor("See")
			loop
		See:
			TNT1 A 0 A_CheckFloor("Land")
			goto Jump
		Land:
			TNT1 A 0 ACS_NamedExecuteAlways("PlayRunBallLandingSound", 0)
			SKRN U 4 Bright A_Stop
			SKRN VW 4 Bright
		SeeLoop:
			SKRN ABCDEFGH 2 Bright A_Chase
			TNT1 A 0 ACS_NamedExecuteAlways("PlayRunBallFootstepSound", 0)
			SKRN IJKLMNOP 2 Bright A_Chase
			TNT1 A 0 ACS_NamedExecuteAlways("PlayRunBallFootstepSound", 0)
			loop
		Pain:
			SKRN X 3 Bright
			SKRN X 3 Bright A_Pain
			goto SeeLoop
		Missile:
			SKRN UVW 4 Bright A_FaceTarget
			TNT1 A 0 Bright A_SkullAttack(random(16, 24))
			TNT1 A 0 A_CheckFloor("MissileJump")
			goto Jump
		MissileJump:
			TNT1 A 0 ThrustThingZ(0, random(16, 32), 0, 1)
			goto Jump
		Death:
			SKRD A 6 Bright
			SKRD B 6 Bright A_Scream
			SKRD C 6 Bright
			SKRD D 6 Bright A_NoBlocking
			SKRD EF 6
			stop
	}
}

actor LostSoulProjectile : LostSoulRB
{
	+NOGRAVITY
	var int user_transformed;
	states
	{
		Spawn:
			SKUL CD 4 Bright A_Jump(4, "StopFly")
			loop
		See:
			TNT1 A 0 A_JumpIf(user_transformed == 0, "Transform")
			goto super::See
		StopFly:
			TNT1 A -1 A_Stop
			stop
		Transform:
			TNT1 A 0 A_SetUserVar("user_transformed", 1)
			TNT1 A 0 A_Gravity
			TNT1 A 0 ACS_NamedExecuteWithResult("LostSoulTransform")
			goto super::See
		Death:
			TNT1 A 0 A_JumpIf(user_transformed == 0, "DeathUntransformed")
			goto super::Death
		DeathUntransformed:
			SKUL F 6 Bright
			SKUL G 6 Bright A_Scream
			SKUL H 6 Bright
			SKUL I 6 Bright A_NoBlocking
			SKUL JK 6
			Stop
	}
}
