ACTOR SSTAbaddon : Abaddon replaces Abaddon
{
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", 5

seesound "cracko/see"
activesound "abaddon/active"
painsound "cracko/pain"
  SpawnID 220
  Health 1200
  Speed 8
  PainChance 8//20
  dropitem "CellPack" 48, 50
  dropitem "Soulsphere"
  Obituary "%o was cast down by an abaddon." // "%o was smitten by an abaddon."
  HitObituary "$OB_ABADDON_MELEE" // "%o became food for an abaddon."
  +QUICKTORETALIATE
  +MISSILEEVENMORE
  +BOSS
	+FORCEXYBILLBOARD
  States
  {
  
    Crush:
	TNT1 A 0 A_SpawnItemEx ("Gibs", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
	TNT1 AAAAAAAA 0 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    TNT1 AAAAAAAA 1 A_SpawnItemEx ("Bloodsquirt3", 0,0,0, 0,0,0, random(-180,180), SXF_USEBLOODCOLOR|SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
    TNT1 A -1
    Stop
  Spawn:
    HED3 A 10 A_Look
    HED3 A 0 A_ChangeVelocity(0,0,0,CVF_REPLACE)
    Loop
  See:
	TNT1 A 0 A_JumpIfTargetInLOS (1)
	Goto See1
	HED3 A 0 A_JumpIfCloser(400,"Weave")
  See1:
    HED3 A 0 A_ChangeVelocity(0,0,0,CVF_REPLACE)
    HED3 A 2 A_Chase
	Loop
  See2:
    HED3 A 0 A_Chase
    HED3 A 3 A_FaceTarget 
    Goto See
  Weave:
	//HED3 A 0 A_Jump(176,"See2")
    HED3 A 0 A_ChangeVelocity(random(-4,4),random(-4,4),random(0,1),CVF_REPLACE)
	HED3 A 0 A_FaceTarget
	HED3 A 0 A_Recoil(-5)
	HED3 A 0 A_Jump(16,1)
	Goto See2
	HED3 A 0 A_ActiveSound
	Goto See2
  Pain:
    HED3 E 3
    HED3 E 3 A_Pain
    HED3 F 6
    Goto See
  Missile:
	HED3 A 0 A_ScaleVelocity(0.75)
    HED3 BC 5 A_FaceTarget
    HED3 C 0 A_Jump(64, "MissileB")
    HED3 D 5 Bright A_BasicAttack (8, "None", "AbaddonBall", 32)
	HED3 A 0 A_Jump(64,"See")
	HED3 A 0 A_ScaleVelocity(0.75)
    HED3 BC 5 A_FaceTarget
    HED3 C 0 A_Jump(24, "MissileB")
    HED3 D 5 Bright A_BasicAttack (8, "None", "AbaddonBall", 32)
    Goto See
  MissileB:
      HED3 B 0 bright A_CustomMissile("CrackodemonBall", 28, 0, 0, 1)
      HED3 B 0 bright A_CustomMissile("CrackodemonBall", 28, 0, -8, 1)
      HED3 D 5 bright A_CustomMissile("CrackodemonBall", 28, 0, 8, 1)
	Goto See
  Death.Plasma:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	goto Death
 Death:
   HED3 G 4 A_SetSolid
   HED3 G 4 //A_SetShootable
   HED3 H 8 A_Scream
 Falling:
   HED3 H 1
    HED3 H 0 A_JumpIf(waterlevel == 3, "Crash")
    HED3 H 0 A_JumpIf(waterlevel == 2, "Crash")
    //HED3 H 0 A_JumpIf(waterlevel == 1, "Crash")
   Loop
 Crash:
   HED3 I 4 A_PlaySound ("cacodemon/splat")
   HED3 J 4
   HED3 K 2 A_NoBlocking
   HED3 K 1 A_UnsetSolid
   HED3 K 1 A_UnSetShootable
   HED3 L 1 A_SetFloorClip
   HED3 M 5
   HED3 N 6
   HED3 O 7
   HED3 P 8
   HED3 Q -1
   stop
 Raise:
   HED3 L 8 A_UnSetFloorClip
   HED3 KJIHG 8
   goto See
  Pain.GreenPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 0,0,0)
	Goto See
  Pain.BluePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 1,0,0)
	Goto See
  Pain.RedPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 2,0,0)
	Goto See
  Pain.OrangePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 3,0,0)
	Goto See
  Pain.PurplePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 4,0,0)
	Goto See
  Pain.WhitePaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 5,0,0)
	Goto See
  Pain.YellowPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 6,0,0)
	Goto See
  Pain.BlackPaint:
    TNT1 A 0 ACS_ExecuteAlways(926,0, 7,0,0)
	Goto See
  }
}
ACTOR SSTAbaddonBall : AbaddonBall replaces AbaddonBall
{
  SpawnID 221
  Radius 6
  Height 8
  Speed 20
  Damage 10
  Projectile
  +RANDOMIZE
	+FORCEXYBILLBOARD
  RenderStyle Add
  SeeSound "caco/attack"
  DeathSound "caco/shotx"
  damagetype "fire"
  States
  {
  Spawn:
    BAL3 A 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail1", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL3 A 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail2", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL3 A 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail3", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL3 A 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail4", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL3 B 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail1", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL3 B 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail2", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL3 B 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail3", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    BAL3 B 1 bright
	NULL AAA 0 A_SpawnItemEx ("CacodemonBallTrail4", 0, random(-4,4), random(-4,4), velx/random(3,5), vely/random(3,5), velz/random(3,5), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE) 
	NULL AAA 0 A_SpawnItemEx ("CacoBallCrackleSpawner", 0, random(-1,1), random(-1,1), 0, 0, 0, 0, 160) 
    loop
  Death:
	NULL A 0 A_SpawnItemEx ("RedParticleShroom", 0,0,0, 0,0,0, 0, 160) 
    BAL3 CDE 6 Bright
    Stop
  }
}

Actor CrackodemonBall
{
    Radius 8
    Height 6
    Speed 21//15
    Damage 10
        PROJECTILE
	+FORCEXYBILLBOARD
	RENDERSTYLE ADD
	ALPHA 0.8
	SeeSound "Crack/see"
	DeathSound "Crack/death"
	Damagetype "Plasma"
	States
	{
	Spawn:
	   BAL9 AAAABBBB 1 BRIGHT A_SpawnItemEx("CrackoBallTrail", 0, 0, 0, 0, 0, 0, 0, 128)
	   Loop
	Death:
	   TNT1 A 0 bright A_SpawnItemEx("purpleflare", 0,0,0, 0,0,0, 0, 160)
	   NULL AAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 
	   BAL9 CDE 6 BRIGHT A_Fadeout(0.2)
	   Stop
	}
}

Actor CrackoBallTrail
{
    Radius 1
    Height 1
    +NOCLIP
    +NOGRAVITY
    +FLOAT
	+FORCEXYBILLBOARD
    Renderstyle ADD
    Alpha 0.5
    States
    {
    Spawn:
    BAL9 A 0
    BAL9 A 0 Thing_ChangeTID (0, 1330) 
        BAL9 AABB 1 Bright A_FadeOut (0.04)
        loop
    }
}
