


Actor Gibs_General
{
radius 1
height 1
mass 1
damage 0
+MISSILE
+NOBLOCKMAP
+CLIENTSIDEONLY
+NOGRAVITY
+DROPOFF
+NOTELEPORT
+FORCEXYBILLBOARD
+NOTDMATCH
+GHOST
radius 1
height 1
mass 1
damage 0
}

//===========================================================================
//
// Lost Soul
//
//===========================================================================
ACTOR TehLostSoul: LostSoul Replaces LostSoul
{
	Game Doom
	Health 100
	Radius 16
	Height 46
	Mass 50
	Speed 12
	DeathHeight 4
	BurnHeight 0
	Damage (random(15,15))
	PainChance 255
	PainChance "Kick", 255
	damagefactor "GibRemoving", 0.0 damagefactor "HangingHook", 0
	PainChance "Avoid", 255
	damagefactor "Fire", 0 damagefactor "sAW", 4.0 damagefactor "Cut", 4.0
	Monster
    +NOBLOOD
	damagefactor "Blood", 0.0 damagefactor "BlueBlood", 0.0 damagefactor "GreenBlood", 0.0
    damagefactor "Fatality", 5.0 damagefactor "PussyGrab", 50.0
	damagefactor "TeleportRemover", 0.0
	DamageFactor "CauseSplash", 0.0 DamageFactor "CauseObjectsToSplashSlime", 0.0 DamageFactor "CauseObjectsToSplashNukage", 0.0
	DamageFactor "CauseObjectsToSplashBlood", 0.0 DamageFactor "CauseObjectsToSplashLava", 0.0
	RenderStyle Normal
    // bloodcolor none
	+FLOAT +NOGRAVITY +DONTFALL +NOICEDEATH
	+FORCEXYBILLBOARD
	AttackSound "skull/melee"
	PainSound "skull/pain"
	DeathSound "LSOD"
	ActiveSound "skull/active"
	Obituary "$OB_SKULL"
	//MinMissileChance 50
	BloodType "LostSoulBlood"
	damagefactor "ExplosiveImpact", 3.0
	damagefactor "Shrapnel", 3.0
	damagefactor "Explosives", 3.0
	Tag "Lost Soul"
    Alpha 1
	States
	{
	Pain.Avoid: 
	  TNT1 A 0
	  TNT1 A 0 A_Jump(255, "AvoidLeft", "AvoidRight")
	  Goto AvoidLeft
	  AvoidLeft:
	    LSOL B 1 A_FaceTarget
	    TNT1 A 0 ThrustThing(angle*256/360+192, 15, 0, 0)
        LSOL B 5 A_FaceTarget
        Goto Missile
	AvoidRight:
	    LSOL B 1 A_FaceTarget
	    TNT1 A 0 ThrustThing(angle*256/360+64, 15, 0, 0)
        LSOL B 5 A_FaceTarget
        Goto Missile
		
	Spawn:
		LSOL A 0
		TNT1 A 0 A_CheckSight("Spawn2")
		LSOL A 2 BRIGHT A_Look
		TNT1 A 0 A_SpawnItem ("RedFlareMedium", 0, 24)
		LSOL AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		Loop
		
    Spawn2:
		LSOZ AAAAAAAA 10 A_Look
		TNT1 A 0 A_CheckSight("Spawn2")
		Goto Spawn
	See:
	    TNT1 A 0
		TNT1 A 0 A_TakeInventory("MaxLostSoulRange", 30)
		LSOL A 2 BRIGHT A_Chase("", "")
		TNT1 A 0 A_JumpIfCloser(160, "Retreat")
		TNT1 A 0 A_ChangeFlag("NOPAIN", 0)
		//LSOL A 0 A_CustomMissile ("CoolAndNewFlameTrailsLongAlpha", 24, 0, random (0, 360), 2, random (0, 160))
		LSOL A 2 BRIGHT A_Chase
		TNT1 A 0 A_JumpIfCloser(160, "Retreat")
	    TNT1 A 0 A_SpawnItem ("RedFlareMedium", 0, 24)
		//LSOL A 0 A_CustomMissile ("CoolAndNewFlameTrailsLongAlpha", 24, 0, random (0, 360), 2, random (0, 160))
        LSOL A 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		Loop
	Retreat:
		LSOL A 1 A_FaceTarget
		TNT1 A 0 A_Recoil(3)
	    TNT1 A 0 A_SpawnItem ("RedFlareMedium", 0, 24)
		//LSOL A 0 A_CustomMissile ("CoolAndNewFlameTrailsLongAlpha", 24, 0, random (0, 360), 2, random (0, 160))
        LSOL A 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
	    Goto See
		
	Missile:
		SKUL A 0 BRIGHT A_SpawnItem ("RedFlare", 0, 24)
		TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
		LSOL B 3 BRIGHT A_FaceTarget
		SKUL A 0 BRIGHT A_SpawnItem ("RedFlare", 0, 24)
		LSOL D 0 BRIGHT A_SkullAttack
        TNT1 A 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		LSOL BB 2 BRIGHT A_SpawnItem ("RedFlareMEdium", 0, 24)
        TNT1 A 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		LSOL BB 2 BRIGHT A_SpawnItem ("RedFlareMEdium", 0, 24)
		TNT1 A 0 A_JumpIfInventory("MaxLostSoulRange", 10, "See")
		TNT1 A 0 A_giveInventory("MaxLostSoulRange", 1)
		Goto Missile+6
	Pain:
        TNT1 AAA 0 A_CustomMissile ("SoulTrails", 12, 0, random (0, 360), 2, random (0, 160))
		LSOL C 3 BRIGHT
        TNT1 A 0 A_Jump (128, 3)
        Goto Avoid
        TNT1 AAA 0
        TNT1 AAA 0 A_CustomMissile ("SoulTrails", 12, 0, random (0, 360), 2, random (0, 160))
		LSOL C 1 BRIGHT A_Pain
		Goto See

	Avoid:
         NULL A 0 A_FaceTarget
         LSOL B 6 A_FastChase
       LSOL AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		SKUL A 0 BRIGHT A_SpawnItem ("RedFlareMedium", 0, 24)

         NULL A 0 A_FaceTarget
         LSOL B 6 BRIGHT A_FastChase
       LSOL AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		SKUL A 0 BRIGHT A_SpawnItem ("RedFlareMedium", 0, 24)

         NULL A 0 A_FaceTarget
         LSOL B 6 BRIGHT A_FastChase
       LSOL AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		SKUL A 0 BRIGHT A_SpawnItem ("RedFlareMedium", 0, 24)

         NULL A 0 A_FaceTarget
         LSOL B 6 BRIGHT A_FastChase
       LSOL AA 0 A_CustomMissile ("SoulTrails", 24, 0, random (0, 360), 2, random (0, 160))
		SKUL A 0 BRIGHT A_SpawnItem ("RedFlareMedium", 0, 24)

		Goto Missile

    //Death.Fatality:
	Death.PussyGrab:
	    TNT1 A 0 A_Pain
	    TNT1 A 0 A_JumpIfIntargetInventory("FistsSelected", 1, 1)
		Goto Death
        TNT1 A 0 A_GiveToTarget("LostSoulFatality", 1)
        TNT1 A 1
        TNT1 A 0
		Stop
	Death:
		LSOL F 4 BRIGHT A_NoBlocking
		TNT1 AAAA 0 A_CustomMissile ("SmallLSPart1", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAA 0 A_CustomMissile ("SmallLSPart3", 0, 0, random (0, 360), 2, random (0, 360))
        TNT1 AAA 0 A_CustomMissile ("CoolAndNewFlameTrailsLong", 12, 0, random (0, 360), 2, random (0, 160))
		LSOL G 0 BRIGHT A_Scream
	    EXPL AA 0 A_SpawnItem("ExplosionParticleSpawner")
	    TNT1 A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,32,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    EXPL AAAAA 0 A_CustomMissile ("FireBallExplosionFlamesMedium", 32, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAA 0 A_CustomMissile ("PlasmaSmoke", 32, 0, random (0, 360), 2, random (0, 360))
       TNT1 AAA 0 A_CustomMissile ("LSpart1", 42, 0, random (0, 360), 2, random (0, 160))
       TNT1 A 0 A_CustomMissile ("LSpart3", 42, 0, random (0, 360), 2, random (0, 160))
       TNT1 AA 0 A_CustomMissile ("LSpart2", 42, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0
        LSOL HI 0
		Stop

    Pain.KillMe:
    Pain.Taunt:
        TNT1 A 0
		TNT1 A 0 HealThing(1)
        Goto Missile
    Death.KillMe:
    Death.Taunt:
	    TNT1 A 0 A_ChangeFlag("SOLID", 0)
        TNT1 A 0 A_SpawnItem("LostSoul")
        Stop
	}
}

////// LOSTSOUL BODY PARTS //////


ACTOR LSPart1
{
    Radius 2
    Height 2
    Speed 7
	Mass 3
	BounceFactor 0.4
	+DOOMBOUNCE
    +NOBLOCKMAP
	+MISSILE
    +NOTELEPORT
    +DONTSPLASH
    +MOVEWITHSECTOR
    +CLIENTSIDEONLY
	+THRUACTORS
    Scale 0.7
    States
    {
    Spawn:
		TNT1 A 0
		
		TNT1 A 0 Thing_ChangeTID(0,394)
		TNT1 A 0 A_Jump(128,9)
		LGI1 ABCDEFGH 2
		wait
		LGI1 HGFEDCBA 2
		wait
	Death:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 A_Jump(128,2)
		LGI1 A 200
		stop
		LGI1 E 200
        Stop
    }
}




actor LSpart2 : LSpart1
{
states
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 Thing_ChangeTID(0,394)
		TNT1 A 0 A_Jump(128,9)
		LGI2 ABCDEFGH 2
		wait
		LGI2 HGFEDCBA 2
		wait
	Death:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 A_Jump(128,2)
		LGI2 A 200
		stop
		LGI2 E 200
        Stop
	}
}

actor LSpart3 : LSpart1
{
states
	{
	spawn:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 Thing_ChangeTID(0,394)
		TNT1 A 0 A_Jump(128,9)
		LGI3 ABCDEFGH 2
		wait
		LGI3 HGFEDCBA 2
		wait
	Death:
		TNT1 A 0
		TNT1 A 0 A_QueueCorpse
		TNT1 A 0 A_Jump(128,2)
		LGI3 A 200
		stop
		LGI3 E 200
        Stop
	}
}

ACTOR SoulTrails
{
	Game Doom
	Radius 1
	Height 1
	Speed 2
	Damage 0 
    +NOBLOCKMAP
    +NOTELEPORT
    +DONTSPLASH
	+MISSILE
	+FORCEXYBILLBOARD
    +CLIENTSIDEONLY
	RenderStyle Add
    DamageType Flames
    Scale 0.5
	Alpha 0.6
	Gravity 0
	States
	{
    Spawn:
        TNT1 A 2 
        FRFX KLMNOP 3 BRIGHT
        Stop
	}
}


ACTOR FireBlood
{
	Radius 6
	Height 8
	States
	{
	Spawn:
	EXPL AAA 0 A_CustomMissile ("FlameTrails", 6, 0, random (0, 360), 2, random (0, 360))
		Stop
	}
}




actor LostSoulBlood : Blood
{
Decal None
 game Doom
+FORCEXYBILLBOARD
+GHOST
+NOBLOCKMAP
+NOGRAVITY
+NOCLIP
-DONTSPLASH
-ALLOWPARTICLES 
Speed 0
 states
 {
  Spawn:
        TNT1 A 0
		TNT1 AAAAAA 0 A_CustomMissile ("SparkXNoModel", 2, 0, random (0, 360), 2, random (0, 360))
		TNT1 AA 0 A_CustomMissile ("SmallLSPart1", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AA 0 A_CustomMissile ("SmallLSPart3", 0, 0, random (0, 360), 2, random (0, 360))
        stop
 }
}


actor SmallLSPart1: LSPart1
{
Scale 0.3
Speed 10
}


actor SmallLSPart3: LSPart1
{
Scale 0.3
Speed 12
}



actor BigLSPart1: LSPart1
{
Scale 1.0
Speed 10
}


actor BigLSPart3: LSPart1
{
Scale 1.0
Speed 12
}

actor BigLSPart2: LSPart1
{
Scale 1.0
Speed 12
}
