ACTOR GenericBoss
{
  Monster
  Radius 20
  Height 62
  Scale 0.7
  Mass 1000
  MeleeThreshold 35
  MeleeRange 80
  Painchance 20
  Species "Touhou"
  DamageFactor "Touhou", 0 //RIP 2hu vs. 2hu
  +DontHurtSpecies
  +LookAllAround
  +FloorClip
  +NoGravity
  +Float
  +Boss
  +DontMorph
  +NoIceDeath
  Seesound "Remsee"
  PainSound "remihurt"
  Deathsound "Realdead"
}



ACTOR 2huBossDeathFlame
{
   Speed 2
   RenderStyle Translucent
   Alpha 0.3
   +NOINTERACTION
   +CLIENTSIDEONLY
   +FORCEXYBILLBOARD
   +NOTIMEFREEZE
   States
   {
   Spawn:
      TNT1 A 2
      2HDT ABCDEFGHIJKL 2 Bright A_SpawnItemEx("2huBossDeathFlame2",0,0,0,random(-4,4),random(-4,4),random(0,8))
      stop
   }
}

ACTOR 2huBossDeathFlame2 : 2huBossDeathFlame
{
   States
   {
   Spawn:
      TNT1 A 2
      2HDT ABCDEFGHIJKL 2 Bright A_ChangeVelocity(0,0,1)
      stop
   }
}

ACTOR 2huBossDeathFlame3 : 2huBossDeathFlame
{
   Speed 15
   Scale 0.35
   States
   {
   Spawn:
      TNT1 A 2
      2HDT ABCDEFGHIJKL 2 Bright A_SpawnItemEx("2huBossDeathFlame4",0,0,0,random(-2,0),random(-1,1),random(-1,1),0,0,0)
      stop
   }
}

ACTOR 2huBossDeathFlame4 : 2huBossDeathFlame
{
   Scale 0.35
   States
   {
   Spawn:
      TNT1 A 2
      2HDT ABCDEFGHIJKL 2 Bright A_ChangeVelocity(0,0,1)
      stop
   }
}




ACTOR BossDeathExplode : BaseProjectileEffect
{   
  Scale 0.5
  +NOTIMEFREEZE
  States
  {
  Spawn:
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(0.6)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(0.7)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(0.8)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(0.9)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.0)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.1)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.2)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.3)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.4)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.5)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.6)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.7)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.8)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(1.9)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(2.0)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(2.1)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(2.2)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(2.3)
	CLBC D 2 Bright A_FadeOut(0.05)
	TNT1 A 0 A_SetScale(2.4)
	CLBC D 2 Bright A_FadeOut(0.05)
  Stop
  }
}

ACTOR 2huBossDeath
{
  +CLIENTSIDEONLY
  +NOINTERACTION
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_SpawnItemEx("BossDeathExplode",0,0,32)
	TNT1 AAAAAAAAAAA 0 A_SpawnItemEx("2huBossDeathFlame",0,0,20,random(-3,3),random(-3,3),random(-3,3))
	TNT1 AAAAAAAAAAA 1 A_SpawnItemEx("2huBossDeathFlame3",0,0,random(5,55),random(-15,15),random(-15,15),random(-15,30))
	Stop
	}
}



ACTOR New2huBossDeathFlame replaces 2huBossDeathFlame
{
  RenderStyle Add
  Alpha 0.6
  +NOINTERACTION
  +CLIENTSIDEONLY
  +FORCEXYBILLBOARD
  States
  {
  Spawn:
     TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 2 A_SpawnItemEx("New2huBossDeathFlame2",0,0,0,random(-4,4),random(-4,4),random(0,8))
     stop
  }
}

ACTOR New2huBossDeathFlame2 : New2huBossDeathFlame replaces 2huBossDeathFlame2
{
  States
  {
  Spawn:
     2HDT ABCDEFGHIJKL 3 Bright A_FadeOut(0.05)
     stop
  }
}

ACTOR New2huBossDeathFlame3 : New2huBossDeathFlame replaces 2huBossDeathFlame3
{
  Scale 0.35
  States
  {
  Spawn:
     TNT1 AAAAAAAAAAAA 3 A_SpawnItemEx("New2huBossDeathFlame4",0,0,0,random(-2,0),random(-1,1),random(0,2))
     stop
  }
}

ACTOR New2huBossDeathFlame4 : 2huBossDeathFlame replaces 2huBossDeathFlame4
{
  Scale 0.35
  States
  {
  Spawn:
     2HDT ABCDEFGHIJKL 2 Bright A_FadeOut(0.05)
     stop
  }
}

ACTOR NewBossDeathExplode : BaseProjectileEffect replaces BossDeathExplode
{  
  Scale 0.4
  States
  {
  Spawn:
	CLBC D 1 Bright A_FadeOut(0.025)
	TNT1 A 0 A_SetScale(ScaleX+0.075)
	Loop
  }
}

ACTOR Red2huBossDeathFlame
{
  RenderStyle Add
  Alpha 0.6
  +NOINTERACTION
  +CLIENTSIDEONLY
  +FORCEXYBILLBOARD
  States
  {
  Spawn:
     TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 2 A_SpawnItemEx("Red2huBossDeathFlame2",0,0,0,random(-4,4),random(-4,4),random(0,8))
     stop
  }
}

ACTOR Red2huBossDeathFlame2 : Red2huBossDeathFlame
{
  States
  {
  Spawn:
     2HD2 ABCDEFGHIJKL 3 Bright A_FadeOut(0.05)
     stop
  }
}

ACTOR Red2huBossDeathFlame3 : Red2huBossDeathFlame
{
  Scale 0.35
  States
  {
  Spawn:
     TNT1 AAAAAAAAAAAA 3 A_SpawnItemEx("Red2huBossDeathFlame4",0,0,0,random(-2,0),random(-1,1),random(0,2))
     stop
  }
}

ACTOR Red2huBossDeathFlame4 : Red2huBossDeathFlame
{
  Scale 0.35
  States
  {
  Spawn:
     2HD2 ABCDEFGHIJKL 2 Bright A_FadeOut(0.05)
     stop
  }
}

ACTOR RedBossDeathExplode : BaseProjectileEffect
{  
  Scale 0.4
  States
  {
  Spawn:
	CLBC B 1 Bright A_FadeOut(0.025)
	TNT1 A 0 A_SetScale(ScaleX+0.075)
	Loop
  }
}