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

Sprites:
Frankensprite - Ryan Cordell, I hope. Bits from 3DRealms work. (Shadow Warrior)
Smoke, ring - Smoke is definitely from Doom 3... notsure about the ring

Sounds:
Up - Epic Games (UT2004)
Fire - sounds like it's Quake 2, but it ain't a one... not sure if edited, or from some other game.
Add - ID (Quake 4)
Fly - Valve (Half-Life 2)
Hit - ?
Zoom in, Zoom out - ID (ET:QW)
*/

ACTOR Instafun : DoomWeapon 24524
{
   //$Category Weapons
   //$Title Instafuneral
   //$Sprite FUNGX0
   Tag "Instafuneral"
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "Mumbling in joy  at ''Instafuneral'' tri-shockrifle! No need for ceremonials - your death will be swift, and with style. (7)" //feel the "Allo Allo" reference!
   Obituary "%o's funeral was shockingly fast executed by %k."
   Weapon.UpSound "Weapons/InstafunUp"
   Weapon.SelectionOrder 2
   Weapon.AmmoType "IonAmmo"
   Weapon.AmmoGive 12
   Weapon.AmmoUse 1
   Weapon.AmmoType2 "IonAmmo"
   Weapon.AmmoUse2 3
   Weapon.Kickback 70
   Weapon.SlotNumber 7
   Scale 0.85
   +NOALERT
   +NOAUTOFIRE
   States
   {
   Spawn:
      FUNG X -1
      Loop
   Ready:
      FUNG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedReady")
      FUNG A 1 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      Loop
   ZoomedReady:
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 0 A_SetBlend("Green",0.025,3)
      FUNZ A 1 A_WeaponReady(WRF_NOBOB)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      Goto Ready
   Select:
      FUNF A 0 A_TakeInventory("Zoomed",999)
      FUNF A 0 A_TakeInventory("FireCounter",3)
      FUNF A 0 A_GiveInventory("FireCounter",1)
   SelectinARiver:
      FUNG A 1 A_Raise
      Loop
   Deselect:
      FUNG A 0 A_ZoomFactor(1)
      FUNG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedDeselect")
      FUNG A 0 A_SetTranslucent(1,0)
      FUNG A 1 A_Lower
      FUNG A 0 A_Lower
      Loop
   Fire:
      FUNG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedFire")
      FUNG A 4 A_GunFlash
      
   Hold:
      FUNG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedHold")
      FUNF A 0 A_GiveInventory("FireCounter",1)
      FUNF A 0 A_AlertMonsters
      FUNF A 0 A_Recoil(1)
      FUNF A 0 A_PlaySound("Weapons/InstafunAddFire",6,0.7)
      FUNG A 0 A_JumpIfInventory("FireCounter",3,"FireBarrel1")
      FUNG A 0 A_JumpIfInventory("FireCounter",2,"FireBarrel3")
      FUNG A 0 A_JumpIfInventory("FireCounter",1,"FireBarrel2")
      Goto FireBarrel3
   FireBarrel1:
      FUN1 A 0 A_TakeInventory("FireCounter",3)
      FUNF A 0 A_PlaySound("Weapons/InstafunFire",5,0.7)
      FUN1 A 0 A_FireCustomMissile("InstafunProjectile",2,1,5,-1,0,0)
      FUN1 D 1 BRIGHT A_ZoomFactor(0.99)
      FUN1 A 0 ACS_Execute(851,0,0,10+random(5,-5))
      FUN1 A 0 A_SetPitch (pitch-0.25)
      FUN1 E 1 BRIGHT A_ZoomFactor(0.98)
      FUN1 A 0 ACS_Execute(851,0,0,5+random(2,-2))
      FUN1 A 0 A_SetPitch (pitch-0.1)
      FUN1 F 1 BRIGHT A_ZoomFactor(0.96)
      FUN1 A 0 ACS_Execute(851,0,0,5)
      FUN1 A 0 A_SetPitch (pitch-0.1)
      
      FUN1 F 1 A_ZoomFactor(0.95)
      FUN1 F 1 A_ZoomFactor(0.96)
      FUN1 D 0 A_ReFire
      Goto FireMain
   FireBarrel2:
      FUN2 A 0 A_PlaySound("Weapons/InstafunFire",8,0.7)
      FUN2 A 0 A_FireCustomMissile("InstafunProjectile",0,1,10,-1,0,0)
      FUN2 D 1 BRIGHT A_ZoomFactor(0.99)
      FUN1 A 0 ACS_Execute(851,0,0,10+random(5,-5))
      FUN2 A 0 A_SetPitch (pitch-0.25)
      FUN2 E 1 BRIGHT A_ZoomFactor(0.98)
      FUN1 A 0 ACS_Execute(851,0,0,5+random(2,-2))
      FUN2 A 0 A_SetPitch (pitch-0.1)
      FUN2 F 1 BRIGHT A_ZoomFactor(0.96)
      FUN1 A 0 ACS_Execute(851,0,0,5)
      FUN2 A 0 A_SetPitch (pitch-0.1)
      
      FUN2 F 1 A_ZoomFactor(0.95)
      FUN2 F 1 A_ZoomFactor(0.96)
      FUN2 D 0 A_ReFire
      Goto FireMain
   FireBarrel3:
      FUN2 A 0 A_PlaySound("Weapons/InstafunFire",1,0.7)
      FUNF A 0 A_FireCustomMissile("InstafunProjectile",-2,1,15,-1,0,0)
      FUNF D 1 BRIGHT A_ZoomFactor(0.99)
      FUN1 A 0 ACS_Execute(851,0,0,10+random(5,-5))
      FUNF A 0 A_SetPitch (pitch-0.25)
      FUNF E 1 BRIGHT A_ZoomFactor(0.98)
      FUN1 A 0 ACS_Execute(851,0,0,5+random(2,-2))
      FUNF A 0 A_SetPitch (pitch-0.1)
      FUNF F 1 BRIGHT A_ZoomFactor(0.96)
      FUN1 A 0 ACS_Execute(851,0,0,5)
      FUNF A 0 A_SetPitch (pitch-0.1)
      
      FUNF F 1 A_ZoomFactor(0.95)
      FUNF F 1 A_ZoomFactor(0.96)
      FUNF D 0 A_ReFire
      Goto FireMain
   FireMain:
      FUN1 E 1 A_ZoomFactor(0.97)
      FUN1 D 1 A_ZoomFactor(0.98)
      FUNF C 1 A_ZoomFactor(0.985)
      FUNF B 1 A_ZoomFactor(0.99)
      FUNF A 1 A_ZoomFactor(0.995)
      FUNG A 1 A_ZoomFactor(1)
      
      FUNG A 0 A_ReFire

      FUNG A 15
      Goto Ready
   AltFire:
      FUNG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedAltFire")
      FUNF A 0 A_AlertMonsters
      FUNF A 0 A_Recoil(3)
      FUNF A 0 A_PlaySound("Weapons/InstafunAddFire",6,0.8)
      FUNF A 0 A_PlaySoundEx("Weapons/InstafunFire","Auto")

      FUN1 A 0 A_FireCustomMissile("InstafunProjectile",2,1,5,-1,0,0)
      FUN2 A 0 A_FireCustomMissile("InstafunProjectile",0,0,10,-1,0,0)
      FUNF A 0 A_FireCustomMissile("InstafunProjectile",-2,0,15,-1,0,0)

      FUNA D 1 BRIGHT A_ZoomFactor(0.96)
      FUN1 A 0 A_SetPitch (pitch-0.4)
      FUN1 A 0 ACS_Execute(851,0,0,20+random(10,-10))
      FUNA E 1 BRIGHT A_ZoomFactor(0.95)
      FUN1 A 0 A_SetPitch (pitch-0.2)
      FUN1 A 0 ACS_Execute(851,0,0,10+random(5,-5))
      FUNA F 1 BRIGHT A_ZoomFactor(0.945)
      FUN1 A 0 A_SetPitch (pitch-0.2)
      FUN1 A 0 ACS_Execute(851,0,0,10)
      
      FUNA F 1 A_ZoomFactor(0.95)
      FUNA F 1 A_ZoomFactor(0.96)
      FUNA E 1 A_ZoomFactor(0.97)
      FUNA D 1 A_ZoomFactor(0.98)
      FUN1 D 0 A_ReFire

      FUNF C 1 A_ZoomFactor(0.985)
      FUNF B 1 A_ZoomFactor(0.99)
      FUNF A 1 A_ZoomFactor(0.995)
      FUNG A 1 A_ZoomFactor(1)
      FUNG A 0 A_ReFire

      FUNG A 15
      Goto Ready

   Flash:
       FUNL ABCD 1 Bright
       Stop
       
   UnZoom:
      FUNZ A 0 A_PlaySound("Weapons/InstafunZoomOut",5,0.7)
      FUNZ A 0 A_TakeInventory("Zoomed",999)

      FUNZ A 0 A_SetTranslucent(0.9,0)
      FUNZ B 1 A_SetBlend("Black",0.35,3) 
      
      FUNZ A 0 A_SetTranslucent(0.92,0)
      FUNZ B 1 A_SetBlend("Black",0.4,3)
      
      FUNZ A 0 A_SetTranslucent(0.94,0)
      FUNZ B 1 A_SetBlend("Black",0.45,3)
      FUNZ A 0 A_ZoomFactor(1.00)
      
      FUNZ A 0 A_SetTranslucent(0.96,0)
      FUNZ B 1 A_SetBlend("Black",0.6,3)
      
      FUNZ A 0 A_SetTranslucent(0.98,0)
      FUNZ B 1 A_SetBlend("Black",0.75,3)
      
      FUNZ A 0 A_SetTranslucent(1,0)
      FUNZ B 1 A_SetBlend("Black",0.9,3)
      
      FUNG A 16 A_SetBlend("Black",1.1,25)
      Goto Ready
  ZoomedDeselect:
      FUNZ A 0 A_PlaySoundEx("Weapons/InstafunZoomOut","SoundSlot5")
      FUNZ A 0 A_TakeInventory("Zoomed",999)

      FUNZ A 0 A_SetTranslucent(0.9,0)
      FUNZ B 1 A_SetBlend("Black",0.35,3) 
      
      FUNZ A 0 A_SetTranslucent(0.92,0)
      FUNZ B 1 A_SetBlend("Black",0.4,3)
      
      FUNZ A 0 A_SetTranslucent(0.94,0)
      FUNZ B 1 A_SetBlend("Black",0.45,3)
      FUNZ A 0 A_ZoomFactor(1.00)
      
      FUNZ A 0 A_SetTranslucent(0.96,0)
      FUNZ B 1 A_SetBlend("Black",0.6,3)
      
      FUNZ A 0 A_SetTranslucent(0.98,0)
      FUNZ B 1 A_SetBlend("Black",0.75,3)
      
      FUNZ A 0 A_SetTranslucent(1,0)
      FUNZ B 1 A_SetBlend("Black",0.9,3)
      
      FUNZ BBBBBBBBBB 1 A_SetBlend("Black",1,3)
      
      FUNG A 16 A_SetBlend("Black",1.1,25)
  ZoomedDeselectMain:
      FUNG A 1 A_Lower
      FUNG A 0 A_Lower
      Loop

   ZoomedFire:
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)
            
   ZoomedHold:
      FUNG A 0 A_JumpIfInventory("FireCounter",3,"ZoomedFireBarrel1")
      FUNG A 0 A_JumpIfInventory("FireCounter",2,"ZoomedFireBarrel3")
      FUNG A 0 A_JumpIfInventory("FireCounter",1,"ZoomedFireBarrel2")
      Goto ZoomedFireBarrel3
      
   ZoomedFireBarrel1:
      FUNF A 0 A_TakeInventory("FireCounter",3)
      FUNZ A 0 A_PlaySound("Weapons/InstafunFire",5,0.7)
      FUNF A 0 A_FireCustomMissile("InstafunProjectile",0,1,-8,0,0,0)
      Goto ZoomedFireMain
   ZoomedFireBarrel2:
      FUNZ A 0 A_PlaySound("Weapons/InstafunFire",8,0.7)
      FUNF A 0 A_FireCustomMissile("InstafunProjectile",0,1,-4,0,0,0)
      Goto ZoomedFireMain
   ZoomedFireBarrel3:
      FUNZ A 0 A_PlaySound("Weapons/InstafunFire",1,0.7)
      FUNF A 0 A_FireCustomMissile("InstafunProjectile",0,1,-2,0,0,0)
      Goto ZoomedFireMain
      
   ZoomedFireMain:
      FUNF A 0 A_GiveInventory("FireCounter",1)
      FUNZ A 0 A_Recoil(0.5)
      FUNZ A 0 A_PlaySound("Weapons/InstafunAddFire",6,0.8)


      FUNZ A 0 A_SetPitch (pitch-1)
      FUNZ A 0 A_ZoomFactor(2.99)	//FUNF D
      FUNZ B 1 Bright A_SetBlend("Blue",0.1,20)

      FUNZ A 0 A_SetPitch (pitch-0.25)
      FUNZ B 0 A_ZoomFactor(2.95)	//FUNF E
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 Bright A_SetBlend("Blue",0.05,3)

      FUNZ A 0 A_SetPitch (pitch-0.1)
      FUNZ B 0 A_ZoomFactor(2.925)	//FUNF F
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 Bright A_SetBlend("Blue",0.025,3)

      FUNZ A 0 A_SetPitch (pitch+0.1)
      FUNZ A 0 A_ZoomFactor(2.94)	//FUNF F
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)
      
      FUNZ A 0 A_SetPitch (pitch+0.25)
      FUNZ A 0 A_ZoomFactor(2.95)	//FUNF F
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ A 0 A_ReFire

      FUNZ A 0 A_ZoomFactor(2.96)	//FUNF E
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 0 A_ZoomFactor(2.97)	//FUNF D
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 0 A_ZoomFactor(2.98)	//FUNF C
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 0 A_ZoomFactor(2.99)	//FUNF B
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 1 A_ZoomFactor(2.995)	//FUNF A
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 0 A_ZoomFactor(3)		//FUNG A
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ A 0 A_ReFire

      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      Goto Ready
   ZoomedAltFire:
      FUNZ A 0 A_Recoil(1.5)
      FUNZ A 0 A_PlaySound("Weapons/InstafunAddFire",6,0.7)
      FUNZ A 0 A_PlaySoundEx("Weapons/InstafunFire","Auto")

      FUNF A 0 A_FireCustomMissile("InstafunProjectile",-0.5,1,-8,0,0,0)
      FUNF A 0 A_FireCustomMissile("InstafunProjectile",0,0,-4,0,0,0)
      FUNF A 0 A_FireCustomMissile("InstafunProjectile",0.5,0,-2,0,0,0)

      FUNZ A 0 A_SetPitch (pitch-1)
      FUNZ A 0 A_ZoomFactor(2.97)	//FUNF D
      FUNZ B 1 Bright A_SetBlend("Blue",0.1,20)

      FUNZ A 0 A_SetPitch (pitch-0.35)
      FUNZ B 0 A_ZoomFactor(2.925)	//FUNF E
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 Bright A_SetBlend("Blue",0.05,3)

      FUNZ A 0 A_SetPitch (pitch-0.25)
      FUNZ B 0 A_ZoomFactor(2.9)	//FUNF F
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 Bright A_SetBlend("Blue",0.025,3)

      FUNZ A 0 A_SetPitch (pitch+0.25)
      FUNZ A 0 A_ZoomFactor(2.91)	//FUNF F
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetPitch (pitch+0.35)

      FUNZ A 0 A_ZoomFactor(2.925)	//FUNF F
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ A 0 A_ZoomFactor(2.95)	//FUNF E
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 0 A_ZoomFactor(2.96)	//FUNF D
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ A 0 A_ReFire

      FUNZ B 0 A_ZoomFactor(2.97)	//FUNF C
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 0 A_ZoomFactor(2.98)	//FUNF B
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 1 A_ZoomFactor(2.99)	//FUNF A
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ B 0 A_ZoomFactor(3)		//FUNG A
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ B 1 A_SetBlend("Green",0.025,3)

      FUNZ A 0 A_ReFire

      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      FUNZ A 0 A_SetBlend("Black",0.3,3)
      FUNZ A 1 A_SetBlend("Green",0.025,3)
      Goto Ready
   Zoom:
      FUNG A 0 A_JumpIfInventory("Zoomed",1,"UnZoom")

      FUNG A 0 A_GiveInventory("Zoomed",1)
      FUNG A 0 A_PlaySound("Weapons/InstafunZoomIn",5,0.7)

      FUNG A 1 A_SetBlend("Black",0.15,3)
      FUNG A 1 A_SetBlend("Black",0.3,3)
      FUNG A 1 A_SetBlend("Black",0.45,3)
      FUNG A 1 A_SetBlend("Black",0.6,3)
      FUNG A 1 A_SetBlend("Black",0.75,3)
      FUNG A 1 A_SetBlend("Black",0.9,3)

      FUNG AAAAAAAAAA 1 A_SetBlend("Black",1,11)
      
      FUNZ A 0 A_ZoomFactor(3.00)
      FUNZ A 0 A_SetTranslucent(0.98,0)
      FUNZ B 1 A_SetBlend("Black",0.9,3)
      
      FUNZ A 0 A_SetTranslucent(0.96,0)
      FUNZ B 1 A_SetBlend("Black",0.85,3)
      
      FUNZ A 0 A_SetTranslucent(0.84,0)
      FUNZ B 1 A_SetBlend("Black",0.75,3)
      
      FUNZ A 0 A_SetTranslucent(0.82,0)
      FUNZ B 1 A_SetBlend("Black",0.65,3)
      
      FUNZ A 0 A_SetTranslucent(0.81,0)
      FUNZ B 1 A_SetBlend("Black",0.55,3)
      
      FUNZ A 0 A_SetTranslucent(0.8,0)
      FUNZ B 1 A_SetBlend("Black",0.45,3)
      
      FUNZ B 1 A_SetBlend("Black",0.4,3)
      FUNZ B 1 A_SetBlend("Black",0.36,3)
      FUNZ B 1 A_SetBlend("Black",0.34,3)
      FUNZ B 1 A_SetBlend("Black",0.33,3)
      FUNZ B 1 A_SetBlend("Black",0.32,3)
      FUNZ B 1 A_SetBlend("Black",0.31,3)
      Goto ZoomedReady
   }
}

ACTOR FireCounter : Inventory
{
     Inventory.MaxAmount 3
}

ACTOR InstafunProjectile : FastProjectile
{
  Speed 300
  Radius 14
  Height 9
  Damage 90
  Renderstyle Add
  +RIPPER
  -CANNOTPUSH
  +NODAMAGETHRUST
  +EXTREMEDEATH
  +FORCERADIUSDMG
  +DONTBLAST
  DeathSound "weapons/InstafunHit"
  //MissileType "InstafunTrail"
  Scale 2
  states
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_SpawnItem("InstafunTrail")
    TNT1 A 1 A_PlaySoundEx("Weapons/InstafunFly","SoundSlot5",1)
    Loop
  Death:
    TNT1 A 0 A_StopSoundEx("SoundSlot5")
    TNT1 A 0 A_SpawnItemEx("InstafunShock",0,0,0,0,0,0,0,128,0)
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(25,128,0,1)
    TNT1 A 2
    TNT1 AAAAAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(50,96,0,1)
    TNT1 A 2
    TNT1 AAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(75,48,0,1)
    TNT1 A 2

    TNT1 A 0 A_SpawnItemEx("InstafunShock",0,0,0,0,0,0,0,128,0)
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(25,128,0,1)
    TNT1 A 2
    TNT1 AAAAAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(50,96,0,1)
    TNT1 A 2
    TNT1 AAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(75,48,0,1)
    TNT1 A 2

    TNT1 A 0 A_SpawnItemEx("InstafunShock",0,0,0,0,0,0,0,128,0)
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(25,128,0,1)
    TNT1 A 2
    TNT1 AAAAAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(50,96,0,1)
    TNT1 A 2
    TNT1 AAA 0 A_SpawnItemEx("InstafunExplode", random(10,-10), random(10,-10), random(5,-5), 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_Explode(75,48,0,1)
    TNT1 A 2
    stop
  }
}

ACTOR InstafunExplode
{
  Radius 17
  Height 10
  Renderstyle Add
  Scale 0.5
  Alpha 0.5
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  states
  {
  Spawn:
    FUNE ABCDEF 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNE G 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE H 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE I 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE J 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE K 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE L 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE M 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE N 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE O 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    FUNE P 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.75), 0)
    FUNP A 0 A_FadeOut(0.05)
    stop
  }
}

ACTOR InstafunShock
{
  Renderstyle Add
  Scale 0
  Alpha 1
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  states
  {
  Spawn:
    FUNP A 0
    FUNP A 0 //A_SetScale(ScaleX +0.1, ScaleY +0.1)
    FUNP A 1 bright A_FadeOut(0.05)
    Loop
  }
}

ACTOR InstafunTrail
{
  RenderStyle Add
  Scale 0.1
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  States
  {
  Spawn:
    FUNP A 0
    //TNT1 A 0 A_SpawnItemEx("InstafunFlame", random(8,-8), random(8,-8), random(8,-8), 0, 0, 0, 0, 128, 0)
    FUNP A 0 //A_SetScale(ScaleX +0.02, ScaleY +0.02)
    FUNP A 1 bright A_FadeOut(0.075)
    FUNP A 0 //A_SetScale(ScaleX +0.02, ScaleY +0.02)
    FUNP A 1 bright A_FadeOut(0.075)
    Loop
  }
}

ACTOR InstafunFlame
{
  Radius 17
  Height 10
  Renderstyle Add
  Scale 0.3
  Alpha 0.15
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOGRAVITY
  states
  {
  Spawn:
    FUNE ABCDEF 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNE G 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.025)
    FUNE H 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.025)
    FUNE I 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.035)
    FUNE J 2 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.025)
    FUNE K 3 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.035)
    FUNE L 3 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.025)
    FUNE M 3 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.035)
    FUNE N 3 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.025)
    FUNE O 3 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.035)
    FUNE P 3 bright A_ChangeVelocity (frandom(-0.5, 0.5), frandom(-0.5, 0.5), frandom(-0.25, 0.25), 0)
    FUNP A 0 A_FadeOut(0.025)
    stop
  }
}
