actor SSTBaron : BaronOfHell //replaces BaronOfHell
{
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

//dropitem "SSTGrenadeLauncher" 16 //formerly 4, then 8
bloodtype "BaronBlood"//"Onegative"
Bloodcolor "00 AA 00"
  spawnid 3
  seesound "baron/sight"
  painsound "baron/pain"
  deathsound "baron/death"
  activesound "baron/active"
  missiletype "WeakBaronBall"
  MONSTER
  +FLOORCLIP
  +BOSSDEATH
  speed 9
  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:
    BOSS AB 10 A_Look
    loop
  See:
    BOSS AABBCCDD 3 A_Chase
    loop
  Melee:
    BOSS EF 5 A_FaceTarget
    BOSS G 6 A_BruisAttack
	BOSS FE 6 A_FaceTarget
    goto See
  Missile:
    BOSS EF 8 A_FaceTarget
    BOSS G 4 A_ComboAttack
    BOSS G 3 A_ComboAttack
    BOSS G 2 A_ComboAttack 
    goto See
  Pain:
    BOSS H 1
    BOSS H 2 A_Pain
    goto See
  Death.Plasma:
	TNT1 A 0 A_Stop
    TNT1 A 0 ACS_ExecuteAlways(926,0, 10,0,0)
	NULL O 0 A_SpawnItemEx ("PlasmaDeathFX", 0,0,0, momx,momy,momz, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	goto Death
  Death:
    BOSS I 0 A_Jump(128, "DeathB")
    BOSS I 0 A_Jump(56, "DeathC")
    BOSS I 7
    BOSS J 7 A_Scream
    BOSS K 7
    BOSS L 7 A_NoBlocking
    BOSS MN 7
    BOSS O -1 A_BossDeath
    stop
  DeathB:
    BOSS P 6
    BOSS Q 6 A_Scream
    BOSS R 6
    BOSS S 6 A_NoBlocking
    BOSS TU 6
    BOSS V -1 A_BossDeath
    stop
	
  Death.Chainsaw:
  DeathC:
    BOSS I 1
	NULL O 0 A_SpawnItemEx("BaronTorso", 0,0,34, random(-4,4),random(-4,4),random(8,12), 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
    BOS2 I 0 A_Scream
    BBO2 AAAABC 7
    BBO2 D 7 A_NoBlocking
    BBO2 D -1 A_BossDeath
    stop
	
  Death.Rocket:
    BOSS I 1 A_NoBlocking
    TROO H 0 A_SpawnItemEx ("BaronRagdoll", 0,0,34, momx*2,momy*2,4, 0, SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION) 
    BOS2 I 0 //A_Scream
    BBO2 AAAABC 7
    BBO2 D 7
    BBO2 D -1 A_BossDeath
    stop
  Raise:
    BOSS ONMLKJI 7
    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 WeakBaronBall : BaronBall
{
  Speed 18
  FastSpeed 23
  Damage 6
  RenderStyle Add
  Alpha 0.75
  SeeSound "baron/attack"
  DeathSound "baron/shotx"
  Decal "BaronScorch"
  Projectile
  +RANDOMIZE
  damagetype "Plasma"
  states
  {
  Spawn:
    BAL7 AB 2 bright
  Prawn:
    BAL7 AABB 1 bright A_SpawnItemEx("baronballtrail", random(-2,2), random(-2,2), random(-2,2), (velx/2)+random(-1,1), (vely/2)+random(-1,1), (velz/2)+random(-1,1), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE, 128)
    loop
  Death:
	NULL A 0 A_SpawnItemEx ("GreenParticleShroom", 0,0,0, 0,0,0, 0, 160) 
    BAL7 CDE 6 bright
    stop
  }
}

actor SSTBaronBall : BaronBall replaces BaronBall
{
  damagetype "plasma"
  
  Game Doom
  SpawnID 154
  Radius 6
  Height 16
  Speed 15
  FastSpeed 20
  Damage 8
  RenderStyle Add
  Alpha 1
  SeeSound "baron/attack"
  DeathSound "baron/shotx"
  Decal "BaronScorch"
  Projectile
	+FORCEXYBILLBOARD
  +RANDOMIZE
  states
  {
  Spawn:
    BAL7 AB 2 bright
  Prawn:
    BAL7 AABB 1 bright A_SpawnItemEx("baronballtrail", random(-2,2), random(-2,2), random(-2,2), (velx/2)+random(-1,1), (vely/2)+random(-1,1), (velz/2)+random(-1,1), 0, SXF_ABSOLUTEVELOCITY|SXF_NOCHECKPOSITION|SXF_CLIENTSIDE)
    loop
  Death:
	NULL A 0 A_SpawnItemEx ("GreenParticleShroom", 0,0,0, 0,0,0, 0, 160) 
    BAL7 CDE 6 bright
    stop
  }

}

ACTOR BaronTorso
{
  -RANDOMIZE
  +CORPSE
  -SOLID
  -SHOOTABLE
  +NOBLOCKMAP
  +CLIENTSIDEONLY
	+FORCEXYBILLBOARD
	+movewithsector
  radius 8
  height 8
  health 1
  alpha 1.0
  bloodcolor "green"
  States
  {
  Spawn:
    TNT1 A 0
    BL2D C 0 ThrustThingZ(0, random(16,24), 0, 0)
  Kufi:
    BTO2 A 1 A_SpawnItemEx("BetterBlood_BH",0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
	Loop
  Crash:
    BTO2 B 0 A_PlaySound ("hellknight/torsoland")
	BTO2 BBBBBBB 1 A_SpawnItemEx ("SuperDuperClientsideBloodSpotSpawner", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION|SXF_USEBLOODCOLOR|SXF_CLIENTSIDE)
    BTO2 C 7
    TNT1 A 0 //Thing_ChangeTID (0, 1330) 
    BTO2 DDD 350
  derp:
    BTO2 D 1 //a_fadeout(0.01)
	loop
    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
  }
}

ACTOR Baronballtrail
{
	+NOTELEPORT
   Radius 1
   Height 1
   Speed 0
   Damage 0
   PROJECTILE
   RENDERSTYLE ADD
   ALPHA 0.48 //38
   Scale 0.12
   //+RANDOMIZE
	+FORCEXYBILLBOARD
   States
   {
   Spawn:
    TNT1 A 0
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
	PSNE H 0 A_Jump(64,"Yiff")
	PSNE H 0 Bright A_Fadeout(0.01)
	PSNE H 0 A_Jump(64,"Yiff")
	PSNE H 0 Bright A_Fadeout(0.01)
	PSNE H 0 A_Jump(64,"Yiff")
	PSNE H 0 Bright A_Fadeout(0.01)
	PSNE H 0 A_Jump(64,"Yiff")
	PSNE H 0 Bright A_Fadeout(0.01)
	PSNE H 0 A_Jump(64,"Yiff")
	PSNE H 0 Bright A_Fadeout(0.01)
	PSNE H 0 A_Jump(64,"Yiff")
	PSNE H 0 Bright A_Fadeout(0.01)
    Goto Yiff
   Yiff:
    //TNT1 A 0 A_CheckSight("Spawn2") 
      PSNE HHH 1 Bright A_Fadeout(0.02)
	TNT1 A 0 A_ChangeVelocity(momx*0.5,momy*0.5,momz*0.5, CVF_REPLACE)
      PSNE III 1 Bright A_Fadeout(0.02)
	TNT1 A 0 A_ChangeVelocity(momx*0.5,momy*0.5,momz*0.5, CVF_REPLACE)
      PSNE JJJ 1 Bright A_Fadeout(0.02)
	TNT1 A 0 A_ChangeVelocity(momx*0.5,momy*0.5,momz*0.5, CVF_REPLACE)
      PSNE KKKLL 1 Bright A_Fadeout(0.02)
      PSNE LMM 1 Bright A_Fadeout(0.01)
      PSNE M 1 Bright
      Stop
	Spawn2:
		NULL A 0
		stop
   }
}