actor SSTLostSoul : LostSoul replaces LostSoul
{
damagefactor "RedPaint", 0.3
damagefactor "OrangePaint", 0.3
damagefactor "YellowPaint", 0.3
damagefactor "GreenPaint", 0.3
damagefactor "BluePaint", 0.3
damagefactor "PurplePaint", 0.3
damagefactor "WhitePaint", 0.3
damagefactor "BlackPaint", 0.3
  PainChance "ShotgunWeak", 64
	+FORCEXYBILLBOARD

  Game Doom
  spawnid 110
  obituary "%o was spooked by a lost soul."
  health 80
  radius 16
  height 56
  mass 50
  speed 8
  damage 2
  painchance 256
  renderstyle SoulTrans
  seesound "skull/melee"
  attacksound "skull/melee"
  painsound "skull/pain"
  deathsound "skull/death"
  activesound "skull/active"
  MONSTER
  +FLOAT
  +NOGRAVITY
  +NOICEDEATH
  +MISSILEMORE
  +DONTFALL
  -NOBLOOD
  +SPAWNFLOAT
  +VISIBILITYPULSE
  //+ROCKETTRAIL
  +DONTHURTSPECIES
  BloodType "SkullPuff"
   bloodcolor "FF 22 00"
   +NOBLOODDECALS
  Species LostSoul
  //-MISSILEMORE 
  //-MISSILEEVENMORE 
  +FIREDAMAGE
  states
  {
  Spawn:
	SKUL C 0 A_ChangeFlag ("ROCKETTRAIL", 0)
    SKUL AB 10 bright A_Look
    loop
  See:
	SKUL C 0 A_ChangeFlag ("ROCKETTRAIL", 0)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    SKUL A 0 bright A_Chase
    SKUL A 1 bright A_SpawnItemEx ("SoulTrail", random(-80,40)*0.1, 0, random(230,270)*0.1, 0,0,random(0,3), 0, 160)
    SKUL A 1 bright A_SpawnItemEx ("SoulTrail", random(-40,80)*0.1, 0, random(230,270)*0.1, 0,0,random(0,3), 0, 160)
    SKUL A 1 bright A_SpawnItemEx ("SoulTrail", random(-40,80)*0.1, 0, random(230,270)*0.1, 0,0,random(0,3), 0, 160)
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    SKUL A 0 bright A_Chase
    SKUL B 1 bright A_SpawnItemEx ("SoulTrail", random(-80,40)*0.1, 0, random(230,270)*0.1, 0,0,random(0,4), 0, 160)
    SKUL B 1 bright A_SpawnItemEx ("SoulTrail", random(-40,80)*0.1, 0, random(230,270)*0.1, 0,0,random(0,4), 0, 160)
    SKUL B 1 bright A_SpawnItemEx ("SoulTrail", random(-40,80)*0.1, 0, random(230,270)*0.1, 0,0,random(0,4), 0, 160)
    loop
  Missile:
    SKUL A 0 A_Jump(32, "See")
    SKUL C 10 bright A_FaceTarget
	SKUL C 0 A_ChangeFlag ("ROCKETTRAIL", 1)
    SKUL D 0 bright A_SkullAttack
    BAL1 A 0 A_JumpIf(waterlevel > 1, "WaterDeath")
    SKUL C 1 bright A_SpawnItemEx ("SoulTrail", random(-40,20)*0.1, 0, random(230,270)*0.1, 0,0,random(0,3), 0, 160)
    SKUL C 1 bright A_SpawnItemEx ("SoulTrail", random(-20,40)*0.1, 0, random(230,270)*0.1, 0,0,random(0,3), 0, 160)
    SKUL D 1 bright A_SpawnItemEx ("SoulTrail", random(-40,20)*0.1, 0, random(230,270)*0.1, 0,0,random(0,3), 0, 160)
    SKUL D 1 bright A_SpawnItemEx ("SoulTrail", random(-20,40)*0.1, 0, random(230,270)*0.1, 0,0,random(0,3), 0, 160)
    goto Missile+4
  Pain:
	SKUL C 0 A_ChangeFlag ("ROCKETTRAIL", 0)
    SKUL E 3 bright
    SKUL E 3 bright A_Pain
    goto See
  WaterDeath:
  	SKUL AAAAA 0 A_SpawnItemEx ("UnderwaterSteam", 0,0,random(0,40), random(-1,1),random(-3,3),random(0,2), 0, 160, 64)  
	SKUL A 0 A_Playsound("flesh/fry",CHAN_5)
    SKUL A 0 A_Die
	Goto Death
  Death:
	SKUL C 0 A_ChangeFlag ("ROCKETTRAIL", 0)
    SKUL F 6 bright
    SKUL G 6 bright A_Scream
    SKUL H 6 bright
	NULL A 0 A_SpawnItemEx ("SoulDeathEffectSpawner", 0,0,25, 0,0,0, 0, 160) 
	NULL A 0 A_SpawnItemEx ("SoulDebrisSpawner", 0,0,25, 0,0,0, 0, 160) 
    SKUL I 6 bright A_NoBlocking
    SKUL JK 6
    stop
	  Pain.GreenPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 0,0,0)
	Goto Pain
  Pain.BluePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 1,0,0)
	Goto Pain
  Pain.RedPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 2,0,0)
	Goto Pain
  Pain.OrangePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 3,0,0)
	Goto Pain
  Pain.PurplePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 4,0,0)
	Goto Pain
  Pain.WhitePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 5,0,0)
	Goto Pain
  Pain.YellowPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 6,0,0)
	Goto Pain
  Pain.BlackPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	Goto Pain
  }
}
actor SoulTrail
{
  Radius 1
  Height 1
  Speed 0
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
  +NOGRAVITY
  +NOBLOCKMAP
  -SOLID
  -SHOOTABLE
  RenderStyle Add
  Alpha 0.85
  scale 0.6
  States
  {
  Spawn:
    BAL1 A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    BAL1 A 0 A_CheckSight("Spawn2") 
    BAL1 CCCCDDDDEEEE 1 bright A_FadeOut(0.02)
    stop
	Spawn2:
		NULL A 0
		stop
  }
}

ACTOR SoulDeathEffectSpawner
{
  Radius 1
  Height 1
  Speed 0
  PROJECTILE
  +NOBLOCKMAP
  +NOTELEPORT
  +NOGRAVITY
  +NOCLIP
  -SOLID
  -SHOOTABLE
  RENDERSTYLE NONE
  States
  {
  Spawn:
    TNT1 A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
      TNT1 AAAAAAAAAA 0 Bright A_CustomMissile("SoulDeathEffect2",0,0,random(-180,180),2,random(-90,90))
      TNT1 AAA 1 Bright A_CustomMissile("SoulDeathEffect1",0,0,random(-180,180),2,random(-90,90))
      TNT1 AAA 2 Bright A_CustomMissile("SoulDeathEffect1",0,0,random(-180,180),2,random(-90,90))
      TNT1 AAA 3 Bright A_CustomMissile("SoulDeathEffect1",0,0,random(-180,180),2,random(-90,90))
      Stop
  }
}

ACTOR SoulDeathEffect1 : SoulTrail
{
  Radius 1
  Height 1
  Speed 2
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
  RenderStyle Add
  Alpha 0.85
  scale 0.6
  States
  {
  Spawn:
    BAL1 CCCCDDDDEEEE 1 bright A_FadeOut(0.02)
    stop
  }
}

ACTOR SoulDeathEffect2 : SoulDeathEffect1
{
  Radius 1
  Height 1
  Speed 3
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
  RenderStyle Add
  Alpha 0.85
  scale 0.7
  States
  {
  Spawn:
    BAL1 CCCCDDDDEEEE 1 bright A_FadeOut(0.02)
    stop
  }
}
actor SoulDebrisSpawner
{
 renderstyle NONE
 +NOGRAVITY
 States
 {
  Spawn:
  NULL A 0
  NULL A 0 A_SpawnDebris("soulchips",1)
  NULL A 0 A_SpawnDebris("soulhorn",1)
  Stop
 }
}

Actor SoulChips // Soul Chips: They're delicious! Now with 15% more demonic life force!
{
    Radius 1
    Height 1
    Speed  3
    Damage 0
	scale 0.75
    Health 5
    RenderStyle Translucent
    Alpha 1.0
    PROJECTILE
    -NOGRAVITY
    +HEXENBOUNCE
    +DONTSPLASH
    -ACTIVATEPCROSS
    -ACTIVATEIMPACT
    +RANDOMIZE
	bouncefactor 0.5
    States
    {
    Spawn:
    	NULL A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	NULL A 0 A_Jump(128,"Spawn2")
    Spawn1:
    	LSF1 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF1 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn1a:
    	LSF1 A 1 A_Fadeout(0.01)
		loop
    Spawn2:
    	LSF2 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF2 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn2a:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF2 A 1 A_Fadeout(0.01)
		loop
    }
}  
Actor SoulHorn
{
    Radius 1
    Height 1
    Speed  3
    Damage 0
    Health 1
    RenderStyle Translucent
    Alpha 1.0
    PROJECTILE
    -NOGRAVITY
    +HEXENBOUNCE
    +DONTSPLASH
    -ACTIVATEPCROSS
    -ACTIVATEIMPACT
    +RANDOMIZE
	bouncefactor 0.5
    States
    {
    Spawn:
    	NULL A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	NULL A 0 A_Jump(128,"Spawn1a")
    Spawn1:
    	LSF3 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF3 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF3 A 350
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    Spawn1a:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	LSF3 A 1 A_Fadeout(0.01)
		loop
    }
}

// i put the barrel stuff here cuz i'm lazy and crazy:

ACTOR BarrelDeathEffect1 : SoulTrail
{
  Radius 1
  Height 1
  Speed 2
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
  RenderStyle Add
  Alpha 0.85
  scale 0.6
  States
  {
  Spawn:
    MISL BBBBCCCCDDDD 1 bright A_FadeOut(0.02)
    stop
  }
}
ACTOR BarrelDeathEffect2 : SoulDeathEffect1
{
  Radius 1
  Height 1
  Speed 3
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
  RenderStyle Add
  Alpha 0.85
  scale 0.7
  States
  {
  Spawn:
    MISL BBBBCCCCDDDD 1 bright A_FadeOut(0.02)
    stop
  }
}
ACTOR BarrelDeathEffectSpawner
{
  Radius 1
  Height 1
  Speed 0
  PROJECTILE
  +NOBLOCKMAP
  +NOTELEPORT
  +NOGRAVITY
  +NOCLIP
  -SOLID
  -SHOOTABLE
  RENDERSTYLE NONE
  States
  {
  Spawn:
    TNT1 A 0
      TNT1 AAAAAAAAAA 0 Bright A_CustomMissile("BarrelDeathEffect2",0,0,random(-180,180),2,random(-90,90))
      TNT1 AAA 1 Bright A_CustomMissile("BarrelDeathEffect1",0,0,random(-180,180),2,random(-90,90))
      TNT1 AAA 2 Bright A_CustomMissile("BarrelDeathEffect1",0,0,random(-180,180),2,random(-90,90))
      TNT1 AAA 3 Bright A_CustomMissile("BarrelDeathEffect1",0,0,random(-180,180),2,random(-90,90))
      Stop
  }
}
actor SkullPuff
{
  +NOBLOCKMAP
  +NOGRAVITY
  -ALLOWPARTICLES
  -RANDOMIZE
  +DONTSPLASH
  RenderStyle Add
  Alpha 1.0
  VSpeed 0
  Scale 0.25
  Mass 5
  States
  {
  Spawn:
	FIR3 A 1 bright
    TNT1 A 0 A_Playsound("lostsoul/blood")
	NULL A 0 A_SpawnItemEx ("PuffEffectSpawner", 0,0,0, 0,0,0, 0, 160) 
    TNT1 A 0 A_Jump(127,"Fast")
    FIR3 ABCDEFGHI 3 bright A_Fadeout(0.1)
    stop
  Fast:
    FIR3 ABCDEFGHI 2 bright A_Fadeout(0.1)
    stop
  }
}