/*
================================================================================
	Aspect of Iris
	
	Class: Inner Sphere angel
	
"A half-human, half angel hybrid, Aspects of Iris are among the most feared 
soldiers in the angelic host. Up close, she can form a rainbow blade from her 
chalice to cut down evil. At medium distance, she can summon a heat-seeking 
butterfly who can be tricky to shake off. She is ineffective at long range
attacks as her butterflies will expire after a short period of time."

-The Aspect of Iris is an all around dangerous enemy that thrives in close to
medium range combat. She is more deadly than the revenant at melee range as she
will lunge towards the player with her rainbow blade. Her butterflies are unique 
as they are ripper missiles, meaning that they will do high amounts of damage
especially if the player is standing still. The butterflies have a time limit 
and will expire after 10-15 seconds, meaning that the Aspect of Iris is not as
dangerous at a distance as the butterflies will expire long before reaching the
player. 
Butterflies come in two varities, pink and green. Pink butterflies travel slowly
and can be tough to shake off, especially in narrow cordidors. 
Green butterflies move as quick as revenant fireballs and pose a greater threat.
While the butterflies will expire given enough time, they can be baited into
walls and instantly explode.
A clever player will use the ripper ability to their advantage. If cornered, it 
is sometimes better to run quickly through the butterfly and take minimul damage.
Butterflies are also skilled and starting angel infighting.
Iris butterflies are experts at killing the Crucified Seraph. Just be ready to
take down that egg.
  
================================================================================
*/

ACTOR AspectOfIrisSpawner replaces Revenant // Spawns the Aspect of Iris or the Quiet Iris.
{
  +NOBLOCKMAP
  +NOSECTOR
  +THRUACTORS
  States
  {
  Spawn:
  	TNT1 A 0
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("Aspect_of_Iris",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	SummonQuietIris:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("QuietIris",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	}
}

ACTOR Aspect_of_Iris
{
  Health 300
  Radius 20
  Height 56
  Mass 450
  Speed 10
  PainChance 25
  Monster
  MeleeThreshold 256
  Bloodcolor "Purple"
  Tag "Aspect of Iris"
  +MISSILEMORE 
  +FLOORCLIP
  +NOICEDEATH
  DamageFactor "UndeadGoHomeImpact", 0
  DamageFactor "Judgement", 0
  DamageFactor "Holy", 0
  DamageFactor "CABladeBeam", 0.5 //Combine arms pistol
  DamageFactor "PlayerVoid", 0.5
  DamageFactor "KissMagic", 3
  SeeSound "iris/sight"
  PainSound "iris/pain"
  DeathSound "iris/death"
  ActiveSound "iris/active"
  MeleeSound "iris/blade"
  HitObituary "%o was decapitated by an Aspect of Iris."
  Obituary "%o could not evade an Aspect of Iris's pet."
	DropItem "AngelHealthSpawner", 256
	DropItem "AngelHealthSpawner", 256
	DropItem "AngelHealthSpawner", 128
	DropItem "Cell", 8
	DropItem "Shell", 8
	DropItem "Clip", 8
	DropItem "Rocketammo", 8
	DropItem "IrisDressSpawner",1
	
	var int user_haloactive;
			
  States
  {
  Spawn:
  	IIIS A 0
	TNT1 A 0 A_JumpIf (user_haloactive == 1, "SpawnLoop") 
	TNT1 A 0 A_SetUserVar (user_haloactive, 1)
    TNT1 A 0 A_SpawnItemEx ("IrisHalo", 0,0,70, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	Goto SpawnLoop
  SpawnLoop:
    IIIS CCDD 8 A_Look
    Loop
  See:
    IIIS AABBCCDD 2 A_Chase
	TNT1 A 0 A_Jump (96, 1)
    Loop
	IIIS TTUU 2 A_Chase 
	IIIS VV 2 A_Chase 
	IIIS WW 2 A_Chase 
    Loop
  Melee:
    IIIS E 6 A_playsound("iris/blade")
    IIIS F 6 A_FaceTarget
	TNT1 A 0 A_Recoil(-10)
    IIIS G 6 A_CustomMeleeAttack(70,"iris/blade")
    Goto See
  Missile:
	IIIS H 0 A_FaceTarget
	IIIS H 10 A_FaceTarget
    IIIS I 5 A_FaceTarget
	IIIS I 0 A_Jump (64, 3)
    IIIS I 4 A_CustomMissile ("Butterfly",80,-20,1)
    IIIS H 2
    Goto See
    IIIS I 4 A_CustomMissile ("ButterflyFast",80,-20,1)
    IIIS H 2
    Goto See
  Pain:
	TNT1 AAAAA 0 A_SpawnItemEx("RainbowBlood", Random(-4,4), 0, Random(35,60), Random(-25,25)*0.1, Random(-25,25)*0.1, Random(0,30)*0.1, 0, SXF_TRANSFERTRANSLATION | SXF_ABSOLUTEPOSITION | SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY | SXF_NOCHECKPOSITION, 0, 0)
    IIIS J 3
	TNT1 AAA 0 A_SpawnItemEx("RainbowBlood", Random(-6,6), 0, Random(35,55), Random(-25,25)*0.1, Random(-25,25)*0.1, Random(0,30)*0.1, 0, SXF_TRANSFERTRANSLATION | SXF_ABSOLUTEPOSITION | SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY | SXF_NOCHECKPOSITION, 0, 0)
	IIIS J 2
	TNT1 AAAAA 0 A_SpawnItemEx("RainbowBlood", Random(-4,4), 0, Random(35,50), Random(-25,25)*0.1, Random(-25,25)*0.1, Random(0,30)*0.1, 0, SXF_TRANSFERTRANSLATION | SXF_ABSOLUTEPOSITION | SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY | SXF_NOCHECKPOSITION, 0, 0)
    IIIS J 3 A_Pain
	TNT1 AAAA 0 A_SpawnItemEx("RainbowBlood", Random(-4,4), 0, Random(35,50), Random(-25,25)*0.1, Random(-25,25)*0.1, Random(0,30)*0.1, 0, SXF_TRANSFERTRANSLATION | SXF_ABSOLUTEPOSITION | SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY | SXF_NOCHECKPOSITION, 0, 0)
    IIIS J 3 
	Goto See
  Death:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_Scream
	TNT1 A 0 A_NoBlocking
	I2IS D 2
	TNT1 A 0 A_SpawnItemEx ("IrisPCDeath", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner2")
	I2IS J -1
	Stop
  Raise:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
    I2IS DDDD 5
	I2IS DDD 5 BRIGHT
	TNT1 A 0 A_SpawnItemEx ("IrisHalo", 10,0,70, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
    Goto See
  }
}

ACTOR QuietIris : Aspect_of_Iris
{
  Tag "Aspect of Iris"
  SeeSound "rain/altint"
  DeathSound "iris/altdeath"
  PainSound "generic/pain"
  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
	I2IS D 2
	TNT1 A 0 A_SpawnItemEx ("IrisPCDeath", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner2")
	I2IS J -1
	Stop
	}
}

Actor IrisPCDeath
{
  -NOINTERACTION
  -SOLID
  +NOGRAVITY
  +DONTFALL
  States
  {
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Quake(5,3,0,4)
	I2IS D 20 Bright
	I2IS DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 1 Bright A_Fadeout(0.01)
	I2IS DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 1 A_Fadeout(0.01)
	I2IS DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 2 A_Fadeout(0.02)
	TNT1 A 0
	Stop
	}
}

ACTOR IrisCast : Aspect_of_Iris
{
  States
	{
  See:
    IIIS AABBCCDD 3 A_Chase
	IIIS TTUU 3 A_Chase 
	IIIS VV 3 A_Chase 
	IIIS WW 3 A_Chase 
    Loop
  Melee:
    IIIS E 6 
    IIIS F 6 
	TNT1 A 0 
    IIIS G 6
    Goto See
  Missile:
	IIIS H 6
    IIIS I 6
    IIIS I 4 
    IIIS H 2
    Goto See
  Death:	
	IIIS K 5
	IIIS K 5
	IIIS L 10 Bright A_PlaySound("seraph/attackx")
    IIIS M 5 Bright A_Scream
    IIIS N 5 Bright A_NoBlocking
    IIIS OP 5 Bright
	IIIS QR 5
    IIIS S 10
    Stop
	}
}
