/*
================================================================================
	Ophanim
	
	Class: Inner Sphere angel
	
	"An angel with 1000 eyes who sees past, present, and future. Her gaze can 
rip a wicked soul to shreds and the more eyes she opens, the more unstoppable 
she becomes. There is no record of anyone seeing an Ophanim open all her eyes 
and living to tell the tale."
	
	Ophanim act as mobile sentry turrets for heaven. She moves slow and it takes
time for her to fully powerup, going through three distince phases.
Her first stage, she fires phychic blasts from her main eyes which can be dodged
easily and doesn't do much damage. Her second phase, she opens the eyes on her
wings and gains the ability to hitscan. When she opens the last set of eyes, she
spews an endless blast of bullets from her main eyes and hitscans even harder 
than before. In her final stage, the Ophanim can deal more damage than any 
other angel in the game.
	The Ophanim is completely vunerable when waking up and going back to sleep.
She will go back to sleep between phases if the player takes cover.

================================================================================
*/


ACTOR Ophanim replaces Arachnotron
{
  Health 700
  Radius 32
  Height 64
  Mass 600
  Speed 4
  Damage 3
  PainChance 0
  Tag "Ophanim"
  Monster
  +FLOORCLIP
  +BOSSDEATH
  +FULLVOLACTIVE
  +NOPAIN
  +DONTRIP
  +DONTHARMSPECIES

  DamageFactor "FireMagic", 0
  DamageFactor "RainbowRip", 0
  DamageFactor "UndeadGoHomeImpact", 0
  DamageFactor "Judgement", 0
  DamageFactor "Holy", 0
  DamageFactor "CABladeBeam", 0.25 //Combine arms pistol
  DamageFactor "PlayerVoid", 0
  DamageFactor "KissMagic", 5
  DamageFactor "OphanimMelee", 0
  SeeSound "ophanim/sight"
  DeathSound "ophanim/death"
  PainSound	"ophanim/pain"
  ActiveSound "ophanim/active"
  Obituary "%o stared at an Ophanim for too long."
  HitObituary "%o bones were shattered by an Ophanim."
  DropItem "AngelHealthSpawner", 256
	DropItem "AngelHealthSpawner", 256
	DropItem "AngelHealthSpawner", 128
	DropItem "AngelHealthSpawner", 128
	DropItem "AngelHealthSpawner", 64

		var int user_haloactive;
			
  States
  {
  Spawn:
	OPHN A 0
	TNT1 A 0 A_JumpIf (user_haloactive == 1, "SpawnLoop")
	TNT1 A 0 A_SetUserVar (user_haloactive, 1)
    TNT1 A 0 A_SpawnItemEx ("OphanimHalo", 0,0,60, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	Goto SpawnLoop
  SpawnLoop:
    OPHN AB 10 A_Look
    Loop
  See:
	TNT1 A 0
	OPHN AABBCCDD 6 A_Chase
	Loop
  Missile:
	TNT1 A 0
	OPHN E 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
	OPHN E 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
	OPHN E 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
	OPHN E 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
	OPHN F 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
	OPHN F 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
	OPHN F 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
	OPHN F 20 A_FaceTarget
	TNT1 A 0 A_Jumpifcloser(50,"Melee")
    OPHN G 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN G 0 A_CustomMissile ("Sight1",35,-10,1)
	TNT1 A 0 A_FaceTarget
	OPHN H 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN H 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN H 0 A_FaceTarget
    OPHN G 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN G 0 A_CustomMissile ("Sight1",35,-10,1)
	TNT1 A 0 A_FaceTarget
	OPHN H 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN H 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN H 0 A_FaceTarget
    OPHN G 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN G 0 A_CustomMissile ("Sight1",35,-10,1)
	TNT1 A 0 A_FaceTarget
	OPHN H 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN H 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN H 0 A_FaceTarget
	OPHN I 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN I 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN J 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN J 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN I 0 A_FaceTarget
	OPHN I 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN I 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN J 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN J 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN I 0 A_FaceTarget
	OPHN I 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN I 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN J 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN J 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN I 0 A_FaceTarget
	OPHN I 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN I 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN J 10 A_CustomMissile ("Sight1",35,10,1)
	OPHN J 0 A_CustomMissile ("Sight1",35,-10,1)
	TNT1 A 0 A_MonsterRefire(128,"Sleep")
	OPHN I 0 A_FaceTarget
	OPHN KL 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff1")
	OPHN K 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN L 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN KL 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff2")
	OPHN K 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN L 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN KL 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff1")
	OPHN K 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN L 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN KL 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff2")
	OPHN K 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN L 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN KL 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff1")
	OPHN K 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN L 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN KL 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff2")
	OPHN K 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN L 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN MN 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff1")
	OPHN M 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN N 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN MN 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff2")
	OPHN M 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN N 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN MN 7 A_CustomBulletAttack (22.5, 0, 1, random(1,5) * 3, "Eyepuff1")
	OPHN M 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN N 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN N 0 A_FaceTarget
	TNT1 A 0 A_MonsterRefire(1,"Sleep")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN O 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff1")
	OPHN O 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN O 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 2 A_Custombulletattack(random(6,17),random(3,13),random(1,2),random(1,8),"Eyepuff2")
	OPHN P 0 A_CustomMissile ("Sight1",35,10,1)
	OPHN P 0 A_CustomMissile ("Sight1",35,-10,1)
	OPHN P 0 A_PlaySound("ophanim/bullet2")
	OPHN P 0 A_MonsterRefire(96,"Sleep")
	goto missile+101	
	Sleep:
	OPHN PPOONNMMLLKKJJII 3
	OPHN HHGG 14
	OPHN FFEE 60
	TNT1 A 0
	Goto See
   Melee:
    O4HN A 1
    O4HN B 1 A_FaceTarget
	TNT1 A 0 A_CustomMissile("OphanimMelee",0,0,0,0)
	TNT1 A 0 A_Recoil(-10)
    O4HN C 8
    Goto See
  Pain:                    // Secret animation
	TNT1 A 0
    OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN Y 10
	OPHN Z 8 A_Pain
	OPHN LLKKJJII 6
	OPHN HHGG 40
	OPHN FFEE 80
    Goto See
  Death.Ice:
	TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	O2HN A 120 
	O2HN A 1 A_BossDeath
	TNT1 A 0 A_SpawnItemEx ("FrozenOphanim", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
    Stop
   Death.PlayerVoid:
	TNT1 A 0
	Goto NakedDeath
   NakedDeath:
    TNT1 A 0
	TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
	TNT1 A 0 A_PlaySound("stonemaiden/pain",6,1, FALSE)
	TNT1 A 0 A_BossDeath
	O2HN Y 10 A_NoBlocking
	TNT1 AAAAAAAAAAAAA 0 A_SpawnItemEx ("Rrock06",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAA 0 A_SpawnItemEx("Rrock02",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAA 0 A_SpawnItemEx("Rrock03",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAA 0 A_SpawnItemEx ("Rrock04",random(-20,20),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAAA 0 A_SpawnItemEx("Rrock05",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Rrock01",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAA 0 A_SpawnItemEx ("Rrock04",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("Rrock05",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAA 0 A_SpawnItemEx("Rrock06",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Rrock01",random(-20,20),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAA 0 A_SpawnItemEx("Rrock02",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAA 0 A_SpawnItemEx("Rrock03",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 A 0 A_PlaySound ("stonemaiden/free")
	TNT1 A 0 A_SpawnItemEx ("StoneOphanim", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
    Stop
  Death:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_Scream
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_Quake(1,5,0,128,"nosound")
	O2HN Y 0 A_BossDeath
	TNT1 A 0 A_SpawnItemEx ("OphanimPCDeath", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	TNT1 AA 0 A_SpawnItemEx ("AviaryIceSpawner2")
	O2HN Y -1
	Stop
  Raise:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
    O2HN ZZZZ 5
	O2HN ZZZ 5 Bright
	TNT1 A 0 A_SpawnItemEx ("OphanimHalo", 0,0,60, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER) 
    Goto See+1
  }
}

Actor FrozenOphanim
{
  Health 150
  Radius 32
  Height 64
  ProjectilePassHeight -16
  Speed 6
  +SOLID
  +SHOOTABLE
  +PUSHABLE
  +NOICEDEATH
  +FULLVOLACTIVE
  +NOBLOOD
  -COUNTKILL
  DamageFactor "Ice", 0
  DamageFactor "Fire", 2
  States
  {
  Spawn:
	O2HN B 140
	O2HN C 60
	TNT1 A 0 A_Dropitem ("Eyecandy")
	O2HN D 80 A_PlaySound("angel/blink")
	TNT1 A 0 A_PlaySound("angel/frozensoild")
	O2HN EFGHI 12
	O2HN JKLM 20
	O2HN N 10000000000000
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
	Stop
   Death:
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
    Stop
   Death.PlayerVoid:
	TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
	TNT1 A 0 A_PlaySound("stonemaiden/pain",6,1, FALSE)
	O2PN O 1 Bright A_NoBlocking
	TNT1 A 0 A_PlaySound ("stonemaiden/free")
	TNT1 A 0 A_Jump (128, "Altstone")
	TNT1 A 0 A_SpawnItemEx ("StoneOphanim", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
    Stop
  AltStone:
	TNT1 A 0 A_SpawnItemEx ("StoneOphanim2", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
    Stop
  }
}

ACTOR QuietOphanim : Ophanim
{
  Tag "Ophanim"
  SeeSound "bird/flock"
  DeathSound "body/altgore"
  PainSound "bird/flap"
  ActiveSound "bird/flap"
  States
  {
  Death:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_Scream
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_Quake(1,5,0,128,"nosound")
	O2HN Y 0
	TNT1 A 0 A_SpawnItemEx ("OphanimPCDeath", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	TNT1 AA 0 A_SpawnItemEx ("AviaryIceSpawner2")
	O2HN Y -1
	Stop
	}
}

Actor StoneOphanim
{
  Health 1000
  Radius 20
  Height 56
  Mass 800
  +SOLID
  +SHOOTABLE
  +PUSHABLE
  +DONTBLAST
  +DONTMORPH
  +DONTRIP
  +NOICEDEATH
  +FULLVOLACTIVE
  +NOBLOOD
  +NEVERTARGET
  -COUNTKILL
	DamageFactor "FireMagic", 0
	DamageFactor "Poison", 0
	DamageFactor "Melee", 2.0
	DamageFactor "Ice", 0
	DamageFactor "Fire", 0
	DamageFactor "Electric", 0
	DamageFactor "Magic", 0
	DamageFactor "PlayerVoid", 0
  States
  {
  Spawn:
	O2HN O 3 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 3 Bright
	O2HN O 3 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 3 Bright
	O2HN O 3 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 3 Bright
	O2HN O 3 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 3 Bright
	O2HN O 3 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 3 Bright
	O2HN O 2 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 2 Bright
	O2HN O 2 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 2 Bright
	O2HN O 2 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 2 Bright
	O2HN O 2 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 2 Bright
	O2HN O 1 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 1 Bright
	O2HN O 1 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 1 Bright
	O2HN O 1 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 1 Bright
	O2HN O 1 Bright A_PlaySound("angel/stonebeam")
	O2HN PQ 1 Bright
	O2HN R 25 Bright
	O2HN ST 50 Bright A_PlaySound("stonemaiden/pain")
	O2HN UVW 50 A_PlaySound("stonemaiden/pain")
	TNT1 A 0 A_PlaySound("stonemaiden/pain4")
	O2HN X -1
	Stop
  Death:
	TNT1 A 0 A_PlaySound("stonemaiden/pain",6,1, FALSE)
	O2HN X 1 A_NoBlocking
	TNT1 AAAAAAAAAAAAA 0 A_SpawnItemEx ("Rrock06",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAA 0 A_SpawnItemEx("Rrock02",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAA 0 A_SpawnItemEx("Rrock03",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAA 0 A_SpawnItemEx ("Rrock04",random(-20,20),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAAA 0 A_SpawnItemEx("Rrock05",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Rrock01",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAA 0 A_SpawnItemEx ("Rrock04",random(-16,16),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("Rrock05",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAA 0 A_SpawnItemEx("Rrock06",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx ("Rrock01",random(-20,20),random(-16,16),42,random(-100,100)/20.0,random(-100,100)/20.0,random(-100,100)/20.0,0)
	TNT1 AAAA 0 A_SpawnItemEx("Rrock02",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 AAA 0 A_SpawnItemEx("Rrock03",0,0,32,random(-10,10),random(-10,10),random(5,10))
	TNT1 A 0 A_PlaySound ("stonemaiden/free")
    Stop
  }
}

Actor StoneOphanim2 : StoneOphanim
{
}

Actor OphanimPCDeath
{
  -NOINTERACTION
  -SOLID
   +NOGRAVITY
  +DONTFALL
  States
  {
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Quake(5,3,0,4)
	TNT1 AAA 0 A_SpawnItemEx("WhiteFeather",random(-20,20),random(-20,20),20,random(-5,5),random(-5,5))
	TNT1 AA 0 A_SpawnItemEx("BrownFeather",random(-30,30),random(-30,30),20,random(-5,5),random(-5,5))
	TNT1 AAAA 0 A_SpawnItemEx("WhiteFeather",random(-40,30),random(-40,40),20,random(-5,5),random(-5,5))
	TNT1 AAA 0 A_SpawnItemEx("BrownFeather",random(-50,50),random(-50,50),20,random(-5,5),random(-5,5))
	TNT1 AA 0 A_SpawnItemEx("WhiteFeather",random(-60,60),random(-60,60),25,random(-5,5),random(-5,5))
	TNT1 AAAAAA 0 A_SpawnItemEx("WhiteFeather",random(-70,70),random(-70,70),25,random(-5,5),random(-5,5))
	TNT1 AAA 0 A_SpawnItemEx("BrownFeather",random(-80,80),random(-80,80),25,random(-10,10),random(-10,10))
	TNT1 AAAAAA 0 A_SpawnItemEx("WhiteFeather",random(-70,70),random(-70,70),25,random(-5,5),random(-5,5))
	TNT1 AAA 0 A_SpawnItemEx("BrownFeather",random(-80,80),random(-80,80),25,random(-10,10),random(-10,10))
	TNT1 AAA 0 A_SpawnItemEx("BrownFeather",random(-50,50),random(-50,50),20,random(-5,5),random(-5,5))
	TNT1 AA 0 A_SpawnItemEx("WhiteFeather",random(-60,60),random(-60,60),25,random(-5,5),random(-5,5))
	TNT1 AAAAAA 0 A_SpawnItemEx("WhiteFeather",random(-70,70),random(-70,70),25,random(-5,5),random(-5,5))
	TNT1 AAA 0 A_SpawnItemEx("BrownFeather",random(-80,80),random(-80,80),25,random(-10,10),random(-10,10))
	TNT1 AAAAAA 0 A_SpawnItemEx("WhiteFeather",random(-70,70),random(-70,70),25,random(-5,5),random(-5,5))
	TNT1 AAA 0 A_SpawnItemEx("BrownFeather",random(-80,80),random(-80,80),25,random(-10,10),random(-10,10))
	O2HN Z 20 Bright
	O2HN ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 1 Bright A_Fadeout(0.01)
	O2HN ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 1 A_Fadeout(0.01)
	O2HN ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 2 A_Fadeout(0.02)
	TNT1 A 0
	Stop
	}
}

ACTOR OphanimCast : Ophanim
{
  States
	{
  See:
	OPHN AABBCCDDAABBCCDD 6 A_Chase
	Loop
  Missile:
    OPHN EF 20 A_FaceTarget
    OPHN GHIJKLMNOPOPOP 10 
	Goto See
  Melee:
    O4HN A 2
    O4HN B 2 A_FaceTarget
    O4HN C 8
    Goto See
  Death:
    OPHN Q 8 A_Scream
    OPHN R 10 A_NoBlocking
    OPHN STU 15
    OPHN VW 8 A_BossDeath
	OPHN X 10 
    Stop
	}
}