ACTOR TorturedSoul 27212
{ 
Health 1000
Speed 8 
Radius 31 
Height 56 
PainChance 60
Mass 400 
PainChance "Souls", 0
PainChance "ChaosSoul", 0
DamageFactor "CurseComet", 0.0
DamageFactor "HelementalComet", 0.0
DamageFactor "SoulToxic", 0.0
DamageFactor "BombBreath", 0.0
Damagefactor "Acid", 0.0
DropItem "BossLifeEssence" 200 25
DropItem "BossArmorBonusMax" 200 1
//DropItem "AcidAmmoBundle" 80 50
//DropItem "AcidAmmo" 180 7
BloodColor "Red"
Tag "$NETortSoul"
+DONTHURTSPECIES
+MISSILEMORE
+NOGRAVITY 
+FLOAT
+QUICKTORETALIATE
SeeSound "torturedsoul/sight" 
PainSound "torturedsoul/pain" 
DeathSound "torturedsoul/death" 
ActiveSound "torturedsoul/active" 
Species "EleSouls"
Obituary "%o was tormented by the Tortured Soul."
MONSTER  
var int user_lowlag;
States 
{ 
   Spawn: 
	TNT1 A 0 NoDelay ACS_NamedExecuteAlways("ModifyMonster",0,1)
	Goto Idle
  Idle:
      TORT AA 10 A_Look 
      Loop 
  See:
	TNT1 A 0 A_JumpIf(user_lowlag == 1,"MoreSee")
	TNT1 A 0 A_JumpIfTargetInLOS("MoreSee",0,0,0,0)
	TORT ABC 2 A_Chase
	Loop
  MoreSee:
	TNT1 A 0 A_SetUserVar("user_lowlag",1)
      TORT AABBCC 2 A_Chase 
	  TNT1 A 0 A_Jump(22,"Evade")
      Loop 
   Evade:
	 TNT1 A 0 A_Jump(128,7)
	 TNT1 A 0 ThrustThing(Angle*256/360+64,14,0,0)
	 TORT ABCA 3 A_Chase
	 TNT1 A 0 A_Stop
	 Goto See
	 TNT1 A 0 ThrustThing(Angle*256/360+192,14,0,0)		 
	 TORT ABCA 3 A_Chase
	 TNT1 A 0 A_Stop		 
	 Goto See
   Missile:
     TNT1 A 0 A_JumpIfCloser(450,"ToxicBreath")
	 TNT1 A 0 A_Jump(138,"PoisonComet","Laser","LaunchSouls")
   Normal:
      TORT DE 3 Bright A_FaceTarget 
      TORT F 3 Bright A_CustomMissile("TorturedSoulCometFast",38,0,0)
	  TNT1 A 0 A_Jump(90,"PoisonComet","Laser")
      Goto See
   PoisonComet:
      TORT DE 3 Bright A_FaceTarget 
	  TORT F 0 A_CustomMissile("TorturedSoulComet",38,0,-5)
	  TORT F 0 A_CustomMissile("TorturedSoulComet",38,0,5)
      TORT F 3 Bright A_CustomMissile("TorturedSoulComet",38,0,0)
	  TNT1 A 0 A_Jump(90,"LaunchSouls")
      Goto See
   LaunchSouls:
      TORT DE 3 Bright A_FaceTarget 
      TNT1 A 0 A_CustomMissile("TorturedSoulSeeker",30,0,0)
      Goto See	 	  
   ToxicBreath:
      TORT A 3 Bright A_FaceTarget 
	  TNT1 A 0 A_PlaySound("monster/psoattack")
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  TORT AAA 0 A_CustomMissile("ToxicEleBreath",10,0,Random(18,-18))
	  TORT A 3 Bright A_FaceTarget
	  Goto See
   Laser:
	  TORT DDDDEEEE 1 A_FaceTarget
	  TORT F 1 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("TorturedSoulLaser",30,0,0)
	  TORT F 1 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("TorturedSoulLaser",30,0,0)
	  TORT F 1 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("TorturedSoulLaser",30,0,0)
	  TORT F 1 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("TorturedSoulLaser",30,0,0)
	  TORT F 1 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("TorturedSoulLaser",30,0,0)
	  TORT F 1 A_FaceTarget
	  TNT1 A 0 A_CustomMissile("TorturedSoulLaser",30,0,0)
	  TORT FD 4
	  GoTo See
   Pain: 
      TORT G 3 
      TORT G 3 A_Pain
	  TNT1 A 0 A_Jump(128,"PainMissile")
      Goto See 
	PainMissile:
	  TORT G 3 Bright A_Pain
	  Goto Missile	
   Death: 
      TORT H 5 
      TORT I 5 Bright A_Scream 
      TORT J 5 Bright A_NoBlocking 
	  TNT1 A 0 A_SetTranslucent(0.75,1)
      TNT1 A 0 A_SpawnItemEx("TorturedSoulGoreGenerator",0,0,0,0,0,0,0,128,0)
	  TNT1 AAAA 0 A_SpawnItemEx("GreenParticleSpawner", 0, 0, random(20,40), 0, 0, 0, 0, 128)
	  TNT1 AAAA 0 A_CustomMissile("SmokeFX2", random(20,40), 0, random(0,360), 2, random(0,360))
	  TNT1 AAAA 0 A_CustomMissile("Kaboom4", random(20,40), 0, random(0,360), 2, random(0,360))
	  TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("PoisonEleBreath",0,0,10,Random(10,-10),Random(10,-10),Random(6,-6))
	  TORT K 5 Bright A_PainDie("PoisonSoul")
	  TORT M 5 Bright
      TORT N 5 Bright
      Stop
   } 
}

ACTOR TorturedSoulComet : Comet
{
Damage 6
ExplosionDamage 42
Species "EleSouls"
DamageType "SoulToxic"
MissileType ""
DeathSound "barbcomet/explosion"
States
{
Spawn:
BRTB AAABBB 1 Bright A_SpawnItemEx("BarbCometTail", 0, 0, 0, 0, 0, 0, 0, 128)
Loop
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("GreenParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
TNT1 AAA 0 A_CustomMissile("SmokeFX2", 0, 0, random(0,360), 2, random(0,360))
TNT1 AAA 0 A_CustomMissile("Kaboom13", 0, 0, random(0,360), random(2,3), random(0,360))
BRTB C 3 Bright A_Explode
BRTB D 3 Bright A_SetTranslucent(0.75,1)
TNT1 AAAAA 0 A_SpawnItemEx("NexusTorturedSoulPoison",0,0,10,Random(4,-4),Random(4,-4),Random(4,-2))
BRTB EFG 3 Bright
Stop
}
}

ACTOR TorturedSoulCometFast : TorturedSoulComet
{
Speed 42
}

ACTOR NexusTorturedSoulPoison : PoisonEleBreath
{ 
	Scale 0.7
	Speed 10
	Species "EleSouls"
	DamageType "SoulToxic"
    States 
    { 
    Spawn: 
        TRPS ABCDEFGDFEGDF 3 A_Explode(6,68)
    Death: 
		TRPS CCBBAA 1 A_FadeOut(0.15)
        Stop 
		}
}


ACTOR ToxicEleBreath : PoisonEleBreath
{ 
	Speed 19
	Species "EleSouls"
	DamageType "SoulToxic"
    States 
    { 
    Spawn: 
        TRPS AABBCDEFGDFEG 3 A_Explode(6,68)
    Death: 
		TRPS CCBBAA 1 A_FadeOut(0.15)
        Stop 
		} 
}

Actor TorturedSoulLaser : CacoLichLaser
{
	Species "EleSouls"
	DamageType "SoulToxic"
}

ACTOR TorturedSoulSeeker
{
    Radius 8
    Height 6
    Speed 17
    Damage 12
	ExplosionDamage 30
	PROJECTILE
	+SEEKERMISSILE
	RENDERSTYLE ADD
	Alpha 0.8
	Scale 1.1
	SeeSound "Imp/attack"
	DeathSound "Imp/shotx"
	Decal CacoScorch
	States
	{
	Spawn:
	   CB4L AB 4 Bright BRIGHT A_SeekerMissile(5,15)
	   TNT1 A 0 BRIGHT A_SpawnItemEx("WatcherBallTrail",0,0,2,0,0,0,0,128,0)
	   Loop
	Death:
	   TNT1 A 0 A_SpawnItemEx("GreenParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
	   TNT1 AAA 0 A_CustomMissile("Kaboom7", 0, 0, random(0,360), 2, random(0,360))
	   TNT1 AAA 0 A_CustomMissile("SmokeFX4", 0, 0, random(0,360), 2, random(0,360))	
	   CB4L C 3 Bright A_Explode
	   CB4L D 3 Bright A_SetTranslucent(0.75,1)
	   TNT1 AAA 0 A_SpawnItemEx("NexusTorturedSoulPoison",0,0,10,Random(4,-4),Random(4,-4),Random(4,-2))
	   CB4L EFG 6 BRIGHT
	   Stop
	}
}

ACTOR TorturedSoulGoreGenerator : GibbedGenerator
{ 
States 
{ 
Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("CheckVanilla") == 1, "Vanilla")
	TNT1 A 0 A_Jump(128,"Alternate")
	TNT1 AA 0 A_CustomMissile("RedBloodCloud", random(25,50), 0, random(0,360), 2, random(0,360))
	TNT1 AAAAAA 0 A_SpawnItemEx("NewFlyingBlood",0,0,Random(25,50),Random(6,-6),Random(6,-6),Random(4,6))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart1",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart2",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("BodyPart1",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 2 A_SpawnItemEx("BodyPart2",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 AA 0 A_CustomMissile("RedBloodCloud", random(25,50), 0, random(0,360), 2, random(0,360))
	TNT1 AAAAAA 0 A_SpawnItemEx("NewFlyingBlood",0,0,Random(25,50),Random(6,-6),Random(6,-6),Random(4,6))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart2",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart1",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("BodyPart3",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 1 A_SpawnItemEx("BodyPart4",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	Stop
Alternate:
	TNT1 A 0
	TNT1 AA 0 A_CustomMissile("RedBloodCloud", random(25,50), 0, random(0,360), 2, random(0,360))
	TNT1 AAAAAA 0 A_SpawnItemEx("NewFlyingBlood",0,0,Random(25,50),Random(6,-6),Random(6,-6),Random(4,6))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart1",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart2",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("BodyPart5",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 2 A_SpawnItemEx("BodyPart6",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 AA 0 A_CustomMissile("RedBloodCloud", random(25,50), 0, random(0,360), 2, random(0,360))
	TNT1 AAAAAA 0 A_SpawnItemEx("NewFlyingBlood",0,0,Random(25,50),Random(6,-6),Random(6,-6),Random(4,6))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart2",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("TorturedSoulPart1",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 0 A_SpawnItemEx("BodyPart7",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	TNT1 A 1 A_SpawnItemEx("BodyPart8",0,0,Random(25,50),Random(10,-10),Random(10,-10),Random(8,10))
	Stop
	}
}

ACTOR TorturedSoulPart1 : CacoPart1
{
States
{
Spawn:
TOP2 AABBCCDDEEFFGG 2 A_SpawnItemEx("RedGibTrail", 0, 0, 0, Random(-1,1), Random(-1,1), Random(-1,1), 0, 128)
Loop
Death:
Crash:
TOP2 H 150
TOP2 H 5 A_FadeOut(0.10)
Goto Death+1
}
}

ACTOR TorturedSoulPart2 : WatcherPart1
{
States
{
Spawn:
TOP1 AABBCCDD 2 A_SpawnItemEx("RedGibTrail", 0, 0, 0, Random(-1,1), Random(-1,1), Random(-1,1), 0, 128)
Loop
Death:
Crash:
TOP1 E 150
TOP1 E 5 A_FadeOut(0.10)
Goto Death+1
}
}