/*
CREDITS:
Music - Wagner (Ride of the Valkyries)
Sprites:
Beacon - Made by me, from bits provided by Rogue Ent. (Strife, reinforcements beacon)
Nuke - Minigunner
Original nuke - KeksDose
Sounds:
Pickup - ?
Deploy - Midway (Turok, propably)
Hugeass Nuke Launch - Trion Ent.
*/

ACTOR HindenburgBeacon : CustomInventory
{
  Tag "Hindenburg"
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Inventory.InterHubAmount 1
  Inventory.Icon "ARTIBEAD"
  Inventory.PickupSound "Weapons/HindenburgPick"
  Inventory.UseSound "Items/Throw"
  Inventory.PickupMessage "You've got the ''Hindenburg Two'' Delivery System Beacon! 90 thousand pounds of glory!"
  //Obituary "%k enjoys his moment of schadenfreude when %o took a zeppelin-sized nuclear bomb to the everything."
  +INVENTORY.INVBAR
  Scale 0.9
  States
  {
  Spawn:
    BEAD A -1
    Stop
  Use:
    TNT1 A 1 A_FireCustomMissile("HindenburgDeployer",0,0,0)
    Stop
  }
}

ACTOR HindenburgDeployer
{ 
    Radius 10
    Height 16
    Mass 1250
	Speed 10
    Scale 1
    Damage 0
    PROJECTILE
    -NOGRAVITY
    +THRUGHOST
    +EXPLODEONWATER
    Gravity 1
    Scale 0.9
    States
   {
    Spawn:
      BEAD A 0
      BEAD A 0 ThrustThingZ(0, 20, 0, 1)
    Looplet:
      BEAD A 1
      Loop
    Death:
      BEAD A 17
      BEAD D 0 A_PlaySound("Weapons/HindenburgDeploy")
      BEAD ABCD 3
      BEAH A 17
    Looper:
      TNT1 A 0 A_JumpIfInventory("HindenburgCounter",10,"KaboomBabe")
      TNT1 A 0 A_GiveInventory("HindenburgCounter",1)
      BEAH B 17 A_PlaySound("Weapons/GopnikNukeTick")
      BEAH A 17
      Loop
    KaboomBabe:
      TNT1 A 0 A_PlaySound("Weapons/HindenburgFire",5,1.0,0,ATTN_NONE)
      TNT1 A 0 A_Quake(9, 35, 0, 4096, "none")
      TNT1 A 0 A_CustomMissile("HindenburgDropper",0,0,0,CMF_TRACKOWNER,-90)
      BEAH A 35
      BEAD D 0 A_PlaySound("Weapons/HindenburgDeploy")
      BEAD DCBA 3
	  BEAD A 35
	  BEAD A 1 A_FadeOut(0.1)
      Wait
   }
}

ACTOR HindenburgCounter : Inventory
{
     Inventory.MaxAmount 99
}

actor HindenburgDropper
{
  Radius 8
  Height 13
  Speed 1
  Projectile
  +NOINTERACTION
  +NOCLIP
  +SEEKERMISSILE
  +CEILINGHUGGER
  +SPAWNCEILING
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 ACS_Execute(705)
    TNT1 A 50
  Death:
  HereComesTehBoi:
    TNT1 A 0 A_SpawnItemEx("HindenburgMissile",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
    Stop
  }
}

ACTOR HindenburgMissile
{
   Speed 1
   Radius 8
   Height 12
   Scale 47 //it's... HUUUUUUUUUUUUUUUUUUUUUGE!
   SeeSound ""
   Obituary "%k enjoys his moment of schadenfreude when %o took a zeppelin-sized nuclear bomb to the everything."
   PROJECTILE
   -NOGRAVITY
   Gravity 0.04
   +RIPPER
   +FORCERADIUSDMG
   +FOILINVUL
   States
   {
   Spawn:
      TNT1 A 0
      TNT1 A 0 A_PlaySound("Weapons/RideOfValkyrie",7,1.0,1,ATTN_NONE)
      HIND A 1
      Loop
   Death:
      TNT1 A 0 A_StopSound(7)
      TNT1 A 0 A_SpawnItemEx("MegaNuke",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
      TNT1 A 0 ACS_Execute(706)
      stop
   }
}