ACTOR SanaeKochiya 31460
{
//Enemy Name: Sanae Kochiya
//Monster Tier: Revenant
//Enemy Tier: Boss (Touhou)
//Difficulty: Hard (6/10)
Tag "\c[m4]Sanae \c[m5]Kochiya"
Speed 8
MONSTER
Health 4000
Radius 24
Height 64
Scale 0.7
Mass 1000
MeleeThreshold 64
MeleeRange 64
Species "Touhou"
MinMissileChance 160
DamageFactor 0.75
DamageFactor "Touhou", 0
DamageFactor "Legendary", 0.5
DropItem "ChaosEssence" 256 1
DropItem "BossArmorBonusMax" 255 1
DropItem "TearofEternity" 60
DropItem "DivinePowerSphere" 60
DropItem "ExoticWeaponEnhancerModuleGiver" 100
Painchance 8
Seesound ""
Painsound "touhou/pain"
Deathsound "touhou/rekt"
Obituary "%o was miraculously defeated by Sanae."
+MISSILEMORE
+QUICKTORETALIATE
+DONTHURTSPECIES
+LOOKALLAROUND
+FLOORCLIP
+DONTRIP
+NORADIUSDMG
+BOSS
+DONTMORPH
+NOICEDEATH
var int user_counter;
var int user_music;
States
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("Disable2hu") == 1, "BegoneThot")
  SpawnLoop:
	TNT1 A 0 A_SetInvulnerable
	TNT1 A 0 A_ChangeFlag("NODAMAGE",1)
	TNT1 A 0 A_ChangeFlag("NOPAIN",1)
    SANA ABCDEFGH 3 A_LookEX(LOF_FULLVOLSEESOUND,0,0,0,360,"Prepare")
    Loop
  BegoneThot:
	TNT1 A 1
	TNT1 A 0 A_SpawnItemEx("Revenant",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 0 A_ChangeFlag("COUNTKILL", FALSE)
	TNT1 A 0
	Stop
  Prepare:
	TNT1 A 0 A_PlaySound("touhou/sight",7,1.0,0,ATTN_NONE)
	TNT1 A 0 A_UnSetInvulnerable
	TNT1 A 0 A_ChangeFlag("NODAMAGE",0)
	TNT1 A 0 A_ChangeFlag("NOPAIN",0)
  See:
    TNT1 A 0 A_JumpIf(user_music == 1,3)
    TNT1 A 0 ACS_NamedExecuteAlways("StartMonsterMusic",0,821)
	TNT1 A 0 A_SetUserVar("user_music",1)
	//TNT1 A 0 NoiseAlert(0,0)
    SANA AAABBBCCCDDDEEEFFFGGGHHH 1 A_Chase
    Loop
  Pain:
	SANA A 0 A_SetTranslucent(1.0)
    SANA I 4 A_Pain
	SANA JKJI 4
    Goto See
  Melee:
	SNAT A 0 A_Jump(128,"Missile")
	SNAT A 0 A_Jump(255,"Melee1","Melee2","Melee3","Melee4","Melee5")
  Melee1:
    SNAT JKLM 2 A_FaceTarget
	SNAT NN 1 A_CustomMeleeAttack(400,"touhou/remi/hit","none","Touhou")
	SNAT OPQR 2 A_FaceTarget
	Goto See
  Melee2:
    SNAT STUV 4 A_FaceTarget
	SNAT WWWW 1 A_CustomMeleeAttack(400,"touhou/remi/hit","none","Touhou")
	SNAT XYZ 4 A_FaceTarget
	Goto See
  Melee3:
    SNA2 AB 4 A_FaceTarget
    SNA2 CD 3 A_FaceTarget
	SNA2 EEEE 1 A_CustomMeleeAttack(350,"touhou/remi/hit","none","Touhou")
	SNA2 FGHI 3 A_FaceTarget
	Goto See
  Melee4:
    SNA2 JKLMN 2 A_FaceTarget
	SNA2 OO 1 A_CustomMeleeAttack(500,"touhou/remi/hit","none","Touhou")
	SNA2 PQRS 2 A_FaceTarget
	Goto See
  Melee5:
    SNA3 ABC 4 A_FaceTarget
	SNA3 DDDD 1 A_CustomMeleeAttack(300,"touhou/remi/hit","none","Touhou")
	SNA3 EFGHI 4 A_FaceTarget
	Goto See
  Missile:
	SANA A 0 A_Jump(224,"SmallStars","Amulets1","Amulets2","Snakes","MightyWind")
	Goto Spellcard
  SmallStars:
    SNAT JKLM 2 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNAT N 0 A_CustomMissile("SanaeSmallStar",32,0,-45)
	SNAT N 0 A_CustomMissile("SanaeSmallStar",32,0,45)
	SNAT N 0 A_CustomMissile("SanaeSmallStar",32,0,-30)
	SNAT N 0 A_CustomMissile("SanaeSmallStar",32,0,30)
	SNAT N 0 A_CustomMissile("SanaeSmallStar",32,0,-15)
	SNAT N 0 A_CustomMissile("SanaeSmallStar",32,0,15)
	SNAT N 2 A_CustomMissile("SanaeSmallStar",32,0,0)
	SNAT OPQR 2 A_FaceTarget
	SNAT A 0 A_Jump(64,"Missile")
	Goto See
  Amulets1:
    SNAT STUV 4 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(0)*6+32,cos(0)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(30)*6+32,cos(30)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(60)*6+32,cos(60)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(90)*6+32,cos(90)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(120)*6+32,cos(120)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(150)*6+32,cos(150)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(180)*6+32,cos(180)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(210)*6+32,cos(210)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(240)*6+32,cos(240)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(270)*6+32,cos(270)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(300)*6+32,cos(300)*96,0,CMF_AIMOFFSET)
	SNAT W 2 A_CustomMissile("SanaeAmulet1",sin(330)*6+32,cos(330)*96,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(0)*12+32,cos(0)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(30)*12+32,cos(30)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(60)*12+32,cos(60)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(90)*12+32,cos(90)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(120)*12+32,cos(120)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(150)*12+32,cos(150)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(180)*12+32,cos(180)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(210)*12+32,cos(210)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(240)*12+32,cos(240)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(270)*12+32,cos(270)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(300)*12+32,cos(300)*128,0,CMF_AIMOFFSET)
	SNAT W 2 A_CustomMissile("SanaeAmulet2",sin(330)*12+32,cos(330)*128,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(0)*18+32,cos(0)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(30)*18+32,cos(30)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(60)*18+32,cos(60)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(90)*18+32,cos(90)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(120)*18+32,cos(120)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(150)*18+32,cos(150)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(180)*18+32,cos(180)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(210)*18+32,cos(210)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(240)*18+32,cos(240)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(270)*18+32,cos(270)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(300)*18+32,cos(300)*160,0,CMF_AIMOFFSET)
	SNAT X 2 A_CustomMissile("SanaeAmulet3",sin(330)*18+32,cos(330)*160,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(0)*24+32,cos(0)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(30)*24+32,cos(30)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(60)*24+32,cos(60)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(90)*24+32,cos(90)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(120)*24+32,cos(120)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(150)*24+32,cos(150)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(180)*24+32,cos(180)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(210)*24+32,cos(210)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(240)*24+32,cos(240)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(270)*24+32,cos(270)*192,0,CMF_AIMOFFSET)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(300)*24+32,cos(300)*192,0,CMF_AIMOFFSET)
	SNAT X 2 A_CustomMissile("SanaeAmulet4",sin(330)*24+32,cos(330)*192,0,CMF_AIMOFFSET)
	SNAT YZ 4 A_FaceTarget
	SNAT A 0 A_Jump(64,"Missile")
	Goto See
  Amulets2:
    SNA2 ABCD 4 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(0)*6+32,cos(0)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(30)*6+32,cos(30)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(60)*6+32,cos(60)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(90)*6+32,cos(90)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(120)*6+32,cos(120)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(150)*6+32,cos(150)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(180)*6+32,cos(180)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(210)*6+32,cos(210)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(240)*6+32,cos(240)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(270)*6+32,cos(270)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet1",sin(300)*6+32,cos(300)*96,0)
	SNA2 E 2 A_CustomMissile("SanaeAmulet1",sin(330)*6+32,cos(330)*96,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(0)*12+32,cos(0)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(30)*12+32,cos(30)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(60)*12+32,cos(60)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(90)*12+32,cos(90)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(120)*12+32,cos(120)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(150)*12+32,cos(150)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(180)*12+32,cos(180)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(210)*12+32,cos(210)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(240)*12+32,cos(240)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(270)*12+32,cos(270)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet2",sin(300)*12+32,cos(300)*128,0)
	SNA2 E 2 A_CustomMissile("SanaeAmulet2",sin(330)*12+32,cos(330)*128,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(0)*18+32,cos(0)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(30)*18+32,cos(30)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(60)*18+32,cos(60)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(90)*18+32,cos(90)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(120)*18+32,cos(120)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(150)*18+32,cos(150)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(180)*18+32,cos(180)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(210)*18+32,cos(210)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(240)*18+32,cos(240)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(270)*18+32,cos(270)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet3",sin(300)*18+32,cos(300)*160,0)
	SNA2 F 2 A_CustomMissile("SanaeAmulet3",sin(330)*18+32,cos(330)*160,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(0)*24+32,cos(0)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(30)*24+32,cos(30)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(60)*24+32,cos(60)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(90)*24+32,cos(90)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(120)*24+32,cos(120)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(150)*24+32,cos(150)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(180)*24+32,cos(180)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(210)*24+32,cos(210)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(240)*24+32,cos(240)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(270)*24+32,cos(270)*192,0)
	SNAT W 0 A_CustomMissile("SanaeAmulet4",sin(300)*24+32,cos(300)*192,0)
	SNA2 F 2 A_CustomMissile("SanaeAmulet4",sin(330)*24+32,cos(330)*192,0)
	SNA2 GHI 4 A_FaceTarget
	SNAT A 0 A_Jump(64,"Missile")
	Goto See
  Snakes:
    SNA2 JKLMN 2 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,45)
	SNA2 O 4 A_CustomMissile("SanaeSnakeBullet",32,-64,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,45)
	SNA2 P 2 A_CustomMissile("SanaeSnakeBullet",32,-192,0)
	SNA2 QRS 2 A_FaceTarget
    SNA2 JKLMN 2 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,45)
	SNA2 O 4 A_CustomMissile("SanaeSnakeBullet",32,-64,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,45)
	SNA2 P 2 A_CustomMissile("SanaeSnakeBullet",32,-192,0)
	SNA2 QRS 2 A_FaceTarget
    SNA2 JKLMN 2 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,64,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-64,45)
	SNA2 O 4 A_CustomMissile("SanaeSnakeBullet",32,-64,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,192,0)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,-90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,90)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,-45)
	SNA2 O 0 A_CustomMissile("SanaeSnakeBullet",32,-192,45)
	SNA2 P 2 A_CustomMissile("SanaeSnakeBullet",32,-192,0)
	SNA2 QRS 2 A_FaceTarget
	SNAT A 0 A_Jump(64,"Missile")
	Goto See
  MightyWind:
    SNA3 AB 4 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 C 2 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 C 2 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 D 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 D 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 D 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 D 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 E 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 E 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 E 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 E 1 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 F 2 A_FaceTarget
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet1",random(8,56),0,random(-45,90))
	SNA3 A 0 A_CustomMissile("SanaeMightyWindBullet2",random(8,56),0,random(-90,45))
	SNA3 F 2 A_FaceTarget
	SNA3 GHI 4 A_FaceTarget
	SNAT A 0 A_Jump(64,"Missile")
	Goto See
  Spellcard:
	//TNT1 A 0 A_JumpIfInventory("SpellcardInactive",1,"See") //Don't use Spellcards if actor is in inventory
	TNT1 A 0 A_ChangeFlag("NOPAIN", TRUE)
    SNAT ABCD 5 A_FaceTarget
	SNAT A 0 A_PlaySound("touhou/spellcard",0,1.0,0,ATTN_NONE)
	SNAT EFGHGFGHGFGH 3 A_FaceTarget
    SNAT I 5 A_FaceTarget
	TNT1 A 0 A_ChangeFlag("NOPAIN", FALSE)
	SNAT A 0 A_Jump(255,"GreyThaumaturgy","StarRitual","DivineWind")
	Goto GreyThaumaturgy
  GreyThaumaturgy:
	SASX A 0 A_SpawnItemEx("SanaeNSBigStarEffect",0,0,0,0,0,0,0,0,0)
	SASX ABCDEFGHIJK 3 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar1",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar2",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar3",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar4",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar5",32,0,0)
	SASX LMNOPQRSTUV 3 A_FaceTarget
	SASX ABCDEFGHIJKLMNOPQRSTUV 3 A_FaceTarget
	Goto See
  StarRitual:
	SASX A 0 A_SpawnItemEx("SanaeNSBigStarEffect",0,0,0,0,0,0,0,0,0)
	SASX ABCDEFGHIJK 3 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar",32,0,72)
	SASX A 0 A_CustomMissile("SanaeLargeStar",32,0,144)
	SASX A 0 A_CustomMissile("SanaeLargeStar",32,0,216)
	SASX A 0 A_CustomMissile("SanaeLargeStar",32,0,288)
	SASX A 0 A_CustomMissile("SanaeLargeStar1",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar1",32,0,72)
	SASX A 0 A_CustomMissile("SanaeLargeStar1",32,0,144)
	SASX A 0 A_CustomMissile("SanaeLargeStar1",32,0,216)
	SASX A 0 A_CustomMissile("SanaeLargeStar1",32,0,288)
	SASX A 0 A_CustomMissile("SanaeLargeStar2",32,0,0)
	SASX A 0 A_CustomMissile("SanaeLargeStar2",32,0,72)
	SASX A 0 A_CustomMissile("SanaeLargeStar2",32,0,144)
	SASX A 0 A_CustomMissile("SanaeLargeStar2",32,0,216)
	SASX A 0 A_CustomMissile("SanaeLargeStar2",32,0,288)
	SASX LMNOPQRSTUV 3 A_FaceTarget
	Goto See
  DivineWind:
	TNT1 A 0 A_SetUserVar("user_counter",0)
	SNAT ABCDE 5 A_FaceTarget
  DivineWindLoop:
    TNT1 A 0 A_JumpIf(user_counter >= 8,"DivineWindEnd")
    TNT1 A 0 A_SetUserVar("user_counter",user_counter+1)
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,0)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,12)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,24)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,36)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,48)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,60)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,72)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,84)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,96)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,108)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,120)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,132)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,144)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,156)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,168)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,180)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,192)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,204)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,216)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,228)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,240)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,252)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,264)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,276)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,288)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,300)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,312)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,324)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,336)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet1",32,0,348)
	SNAT FGHG 3 A_FaceTarget
	SNAT W 0 A_PlaySound("remishot",CHAN_BODY,1,0)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,0)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,12)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,24)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,36)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,48)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,60)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,72)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,84)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,96)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,108)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,120)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,132)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,144)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,156)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,168)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,180)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,192)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,204)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,216)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,228)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,240)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,252)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,264)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,276)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,288)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,300)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,312)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,324)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,336)
	SNAT A 0 A_CustomMissile("SanaeMightyWindBullet2",32,0,348)
	SNAT FGHG 3 A_FaceTarget
	SNAT A 0 A_Jump(64,"Missile")
	Loop
  DivineWindEnd:
	SNAT HI 3 A_FaceTarget
	Goto See
  Death:
	SANA K 70 A_PlaySound("uroboros/death",5,1.0,0,ATTN_NONE)
    MYST K 0 A_Scream
	TNT1 A 0 A_NoBlocking
	TNT1 AAA 0 A_SpawnItemEx("Red2huBossDeathFlame",0,0,20,random(-4,4),random(-4,4),random(0,3))
	TNT1 AAA 0 A_SpawnItemEx("Red2huBossDeathFlame3",0,0,20,random(-20,20),random(-20,20),random(0,20))
	TNT1 A 0 A_Explode(256,256,0)
	TNT1 AAA 0 A_CustomMissile("BigRedBloodCloud", random(10,80), 0, random(0,360), 2, random(0,360))
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("2huBossDeathFlame", Random(-8,8), Random(-8,8), Random(12,80), Random(8,38), 0, Random(3,43), Random(-180,180))
	TNT1 A 1
	Stop
  }
}

ACTOR SanaeNSBigStarEffect
{
  +NOINTERACTION
  +CLIENTSIDEONLY
  RenderStyle Add
  States
  {
  Spawn:
	SNST A 0
	SNST A 0 A_SetTranslucent(0.1,1)
	SNST AAABBBCCCDDDEEEFFFAAABBBCCCDDDEEEFFF 1 Bright A_FadeIn(0.05)
	TNT1 A 0
	Stop
  }
}

ACTOR SanaeLargeStar
{
  Radius 10
  Height 20
  Speed 15
  damage 2
  DamageType "Touhou"
  Projectile
  +FORCEXYBILLBOARD
  +RIPPER
  RenderStyle Add
  Scale 2.0
  SeeSound ""
  DeathSound "touhou/hit"
  States
  {
  Spawn:
	SNST A 0
	SNST ABCDEFABC 4 Bright A_Explode(4,256,0,0,256)
	SNST DEFABCDEFABC 3 Bright A_Explode(4,256,0,0,256)
	SNST DEFABCDEFABCDEF 2 Bright A_Explode(4,256,0,0,256)
  LoopState:
    SNST ABCDEF 1 Bright A_Explode(4,256,0,0,256)
	Loop
  Death:
    SNST ABCDEFABCDEF 1 Bright A_FadeOut
    Stop
  }
}

ACTOR SanaeLargeStar1 : SanaeLargeStar
{
  States
  {
  Spawn:
    SNST A 0
	SNST A 1
	Goto "Super::Spawn"
  }
}

ACTOR SanaeLargeStar2 : SanaeLargeStar
{
  States
  {
  Spawn:
    SNST A 0
	SNST A 2
	Goto "Super::Spawn"
  }
}

ACTOR SanaeLargeStar3 : SanaeLargeStar
{
  States
  {
  Spawn:
    SNST A 0
	SNST A 3
	Goto "Super::Spawn"
  }
}

ACTOR SanaeLargeStar4 : SanaeLargeStar
{
  States
  {
  Spawn:
    SNST A 0
	SNST A 4
	Goto "Super::Spawn"
  }
}

ACTOR SanaeLargeStar5 : SanaeLargeStar
{
  States
  {
  Spawn:
    SNST A 0
	SNST A 5
	Goto "Super::Spawn"
  }
}

ACTOR SanaeSmallStar
{
  Radius 4
  Height 8
  Speed 15
  FastSpeed 20
  damage (16)
  DamageType "Touhou"
  Projectile
  +FORCEXYBILLBOARD
  +RIPPER
  RenderStyle Add
  Scale 0.5
  SeeSound ""
  DeathSound "touhou/hit"
  States
  {
  Spawn:
    SNST ABCDEF 1 Bright //A_JumpIfInTargetInventory("BulletDeathTrigger",1,"Death")
	Loop
  Death:
    SNST ABCDEFABCDEF 1 Bright A_FadeOut
    Stop
  }
}

ACTOR SanaeAmulet1
{
  Radius 2
  Speed 24
  fastspeed 36
  Height 4
  damage (32)
  DamageType "Touhou"
  Projectile
  +FORCEXYBILLBOARD
  //RenderStyle Add
  SeeSound ""
  DeathSound "touhou/hit"
  States
  {
  Spawn:
    VAMU A 1 Bright //A_JumpIfInTargetInventory("BulletDeathTrigger",1,"Death")
	Loop
  Death:
    VAMU AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}

ACTOR SanaeAmulet2 : SanaeAmulet1 { Speed 20 fastspeed 30 }

ACTOR SanaeAmulet3 : SanaeAmulet1 { Speed 16 fastspeed 24 }

ACTOR SanaeAmulet4 : SanaeAmulet1 { Speed 12 fastspeed 18 }

ACTOR SanaeSnakeBullet
{
  Radius 2
  Speed 15
  Height 4
  damage (12)
  DamageType "Touhou"
  Projectile
  +FORCEXYBILLBOARD
  +SEEKERMISSILE
  RenderStyle Add
  SeeSound ""
  DeathSound "touhou/hit"
  States
  {
  Spawn:
    GBL1 A 1 Bright A_Weave(2, 0, 2.0, 0.0)
	GBL1 A 0 Bright A_SeekerMissile(0, 20, SMF_PRECISE|SMF_LOOK)
	GBL1 A 0 Bright A_SpawnItemEx("SanaeSnakeBulletTrail",0,0,0,0,0,0,0,0,0)
	Loop
  Death:
    GBL1 AAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}

ACTOR SanaeSnakeBulletTrail
{
  +NOGRAVITY
  +NOINTERACTION
  +CLIENTSIDEONLY
  RenderStyle Add
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    GBL1 AAAAAAAAAAAA 1 Bright A_FadeOut(0.1)
    Stop
  }
}

ACTOR SanaeMightyWindBullet1
{
  Radius 4
  Height 8
  Speed 20
  fastspeed 30
  damage (80)
  DamageType "Touhou"
  Scale 1.3
  Projectile
  +FORCEXYBILLBOARD
  RenderStyle Add
  SeeSound ""
  DeathSound "touhou/hit"
  States
  {
  Spawn:
    CBL4 A 4 Bright //A_JumpIfInTargetInventory("BulletDeathTrigger",1,"Death")
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,2,0,0,0,0)
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,-2,0,0,0,0)
    CBL4 A 4 Bright //A_JumpIfInTargetInventory("BulletDeathTrigger",1,"Death")
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,0,2,0,0,0)
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,0,-2,0,0,0)
	CBL4 A 0 Bright A_ScaleVelocity(0.9)
	CBL4 A 0 Bright A_SetAngle(angle+6)
	CBL4 A 0 Bright ThrustThing(angle*256/360, 4, 0, 0)
    Loop
  Death:
    CBL4 AAAAAAAAAA 3 Bright A_FadeOut
    Stop
  }
}

ACTOR SanaeMightyWindBullet2 : SanaeMightyWindBullet1
{
  States
  {
  Spawn:
    CBL4 A 4 Bright //A_JumpIfInTargetInventory("BulletDeathTrigger",1,"Death")
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,2,0,0,0,0)
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,-2,0,0,0,0)
    CBL4 A 4 Bright //A_JumpIfInTargetInventory("BulletDeathTrigger",1,"Death")
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,0,2,0,0,0)
	CBL4 A 0 Bright A_SpawnItemEx("AyaYoukaiKillingFanBulletTrail",0,0,0,0,0,-2,0,0,0)
	CBL4 A 0 Bright A_ScaleVelocity(0.9)
	CBL4 A 0 Bright A_SetAngle(angle-6)
	CBL4 A 0 Bright ThrustThing(angle*256/360, 4, 0, 0)
    Loop
  Death:
    CBL4 AAAAAAAAAA 3 Bright A_FadeOut
    Stop
  }
}

ACTOR AyaYoukaiKillingFanBulletTrail
{
  +NOGRAVITY
  +NOINTERACTION
  +CLIENTSIDEONLY
  RenderStyle Add
  Scale 1.2
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    CBL4 AAAAAAAAAAAA 1 Bright A_FadeOut
    Stop
  }
}