//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"
  Tag "Hades Sphere"
  +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:
  TNT1 A 0 Radius_Quake(1,5,0,10,0) //(intensity, duration, damrad, tremrad, tid)
    HADE A 2 Bright A_Playsound("monster/hadwlk")
    HADE ABBCCDD 2 Bright A_GiveInventory("HS_SpecialChase", 1) // [Blue Shadow] Conditional A_Chase
    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
	TNT1 A 0 Radius_Quake(1,10,0,10,0) //(intensity, duration, damrad, tremrad, tid)
	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:
    "####" "#" 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 A_CheckFlag("SKULLFLY", "ThrustChase")
    TNT1 A 0 A_Chase
    Stop
  ThrustChase:
    TNT1 A 0 A_Chase("", "")
    Stop
  }
}
//End of Hades Sphere