//////////Rare Birds///////////

/*
================================================================================
	Puckish Prankster
	
	Class: Rare outer sphere angel
		
	Extra tricky Cherubs with a reputation for pulling off pranks. These Cherubs 
don bright red bows to alert other angels of possible prank attacks.
================================================================================
*/

Actor EliteCherubSpawner 
{
  +NOBLOCKMAP
  +NOSECTOR
  +NOGRAVITY
  +THRUACTORS
  +SPAWNFLOAT
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("EliteCherub",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	}
}

ACTOR EliteCherub
{
  Health 80
  Radius 20
  Height 56
  Mass 30
  Speed 14
  PainChance 120
  Monster
  Species "Cherub"
  Tag "Puckish Prankster"
  +FLOAT
  +NOGRAVITY
  +SPAWNFLOAT
  +MISSILEEVENMORE
  +NOICEDEATH
  DamageFactor "NoRainbowRip", 1
  DamageFactor "KissMagic", 2
  SeeSound "cherub/sight"
  PainSound "cherub/pain"
  DeathSound "cherub/death"
  ActiveSound "cherub/active"
  HitObituary "%o was slapped silly by a Puckish Prankster."
  Obituary "%o was fatally pranked by a Michevious Cherub."
	DropItem "Clip"
	DropItem "AngelHealthSpawner" 256
    DropItem "AngelHealthSpawner" 128
	DropItem "AngelHealthSpawner" 64
	DropItem "Cell" 8
	DropItem "Rarecandyspawner1" 8
  
	var int user_haloactive;
	
  States
  {
  Spawn:
	RDCB A 0 // Blank frame with the angel's sprite, in case a map or script makes them dormant, or for mods like Corruption Cards.
	TNT1 A 0 A_JumpIf (user_haloactive == 1, "SpawnLoop") // Makes sure the halo is only spawned once.
	TNT1 A 0 A_SetUserVar (user_haloactive, 1)
    TNT1 A 0 A_SpawnItemEx ("CherubHalo", 0,0,28, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	Goto SpawnLoop
  SpawnLoop:
	RDCB ABCDABCDABCD 10 A_Look
	RD2B ABCD 5 A_Look
	Loop
  See:
    RDCB AABB 3 A_Chase 
	RDCB C 4 A_FastChase
	TNT1 A 0 A_PlaySound("bird/flap")
	RDCB DD 3 A_Chase 
	TNT1 A 0 A_Jump (64, 1)
    Loop
	TNT1 A 0 A_PlaySound("cherub/bubble1")
	TNT1 AAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-10, 10), random(-10, 10),random(-10, 10) )
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10),random(-10, 10))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble3", random(-10, 10), random(-10, 10),random(-10, 10))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10),random(-10, 10))
	TNT1 AAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-10, 10), random(-10, 10),random(-10, 10))
	TNT1 AAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20),random(-20, 20))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-20, 20), random(-20, 20),random(-20, 20))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble", random(-20, 20), random(-20, 20),random(-20, 20))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20),random(-20, 20))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-20, 20), random(-20, 20),random(-20, 20))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-40, 40), random(-40, 40),random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	RD2B AABB 3 A_FastChase 
	RD2B C 4 A_FastChase
	TNT1 A 0 A_PlaySound("bird/flap")
	RD2B DD 3 A_FastChase 
	Loop
  Melee:
    RDCB EF 8 A_FaceTarget
    RDCB G 6 A_CustomMeleeAttack(1,"cherub/melee")
	Goto See
  Missile:
    RDCB EF 8 A_FaceTarget
    RDCB G 6 A_CustomMissile ("TrickyWaterBall",20,10,0)
	RDCB F 4 A_FaceTarget
    RDCB G 3 A_CustomMissile ("TrickyWaterBall",20,10,0)
	RDCB F 4 A_FaceTarget
    RDCB G 3 A_CustomMissile ("TrickyWaterBall",20,10,0)
	Goto See
  Pain:
	TNT1 A 0 A_SpawnItemEx("WhiteFeather",random(-20,20),random(-20,20),30,random(-5,5),random(-5,5),random(-5,5))
	TNT1 A 0 A_SpawnItemEx("WhiteFeather",random(-20,20),random(-20,20),30,random(-5,5),random(-5,5),random(-5,5))
    RDCB H 2
    RDCB H 2 A_Pain
    Goto See
  Death:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_Scream
	CHUB H 1
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_SpawnItemEx ("CherubPCDeath")
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
	TNT1 AAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble3", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-100, 100), random(-100, 100),random(-100, 100))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	CH3B P -1
	Stop
  XDeath:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_PlaySound("cherub/gib")
	TNT1 A 0 A_NoBlocking
	TNT1 AAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble3", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-100, 100), random(-100, 100),random(-100, 100))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAA 0 A_SpawnItemEx("CloudGibSpawner")
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
	CH3B P -1
	Stop
  Death.CALinkedBomb:
  Death.CALinked:
		TNT1 A 0
		TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
		TNT1 A 0 A_SetUserVar (user_haloactive, 0)
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 a_changeflag ("THRUACTORS",1)
		TNT1 A 0 A_Stop
		TNT1 A 0 A_PlaySound ("Angels/LinkedHurt",0,0.80)
		TNT1 A 1 A_SpawnItemEx ("CALinkedKillAngel",0,0,35)
		TNT1 A 0 A_PlaySound ("Angels/LinkedDeath",0,1,0,0.90)
		TNT1 A 2
		TNT1 A 3 ThrustThingZ (0,30,0,1)
		DTHZ C 2
		DTHZ C -1
		Stop
  Raise:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0) // Shouldn't be necessary, but just in case.
	CH2B P 10
	CH2B P 10 BRIGHT
    Goto Spawn
  Noextracherub:
		TNT1 A 0
		TNT1 A 0 A_Changeflag("COUNTKILL",FALSE)
		TNT1 A 0 A_SpawnItemEx ("LostFlower", 0,0,0,0,0,0,0,0,0,0)
		Stop
  }
}

ACTOR QuietEliteCherub : EliteCherub
{
  Tag "Puckish Prankster"
  SeeSound "bird/song"
  PainSound "virgin/pain"
  DeathSound "body/altgore"
  ActiveSound "bird/flock"
  States
  {
  Death:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_Scream
	CHUB H 1
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_SpawnItemEx ("CherubPCDeath")
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
	TNT1 AAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble3", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-100, 100), random(-100, 100),random(-100, 100))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 A 0
	Stop
  XDeath:
	TNT1 A 0
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_XScream
	TNT1 A 0 A_NoBlocking
	TNT1 AAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble3", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-10, 10), random(-10, 10), random(-10, 10))
	TNT1 AAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAA 0 Bright A_CustomMissile("BigBigBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AA 0 Bright A_CustomMissile("BigBigBubble2", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-20, 20), random(-20, 20), random(-20, 20))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAAAAAAAAAAAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-40, 40), random(-40, 40), random(-40, 40))
	TNT1 AAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble3", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAAA 0 Bright A_CustomMissile("BigBigBubble2", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 AAAA 0 Bright A_CustomMissile("TinyTinyBubble", random(-100, 100), random(-100, 100),random(-100, 100))
	TNT1 AAAAAAA 0 Bright A_CustomMissile("BigBigBubble", random(-100, 100), random(-100, 100), random(-100, 100))
	TNT1 A 0 A_SpawnItemEx ("CherubPCDeath")
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
	TNT1 A 0
	Stop
  }
}

/*
================================================================================
	Rusalka
	
	Class: Rare outer sphere angel
		
	On death, Rusalka will freeze and then explode into dozens of deadly ice 
shards. If gibbed, she will instantaniously explode into more deadly ice shards.
	

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

Actor RusalkaSpawner
{
  +NOBLOCKMAP
  +NOSECTOR
  +THRUACTORS
  States
  {
  Spawn:
  	TNT1 A 0
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("Rusalka",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	SummonQuietRusalka:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("QuietRusalka",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	}
}

ACTOR Rusalka
{
  Health 50
  Radius 20
  Height 56
  Mass 60
  Speed 8
  PainChance 200
  Tag "Rusalka"
  Bloodcolor "Blue"
  Monster
  +FLOAT
  +MISSILEMORE
  +NOGRAVITY
  +NOICEDEATH
  DamageFactor "Ice", 0
  DamageFactor "Fire", 2
  DamageFactor "KissMagic", 3
  SeeSound "snow/altsight"
  PainSound "snow/pain"
  DeathSound "snow/death"
  ActiveSound "snow/active"
  AttackSound "snow/attack"
  Obituary "%o felt the chill of Rusalka."
  Dropitem "Clip" 256
    DropItem "AngelHealthSpawner" 128
		DropItem "AngelHealthSpawner" 128
		DropItem "AngelHealthSpawner" 128
		DropItem "AngelHealthSpawner" 128
		DropItem "Clipbox" 1
			
		var int user_haloactive;
			
  States
  {
  Spawn:
  	S2OW A 0
	TNT1 A 0 A_JumpIf (user_haloactive == 1, "SpawnLoop")
	TNT1 A 0 A_SetUserVar (user_haloactive, 1)
    TNT1 A 0 A_SpawnItemEx ("SnowBallHalo", 0,0,40, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	Goto SpawnLoop
  SpawnLoop:
    S2OW AB 10 A_Look
    Loop
  See:
    S2OW AABBCCDD 3 A_Chase
    Loop
  Missile:
    S2OW E 15 A_FaceTarget
    S2OW FG 3 Bright A_CustomMissile ("Flake" ,20,0,1)
	S2OW G 0 Bright A_CustomMissile ("Flake",20,0,45, CMF_AIMDIRECTION)
	S2OW G 0 Bright A_CustomMissile ("Flake",20,0,-45, CMF_AIMDIRECTION)
	S2OW G 0 Bright A_CustomMissile ("Flake",20,0,90, CMF_AIMDIRECTION)
	S2OW G 0 Bright A_CustomMissile ("Flake",20,0,-90, CMF_AIMDIRECTION)
    S2OW F 1 A_CPosRefire
    Goto Missile+1
  Pain:
    S2OW H 5
    S2OW H 5 A_Pain
    Goto See
  Death:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
    S2OW I 10 A_PlaySound ("angel/frozensoild")
	S2OW I 10 Bright
	S2OW I 10
	S2OW I 5 Bright
	S2OW I 5
	S2OW I 5 Bright
	S2OW I 5
	S2OW I 3 Bright
	S2OW I 3
	S2OW I 3 Bright
	S2OW I 3
	S2OW I 3 Bright
	S2OW I 3
	S2OW I 1 Bright
	S2OW I 1
	S2OW I 1 Bright
	S2OW I 1
	S2OW I 1 Bright
	S2OW I 1
	S2OW I 1 Bright
	S2OW I 1
	S2OW I 1 Bright
	S2OW I 1
	S2OW I 1 Bright
	S2OW I 1
	TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
	TNT1 A 1 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
	TNT1 A 0 A_SpawnItemEx ("SnowballPCDeath")
	TNT1 A 0 A_NoBlocking
		TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,45, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,-45, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,90, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,-90, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,135, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,-135, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,180, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,0, CMF_AIMDIRECTION)
		TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,-45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,-90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,-135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,180, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",26,0,0, CMF_AIMDIRECTION)
		TNT1 A 0 Bright A_CustomMissile ("WeakFlake",12,0,45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",38,0,-45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",38,0,90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",38,0,-90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",38,0,135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",38,0,-135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",38,0,180, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",38,0,0, CMF_AIMDIRECTION)
		TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,-45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,-90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,-135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,180, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("WeakFlake",50,0,0, CMF_AIMDIRECTION)
	TNT1 A 0 A_PlaySound ("snow/gib")
	TNT1 A 0
    Stop
  XDeath:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
	TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
	TNT1 I 1 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner")
	TNT1 A 0 A_NoBlocking
		TNT1 A 0 Bright A_CustomMissile ("BigFlake2",12,0,45, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("BigFlake1",12,0,-45, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("BigFlake2",12,0,90, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("BigFlake1",12,0,-90, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("BigFlake2",12,0,135, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("BigFlake1",12,0,-135, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("BigFlake2",12,0,180, CMF_AIMDIRECTION)
	TNT1 A 0 Bright A_CustomMissile ("BigFlake1",12,0,0, CMF_AIMDIRECTION)
		TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",26,0,45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",26,0,-45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",26,0,90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",26,0,-90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",26,0,135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",26,0,-135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",26,0,180, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",26,0,0, CMF_AIMDIRECTION)
		TNT1 A 0 Bright A_CustomMissile ("BigFlake2",12,0,45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",38,0,-45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",38,0,90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",38,0,-90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",38,0,135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",38,0,-135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",38,0,180, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",38,0,0, CMF_AIMDIRECTION)
		TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",50,0,45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",50,0,-45, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",50,0,90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",50,0,-90, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",50,0,135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",50,0,-135, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake1",50,0,180, CMF_AIMDIRECTION)
	TNT1 AA 0 Bright A_CustomMissile ("BigFlake2",50,0,0, CMF_AIMDIRECTION)
	TNT1 A 0 A_PlaySound ("snow/gib")
    Stop
  Raise:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
    S2OW UTSRQPONMLKJ 2
	TNT1 H 0 A_SpawnItemEx ("SnowballHalo", 0,0,40, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	GoTo See
  Death.CALinkedBomb:
  Death.CALinked:
		TNT1 A 0
		TNT1 A 0 A_Changeflag("DONTCORPSE",TRUE)
		TNT1 A 0 A_SetUserVar (user_haloactive, 0)
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 a_changeflag ("THRUACTORS",1)
		TNT1 A 0 A_Stop
		TNT1 A 0 A_PlaySound ("angels/LinkedHurt",0,0.80)
		TNT1 A 1 A_SpawnItemEx ("CALinkedKillAngel",0,0,35)
		TNT1 A 0 A_PlaySound ("angels/LinkedDeath",0,1,0,0.90)
		TNT1 A 2
		TNT1 A 3 ThrustThingZ (0,30,0,1)
		DTHZ C 2
		DTHZ C -1
		Stop
  NoExtraRusalka:
		TNT1 A 0
		TNT1 A 0 A_Changeflag("COUNTKILL",FALSE)
		TNT1 A 1 A_SpawnItemEx ("LostFlower", 0,0,0,0,0,0,0,0,0,0)
		Stop
  }
}

ACTOR QuietRusalka : Rusalka
{
  Tag "Rusalka"
  SeeSound "snow/altsight"
  PainSound "virgin/pain"
  DeathSound "body/altgore"
  ActiveSound "bird/flap"
  }



ACTOR RusalkaSpawner2 : RandomSpawner replaces "DeadDemon"
{
  +NOBLOCKMAP
  +NOSECTOR
  +NOGRAVITY
  +THRUACTORS
	DropItem "WWhiteCandlestick" 255, 14
    DropItem "RusalkaSpawner" 255, 1
}

ACTOR WWhiteCandlestick
{
  Radius 20
  Height 14
  ProjectilePassHeight -16
  States
  {
  Spawn:
    CAND A -1 Bright
    Stop
  }
}

ACTOR LostFlower
{
  Radius 20
  Height 14
  ProjectilePassHeight -16
  States
  {
  Spawn:
    FWLR A -1 
    Stop
  }
}

ACTOR LostFlowerKeen : LostFlower
{
  States
  {
    Spawn:
    FWLR A 100 
	FWLR A 1 A_Keendie
    Loop
	}
}

//////// Jay /////////

Actor JaySpawnerA replaces MBFHelperDog
{
  +NOBLOCKMAP
  +NOSECTOR
  +THRUACTORS
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("Jay",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	SummonQuietJay:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("QuietJay",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	}
}

Actor JaySpawner replaces CommanderKeen
{
  +NOBLOCKMAP
  +NOSECTOR
  +THRUACTORS
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("Jay",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	SummonQuietJay:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("QuietJay",0,0,0, 0, 0,0,0, SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG )
	Stop
	}
}

ACTOR Jay 
{
  Health 300
  PainChance 180
  Speed 10
  Radius 30
  Height 56
  Mass 300
  Scale 1.1
  Monster
  Tag "Jay"
  +FLOORCLIP
  +NOICEDEATH
  SeeSound "jay/sight"
  AttackSound "cardinal/melee"
  PainSound "jay/pain"
  DeathSound "jay/death"
  ActiveSound "jay/active"
  HitObituary "%o was shredded by a Jay."
  DamageFactor "Judgement", 0
  DamageFactor "UndeadGoHomeImpact", 0
  DamageFactor "KissMagic", 4
  DropItem "Shell" 256
  DropItem "Clip" 256
  DropItem "AngelHealthSpawner" 128
	DropItem "AngelHealthSpawner" 128
	DropItem "AngelHealthSpawner" 128
	DropItem "AngelHealthSpawner" 128
	DropItem "Rarecandyspawner2", 8

	var int user_haloactive;
			
  States
  {
  Spawn:
  	JARD A 0
	TNT1 A 0 A_JumpIf (user_haloactive == 1, "SpawnLoop")
	TNT1 A 0 A_SetUserVar (user_haloactive, 1)
    TNT1 A 0 A_SpawnItemEx ("JayHalo", 0,0,56, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	Goto SpawnLoop
	SpawnLoop:
	JARD WXYZ 10 A_Look
	Loop
  See:
    JARD AABBCCDD 2 Fast A_Chase
	TNT1 A 0 A_Jump (16, "Takeoff")
    Loop
  TakeOff:
	JA2D A 3
	JA2D B 6
	JA2D C 4
  Goto TakeOff2
  TakeOff2:
	TNT1 A 0 A_Changeflag("FLOAT",TRUE)
	TNT1 A 0 A_Changeflag("NOGRAVITY",TRUE)
	TNT1 A 0 A_Changeflag("NOPAIN",TRUE)
	TNT1 A 0 A_Changeflag("FLOAT",TRUE)
	TNT1 A 0 ThrustThingZ(0,7,0,0)
	JA2D DE 4
	Goto Flight
  Flight:
	JARD WXY 3 A_Chase 
	TNT1 A 0 A_PlaySound("bird/flap")
	JARD ZWXY 3 A_Chase
	TNT1 A 0 A_PlaySound("bird/flap")
	JARD ZWXY 3 A_Chase
	TNT1 A 0 A_PlaySound("bird/flap")
	JARD ZWXY 3 A_Chase
	TNT1 A 0 A_PlaySound("bird/flap")
	JARD ZWXY 3 A_Chase
	TNT1 A 0 A_PlaySound("bird/flap")
	JARD ZWXY 3 A_Chase
	TNT1 A 0 A_PlaySound("bird/flap")
	JARD ZWXY 3 A_Chase
	TNT1 A 0 A_PlaySound("bird/flap")
	JARD ZWXY 3 A_Chase
	JARD Z 3 A_Chase
	TNT1 A 0 A_Jump (128, "Charge")
	TNT1 A 0 A_Jump (16, "Land")
	Loop
  Charge:
  	JA2D C 5 A_FaceTarget
	TNT1 A 0 A_Changeflag("FLOAT",FALSE)
	TNT1 A 0 A_Changeflag("NOGRAVITY",FALSE)
	TNT1 A 0 A_Changeflag("NOPAIN",FALSE)
	JA2D B 5 A_SkullAttack
	JARD AE 5 A_SkullAttack
	TNT1 A 0 Bright A_PlaySound("cardinal/melee1")
	JARD F 5 Fast A_SargAttack 
	TNT1 A 0 Bright A_PlaySound("cardinal/melee2")
    JARD G 5 Fast A_SargAttack 
	JARD EE 16
	Goto See
  Land:
	TNT1 A 0 A_Changeflag("FLOAT",FALSE)
	TNT1 A 0 A_Changeflag("NOGRAVITY",FALSE)
	TNT1 A 0 A_Changeflag("NOPAIN",FALSE)
	JA2D EDCB 4
	JA2D A 8
	Goto See
  Melee:
    TNT1 A 0 A_Changeflag("FLOAT",FALSE)
	TNT1 A 0 A_Changeflag("NOGRAVITY",FALSE)
	TNT1 A 0 A_Changeflag("NOPAIN",FALSE)
    JARD E 8 Fast A_FaceTarget
	TNT1 A 0 Bright A_PlaySound("cardinal/melee1")
	JARD F 5 Fast A_SargAttack 
	TNT1 A 0 Bright A_PlaySound("cardinal/melee2")
    JARD G 5 Fast A_SargAttack 
	JARD EE 16
    Goto See
  Pain:
	TNT1 A 0 A_Changeflag("FLOAT",FALSE)
	TNT1 A 0 A_Changeflag("NOGRAVITY",FALSE)
	TNT1 A 0 A_Changeflag("NOPAIN",FALSE)
	TNT1 A 0 A_SpawnItemEx("BlueFeather",random(-20,20),random(-20,20),40,random(-5,5),random(-5,5),random(-5,5))
	TNT1 A 0 A_SpawnItemEx("BlueFeather",random(-20,20),random(-20,20),45,random(-5,5),random(-5,5),random(-5,5))
    JARD H 2 Fast
    JARD H 2 Fast A_Pain
    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_KeenDie
	JARD H 2
	JARD H 1
	TNT1 A 0 A_SpawnItemEx ("JayDeathPC", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	TNT1 A 0 A_SpawnItemEx ("AviaryIceSpawner") 
	JA2D P -1
	Stop
  Raise:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
    JARD N 5
    JARD MLKJI 5
	TNT1 I 0 A_SpawnItemEx ("JayHalo", 10,0,56, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
    Goto See
  NoextraJay:
	TNT1 A 0
  	TNT1 A 1 A_Changeflag("COUNTKILL",FALSE)
	TNT1 A 0 A_SpawnItemEx ("LostFlowerKeen")
	Stop
  }
}

ACTOR QuietJay : Jay
{
  Tag "Cardinal"
  SeeSound "crow/sight1"
  PainSound "generic/pain"
  DeathSound "crow/death1"
  ActiveSound "crow/active1"
}

ACTOR Jay2 : Jay replaces DeadLostSoul 
{
	Tag "Jay"
}

ACTOR JaySpawner2 : RandomSpawner replaces "Brainstem"
{
  +NOBLOCKMAP
  +NOSECTOR
  +NOGRAVITY
  +THRUACTORS
	DropItem "WWhiteCandlestick" 255, 19
    DropItem "JaySpawner" 255, 1
}

Actor JayDeathPC
{
   Scale 1.1
  +NOGRAVITY
  +DONTFALL
  States
  {
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Quake(5,3,0,4)
	TNT1 AAA 0 A_SpawnItemEx("BlueFeather",random(-30,30),random(-30,30),45,random(-5,5),random(-5,5))
	TNT1 AAAA 0 A_SpawnItemEx("BlueFeather",random(-30,30),random(-30,30),45,random(-5,5),random(-5,5))
	TNT1 AAAAAAAA 0 A_SpawnItemEx("BlueFeather",random(-20,20),random(-20,20),45,random(-5,5),random(-5,5),random(-5,80))
	TNT1 AAAA 0 A_SpawnItemEx("BlueFeather",random(-20,20),random(-20,20),45,random(-5,5),random(-5,5),random(-5,5))
	CA3D V 20 Bright
	CA3D VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 1 BRIGHT A_Fadeout(0.01)
	CA3D VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 1 A_Fadeout(0.01)
	CA3D VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 2 A_Fadeout(0.02)
	TNT1 A 0
	Stop
	}
}

ACTOR SSrandomizer : RandomSpawner replaces WolfensteinSS
{
  +NOBLOCKMAP
  +NOSECTOR
  +NOGRAVITY
  +THRUACTORS
	DropItem "EliteCherubSpawner" 255, 1
	DropItem "RusalkaSpawner" 255, 1
}


ACTOR HeadOnAStick01
{
  Radius 16
  Height 56
  ProjectilePassHeight -16
  +SOLID
  States
  {
  Spawn:
    POL4 A -1
    Stop
  }
}

ACTOR GoldenGoose 
{
  Health 2500
  Radius 9
  Height 22
  Mass 40
  Speed 4
  PainChance 200
  Monster
  Tag "Golden Goose"
  Damagetype "GoldenGooseDamage"
  -COUNTKILL
  +FLOAT
  +NOGRAVITY
  +WINDTHRUST
  +DONTMORPH
  +FLOORCLIP
  +FRIENDLY
  +BOSS
  SeeSound "chicken/pain"
  AttackSound "chicken/attack"
  PainSound "chicken/pain"
  DeathSound "chicken/death"
  ActiveSound "chicken/active"
  Obituary "%o met the Golden Goose"
  States
  {
  Spawn:
    K8CK AB 10 A_Look
    Loop
  See:
    K8CK AB 3 A_Chase
    Loop
  Pain:
    K8CK D 5 
    K8CK C 5 A_Pain
    Goto See
  Melee:
    K8CK A 8 A_FaceTarget
    K8CK C 10 A_CustomMeleeAttack(1000, "chicken/attack", "chicken/attack", "GoldenGooseDamage")
    Goto See
  Death:
    K8CK E 6 A_Scream
    K8CK F 6 A_Feathers
    K8CK G 6
    K8CK H 6 A_NoBlocking
    K8CK IJK 6
    K8CK L -1
    Stop
  }
  
}

ACTOR Barrelspawnner : RandomSpawner replaces ExplosiveBarrel
{
  +NOBLOCKMAP
  +NOSECTOR
  +NOGRAVITY
  +THRUACTORS
	DropItem "NormalExplosivebarrel" 255, 99
    DropItem "AngelicBarrel" 255, 1
}

ACTOR NormalExplosivebarrel
{
  Health 20
  Radius 10
  Height 42
  +SOLID
  +SHOOTABLE
  +NOBLOOD
  +ACTIVATEMCROSS
  +DONTGIB
  +NOICEDEATH
  +OLDRADIUSDMG
  -COUNTKILL
  DeathSound "world/barrelx"
  Obituary "$OB_BARREL" // "%o went boom."
  States
  {
  Spawn:
    BAR1 AB 6
    Loop
  Death:
    BEXP A 5 Bright
    BEXP B 5 Bright A_Scream
    BEXP C 5 Bright
    BEXP D 5 Bright A_Explode
    BEXP E 10 Bright
    TNT1 A 1050 Bright A_BarrelDestroy
    TNT1 A 5 A_Respawn
    Wait
  }

}
	
ACTOR AngelicBarrel
{
  Health 20
  Radius 10
  Height 42
  Mass 30
  Speed 14
  PainChance 120
  Species "Angelic Barrel"
  +FLOAT
  +NOGRAVITY
  +SPAWNFLOAT
  +SOLID
  +SHOOTABLE
  +NOBLOOD
  +ACTIVATEMCROSS
  +DONTGIB
  +NOICEDEATH
  +OLDRADIUSDMG
  +AVOIDMELEE
  -COUNTKILL
  Obituary "%o didn't know. All barrels go to heaven."
 
  	var int user_haloactive;
  
  States
  {
    Spawn:
	AB8L A 0 // Blank frame with the angel's sprite, in case a map or script makes them dormant, or for mods like Corruption Cards.
	TNT1 A 0 A_JumpIf (user_haloactive == 1, "SpawnLoop") // Makes sure the halo is only spawned once.
	TNT1 A 0 A_SetUserVar (user_haloactive, 1)
    TNT1 A 0 A_SpawnItemEx ("CherubHalo", 0,0,28, 0,0,0, 0, SXF_NOCHECKPOSITION | SXF_SETMASTER)
	Goto SpawnLoop
  SpawnLoop:
	AB8L ABC 4 A_Wander
	TNT1 A 0 A_PlaySound("bird/flap")
	AB8L D 4 A_Wander
	Loop
  See:
    AB8L AABBCCD 10 A_Wander
    Loop
  Death:
	TNT1 A 0 A_SetUserVar (user_haloactive, 0)
    AB8L E 10 Bright
	AB8L F 10 Bright A_Scream
	TNT1 A 0 A_PlaySound ("seraph/attack4")
    AB8L F 5 Bright A_Explode(200,256)
    AB8L G 20 Bright
    TNT1 A 1050 Bright A_BarrelDestroy
    TNT1 A 5 A_Respawn
    Wait
  }
}