//Monster-Death Incarnate
ACTOR Incarnate 30115
{
//$Title "Death Incarnate"
//$Category Monsters
Health 100
Radius 20
Height 56
Mass 500
Speed 12
MeleeDamage 7
PainChance 64
MONSTER
Damagefactor IncarnateShot, 0
// [MagicWazard] Note to modders: adding a GibHealth value of 50 - 100 will make
// it easier to trigger his Hades Sphere-spawning XDeath sequence
+FLOORCLIP
+SHORTMISSILERANGE
//Zandronum 2.0:
//+DONTHARMCLASS
Obituary "%o was killed by a Death Incarnate's glare."
HitObituary "%o was beaten to death by a Death Incarnate."
SeeSound "monster/incsit"
PainSound "skeleton/pain"
DeathSound "monster/incdth"
ActiveSound "monster/incact"
AttackSound "monster/incatk"
MeleeSound "monster/inchit"
States
   {
   Spawn:
	TNT1 A 35 //Let the monster drop to the ground since we spawn
			  //them way above ground level so they don't get stuck
			  //in the floor.
	TNT1 A 0 A_SetTranslucent(0.0, 2)
	INCA Q 6 A_SetTranslucent(0.2, 2)
	INCA Q 6 A_SetTranslucent(0.4, 2)
	INCA Q 6 A_SetTranslucent(0.6, 2)
	INCA Q 6 A_SetTranslucent(0.8, 2)
	INCA Q 6 A_SetTranslucent(1.0, 0) //opaque
	INCA QPONML 7 //Play death animation in reverse so it looks
	              //like it's coming out of the ground
	//Continue to next state
	SpawnLook:
       INCA AB 10 A_Look
       Loop
   See:
       INCA AABBCCDDEEFF 2 A_Chase
       Loop
   Melee:
       INCA G 0 A_Jump(128,5)
       INCA G 0 A_FaceTarget
       INCA G 6 A_SkelWhoosh
       INCA H 6 A_FaceTarget
       INCA I 6 A_MeleeAttack
       Goto See
       INCA R 0 A_FaceTarget
       INCA R 5 A_SkelWhoosh
       INCA S 5 A_FaceTarget
       INCA T 5 A_MeleeAttack
       INCA G 0 A_FaceTarget
       INCA G 5 A_SkelWhoosh
       INCA H 5 A_FaceTarget
       INCA I 5 A_MeleeAttack
       Goto See
   Missile:
       INCA J 5 A_FaceTarget
       INCA J 5
       INCA U 10 Bright A_CustomBulletAttack(30,0,5,3,"DIpuff",1024)
       INCA K 10
       Goto See
   Pain:
       INCA L 5
       INCA L 5 A_Pain
       Goto See
   Death:
       INCA L 0 A_Jump(192,7)
       INCA LM 7
       INCA N 7 A_Scream
       INCA O 7 A_NoBlocking
       INCA P 7
       INCA Q -1
       Stop
       INCA LM 7
       INCA N 7 A_Scream
       INCA O 7 A_NoBlocking
       INCA P 7
       INCA Q 0 A_Jump(192,4)
       INCA Q 0 A_Jump(128,4)
       INCA Q 0 A_Jump(96,4)
       INCA Q 0 A_Jump(64,4)
       INCA Q 115
       INCA Q 115
       INCA Q 115
       INCA Q 115
       INCA Q 115
       INCA Q -1 Thing_Raise(0)
       Stop
   XDeath:
       INCX A 10 Bright A_Playsound("monster/incexp")
       INCX BC 5 Bright
       INCX D 5 Bright A_NoBlocking
       INCX D 0 Bright A_SpawnItem("HS",0,32)
       INCX EFGHIJ 5 Bright
       INCX K -1
   Raise:
       INCA Q 0 A_KillChildren
       INCA QPONML 5
       Goto See
   }
}

ACTOR DIPuff
{
   Radius 0
   Height 1
   Speed 0
   PROJECTILE
   RENDERSTYLE NONE
   DamageType IncarnateShot
   States
   {
   Spawn:
      TNT1 A 2 Bright
      Stop
   }
}
//End of Incarnate


//Hades Sphere
ACTOR HS 30116
{
  //$Title "Hades Sphere"
  //$Category Monsters
  Health 35
  Radius 24
  Height 48
  Mass 3000
  Speed 10
  Obituary "%o was blown away by a Hades Sphere."
  Monster
  SeeSound "monster/hadsit"
  DeathSound "monster/hadexp"
  +LOOKALLAROUND
  +DONTGIB
  +NOTARGET
  +NOGRAVITY
  +FLOAT
  +DONTFALL
  //+DONTHARMCLASS // [MagicWazard] See "notes" below
  States
  {
  Spawn:
    TNT1 A 1 Bright A_Look
    Loop
  See:
    HADE EFGH 4 Bright
  SeeLoop:
    HADE A 2 Bright A_Playsound("monster/hadwlk")
    HADE ABBCCDD 2 Bright A_GiveInventory("HS_SpecialChase", 1) // [Blue Shadow] Conditional A_Chase
    //Zandronum 2.0:
	//TNT1 A 0 A_CheckFlag("SKULLFLY", "SeeLoop") // [Blue Shadow] Don't bother trying to teleport out while "skull-flying"
    TNT1 A 0 A_Jump(32, "TeleportOut")
    Loop
  TeleportOut:
    TNT1 A 0 A_UnSetSolid
    TNT1 A 0 A_UnSetShootable
    HADE H 5 Bright A_Playsound("monster/hadtel")
    HADE GFEIJKL 4 Bright
  SeeTeleport:
    TNT1 AAAAAAAA 2 A_Chase(0)
    TNT1 A 0 A_Jump(96, "TeleportIn")
    Loop
  TeleportIn:
    HADE L 3 Bright A_Playsound("monster/hadtel")
    HADE KJIEFG 4 Bright
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_SetSolid
    Goto SeeLoop
  Melee:
    TNT1 A 0 A_SetInvulnerable
    HADE HGFE 4 Bright
    TNT1 A 0 A_UnSetInvulnerable
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_Die
    Stop
  Death:
    TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_SetTranslucent(0.9, 1)
	TNT1 A 0 A_Scream
	HADE M 4 Bright A_Explode(112, 112)/*, XF_NOTMISSILE)*/
    HADE NOPQ 5 Bright
    Stop
  XDeath:
    TNT1 A 0 A_Noblocking
    HADE H 5 Bright A_PlaySound("monster/haddth")
    HADE GFE 4 Bright
    HADE RSTUVWX 4 Bright
    Stop
  Death.Ice:
    TNT1 A 0 A_ChangeFlag("NOGRAVITY", FALSE)
    Goto GenericFreezeDeath
  }
}

// [MagicWazard] NOTES: +DONTHARMCLASS was originally enabled, but HS were still
// able to damage each other with self-destructs due to way the self-destruct
// was coded. Now that the self-destruct code has been changed, they are
// invulnerable to each others' explosions if that flag is enabled. Keep
// +DONTHARMCLASS disabled if you want the HS to be vunlerable to each others'
// explosions! Remove the comments and enable the flag if you want the HS to be
// immune to other HS' self-destruct damage.


// [Blue Shadow] Depending on whether or not the Hades Sphere is currently flying
// (due to A_SkullAttack), choose the appropriate "chase mode".
ACTOR HS_SpecialChase : CustomInventory
{
  States
  {
  Pickup:
    TNT1 A 0 
    //TNT1 A 0 A_CheckFlag("SKULLFLY", "ThrustChase")
    TNT1 A 0 A_Chase
    Stop
  ThrustChase:
    TNT1 A 0 A_Chase("", "")
    Stop
  }
}
//End of Hades Sphere