/*
================================================================================
	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
  +NOICEDEATH
  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:
	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 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 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
	}
}