ACTOR Yorihime : GenericBoss 31539
{
//$Category "Touhou Characters"
  floatspeed 8
  Speed 8
  Health 2500
  +THRUSPECIES
  +MTHRUSPECIES
  DropItem "BossLifeEssence" 255 25
  DropItem "BossArmorBonusMax" 255 1
  DropItem "DemonAmmoBox" 128 200
  DropItem "DemonicChalice" 128
  DropItem "SkullOfPower" 128
  Obituary "%o met a horrible demise from Yorihime."
  HitObituary "%o couldn't see Yorihime."
  Tag "\c[i3]Yorihime\c-"
  States
  {
  Spawn:
    TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_SetShootable
    YORI AAAABBBBCCCCDDDDEEEE 1 A_Look
    Loop
  See:
    TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_SetShootable
    YORI AAAABBBBCCCCDDDDEEEE 1 A_Chase
    Loop
  Pain:
    YORI F 0 A_playsound("remihurt")
    YORI F 10
    Goto See
  Melee:
    YORA AB 5
	YORA B 3 A_CustomMeleeAttack(70,"remhit","none")
	YORA C 8
	Goto See
  AppearMelee:
	YORA A 0 A_Playsound("Yorihime/Appear")
	YORA A 1 A_SetTranslucent(0.10)
    YORA A 1 A_SetTranslucent(0.20)
    YORA A 1 A_SetTranslucent(0.30)
    YORA A 1 A_SetTranslucent(0.40)
    YORA A 1 A_SetTranslucent(0.50)
    YORA A 1 A_SetTranslucent(0.60)
    YORA A 1 A_SetTranslucent(0.70)
    YORA A 1 A_SetTranslucent(0.80)
    YORA A 1 A_SetTranslucent(0.90)
    YORA A 1 A_SetTranslucent(1.0)
    YORA B 4 A_SetShootable
	YORA B 2 A_CustomMeleeAttack(70,"remhit","none")
	YORA C 8
	Goto See
  Missile:
    YORA A 0 A_facetarget
    YORA A 0 A_Jump(256,"InvisiMelee","Orbs1","AOE")
    Goto See
  InvisiMelee:
    YORA H 4 A_Facetarget
	YORA HI 6 
	YORA A 0 A_UnsetShootable
	YORA A 0 A_Playsound("Yorihime/Disappear")
	YORA J 1 A_SetTranslucent(0.90)
    YORA J 1 A_SetTranslucent(0.80)
    YORA J 1 A_SetTranslucent(0.70)
    YORA J 1 A_SetTranslucent(0.60)
    YORA J 1 A_SetTranslucent(0.50)
    YORA J 1 A_SetTranslucent(0.40)
    YORA J 1 A_SetTranslucent(0.30)
    YORA J 1 A_SetTranslucent(0.20)
    YORA J 1 A_SetTranslucent(0.10)
    YORA J 1 A_SetTranslucent(0)
	Goto MeleeChase
  MeleeChase:
    TNT1 A 0 A_Chase("AppearMelee", "")
    TNT1 A 0 A_Chase("AppearMelee", "")
    YORI A 1 A_Chase("AppearMelee", "")
	TNT1 A 0 A_Jump(2,"Appear")
    Loop
  Appear:
	YORI A 0 A_Playsound("Yorihime/Appear")
	YORI A 1 A_SetTranslucent(0.10)
    YORI A 1 A_SetTranslucent(0.20)
    YORI A 1 A_SetTranslucent(0.30)
    YORI A 1 A_SetTranslucent(0.40)
    YORI A 1 A_SetTranslucent(0.50)
    YORI A 1 A_SetTranslucent(0.60)
    YORI A 1 A_SetTranslucent(0.70)
    YORI A 1 A_SetTranslucent(0.80)
    YORI A 1 A_SetTranslucent(0.90)
    YORI A 1 A_SetTranslucent(1.0)
    YORI A 4 A_SetShootable
	Goto See
  Orbs1:
	YORA HHIJ 5
	YORA Y 0 A_Playsound("remishot",0,1)
	YORA Y 0 A_CustomMissile("HomingExplosivePinkOrb",30,0,20)
	YORA Y 0 A_CustomMissile("HomingExplosivePinkOrb",30,0,-20)
	YORA Y 0 A_CustomMissile("HomingExplosivePinkOrb",30,0,40)
	YORA Y 0 A_CustomMissile("HomingExplosivePinkOrb",30,0,-40)
	YORA J 3
	YORA IH 5
	Goto See
  AOE:
	YORA D 4
	TNT1 A 0 A_ChangeFlag("NOGRAVITY",0)
	TNT1 A 0 A_ChangeFlag("NOPAIN",1)
	TNT1 A 0 A_ChangeFlag("FLOAT",0)
	YORA E 8 
	YORA F 8 A_Playsound("SwordRock", 4, 2.0)
	YORA A 0 A_Quake(2, 90, 256, 1024)
	YORA G 3
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GGGGGG 0 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA G 3 A_CustomMissile("SmallExplosivePinkOrb", 30, 0, random(0, 359), CMF_OFFSETPITCH, frandom(-5, 5))
	YORA GF 5
	TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
	TNT1 A 0 A_ChangeFlag("FLOAT",1)
	TNT1 A 0 A_ChangeFlag("NOPAIN",0)
	TNT1 A 0 ThrustThingZ(0,30,0,1)
	YORA E 10
	TNT1 A 0 A_Stop
	Goto See
  Death:
    YORI F 3
    YORI G 30
	YORI K 0 A_NoBlocking
    YORI K 0 A_scream
	TNT1 A 0 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 ExplosivePinkOrb : GenericSuperOrb
{
  Speed 20
  damage (random(1,1)*10)
  States
  {
  Spawn:
    CLBB G 1 Bright A_SpawnItemEx("PinkProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SpawnItemEx("PinkProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
    Loop
  Death:
	TNT1 A 0
	TNT1 A 0 A_Explode(100,200)
	TNT1 A 0 A_SpawnItem("PinkProjExplodeLarge")
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("PinkProjParticleSuperLarge",0,0,0,frandom(-4,4),frandom(-4,4),frandom(-4,4),random(0,359))
    CLBB G 1 Bright A_FadeOut(0.2)
    Goto Death+3
  }
}

ACTOR HomingExplosivePinkOrb : ExplosivePinkOrb
{
  +Seekermissile
  States
  {
  Spawn:
    CLBB G 1 Bright A_SpawnItemEx("PinkProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SpawnItemEx("PinkProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
    CLBB G 1 Bright A_SpawnItemEx("PinkProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SpawnItemEx("PinkProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SeekerMissile(2,4)
    Loop
  }
}

ACTOR SmallExplosivePinkOrb : GenericWeakOrb
{
  Speed 15
  damage (random(1,1)*15)
  SeeSound "remishot"
  States
  {
  Spawn:
    CLBA G 1 Bright A_SpawnItemEx("PinkProjParticleLarge",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SpawnItemEx("PinkProjParticleLarge",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
    Loop
  Death:
	TNT1 A 0
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("PinkProjParticle",0,0,0,frandom(-4,4),frandom(-4,4),frandom(-4,4),random(0,359))
    CLBA G 1 Bright A_FadeOut(0.2)
    Goto Death+1
  }
}