/*
================================================================================
	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 A_JumpIf(Getcvar("AA_IrisShutUp") == 2, "SummonQuietIris")
	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
  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
	
	var int user_haloactive;
			
  States
  {
  Spawn:
  	IIIS A 0 NoDelay A_SpawnItemEx ("IrisHalo", 0,0,70, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
// 	TNT1 A 0 A_JumpIf (user_haloactive == 1, "SpawnLoop")
// 	TNT1 A 0 A_SetUserVar (user_haloactive, 1)
	TNT1 A 0 A_Jump(256, "SpawnLoop")
	Goto SpawnLoop
  Idle:
  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 Bright A_FaceTarget
	IIIS H 10 Bright 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 A_SetUserVar (user_haloactive, 0)
	TNT1 AAAAAAAAA 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 K 5
	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 K 5
	TNT1 AAAAA 0 A_SpawnItemEx("RainbowBlood", Random(-4,4), 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 K 5
	TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("RainbowBlood", Random(-10,10), 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 L 10 Bright A_PlaySound("seraph/attackx")
	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 M 5 Bright A_Scream
	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 N 5 Bright A_NoBlocking
	TNT1 AAAA 0 A_SpawnItemEx("RainbowBlood", Random(-4,4), 0, 20, 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)
	TNT1 A 0 Bright A_playsound("iris/break")
    IIIS OP 5 Bright
	TNT1 AA 0 A_SpawnItemEx("RainbowBlood", Random(-4,4), 0, 10, 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 QR 5
    IIIS S -1
    Stop
  Death.PlayerVoid:
// 	TNT1 A 0 A_JumpIf(Getcvar("AA_Petrify") == 1, "Death")
// 	TNT1 A 0 A_JumpIf(Getcvar("AA_Fanservice") == 2, "Death")
	TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
	TNT1 A 0 A_playsound("stonemaiden/pain",6,1, FALSE)
	I2IS A 1 Bright 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_Jump (128, "Altstone")
	TNT1 A 0 A_SpawnItemEx ("StoneIris", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
    Stop
  AltStone:
	TNT1 A 0 A_SpawnItemEx ("StoneIris2", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
    Stop
  Raise:
	TNT1 A 0 // A_SetUserVar (user_haloactive, 0)
    IIIS R 5
    IIIS QPONMLK 5
	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"
}

Actor StoneIris
{
  Health 1000
  Radius 20
  Height 56
  Mass 800
  +SOLID
  +SHOOTABLE
  +PUSHABLE
  +DONTBLAST
  +DONTMORPH
  +DONTRIP
  +NOICEDEATH
  +FULLVOLACTIVE
  +NOBLOOD
  +NEVERTARGET
  -COUNTKILL
	DamageFactor "Poison", 0
	DamageFactor "Melee", 2.0
	DamageFactor "Ice", 0
	DamageFactor "Fire", 0
	DamageFactor "Electric", 0
	DamageFactor "Magic", 0
	DamageFactor "Playervoid", 0
  States
  {
  Spawn:
	I2IS A 3 Bright A_playsound("angel/stonebeam")
	I2IS BC 3 Bright
	I2IS A 3 Bright A_playsound("angel/stonebeam")
	I2IS BC 3 Bright
	I2IS A 3 Bright A_playsound("angel/stonebeam")
	I2IS BC 3 Bright
	I2IS A 3 Bright A_playsound("angel/stonebeam")
	I2IS BC 3 Bright
	I2IS A 3 Bright A_playsound("angel/stonebeam")
	I2IS BC 3 Bright 
	I2IS A 2 Bright A_playsound("angel/stonebeam")
	I2IS BC 2 Bright 
	I2IS A 2 Bright A_playsound("angel/stonebeam")
	I2IS BC 2 Bright 
	I2IS A 2 Bright A_playsound("angel/stonebeam")
	I2IS BC 2 Bright 
	I2IS A 2 Bright A_playsound("angel/stonebeam")
	I2IS BC 2 Bright 
	I2IS A 1 Bright A_playsound("angel/stonebeam")
	I2IS BC 1 Bright 
	I2IS A 1 Bright A_playsound("angel/stonebeam")
	I2IS BC 1 Bright 
	I2IS A 1 Bright A_playsound("angel/stonebeam")
	I2IS BC 1 Bright 
	I2IS D 25 Bright
	I2IS EF 50 Bright A_playsound("stonemaiden/pain")
	I2IS GH 50 A_playsound("stonemaiden/pain")
	TNT1 A 0 A_playsound("stonemaiden/pain4")
	I2IS I -1
	Stop
  Death:
	TNT1 A 0 A_playsound("stonemaiden/pain",6,1, FALSE)
	I2IS I 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 StoneIris2 : StoneIris
{
//   +SPRITEFLIP
}
