/*
CREDITS:
INFO - Frankensprite - a sprite made of parts of other sprites.
Just like frankenstein is a mashup of other people's limbs. Crazy, eh?

Frankensprite - Mophead561, bits from 3DRealms (Duke Nukem 3D)
Projectile - KeksDose

Sounds:
Up - Epic Games (UT2004)
Charge, Fire - Westwood (C&C Renegade)
Add Fire 1 - Blizzard (Starcraft 2)
Add Fire 2 - EA (C&C3)
Impact - ?
Alt-Fire - ?
Alt-Fire Recharge - ID (ET: Quake Wars)
Recharge finish - ?

Minibelisk loop, explode - ID (Quake 4)
*/

ACTOR Stachanov : Weapon 24511
{
   //$Category Weapons
   //$Title Stachanov
   //$Sprite OBLGX0
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "Picked up a ''Stachanov'' portabelisk of light! Let's do some overtime! (7)"
   Obituary "%o was burned to ashes by %k's ''Stachanov''."
   Weapon.UpSound "weapons/StachanovUp"
   Weapon.SelectionOrder 2
   Weapon.AmmoType "NukeCellAmmo"
   Weapon.AmmoUse 2
   Weapon.AmmoGive 30
   Weapon.AmmoType2 "MinibeliskCharge"
   Weapon.AmmoUse2 0
   Weapon.AmmoGive2 0
   Weapon.Kickback 125
   Weapon.SlotNumber 7
   Scale 0.65
   +NOALERT
   States
   {
   Spawn:
      OBLG X -1
      Loop
   Ready:
      OBLG A 0
      OBLG BCDBCD 2 A_WeaponReady(WRF_NOFIRE)
   ReadyMain:
      OBLG A 0 A_JumpIfInventory("MinibeliskCharge",1,"Discharge")
      OBLG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedReady")
      OBLG A 1 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      Loop
   Discharge:
      OBLG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedDischarge")
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      OBLG A 25 A_WeaponReady
      OBLG A 0 A_PlaySound("Weapons/MinibeliskCharge",5,0.9)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      OBLG A 53 A_WeaponReady
      OBLG A 0 A_PlaySound("Weapons/MinibeliskReady",5,0.5)
      OBLG A 0 A_TakeInventory("MinibeliskCharge",1)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      OBLG Y 10 A_WeaponReady
      Goto ReadyMain
   Select:
      OBLG A 0 A_TakeInventory("Zoomed",999)
      OBLG A 1 A_Raise
      OBLG A 0 A_Raise
      Loop
   Deselect:
      OBLG A 0 A_ZoomFactor(1)
      OBLG A 0 A_StopSound(5)
      OBLG A 0 A_TakeInventory("ZoomedDischargeCounter",999)
      OBLG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedDeselect")
      OBLG A 0 A_SetTranslucent(1,0)
      OBLF A 0 A_TakeInventory("ObeliskPower",3)
      OBLG A 1 A_Lower
      OBLG A 0 A_Lower
      Loop
   Fire:
      OBLF A 0 A_TakeInventory("ZoomedDischargeCounter",999)
      OBLF A 0 A_JumpIfInventory("Zoomed",1,"ZoomedFire")
      OBLG A 4
      OBLF A 0 A_ReFire("Charge1A")
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile",0,1,12.5,-2,0,0)
      OBLF A 0 A_SetBlend("Red",0.25,15)
      OBLF A 0 A_StopSound(5)
      OBLF A 0 A_GunFlash
      OBLF A 0 A_AlertMonsters
      OBLF A 0 A_PlaySound("Weapons/StachanovFire",1)
      OBLF A 0 A_PlaySound("Weapons/StachanovAddFire",0)
      OBLF A 1 BRIGHT A_ZoomFactor(0.95)
      OBLF B 1 BRIGHT A_ZoomFactor(0.96)

      OBLF B 1 A_ZoomFactor(0.97)
      OBLF C 1 A_ZoomFactor(0.98)
      OBLF D 1 A_ZoomFactor(0.99)
      OBLF E 1 A_ZoomFactor(0.995)

      OBLF F 1 A_ZoomFactor(1)
      OBLG BCDBCD 2
      OBLG A 2
      OBLG A 1 A_ClearReFire
      goto ReadyMain
   Charge1A: //Stage 1, aka "looks like he's gonna rack up some more power."
      OBLG A 0 A_PlaySound("Weapons/StachanovCharge",5,1.0,1)
      OBLG D 0 A_Quake (1, 9, 0, 3, none)
      OBLG BCD 3 A_SetBlend("Red",0.1,6)
      TNT1 A 0 A_ReFire("Charge1B")
      Goto Fire+3
   Charge1B:
      OBLG D 0 A_Quake (1, 9, 0, 3, none)
      OBLG BCD 3 A_SetBlend("Red",0.1,6)
      TNT1 A 0 A_ReFire("Charge1C")
      Goto ChargedFire1
   Charge1C:
      OBLG D 0 A_Quake (1, 9, 0, 3, none)
      OBLG BC 3 A_SetBlend("Red",0.1,6)
      TNT1 A 0 A_ReFire("Charge2A")
      Goto ChargedFire1

   Charge2A: //Stage 2, aka "Should we stay in his line of fire? I don't think so."
      OBLG D 0 A_Quake (2, 6, 0, 3, none)
      OBLG BCD 2 A_SetBlend("Red",0.15,6)
      TNT1 A 0 A_ReFire("Charge2B")
      Goto ChargedFire2
   Charge2B:
      OBLG D 0 A_Quake (2, 6, 0, 3, none)
      OBLG BCD 2 A_SetBlend("Red",0.15,6)
      TNT1 A 0 A_ReFire("Charge2C")
      Goto ChargedFire2
   Charge2C:
      OBLG D 0 A_Quake (1, 6, 0, 3, none)
      OBLG BCD 2 A_SetBlend("Red",0.15,6)
      TNT1 A 0 A_ReFire("Charge2D")
      Goto ChargedFire2
   Charge2D:
      OBLG D 0 A_Quake (1, 6, 0, 3, none)
      OBLG BCD 2 A_SetBlend("Red",0.15,6)
      TNT1 A 0 A_ReFire("Charge3A")
      Goto ChargedFire2

   Charge3A:	//Stage 3, aka "HOLYSHITHESGONNABLOWMYASSOFF!!"
      OBLG D 0 A_Quake (1, 6, 0, 3, none)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      TNT1 A 0 A_ReFire("Charge3B")
      Goto ChargedFire3
   Charge3B:
      OBLG D 0 A_Quake (1, 6, 0, 3, none)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      TNT1 A 0 A_ReFire("Charge3C")
      Goto ChargedFire3
   Charge3C:
      OBLG D 0 A_Quake (1, 6, 0, 3, none)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      TNT1 A 0 A_ReFire("Charge3D")
      Goto ChargedFire3
   Charge3D:
      OBLG D 0 A_Quake (1, 6, 0, 3, none)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      OBLG BC 1 A_SetBlend("Red",0.2,1)
      OBLG D 1 A_SetBlend("Red",0.18,1)
      Goto ChargedFire3

   ChargedFire1:
      OBLF A 0 A_PlaySound("Weapons/StachanovCharged1",6)
      OBLF A 0 A_SetBlend("Red",0.3,20)
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile1",0,1,12.5,-2,0,0.0)
      Goto Fire+5
   ChargedFire2:
      OBLF A 0 A_PlaySound("Weapons/StachanovCharged2",6)
      OBLF A 0 A_SetBlend("Red",0.35,25)
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile2",0,1,12.5,-2,0,0.0)
      Goto Fire+5
   ChargedFire3:
      OBLF A 0 A_PlaySound("Weapons/StachanovCharged3",6)
      OBLF A 0 A_SetBlend("Red",0.4,30)
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile3",0,1,12.5,-2,0,0.0)
      Goto Fire+5
	  
   AltFire:
      OBLF A 0 A_TakeInventory("ZoomedDischargeCounter",999)
      OBLF A 0 A_JumpIfInventory("NukeCellAmmo",8,1)
      Goto HeckNo
      OBLF A 0 A_JumpIfInventory("Zoomed",1,"ZoomedAltFire")
      OBLF A 0 A_JumpIfInventory("MinibeliskCharge",3,"HeckNo")

      OBLF A 0 A_TakeInventory("NukeCellAmmo",8,TIF_NOTAKEINFINITE)
      OBLF A 0 A_GiveInventory("MinibeliskCharge",1)
      OBLF A 0 A_SetBlend("Red",0.25,15)
      OBLF A 0 A_FireCustomMissile("MinibeliskSpawner",0,1,12.5,-2,0,0)
      OBLF A 0 A_StopSound(5)
      OBLF A 0 A_GunFlash
      OBLF A 0 A_AlertMonsters
      OBLF A 0 A_PlaySound("Weapons/MinibeliskFire",6,0.8)
      OBLF A 0 A_PlaySound("Weapons/StachanovFire",1)
      OBLF A 1 BRIGHT A_ZoomFactor(0.95)
      OBLF B 1 BRIGHT A_ZoomFactor(0.96)

      OBLF B 1 A_ZoomFactor(0.97)
      OBLF C 1 A_ZoomFactor(0.98)
      OBLF D 1 A_ZoomFactor(0.99)
      OBLF E 1 A_ZoomFactor(0.995)

      OBLF F 1 A_ZoomFactor(1)
      OBLG BCDBCD 2
      OBLG A 2
      OBLG A 1 A_ClearReFire
      goto ReadyMain
   HeckNo:
      OBLG Y 10 A_JumpIfInventory("Zoomed",1,"ZoomedHeckNo")
      OBLG Y 10 A_PlaySound("Weapons/MinibeliskNope",5,0.5)
	  OBLG A 6
	  Goto ReadyMain


   ZoomedReady:
      XBSZ A 0 A_JumpIfInventory("MinibeliskCharge",1,"ZoomedDischarge")
      XBSZ A 0 A_SetBlend("Red",0.2,2)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      XBSZ A 1 A_WeaponReady(WRF_NOBOB)
      Goto ReadyMain
  ZoomedDeselect:
      XBSZ A 0 A_PlaySound("weapons/StachanovZoom",5,1.0,1)
      XBSZ A 0 A_TakeInventory("Zoomed",999)

      XBSZ A 0 A_SetTranslucent(0.9,0)
      XBSZ A 0 A_SetBlend("Red",0.2,3)
      XBSZ A 1 A_SetBlend("Black",0.15,3) 
      
      XBSZ A 0 A_SetTranslucent(0.92,0)
      XBSZ A 0 A_SetBlend("Red",0.18,3)
      XBSZ A 1 A_SetBlend("Black",0.3,3)
      
      XBSZ A 0 A_SetTranslucent(0.94,0)
      XBSZ A 0 A_SetBlend("Red",0.16,3)
      XBSZ A 1 A_SetBlend("Black",0.45,3)
      XBSZ A 0 A_ZoomFactor(1.00)
      
      XBSZ A 0 A_SetTranslucent(0.96,0)
      XBSZ A 0 A_SetBlend("Red",0.14,3)
      XBSZ A 1 A_SetBlend("Black",0.6,3)
      
      XBSZ A 0 A_SetTranslucent(0.98,0)
      XBSZ A 0 A_SetBlend("Red",0.12,3)
      XBSZ A 1 A_SetBlend("Black",0.75,3)
      
      XBSZ A 0 A_SetTranslucent(1,0)
      XBSZ A 0 A_SetBlend("Red",0.1,3)
      XBSZ A 1 A_SetBlend("Black",0.9,3)
      
      XBSZ AAAAAA 1 A_SetBlend("Black",1,11)
      
      OBLG A 0 A_StopSound(5)
      OBLG A 15 A_SetBlend("Black",0.9,10)
      OBLG A 1
  ZoomedDeselectMain:
      OBLF A 0 A_TakeInventory("ObeliskPower",3)
      OBLG A 0 A_Lower
      OBLG A 1 A_Lower
      Loop
   ZoomedFire:
      OBLG A 0 A_TakeInventory("ZoomedDischargeCounter",999)
      OBLF A 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ AAAA 1 A_SetBlend("Red",0.2,2)
      OBLF A 0 A_ReFire("ZoomedCharge1A")
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile",0,1,0,-3,0,0.0)
      OBLF A 0 A_SetBlend("Red",0.6,30)

      OBLF A 0 A_StopSound(5)
      OBLF A 0 A_AlertMonsters
      OBLF A 0 A_GunFlash
      OBLF A 0 A_PlayWeaponSound("Weapons/StachanovFire")
      XBSZ B 1 Bright A_ZoomFactor(2.95)
      XBSZ A 0 A_SetPitch (pitch-0.5)
      XBSZ B 1 Bright
      XBSZ A 0 A_SetPitch (pitch-0.25)
      XBSZ B 1 Bright
      XBSZ A 0 A_SetPitch (pitch-0.15)

      XBSZ B 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ A 0 A_SetPitch (pitch+0.15)
      XBSZ B 0 A_ZoomFactor(3.00)
      XBSZ B 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ A 0 A_SetPitch (pitch+0.25)
      XBSZ B 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ A 0 A_SetPitch (pitch+0.5)
      XBSZ BB 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ BBBB 1 A_SetBlend("Red",0.2,3)
      XBSZ AAAAAAAAA 1 A_SetBlend("Red",0.2,1)
      Goto ReadyMain
   ZoomedCharge1A:
      XBSZ C 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ C 0 A_PlaySound("Weapons/StachanovCharge",5,1.0,1)
      XBSZ C 0 A_Quake (1, 9, 0, 3, none)
      XBSZ BBBBBBBBB 1 A_SetBlend("Red",0.2,2)
      TNT1 A 0 A_ReFire("ZoomedCharge1B")
      Goto ZoomedFire+6
   ZoomedCharge1B:
      XBSZ C 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ C 0 A_Quake (1, 9, 0, 3, none)
      XBSZ CCCCCCCCC 1 A_SetBlend("Red",0.2,2)
      TNT1 A 0 A_ReFire("ZoomedCharge1C")
      Goto ZoomedFire1
   ZoomedCharge1C:
      XBSZ C 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ C 0 A_Quake (2, 9, 0, 3, none)
      XBSZ CCCCCCCCC 1 A_SetBlend("Red",0.2,2)
      TNT1 A 0 A_ReFire("ZoomedCharge2A")
      Goto ZoomedFire1

   ZoomedCharge2A:
      XBSZ D 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ D 0 A_Quake (3, 6, 0, 3, none)
      XBSZ DDDDDD 1 A_SetBlend("Red",0.25,2)
      TNT1 A 0 A_ReFire("ZoomedCharge2B")
      Goto ZoomedFire2
   ZoomedCharge2B:
      XBSZ D 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ D 0 A_Quake (3, 6, 0, 3, none)
      XBSZ DDDDDD 1 A_SetBlend("Red",0.25,2)
      TNT1 A 0 A_ReFire("ZoomedCharge2C")
      Goto ZoomedFire2
   ZoomedCharge2C:
      XBSZ D 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ D 0 A_Quake (3, 6, 0, 3, none)
      XBSZ DDDDDD 1 A_SetBlend("Red",0.25,2)
      TNT1 A 0 A_ReFire("ZoomedCharge2D")
      Goto ZoomedFire2
   ZoomedCharge2D:
      XBSZ D 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ D 0 A_Quake (3, 6, 0, 3, none)
      XBSZ DDDDDD 1 A_SetBlend("Red",0.25,2)
      TNT1 A 0 A_ReFire("ZoomedCharge3A")
      Goto ZoomedFire2

   ZoomedCharge3A:
      XBSZ E 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ E 0 A_Quake (3, 6, 0, 3, none)
      XBSZ EEEEEE 1 A_SetBlend("Red",0.3,2)
      TNT1 A 0 A_ReFire("ZoomedCharge3B")
      Goto ZoomedFire3
   ZoomedCharge3B:
      XBSZ E 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ E 0 A_Quake (3, 6, 0, 3, none)
      XBSZ EEEEEE 1 A_SetBlend("Red",0.3,2)
      TNT1 A 0 A_ReFire("ZoomedCharge3C")
      Goto ZoomedFire3
   ZoomedCharge3C:
      XBSZ E 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ E 0 A_Quake (3, 6, 0, 3, none)
      XBSZ EEEEEE 1 A_SetBlend("Red",0.3,2)
      TNT1 A 0 A_ReFire("ZoomedCharge3D")
      Goto ZoomedFire3
   ZoomedCharge3D:
      XBSZ E 0 A_JumpIfNoAmmo("UnZoom")
      XBSZ E 0 A_Quake (3, 6, 0, 3, none)
      XBSZ EEEEEE 1 A_SetBlend("Red",0.3,2)
      Goto ZoomedFire3

   ZoomedFire1:
      OBLF A 0 A_SetPitch (pitch-0.25)
      OBLF A 0 A_SetBlend("Red",0.65,30)
      OBLF A 0 A_PlaySound("Weapons/StachanovCharged1",6)
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile1",0,1,0,-3,0,0.0)
      Goto ZoomedFire+8
   ZoomedFire2:
      OBLF A 0 A_SetPitch (pitch-0.5)
      OBLF A 0 A_SetBlend("Red",0.7,35)
      OBLF A 0 A_PlaySound("Weapons/StachanovCharged2",6)
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile2",0,1,0,-3,0,0.0)
      Goto ZoomedFire+8
   ZoomedFire3:
      OBLF A 0 A_SetPitch (pitch-0.75)
      OBLF A 0 A_SetBlend("Red",0.75,40)
      OBLF A 0 A_PlaySound("Weapons/StachanovCharged3",6)
      OBLF A 0 A_FireCustomMissile("ObeliskProjectile3",0,1,0,-3,0,0.0)
      Goto ZoomedFire+8
   ZoomedAltFire:
      OBLF A 0 A_JumpIfInventory("NukeCellAmmo",8,1)
      Goto ZoomedHeckNo
      OBLF A 0 A_JumpIfInventory("MinibeliskCharge",3,"ZoomedHeckNo")

      OBLF A 0 A_TakeInventory("NukeCellAmmo",8,TIF_NOTAKEINFINITE)
      OBLF A 0 A_GiveInventory("MinibeliskCharge",1)
      OBLF A 0 A_SetBlend("Red",0.6,30)
      OBLF A 0 A_FireCustomMissile("MinibeliskSpawner",0,1,0,-3,0,0.0)

      OBLF A 0 A_StopSound(5)
      OBLF A 0 A_AlertMonsters
      OBLF A 0 A_GunFlash
      OBLF A 0 A_PlaySound("Weapons/MinibeliskFire",6,0.8)
      OBLF A 0 A_PlayWeaponSound("Weapons/StachanovFire")
      XBSZ B 1 Bright A_ZoomFactor(2.95)
      XBSZ A 0 A_SetPitch (pitch-0.5)
      XBSZ B 1 Bright
      XBSZ A 0 A_SetPitch (pitch-0.25)
      XBSZ B 1 Bright
      XBSZ A 0 A_SetPitch (pitch-0.15)

      XBSZ B 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ A 0 A_SetPitch (pitch+0.15)
      XBSZ B 0 A_ZoomFactor(3.00)
      XBSZ B 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ A 0 A_SetPitch (pitch+0.25)
      XBSZ B 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ A 0 A_SetPitch (pitch+0.5)
      XBSZ BB 1 Bright A_SetBlend("Red",0.2,3)
      XBSZ BBBB 1 A_SetBlend("Red",0.2,3)
      XBSZ AAAAAAAAAAAAA 1 A_SetBlend("Red",0.2,1)
      Goto ReadyMain
   ZoomedHeckNo:
      XBSZ A 0 A_PlaySound("Weapons/MinibeliskNope",5,0.7)
      XBSZ A 10 A_SetBlend("Red",0.5,20)
      XBSZ AAAAAA 1 A_SetBlend("Red",0.2,3)
	  Goto ZoomedReady
   Zoom:
      OBLG A 0 A_TakeInventory("ZoomedDischargeCounter",999)
      OBLG A 0 A_JumpIfInventory("Zoomed",1,"UnZoom")

      OBLG A 0 A_GiveInventory("Zoomed",1)
      OBLG A 0 A_PlaySound("weapons/StachanovZoom",5,1.0,1)
      OBLG A 0 A_ZoomFactor(1.00)
      OBLG A 1 A_SetBlend("Black",0.15,3)
      OBLG A 1 A_SetBlend("Black",0.3,3)
      OBLG A 1 A_SetBlend("Black",0.45,3)
      OBLG A 1 A_SetBlend("Black",0.6,3)
      OBLG A 1 A_SetBlend("Black",0.75,3)
      OBLG A 1 A_SetBlend("Black",0.9,3)

      XBSZ AAAAA 1 A_SetBlend("Black",1,11)
      
      XBSZ A 0 A_ZoomFactor(3.00)
      XBSZ A 0 A_SetTranslucent(0.98,0)
      XBSZ A 0 A_SetBlend("Red",0.15,2)
      XBSZ A 1 A_SetBlend("Black",0.9,3)
      
      XBSZ A 0 A_SetTranslucent(0.96,0)
      XBSZ A 0 A_SetBlend("Red",0.16,2)
      XBSZ A 1 A_SetBlend("Black",0.85,3)
      
      XBSZ A 0 A_SetTranslucent(0.84,0)
      XBSZ A 0 A_SetBlend("Red",0.17,2)
      XBSZ A 1 A_SetBlend("Black",0.75,3)
      
      XBSZ A 0 A_SetTranslucent(0.82,0)
      XBSZ A 0 A_SetBlend("Red",0.18,2)
      XBSZ A 1 A_SetBlend("Black",0.65,3)
      
      XBSZ A 0 A_SetTranslucent(0.81,0)
      XBSZ A 0 A_SetBlend("Red",0.19,2)
      XBSZ A 1 A_SetBlend("Black",0.55,3)
      
      XBSZ A 0 A_SetTranslucent(0.8,0)
      XBSZ A 0 A_SetBlend("Red",0.2,2)
      XBSZ A 1 A_SetBlend("Black",0.45,3)
      XBSZ A 0 A_StopSound(5)
      
      XBSZ A 1 A_SetBlend("Black",0.35,3)
      XBSZ A 1 A_SetBlend("Black",0.25,3)
      XBSZ A 1 A_SetBlend("Black",0.15,3)
      XBSZ A 1 A_SetBlend("Black",0.05,3)
      Goto ZoomedReady
   UnZoom:
      XBSZ A 0 A_PlaySound("weapons/StachanovZoom",5,1.0,1)
      XBSZ A 0 A_TakeInventory("Zoomed",999)

      XBSZ A 0 A_SetTranslucent(0.9,0)
      XBSZ A 0 A_SetBlend("Red",0.2,3)
      XBSZ A 1 A_SetBlend("Black",0.15,3) 
      
      XBSZ A 0 A_SetTranslucent(0.92,0)
      XBSZ A 0 A_SetBlend("Red",0.18,3)
      XBSZ A 1 A_SetBlend("Black",0.3,3)
      
      XBSZ A 0 A_SetTranslucent(0.94,0)
      XBSZ A 0 A_SetBlend("Red",0.16,3)
      XBSZ A 1 A_SetBlend("Black",0.45,3)
      XBSZ A 0 A_ZoomFactor(1.00)
      
      XBSZ A 0 A_SetTranslucent(0.96,0)
      XBSZ A 0 A_SetBlend("Red",0.14,3)
      XBSZ A 1 A_SetBlend("Black",0.6,3)
      
      XBSZ A 0 A_SetTranslucent(0.98,0)
      XBSZ A 0 A_SetBlend("Red",0.12,3)
      XBSZ A 1 A_SetBlend("Black",0.75,3)
      
      XBSZ A 0 A_SetTranslucent(1,0)
      XBSZ A 0 A_SetBlend("Red",0.1,3)
      XBSZ A 1 A_SetBlend("Black",0.9,3)
      
      XBSZ AAAAAA 1 A_SetBlend("Black",1,11)
      
      OBLG A 0 A_StopSound(5)
      OBLG A 15 A_SetBlend("Black",0.9,10)
      OBLG A 1
      Goto ReadyMain
   ZoomedDischarge:
	  Stage1:
      XBSZ A 0 A_JumpIfInventory("ZoomedDischargeCounter",25,"Stage1Finish")
      XBSZ A 0 A_GiveInventory("ZoomedDischargeCounter",1)
      XBSZ A 0 A_SetBlend("Red",0.2,2)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      XBSZ A 1 A_WeaponReady(WRF_NOBOB)
	  Loop
	  Stage1Finish:
      OBLG A 0 A_PlaySound("Weapons/MinibeliskCharge",5,0.9)
	  Goto Stage2
	  Stage2:
      XBSZ A 0 A_JumpIfInventory("ZoomedDischargeCounter",78,"Stage2Finish")
      XBSZ A 0 A_GiveInventory("ZoomedDischargeCounter",1)
      XBSZ A 0 A_SetBlend("Red",0.2,2)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      XBSZ A 1 A_WeaponReady(WRF_NOBOB)
	  Loop
	  Stage2Finish:
      OBLG A 0 A_PlaySound("Weapons/MinibeliskReady",5,0.5)
      OBLG A 0 A_TakeInventory("MinibeliskCharge",1)
      XBSZ A 0 A_TakeInventory("ZoomedDischargeCounter",999)
      XBSZ A 0 A_SetBlend("Red",0.3,28)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      XBSZ B 13 A_WeaponReady(WRF_NOBOB)
	  Goto ZoomedReady
  Flash:
      TNT1 A 5 bright A_Light2
      TNT1 A 3 bright A_Light1
      TNT1 A 0 bright A_Light0
      stop
   }
}

//Charge trigger

ACTOR ObeliskPower : Inventory
{
  Inventory.MaxAmount 3
}

//Projectile

ACTOR ObeliskProjectile : FastProjectile
{
  Speed 350
  Radius 17
  Height 10
  Damage 175
  Renderstyle Add
  +RIPPER
  -CANNOTPUSH
  +NODAMAGETHRUST
  +EXTREMEDEATH
  +FORCERADIUSDMG
  DamageType Fire
  DeathSound "weapons/StachanovHit"
  MissileType "ObeliskTrail"
  states
  {
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_PlaySound("Weapons/StachanovFly",5,1.0,1)
    Loop
  Death:
    TNT1 A 0 A_PlaySound("Weapons/YamatoExp",5)
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ObeliskTrailSparks", random(19,-19), random(19,-19), random(19,-19), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_SpawnItemEx("ObeliskExplode",0,0,0,0,0,0,0,128,0)
    TNT1 A 0 A_Explode(225,128,0,1)
    TNT1 BCD 4
    stop
  }
}

ACTOR ObeliskExplode
{
  Radius 17
  Height 10
  Renderstyle Add
  Scale 0.5
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  states
  {
  Spawn:
    YAE3 ABCDEFGHIJKLMNOPQRS 1 bright A_FadeOut(0.05)
    stop
  }
}

ACTOR ObeliskTrail
{
  RenderStyle Add
  XScale 0.175
  YScale 0.0875
  Alpha 1
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 //A_SetScale(ScaleX, ScaleY -0.0875)
    YAE4 A 2 bright A_SpawnItemEx("ObeliskTrailSparks", random(4,-4), random(4,-4), random(4,-4), 0, 0, 0, 0, 128, 0)
    YAE4 A 2 bright
  Trolololo:
    YAE4 A 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    YAE4 A 1 bright A_FadeOut(0.295)
    Loop
  }
}

ACTOR ObeliskTrailSparks
{ 
    RenderStyle Add
    Scale 0.0125
    Alpha 0.95
    +NOINTERACTION
	+CLIENTSIDEONLY
    +NOGRAVITY
    States
    {
    Spawn:
    YAE4 A 3 bright A_ChangeVelocity (frandom(-0.8, 0.8), frandom(-0.8, 0.8), frandom(-0.8, 0.8), 0)
    YAE4 A 1 bright A_FadeOut(0.05)
    Loop
    }
}


//Charge-up stuff
ACTOR ObeliskProjectile1 : ObeliskProjectile
{
  Damage 200
  MissileType "ObeliskTrail"
}

ACTOR ObeliskProjectile2 : ObeliskProjectile
{
  Damage 225
  MissileType "ObeliskTrail2"
}

ACTOR ObeliskProjectile3 : ObeliskProjectile
{
  Damage 250
  MissileType "ObeliskTrail3"
}

ACTOR ObeliskTrail2 : ObeliskTrail
{
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 //A_SetScale(ScaleX, ScaleY -0.0875)
    YAE4 AA 2 bright A_SpawnItemEx("ObeliskTrailSparks", random(4,-4), random(4,-4), random(4,-4), 0, 0, 0, 0, 128, 0)
  Trolololo:
    YAE4 A 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    YAE4 A 1 bright A_FadeOut(0.195)
    Loop
  }
}

ACTOR ObeliskTrail3 : ObeliskTrail
{
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 //A_SetScale(ScaleX, ScaleY -0.0875)
    YAE4 A 1 bright
    YAE4 A 1 bright A_SpawnItemEx("ObeliskTrailSparks", random(4,-4), random(4,-4), random(4,-4), 0, 0, 0, 0, 128, 0)
    YAE4 A 1 bright A_SpawnItemEx("ObeliskTrailSparks", random(4,-4), random(4,-4), random(4,-4), 0, 0, 0, 0, 128, 0)
    YAE4 A 1 bright A_SpawnItemEx("ObeliskTrailSparks", random(4,-4), random(4,-4), random(4,-4), 0, 0, 0, 0, 128, 0)
  Trolololo:
    YAE4 A 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    YAE4 A 1 bright A_FadeOut(0.095)
    Loop
  }
}

//ALT-FIRE

actor MinibeliskCharge : Ammo
{
	Inventory.PickupMessage "Picked up a MINIBELISK OVERHEAT COUNTER. IF YOU READ THIS THEN YOUR DUMB."
	Inventory.Amount 1
	Inventory.MaxAmount 3
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 3
	Inventory.Icon "OBLGX0"
	States
	{
	Spawn:
		OBLG X -1
		Stop
	}
}

ACTOR MinibeliskSpawner : FastProjectile
{
  Speed 350
  Radius 17
  Height 10
  Damage 120
  Renderstyle Add
  +RIPPER
  -CANNOTPUSH
  +NODAMAGETHRUST
  +EXTREMEDEATH
  +FORCERADIUSDMG
  DamageType Fire
  DeathSound "weapons/StachanovHit"
  MissileType "MinibeliskTrail"
  states
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 ThrustThingZ(0,90,0,1)
  Looplet:
    TNT1 A 0 ThrustThingZ(0,random(-40,-45),0,1)
    TNT1 A 1 A_PlaySound("Weapons/StachanovFly",5,1.0,1)
    Loop
  Death:
    TNT1 A 0 A_PlaySound("Weapons/MinibeliskStart",5)
    TNT1 A 0 A_SpawnItemEx("ObeliskExplode",0,0,0,0,0,0,0,128,0)
    YAE4 A 0 A_SpawnItemEx("MinibeliskImpact",0,0,10)
    YAE4 A 0 A_AlertMonsters
    TNT1 A 1
    YAE4 A 0 A_SpawnItemEx("MinibeliskGLDEF")
    TNT1 A 1 A_SpawnItemEx("Minibelisk",0,0,10,0,0,0,0,SXF_TRANSFERPOINTERS)
    stop
  }
}

ACTOR MinibeliskTrail
{
  RenderStyle Add
  XScale 0.175
  YScale 0.0875
  Alpha 1
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 //A_SetScale(ScaleX, ScaleY -0.0875)
    YAE4 A 0 A_SpawnItemEx("MinibeliskSmokeDeath",random(13,-13),random(13,-13),random(13,-13),frandom(-0.3,0.3),frandom(-0.3,0.3),frandom(-0.3,0.3),random(0,359),128,0)
    YAE4 A 2 bright A_SpawnItemEx("ObeliskTrailSparks", random(4,-4), random(4,-4), random(4,-4), 0, 0, 0, 0, 128, 0)
    YAE4 A 2 bright
  Trolololo:
    YAE4 A 0 //A_SetScale(ScaleX -0.01, ScaleY -0.01)
    YAE4 A 1 bright A_FadeOut(0.085)
    Loop
  }
}

ACTOR Minibelisk
{
  obituary "%o was scorched by obelisk incarnation."
  radius 15
  height 42
  mass 9999999
  speed 0
  MaxTargetRange 2048
  Scale 0.175
  Renderstyle Add
  MONSTER
  +FLOORCLIP
  +FRIENDLY
  +NOBLOOD
  +MISSILEMORE
  +MISSILEEVENMORE
  +LOOKALLAROUND
  +NEVERRESPAWN
  +STANDSTILL
  +NOTARGET
  +DONTBLAST
  +NOFEAR
  +DONTMORPH
  +INFLOAT
  +NOGRAVITY
  +NOCLIP
  +INVULNERABLE
  +FLOATBOB
  states
  {
  Spawn:
    YAE4 A 0
    YAE4 A 0 A_PlaySound("Weapons/MinibeliskLoop",5,0.85,1)
    YAE4 A 0 A_TakeInventory("MinibeliskCounter",1)
    YAE4 A 0 A_SpawnItemEx("ObeliskTrailSparks", random(10,-10), random(10,-10), random(10,-10), 0, 0, 0, 0, 128, 0)
    YAE4 AA 0 A_SpawnItemEx("MinibeliskSmoke",random(23,-23),random(23,-23),random(23,-23),frandom(0.3,0.6),frandom(0.3,0.6),frandom(-0.2,0.5),random(0,359),128,0)
    YAE4 A 0 A_JumpIfInventory("BurnoutCounter",925,"Death")
    YAE4 A 0 A_GiveInventory("BurnoutCounter",1)
    YAE4 A 1 Bright A_Look
    loop
  See:
    YAE4 A 0 A_TakeInventory("MinibeliskCounter",1)
    YAE4 AA 0 A_SpawnItemEx("MinibeliskSmoke",random(23,-23),random(23,-23),random(23,-23),frandom(0.3,0.6),frandom(0.3,0.6),frandom(-0.2,0.5),random(0,359),128,0)
    YAE4 A 0 A_JumpIfInventory("BurnoutCounter",925,"Death")
    YAE4 A 0 A_GiveInventory("BurnoutCounter",1)
    YAE4 A 1 Bright A_Chase
    loop
  Missile:
    YAE4 A 0 A_JumpIfInventory("BurnoutCounter",925,"Death")
    YAE4 A 0 A_JumpIfInventory("MinibeliskCounter",1,"See")

    YAE4 A 0 A_SpawnItemEx("ObeliskTrailSparks", random(10,-10), random(10,-10), random(10,-10), 0, 0, 0, 0, 128, 0)
    YAE4 A 0 A_SpawnItemEx("MinibeliskLaunch",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
    YAE4 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MinibeliskSmokeDeath",random(28,-28),random(28,-28),random(28,-28),frandom(-4,4),frandom(1,4),frandom(-3,4),random(0,359),128,0)
    YAE4 AA 0 A_SpawnItemEx("MinibeliskSmoke",random(23,-23),random(23,-23),random(23,-23),frandom(0.3,0.6),frandom(0.3,0.6),frandom(-0.2,0.5),random(0,359),128,0)
    YAE4 A 0 A_PlaySound("Weapons/StachanovFire")
    YAE4 A 0 A_PlaySound("Weapons/DeathheadExplode",6)
    YAE4 A 0 A_GiveInventory("BurnoutCounter",25)
    YAE4 A 0 A_AlertMonsters
    YAE4 A 1 Bright A_FaceTarget
    YAE4 A 0 A_SpawnItemEx("ObeliskTrailSparks", random(10,-10), random(10,-10), random(10,-10), 0, 0, 0, 0, 128, 0)
    YAE4 AA 0 A_SpawnItemEx("MinibeliskSmoke",random(23,-23),random(23,-23),random(23,-23),frandom(0.3,0.6),frandom(0.3,0.6),frandom(-0.2,0.5),random(0,359),128,0)
    YAE4 A 1 Bright A_CustomMissile("ObeliskProjectile")
    YAE4 A 1 Bright A_ClearTarget
    YAE4 A 0 A_SpawnItemEx("ObeliskTrailSparks", random(10,-10), random(10,-10), random(10,-10), 0, 0, 0, 0, 128, 0)
    YAE4 AA 0 A_SpawnItemEx("MinibeliskSmoke",random(23,-23),random(23,-23),random(23,-23),frandom(0.3,0.6),frandom(0.3,0.6),frandom(-0.2,0.5),random(0,359),128,0)
    YAE4 A 0 A_GiveInventory("MinibeliskCounter",70)
    goto Spawn
  Death:
    YAE4 A 0
    YAE4 A 0 A_AlertMonsters
    YAE4 A 0 A_PlaySound("Weapons/MinibeliskDead",5)
    YAE4 A 0 A_SpawnItemEx("MinibeliskImpact",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
    YAE4 A 0 A_SpawnItemEx("MinibeliskGLDEF")
    Stop
  }
}

ACTOR MinibeliskInherit
{
	+NOINTERACTION
	+NOGRAVITY
}

ACTOR MinibeliskLaunch
{
	+NOGRAVITY
	+NOINTERACTION
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 AAAAAAAA 0 A_SpawnItemEx("MinibeliskBlast",random(40,-40),random(40,-40),random(40,-40),frandom(0.05,0.1),frandom(0.05,0.1),frandom(0.075,0.125),random(0,359),SXF_TRANSFERPOINTERS,0)
		Stop
	}
}

ACTOR MinibeliskBlast
{
	+NOGRAVITY
	+NOINTERACTION
	+FORCERADIUSDMG
	Renderstyle Add
	Damagetype Nope
	Alpha 0.8
	Scale 1
	States
	{
	Spawn:
		YAE2 A 0
		YAE2 A 0 A_Explode(90,128,0)
        YAE2 ABCDEFGHIJKLMNO 1 Bright
		YAE2 PQRSTU 2 A_FadeOut
		Stop
	}
}

ACTOR MinibeliskSmoke : MinibeliskInherit
{
	Renderstyle Add
	+CLIENTSIDEONLY
	Alpha 0.4
	States
	{
	Spawn:
	TNT1 A 0
	OBSK FGHIJKLMNOPQRST 1
	OBSK UVWXYZ 1 A_FadeOut(0.05)
	Stop
	}
}

ACTOR MinibeliskSmokeDeath : MinibeliskInherit
{
	Renderstyle Add
	+CLIENTSIDEONLY
	Alpha 0.75
	States
	{
	Spawn:
	TNT1 A 0
	OBSK FGHIJKLMNOPQRST 2
	OBSK UVWXYZ 2 A_FadeOut(0.1)
	Stop
	}
}

ACTOR MinibeliskImpact : MinibeliskInherit
{
	DamageType Nope
	+FORCERADIUSDMG
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_Explode(400,224,0)
	YAE4 AAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("ObeliskTrailSparks", random(10,-10), random(10,-10), random(10,-10), frandom(4,6), frandom(4,6), frandom(-6,6), random(0,359), 128, 0)
	YAE4 AA 0 A_SpawnItemEx("MinibeliskSmoke",random(23,-23),random(23,-23),random(23,-23),frandom(0.3,0.6),frandom(0.3,0.6),frandom(-0.2,0.5),random(0,359),128,0)
	YAE4 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MinibeliskSmokeDeath",random(28,-28),random(28,-28),random(28,-28),frandom(-4,4),frandom(1,4),frandom(-3,4),random(0,359),128,0)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("MinibeliskSmokeDeath",random(28,-28),random(28,-28),random(28,-28),frandom(1,4),frandom(1,4),frandom(1,4),random(0,359),128,0)
	Stop
	}
}

ACTOR MinibeliskGLDEF : MinibeliskInherit
{
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	TNT1 A 21
	Stop
	}
}

ACTOR MinibeliskProjectile : ObeliskProjectile
{
  DamageType Nope
}

ACTOR BurnoutCounter : Inventory //The fuel
{
	Inventory.MaxAmount 999
}

ACTOR MinibeliskCounter : Inventory //Reload
{
	Inventory.MaxAmount 999
}

ACTOR ZoomedDischargeCounter : Inventory //Reload in zoom
{
	Inventory.MaxAmount 999
}
