//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// POWERUP    ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

actor WeaponPowerItem : CustomInventory 25007
{
//$Category Stronghold_Items
  inventory.pickupmessage "Picked up a weapon powerup kit."
  inventory.maxamount 3
  inventory.icon POWIA0
  tag "Weapon Powerup Kit"
  +INVENTORY.INVBAR
  scale 0.75
  states
  {
  Spawn:
   	POWP A -1 BRIGHT
    	stop
  Pickup:
  	TNT1 A 1 A_PlaySound("pickup")
  	stop
  Use:
        TNT1 A 1 A_GiveInventory("WeaponPowerUpGiver")
  	stop
  }
}

actor WeaponPowerupGiver : PowerupGiver
{
  powerup.color "80 00 ff",0.1
  powerup.duration 2100 //60 seconds
  powerup.type WeaponLevel2
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.AUTOACTIVATE
  inventory.maxamount 0
}

//////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////  PISTOL    ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

actor PowerPistol : DoomWeapon
{
  Weapon.SelectionOrder 1900
  Weapon.AmmoUse 1
  Weapon.AmmoGive 20
  Weapon.AmmoType "Clip"
  Weapon.SisterWeapon "DEPistol"
  +POWERED_UP
  Obituary "$OB_MPPISTOL" // "%o was tickled by %k's pea shooter."
  attacksound "weapons/pistol"
  +WEAPON.WIMPY_WEAPON
  Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED" // "Picked up a pistol."
  Tag "Pistol"
  States
  {
  Ready:
    PISG A 1 A_WeaponReady
    Loop
  Deselect:
    PISG A 1 A_Lower
    Loop
  Select:
    PISG A 1 A_Raise
    Loop
  Fire:
    PISG A 2
	PISG B 3 A_FirePistol
    PISG C 2
    PISG B 5 A_ReFire
    Goto Ready
  Flash:
    PISF A 3 Bright A_Light1
    Goto LightDone
    PISF A 0 Bright A_Light0
    Goto LightDone
  Spawn:
    PIST A -1
    Stop
  }
}

//////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////  SHOTGUN   ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

actor PowerShotgun : DoomWeapon
{
  Weapon.SelectionOrder 1300
  Weapon.AmmoUse 1
  Weapon.AmmoGive 8
  Weapon.AmmoType "Shell"
  Weapon.SisterWeapon "DEShotgun"
  +POWERED_UP
  attacksound "weapons/shotgf"
  Inventory.PickupMessage "$GOTSHOTGUN" // "You got the shotgun!"
  Obituary "%o got pummeled by %k's shotgun." // "%o chewed on %k's boomstick."
  Tag "Shotgun"
  States
  {
  Ready:
    SHTG A 1 A_WeaponReady
    Loop
  Deselect:
    SHTG A 1 A_Lower
    Loop
  Select:
    SHTG A 1 A_Raise
    Loop
  Hold:
  Fire:
    SHTG A 3
    SHTG E 0 A_GunFlash
    SHTG E 2 A_FireBullets (1.5, 0.5, 10, 5, "BulletPuff")
    SHTG F 3
    SHTG G 2
    SHTG BCDCB 2
    SHTG A 1 A_ReFire
    goto Ready
  Flash:
    TNT1 A 4 bright A_Light1
    TNT1 A 3 bright A_Light2
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    SHOT A -1
    Stop
  }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// CHAINGUN   ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

actor PowerChaingun : DoomWeapon
{
   Weapon.SelectionOrder 700
   Weapon.AmmoUse 1
   Weapon.AmmoGive 20
   Weapon.AmmoType "Clip"
   Weapon.SisterWeapon "DEChaingun"
   +POWERED_UP
   attacksound "weapons/chngun"
   Inventory.PickupMessage "$GOTCHAINGUN" // "You got the chaingun"
   Obituary "$OB_MPCHAINGUN" // "%o was mowed down by %k's chaingun."
   Tag "Chaingun"
   States
   {
   Ready:
     CHGG A 1 A_WeaponReady
     Loop
   Deselect:
     CHGG A 1 A_Lower
     Loop
   Select:
     CHGG A 1 A_Raise
     Loop
   Spawn:
     MGUN A -1
     Stop
   Fire:
     CHGG C 2 Bright A_GunFlash
     CHGG D 2 Bright A_FireBullets (1,1.1,1,5,"BulletPuff")
     CHGG E 2 Bright A_GunFlash
     CHGG F 2 Bright A_FireBullets (3,2.1,1,5,"BulletPuff")
     CHGG A 0 A_Refire
     // Yes, I know the "cooldown" that's in the "hold" state is not here,
     // it's not needed. This is intentional.
     goto Ready
   Hold:
     CHGG C 1 Bright A_GunFlash
     CHGG D 1 Bright A_FireBullets (6,3.1,1,5,"BulletPuff")
     CHGG E 1 Bright A_GunFlash
     CHGG F 1 Bright A_FireBullets (6,3.1,1,5,"BulletPuff")
     CHGG A 2 A_Refire
     CHGG B 2
     CHGG A 2
     CHGG B 2
     goto Ready
   Flash:
     TNT1 A 2 bright A_Light1
     TNT1 A 2 bright A_Light2
     TNT1 A 0 bright A_Light0
     stop
   }
}



//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// ROCKET LAUNCHER //////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerRLauncher : RocketLauncher
{
   Weapon.SisterWeapon "DERLauncher"
   Tag "Rocket Launcher"


   +POWERED_UP
   States
   {
   Spawn:
      LAUN A -1
      Loop
   Ready:
      MISG A 1 A_WeaponReady
      Loop
   Deselect:
      MISG A 0 A_Lower
      MISG A 1 A_Lower
      Loop
   Select:
      MISG A 0 A_Raise
      MISG A 1 A_Raise
      Loop
   Fire:
      MISF A 4 Bright A_GunFlash
      MISF B 5 Bright A_FireCustomMissile("PowerRocket2",0,1,-1,-1)
      MISF B 5 Bright A_FireCustomMissile("PowerRocket2",0,0,1,-1)
      MISF B 5 Bright A_FireCustomMissile("PowerRocket2",0,0,-1,1)
      MISF B 2 Bright A_FireCustomMissile("PowerRocket2",0,0,1,1)
      MISF CD 5 Bright
      MISG A 0 A_Refire
      Goto Ready
   Hold:
      MISF A 4 Bright A_GunFlash
      MISF B 5 Bright A_FireCustomMissile("PowerRocket2",0,1,-1,-1)
      MISF B 5 Bright A_FireCustomMissile("PowerRocket2",0,0,1,-1)
      MISF B 5 Bright A_FireCustomMissile("PowerRocket2",0,0,-1,1)
      MISF B 2 Bright A_FireCustomMissile("PowerRocket2",0,0,1,1)
      MISF CD 5 Bright
      MISG A 0 A_Refire
      Goto Ready
   Flash:
      TNT1 A 4 A_Light1
      TNT1 A 17 A_Light2
      TNT1 A 5 A_Light1
      TNT1 A 5 A_Light0
      stop
   }
}

actor PowerRocket2
{
  obituary "%o rode %k's rocket."
  radius 11
  height 8
  speed 30
  damage 35
  seesound "weapons/rocklf"
  deathsound "weapons/rocklx"
  scale 0.5
  translation "128:151=[192,192,192]:[64,64,64]","48:79=[255,255,255]:[0,0,0]","112:127=[255,255,255]:[0,0,0]"
  PROJECTILE
  Damagetype "Normal"
  +RANDOMIZE
  +ROCKETTRAIL
  +THRUGHOST
  +SeekerMissile
  states
  {
  Spawn:
    MISL A 0 bright A_SeekerMissile(10,2)
    MISL A 0 bright A_BishopMissileWeave
    MISL A 1 bright A_BishopMissileWeave
    loop
  Death:
    MISL B 0 bright A_SetTranslucent (0.67,1)
    MISL B 8 bright A_Explode(96,128)
    MISL C 6 bright
    MISL D 4 bright
    stop
  }
}


//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// PLASMA RIFLE /////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerPlasmaRifle : PlasmaRifle
{
   weapon.ammouse 2
   Weapon.SisterWeapon "DEPlasmaRifle"
   Tag "Plasma Rifle"
   +POWERED_UP
   States
   {
   Spawn:
      PLAS A -1
      Loop
   Ready:
      PLSG ABC 3 Bright A_WeaponReady
      Loop
   Deselect:
      PLSG E 0 A_Lower
      PLSG E 1 A_Lower
      Loop
   Select:
      PLSG E 0 A_Raise
      PLSG E 1 A_Raise
      Loop
   Fire:
      PLSG F 1 Bright A_GunFlash
      PLSG F 1 Bright A_FireCustomMissile("PowerPlasmaBall",0,1,0,0)
      PLSG G 1 Bright
      PLSG H 1 Bright
      PLSG D 20 A_Refire
      Goto Ready
   Hold:
      PLSG F 1 Bright A_GunFlash
      PLSG F 1 Bright A_FireCustomMissile("PowerPlasmaBall",0,1,0,0)
      PLSG G 1 Bright
      PLSG H 1 Bright
      PLSG D 20 A_Refire
      Goto Ready
   Flash:
      TNT1 A 1 A_Light1
      TNT1 A 1 A_Light2
      TNT1 A 1 A_Light1
      TNT1 A 1 A_Light0
      stop
   }
}

actor PowerPlasmaBall
{
  Radius 22.75
  Height 14
  Speed 25
  Damage 9
  Scale 0.8
  Projectile
  +RANDOMIZE
  +DOOMBOUNCE
  Bouncecount 5
  RenderStyle Add
  Alpha 0.75
  SeeSound "weapons/plasmaf"
  DeathSound "weapons/plasmax"
  Obituary "$OB_MPPLASMARIFLE"
  States
  {
  Spawn:
    PLSE A 6 bright
    loop
  Death:
    PLSE ABCDE 4 bright
    stop
  }
}

//////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////  BFG9000   ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

// Unlike it's unpowered counterpart, it really really sucks to use this at close
// range now. That's the price you pay for being tough. ;)

actor PowerBFG9000 : BFG9000
{
  weapon.ammouse 5
  Weapon.SisterWeapon "DEBFG9000"
  Tag "BFG 9000"
  +POWERED_UP
  States
  {
  Spawn:
    BFUG A -1
    stop
  Ready:
      BFGG ABCD 3 Bright A_WeaponReady
      loop
  Deselect:
      BFGG E 0 A_Lower
      BFGG E 1 A_Lower
      loop
  Select:
      BFGG E 0 A_Raise
      BFGG E 1 A_Raise
      loop
  Fire:
      BFGG F 1 Bright
      BFGG H 1 Bright
      BFGG J 1 Bright
      BFGG K 0 Bright A_GunFlash
      BFGG L 1 Bright A_FireCustomMissile ("PowerBFGBall",0,1,0,0)
      BFGG N 1 Bright
      BFGG E 7 Bright A_ReFire
      goto Ready
  Hold:
      BFGG F 1 Bright
      BFGG H 1 Bright
      BFGG J 1 Bright
      BFGG K 0 Bright A_GunFlash
      BFGG L 1 Bright A_FireCustomMissile ("PowerBFGBall",0,1,0,0)
      BFGG N 1 Bright
      BFGG E 7 Bright A_ReFire
      goto Ready
   Flash:
      TNT1 A 1 A_Light1
      TNT1 A 1 A_Light2
      TNT1 A 3 A_Light1
      TNT1 A 0 A_Light0
    stop
  }
}

// This is a weaker version of the BFG that gets rapidfired. Instead of tracers, it simply explodes. Note that it foils boss immunity to explosions, and it WILL hurt the shooter.
actor PowerBFGBall
{
  SeeSound "weapons/bfg_fire"
  DeathSound "weapons/bfg_hum"
  Radius 13
  Height 8
  Speed 35
  Damage 20
  Renderstyle Add
  Scale 0.6
  Alpha 0.75
  Projectile
  +RANDOMIZE
  +EXTREMEDEATH
  +FORCERADIUSDMG
  Obituary "$OB_MPBFG_BOOM" // "%o was splintered by %k's BFG."
  //SuicideObituary "%k couldn't handle the overwhelming power."
  States
  {
  Spawn:
    BFS1 AB 4 bright
    loop
  Death:
    BFE1 A 3 bright A_Explode(128,196)
    BFE1 BCDEF 3 bright
    stop
  }
}


//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// SUPER SHOTGUN ////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

actor PowerSuperShotgun : SuperShotgun
{
  Weapon.SisterWeapon "DESuperShotgun"
  +POWERED_UP
  obituary "%o was splattered by %k's super shotgun."
  Tag "Super Shotgun"
  radius 20
  height 16
  attacksound "weapons/sshotf"
  inventory.pickupmessage "You got the super shotgun!"
  weapon.selectionorder 400
  weapon.kickback 100
  weapon.ammotype "Shell"
  weapon.ammouse 2
  weapon.ammogive 8
  Damagetype "Normal"
  states
  {
  Ready:
    SHT2 A 1 A_WeaponReady
    loop
  Deselect:
    SHT2 A 0 A_Lower
    SHT2 A 1 A_Lower
    loop
  Select:
    SHT2 A 0 A_Raise
    SHT2 A 1 A_Raise
    loop
  Fire:
  Hold:
    SHT2 A 3
    SHT2 M 0 A_FireCustomMissile ("SSGRipper",0,1,0,0)
    SHT2 A 0 A_GunFlash
    SHT2 M 0 A_PlayWeaponSound ("weapons/sshotf")
    SHT2 MMMMMMMMMMMMMMMMMMM 0 A_FireCustomMissile ("SSGRipper",random(-11.2,11.2),0,0,random(-7.1,7.1))
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-4.00,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-3.55,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-3.11,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-2.66,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-2.22,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-1.77,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-1.33,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-0.88,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",-0.44,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",0.00,0,0,0) // middle
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",0.44,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",0.88,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",1.33,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",1.77,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",2.22,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",2.66,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",3.11,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",3.55,0,0,0)
    //SHT2 M 0 A_FireCustomMissile ("SSGRipper",4.00,0,0,0)
    SHT2 M 2 Bright
    SHT2 N 3 Bright
    SHT2 O 2 Bright
    SHT2 B 3
    SHT2 C 4
    SHT2 D 4 A_CheckReload
    SHT2 C 3
    SHT2 E 3 A_PlayWeaponSound ("weapons/sshoto")
    SHT2 F 3
    SHT2 G 4
    SHT2 H 4
    SHT2 I 3 A_PlayWeaponSound ("weapons/sshotl")
    SHT2 J 3
    SHT2 K 3
    SHT2 L 4
    SHT2 E 0 A_PlayWeaponSound ("weapons/sshotc")
    SHT2 E 6 A_ReFire
    SHT2 A 5 A_ReFire
    goto Ready
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 3 bright A_Light2
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    SGN2 A -1
    stop
  }
}

ACTOR SSGRipper {
  Radius 13
  Height 8
  Speed 500
  Damage 5
  Projectile
  +RIPPER
  +NOEXTREMEDEATH
  +INVISIBLE
  Obituary "%o was splattered by %k's super shotgun."
  States
  {
  Spawn:
    //PUFF A 1 bright
    TNT1 A 1
    loop
  Death:
    //PUFF BCD 4 bright
    TNT1 A 1 A_SpawnItemEx("BulletPuff",0,0,0,0,0,1,160,128)
    stop
  }
}


////////////////////////////////////////////////////////
/////////////////////////// FIST ///////////////////////
////////////////////////////////////////////////////////
actor PowerFist : Weapon
{
  Weapon.SisterWeapon "DEFist"
  Tag "Fist"
  +POWERED_UP
  obituary "%o chewed on %k's fist."
  weapon.selectionorder 3700
  weapon.kickback 100
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  states
  {
  Ready:
    PUNG A 1 A_WeaponReady
    loop
  Deselect:
    PUNG A 0 A_Lower
    PUNG A 1 A_Lower
    loop
  Select:
    PUNG A 0 A_Raise
    PUNG A 1 A_Raise
    loop
  Fire:
    PUNG B 4
    PUNG C 4 A_CustomPunch(20,0,0,"ElectricalPuff",0)
    PUNG D 5
    PUNG C 4
    PUNG B 5 A_ReFire
    goto Ready
  }
}

actor ElectricalPuff
{
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  RenderStyle Translucent
  Alpha 0.5
  VSpeed 0.25
  Scale 0.5
  Mass 5
  SeeSound "weapons/plasmax"
  AttackSound "weapons/plasmax"
  States
  {
  Spawn:
    PLSE ABCDE 4 bright
    stop
  }
}


////////////////////////////////////////////////////////
////////////////// CHAINSAW ////////////////////////////
////////////////////////////////////////////////////////
actor PowerChainsaw : Weapon
{
  obituary "%o was mowed over by %k's chainsaw."
  radius 20
  height 16
  inventory.pickupmessage "A chainsaw!  Find some meat!"
  weapon.selectionorder 2200
  weapon.upsound "weapons/sawup"
  weapon.readysound "weapons/sawidle"
  Weapon.SisterWeapon "DEChainsaw"
  Tag "Chainsaw"
  +POWERED_UP
  +WEAPON.MELEEWEAPON
  states
  {
  Ready:
    SAWG CD 4 A_WeaponReady
    loop
  Deselect:
    SAWG C 0 A_Lower
    SAWG C 1 A_Lower
    loop
  Select:
    SAWG C 0 A_Raise
    SAWG C 1 A_Raise
    loop
  Fire:
    SAWG AABBAABBAABB 1 A_Saw
    SAWG CCDDCCDDCCDD 1 A_Saw
    SAWG B 0 A_ReFire
    goto Ready
  Spawn:
    CSAW A -1
    stop
  }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// DEVASTATOR ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerDevastator : Weapon
{
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the Devastator, Hell yeah!"
   Obituary "%o was desintergrated by %k's Devastator."
   Weapon.AmmoType "Cell"
   Weapon.AmmoGive 60
   Weapon.AmmoUse 60
   Weapon.SisterWeapon "Devastator"
   Tag "Devastator"
   +POWERED_UP
   Damagetype "Normal"
   +WEAPON.EXPLOSIVE
   +WEAPON.BFG
   +WEAPON.NOAUTOFIRE
   States
   {
   Spawn:
      WDEV A -1
      Loop
   Ready:
      DEVG A 2 A_WeaponReady
      Loop
   Deselect:
      DEVG A 0 A_Lower
      DEVG A 1 A_Lower
      Loop
   Select:
      DEVG A 0 A_Raise
      DEVG A 1 A_Raise
      Loop
   Fire:
      DEVG B 5 A_PlayWeaponSound("weapons/devchr")
      DEVG CDEF 5 Bright
      DEVG A 0 A_Refire
      DEVG J 2 Bright A_GunFlash
      DEVG J 1 Bright A_Playsound("weapons/devfir")
      DEVG K 5 Bright A_FireCustomMissile ("DevastatorBall",0,1,0,0)
      DEVG L 3 Bright
      Goto Ready
   Hold:
      DEVG G 1 Bright A_PlayWeaponSound("weapons/devfch")
      DEVG G 2 Bright A_FireBullets(4,4,2,6,"DevPuff",0,64)
      DEVG H 2 Bright A_FireBullets(4,4,2,6,"DevPuff",0,64)
      DEVG I 2 Bright A_FireBullets(4,4,2,6,"DevPuff",0,64)
      DEVG G 2 Bright A_FireBullets(4,4,2,6,"DevPuff",0,64)
      DEVG H 2 Bright A_FireBullets(4,4,2,6,"DevPuff",0,64)
      DEVG I 2 Bright A_FireBullets(4,4,2,6,"DevPuff",0,64)
      DEVG I 0 A_Refire
      DEVG J 2 Bright A_GunFlash
      DEVG J 1 Bright A_Playsound("weapons/devfir")
      DEVG K 5 Bright A_FireCustomMissile ("DevastatorBall",0,1,0,0)
      DEVG L 3 Bright
      Goto Ready
   Flash:
      TNT1 A 2 A_Light1
      TNT1 A 5 A_Light2
      TNT1 A 4 A_Light1
      TNT1 A 2 A_Light0
      stop
   }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// RAILGUN    ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerRailGun : Weapon
{
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the railgun!"
   Obituary "%o was railed by %k."
   Damagetype "Normal"
   Tag "Railgun"
   Weapon.AmmoType "Cell"
   Weapon.AmmoGive 40
   Weapon.AmmoUse 5
   +POWERED_UP
   States
   {
   Spawn:
      WRAL A -1
      Loop
   Ready:
   	  RAIG A 2 A_WeaponReady
	  Loop
	  RSCP A 2 Bright A_WeaponReady(1)
	  Goto Ready+1
   Deselect:
	  RAIG A 0 A_TakeInventory("RailgunScope",1)
	  RAIG A 0 A_ZoomFactor(1)
      RAIG A 0 A_Lower
      RAIG A 1 A_Lower
      Loop
   Select:
	  RAIG A 0 A_TakeInventory("RailgunScope",1)
	  RAIG A 0 A_ZoomFactor(1,ZOOM_INSTANT)
      RAIG A 0 A_Raise
      RAIG A 1 A_Raise
      Loop
   Fire:
      RAIG A 0 A_JumpIfInventory("RailgunScope",1,"ZoomFire")
      RAIG A 0 A_JumpIfInventory("RailCharge",2,22)
      RAIG A 0 A_JumpIfInventory("RailCharge",1,10)
      RAIG B 6 A_PlayWeaponSound("weapons/railch")
      RAIG B 6 Bright A_GiveInventory("RailCharge",1)
      RAIG B 0 A_Refire
      RAIG E 3 Bright A_GunFlash
      RAIG E 1 A_PlayWeaponSound("weapons/railf1")
      RAIG F 6 Bright A_RailAttack(200,0,1,"FF 00 00","FF FF FF")
      RAIG A 4
      RAIG K 15
      RAIG A 0 A_TakeInventory("RailCharge",3)
      Goto Ready
      RAIG C 6 Bright
      RAIG C 6 Bright A_GiveInventory("RailCharge",1)
      RAIG C 0 A_Refire
      RAIG G 3 Bright A_GunFlash
      RAIG G 1 A_PlayWeaponSound("weapons/railf2")
      RAIG H 0 Bright A_RailAttack(0,0,1,"FF FF 00","FF FF FF")
      RAIG H 6 Bright A_RailAttack(400,0,1,"FF FF 00","FF 45 00")
      RAIG A 4
      RAIG K 15
      RAIG A 0 A_TakeInventory("RailCharge",3)
      Goto Ready
      RAIG D 6 Bright
      RAIG D 6 Bright
      RAIG D 0 A_Refire
      RAIG I 3 Bright A_GunFlash
      RAIG I 1 A_PlayWeaponSound("weapons/railf3")
      RAIG J 0 Bright A_RailAttack(0,0,1,"00 00 FF","00 45 FF")
      RAIG J 0 Bright A_RailAttack(0,0,1,"00 00 FF","FF FF FF")
      RAIG J 4 Bright A_RailAttack(600,0,1,"00 00 FF","00 FF 00")
      RAIG A 4
      RAIG K 15
      RAIG A 0 A_TakeInventory("RailCharge",3)
      Goto Ready
   ZoomFire:
	  RSCP A 0 Bright A_JumpIfInventory("RailCharge",2,19)
      RSCP A 0 Bright A_JumpIfInventory("RailCharge",1,9)
      RSCP A 6 Bright A_PlayWeaponSound("weapons/railch")
      RSCP A 6 Bright A_GiveInventory("RailCharge",1)
      RSCP A 0 Bright A_Refire
      RSCP A 3 Bright A_GunFlash
      RSCP A 1 Bright A_PlayWeaponSound("weapons/railf1")
      RSCP A 6 Bright A_RailAttack(200,0,1,"FF 00 00","FF FF FF")
      RSCP A 19 Bright
      RSCP A 0 Bright A_TakeInventory("RailCharge",3)
      Goto Ready+1
      RSCP A 6 Bright
      RSCP A 6 Bright A_GiveInventory("RailCharge",1)
      RSCP A 0 Bright A_Refire
      RSCP A 3 Bright A_GunFlash
      RSCP A 1 Bright A_PlayWeaponSound("weapons/railf2")
      RSCP A 0 Bright A_RailAttack(0,0,1,"FF FF 00","FF FF FF")
      RSCP A 6 Bright A_RailAttack(400,0,1,"FF FF 00","FF 45 00")
      RSCP A 19 Bright
      RSCP A 0 Bright A_TakeInventory("RailCharge",3)
      Goto Ready+1
      RSCP A 12 Bright
      RSCP A 0 Bright A_Refire
      RSCP A 3 Bright A_GunFlash
      RSCP A 1 Bright A_PlayWeaponSound("weapons/railf3")
      RSCP A 0 Bright A_RailAttack(0,0,1,"00 00 FF","00 45 FF")
      RSCP A 0 Bright A_RailAttack(0,0,1,"00 00 FF","FF FF FF")
      RSCP A 4 Bright A_RailAttack(600,0,1,"00 00 FF","00 FF 00")
      RSCP A 19 Bright
      RSCP A 0 Bright A_TakeInventory("RailCharge",3)
      Goto Ready+1
   AltFire:
      RSCP A 0 Bright A_JumpIfInventory("RailgunScope",1,3)
	  RSCP A 0 Bright A_GiveInventory("RailgunScope",1)
	  RSCP A 8 Bright A_ZoomFactor(3)
	  Goto Ready+1
	  RAIG A 0 A_TakeInventory("RailgunScope",1)
	  RAIG A 8 A_ZoomFactor(1)
	  Goto Ready
   Flash:
      TNT1 A 4 A_Light1
      TNT1 A 4 A_Light2
      TNT1 A 1 A_Light1
      TNT1 A 0 A_Light0
      stop
   }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// HOMING ROCKET LAUNCHER ///////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerHRL : Weapon
{
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the Homing-Rocket Launcher!"
   Obituary "%o couldn't dodge %k's homing rockets."
   Weapon.AmmoType "RocketAmmo"
   Weapon.AmmoGive 4
   Weapon.AmmoUse 2
   Weapon.SisterWeapon "HRL"
   Tag "Homing Rocket Launcher"
   +POWERED_UP
   States
   {
   Spawn:
      WHRL A -1
      Loop
   Ready:
      HRLG A 1 A_WeaponReady
      Loop
   Deselect:
      HRLG A 0 A_Lower
      HRLG A 1 A_Lower
      Loop
   Select:
      HRLG A 0 A_Raise
      HRLG A 1 A_Raise
      Loop
   Fire:
      HRLG A 4
      HRLG C 0 Bright A_GunFlash
      HRLG C 5 Bright
      HRLG D 0 Bright A_FireCustomMissile ("PowerHomRocket1",4,1,0,4.5)
      HRLG D 0 Bright A_FireCustomMissile ("PowerHomRocket1",-4,0,0,4.5)
      HRLG D 0 Bright A_FireCustomMissile ("PowerHomRocket1",3.7,0,3,0)
      HRLG D 0 Bright A_FireCustomMissile ("PowerHomRocket1",-4.3,0,3,0)
      HRLG D 0 Bright A_FireCustomMissile ("PowerHomRocket1",4.3,0,-3,0)
      HRLG D 6 Bright A_FireCustomMissile ("PowerHomRocket1",-3.7,0,-3,0)
      HRLG E 5 Bright
      HRLG F 4 Bright
      HRLG B 3 A_Refire
      Goto Ready
   Flash:
      TNT1 A 5 A_Light1
      TNT1 A 6 A_Light2
      TNT1 A 5 A_Light1
      TNT1 A 0 A_Light0
      stop
   }
}

ACTOR PowerHomRocket1
{
   Radius 4
   Height 5.5
   Scale 0.5
   Speed 35
   Damage 8
   PROJECTILE
   DeathSound "weapons/hrlexp"
   ExplosionDamage 64
   ExplosionRadius 96
   Damagetype "Normal"
   +SeekerMissile
   +Rockettrail
   +THRUGHOST
   SeeSound "weapons/hrlfir"
   States
   {
   Spawn:
      MISL A 1 Bright A_SeekerMissile (45,35)
      MISL A 1 Bright A_SeekerMissile (30,25)
      goto Spawn+1
   Death:
      MISL B 0 Bright A_SetTranslucent (0.67,1)
      MISL C 8 Bright A_Explode
      MISL D 5 Bright
      stop
   }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// PYRO CANNON //////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerPyroCannon : Weapon
{
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the PyroCannon ProtoType!"
   Obituary "%o was incinerated by %k's Pyrocannon."
   Tag "Pyro Cannon"
   Weapon.AmmoType "Gas"
   Weapon.AmmoGive 48
   Weapon.AmmoUse 16
   Weapon.SisterWeapon "PyroCannon"
   +WEAPON.EXPLOSIVE
   +WEAPON.BFG
   +WEAPON.DONTBOB
   +WEAPON.STAFF2_KICKBACK
   +POWERED_UP
   States
   {
   Spawn:
      WPYR A -1
      Loop
   Ready:
      PYRG A 1 A_WeaponReady
      Loop
   Deselect:
      PYRG A 0 A_Lower
      PYRG A 1 A_Lower
      Loop
   Select:
      PYRG A 0 A_Raise
      PYRG A 1 A_Raise
      Loop
   Fire:
      PYRG A 5
      PYRG B 8 Bright A_GunFlash
      PYRG C 3 Bright A_FireCustomMissile("PyroShot",0,1,0,0)
      PYRG C 3 Bright A_FireCustomMissile("PyroShot",0,1,0,0)
      PYRG C 3 Bright A_FireCustomMissile("PyroShot",0,1,0,0)
      PYRG DEFG 5 Bright
      PYRG A 5 A_Refire
      Goto Ready
   Hold:
      PYRG A 5
      PYRG B 8 Bright A_GunFlash
      PYRG C 3 Bright A_FireCustomMissile("PyroShot",0,1,0,0)
      PYRG C 3 Bright A_FireCustomMissile("PyroShot",0,1,0,0)
      PYRG C 3 Bright A_FireCustomMissile("PyroShot",0,1,0,0)
      PYRG DEFG 5 Bright
      PYRG A 5 A_Refire
      Goto Ready
   Flash:
      TNT1 A 8 A_Light1
      TNT1 A 10 A_Light2
      TNT1 A 15 A_Light1
      TNT1 A 1 A_Light0
      stop
   }
}


//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// AUTO SHOTGUN /////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

actor PowerAutoShotgun : Weapon
{
  +AMMO_OPTIONAL
  obituary "%o got blasted away by %k's autoshotgun."
  radius 20
  height 16
  Inventory.Pickupmessage "You got the automatic shotgun!"
  Tag "Autoshotgun"
  weapon.selectionorder 700
  Weapon.AmmoType1 "Shell"
  Weapon.AmmoType2 "ASGClip"
  Weapon.AmmoGive1 16
  Weapon.AmmoGive2 16
  Weapon.AmmoUse 1
  Weapon.SisterWeapon "AutoShotgun"
  +POWERED_UP
  AttackSound "weapons/asgfir"
  Damagetype "Normal"
  states
  {
  Spawn:
    WASG A -1
    stop
  Ready:
	ASGG A 0 A_JumpIfInventory("ASGClip",20,2)
	ASGG A 0 A_JumpIfInventory("Shell",1,2)
	ASGG A 1 A_WeaponReady(8)
	Loop
    ASGG A 1 A_WeaponReady
    Loop
  Deselect:
    ASGG A 0 A_Lower
    ASGG A 1 A_Lower
    loop
  Select:
    ASGG A 0 A_Raise
    ASGG A 1 A_Raise
    loop
  Fire:
  Hold:
    ASGG A 0 A_JumpIfInventory("ASGClip",1,29)
    ASGG A 0 A_JumpIfInventory("Shell",1,2)
    ASGG A 2 A_PlayWeaponSound("Weapons/asgout")
    Goto Ready
    ASGG BCDEF 3
    ASGG G 3 A_PlayWeaponSound("Weapons/asgout")
    ASGG HIJ 3
    ASGG k 15
    ASGG JIH 3
    ASGG G 0 A_TakeInventory("Shell",1)
    ASGG G 0 A_GiveInventory("ASGClip",1)
    ASGG G 0 A_JumpIfInventory("ASGClip",20,2)
    ASGG G 0 A_JumpIfInventory("Shell",1,2)
    ASGG G 0
    Goto Hold+22
    ASGG G 0
    Goto Hold+16
    ASGG G 3 A_PlayWeaponSound("Weapons/asgin")
    ASGG FEDCB 3
    ASGG A 8 A_PlaySoundEX("weapons/asgld1","auto",0)
    goto Ready
    ASGG A 1
    ASGG L 0 A_GunFlash
    ASGG A 0 A_TakeInventory("ASGClip",1)
    ASGG L 2 A_FireBullets(5,4,7,5,"BulletPuff",0)
    ASGG M 3
    ASGG N 2
    ASGG A 4 A_PlaySoundEX("weapons/asgld1","auto",0)
    ASGG A 0
    ASGG A 0 A_ReFire
    goto Ready
  AltFire:
    ASGG BCDEF 3
    ASGG G 3 A_PlayWeaponSound("Weapons/asgout")
    ASGG HIJ 3
    ASGG K 15
    ASGG JIH 3
    ASGG G 0 A_TakeInventory("Shell",1)
    ASGG G 0 A_GiveInventory("ASGClip",1)
    ASGG G 0 A_JumpIfInventory("ASGClip",20,2)
    ASGG G 0 A_JumpIfInventory("Shell",1,2)
    ASGG G 0
    Goto AltFire+19
    ASGG G 0
    Goto AltFire+13
    ASGG G 3 A_PlayWeaponSound("Weapons/asgin")
    ASGG FEDCB 3
    ASGG A 8 A_PlaySoundEX("weapons/asgld1","auto",0)
    Goto Ready
  Flash:
    TNT1 A 4 bright A_Light1
    TNT1 A 3 bright A_Light2
    TNT1 A 0 bright A_Light0
    stop
  }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// REPEATER /////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerRepeater : Weapon
{
   spawnid 236
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the plasma repeater!"
   Obituary "%o was disintegrated by %k's repeater."
   Weapon.AmmoType1 "Cell"
   Weapon.AmmoGive 20
   Weapon.AmmoUse 1
   Weapon.SisterWeapon "Repeater"
   +POWERED_UP
   +WEAPON.EXPLOSIVE
   AttackSound "weapons/repfir"
   Tag "Plasma Repeater"
   States
   {
   Spawn:
      WREP A -1
      Loop
   Ready:
      REPG A 1 A_WeaponReady
      Loop
   Deselect:
      REPG A 0 A_Lower
      REPG A 1 A_Lower
      Loop
   Select:
      REPG A 0 A_Raise
      REPG A 1 A_Raise
      Loop
   Fire:
      REPG A 4 A_PlaySound("weapons/repidl")
      REPG BCD 4
      REPG ABCD 3
      REPG ABCD 2
      REPG E 0 Bright A_Gunflash
      REPG E 1 Bright A_FireBullets(4,4,2,9,RepPuff,1,10240)
      REPG F 1 Bright
      REPG G 1 Bright A_FireBullets(4,4,2,9,RepPuff,1,10240)
      REPG H 1 Bright
      REPG A 0 A_Refire
      REPG A 2 A_PlaySound("weapons/repstp")
      REPG BCD 2
      REPG ABCD 3
      REPG ABCD 4
      Goto Ready
   Hold:
      REPG E 0 Bright A_Gunflash
      REPG E 1 Bright A_FireBullets(4,4,2,9,RepPuff,1,10240)
      REPG F 1 Bright
      REPG G 1 Bright A_FireBullets(4,4,2,9,RepPuff,1,10240)
      REPG H 1 Bright
      REPG A 0 A_Refire
      REPG A 2 A_PlaySound("weapons/repstp")
      REPG BCD 2
      REPG ABCD 3
      REPG ABCD 4
      REPG ABCD 5
      Goto Ready
   Flash:
      TNT1 A 2 A_Light2
      TNT1 A 2 A_Light1
      TNT1 A 0 A_Light0
      stop
   }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// MINE LAYER ///////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerLandMineLayer : Weapon
{
   Inventory.PickupMessage "You got some Landmines!"
   Inventory.PickupSound "misc/w_pkup"
   Weapon.AmmoType "Mines"
   Weapon.AmmoGive 5
   Weapon.AmmoUse 1
   Weapon.AmmoType2 "Mines"
   Weapon.AmmoUse2 1
   Weapon.SisterWeapon "LandMineLayer"
   Tag "Land Mines"
   +POWERED_UP
   States
   {
   Spawn:
      MINE A -1
      Loop
   Ready:
      LAYR A 1 A_WeaponReady
      Loop
   Deselect:
      LAYR A 0 A_Lower
      LAYR A 1 A_Lower
      Loop
   Select:
      LAYR A 0 A_Raise
      LAYR A 1 A_Raise
      Loop
   AltFire:
      LAYR B 8 A_PlaySound("weapons/minebeep")
      LAYD ABCDE 1
      TNT1 A 10
      LAYT A 1 A_PlaySound("weapons/minethrow")
      LAYT BCDEFGH 1
      LAYT I 1 A_FireCustomMissile("PowerLandmine2",0,1,0,8)
      LAYT I 1 A_FireCustomMissile("PowerLandmine2",-7,0,0,8)
      LAYT I 1 A_FireCustomMissile("PowerLandmine2",7,0,0,8)
      LAYT JKLMNOPQR 1
      TNT1 A 10
      LAYU ABCDE 1
      LAYR A 6
      Goto Ready
   Fire:
      LAYR B 8 A_PlaySound("weapons/minebeep")
      LAYD ABCDE 1
      TNT1 A 10
      TNT1 A 19 A_FireCustomMissile("PowerLandmine3",0,1,0,0)
      LAYU ABCDE 1
      LAYR A 6
      Goto Ready
   }
}

ACTOR PowerLandmineA
{
   Radius 8 //was 5
   Height 5
   Mass 1000000
   Health 20
   Damage 20
   SeeSound "weapons/tink"
   ExplosionDamage 768
   ExplosionRadius 240
   DONTHURTSHOOTER
   Speed 0
   +NOBLOOD
   -SHOOTABLE
   +MISSILE
   +THRUGHOST
   States
   {
   Spawn:
      MINE A 0 A_Gravity
      MINE AB 5
      Loop
   Death:
      MISL B 0 A_PlaySound("weapons/mineexpl")
      MISL B 8 A_Explode
      MISL C 6
      MISL D 4
      Stop
   }
}

ACTOR PowerLandmineB : PowerLandmineA
{
   ExplosionDamage 256
   ExplosionRadius 160
}


ACTOR PowerLandmine2
{
   Radius 8 //was 5
   Height 5
   Mass 1000000
   Health 20
   Damage 10
   SeeSound "weapons/tink"
   DONTHURTSHOOTER
   Speed 15
   +NOBLOOD
   -SHOOTABLE
   +MISSILE
   +DOOMBOUNCE
   +THRUGHOST
   States
   {
   Spawn:
      MINE A 0 A_Gravity
      MINE AB 5
      Loop
   Death:
      MINE A 0 A_SpawnItem("PowerLandmineB")
      Stop
   }
}

ACTOR PowerLandmine3 : PowerLandmine2
{
   Speed 2
   States
   {
   Spawn:
      MINE A 0 A_Gravity
      MINE AB 5
      Loop
   Death:
      MINE A 0 A_SpawnItem("PowerLandmineA")
      Stop
   }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// STUNNER RIFLE ////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerStunnerRifle : PlasmaRifle
{
   Weapon.AmmoUse 5
   Weapon.SisterWeapon "StunnerRifle"
   Tag "Stunner Rifle"
   +POWERED_UP
   States
   {
   Spawn:
      STPP A -1
      Loop
   Ready:
      STPO ABC 3 Bright A_WeaponReady
      Loop
   Deselect:
      STPO E 0 A_Lower
      STPO E 1 A_Lower
      Loop
   Select:
      STPO E 0 A_Raise
      STPO E 1 A_Raise
      Loop
   Fire:
      STPO F 0 Bright A_GunFlash
      STPO F 3 Bright A_FireCustomMissile("PowerStunnerBall",0,1,0,0)
      STPO GH 3 Bright
      STPO D 16
      STPO D 6 A_ReFire
      Goto Ready
   Flash:
      TNT1 A 1 A_Light1
      TNT1 A 1 A_Light2
      TNT1 A 1 A_Light1
      TNT1 A 1 A_Light0
      stop
   }
}

actor PowerStunnerBall
{
  spawnid 10
  radius 6
  height 8
  speed 20
  scale 0.45
  damagetype Stunner
  damage 1
  renderstyle Add
  seesound "weapons/stunner/shot"
  deathsound "weapons/stunner/hit"
  translation "192:207=250:254"
  PROJECTILE
  +RANDOMIZE
  +RIPPER
  +SEEKERMISSILE
  // [SP] The following flag is being removed for Skulltag compatibility.
  // +SCREENSEEKER
  states
  {
  Spawn:
    STPR A 0 A_BishopMissileWeave
	STPR A 0 A_Tracer2
	STPR A 0 A_SpawnItemEx("StunnerBallFX",0,0,0,0,0,0,0,128)
	STPR A 1 Bright
    loop
  Death:
    PLSE ABCDE 4 bright
    stop
  }
}

//////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// FLAMER ///////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

ACTOR PowerFlamer : Weapon
{
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "You got the flamethrower! Time for a BBQ!"
   Obituary "%o was BBQed by %k's flamethrower."
   Weapon.AmmoType "Gas"
   Weapon.AmmoGive 48
   Weapon.AmmoUse 1
   Weapon.SisterWeapon "Flamer"
   Tag "Flamethrower"
   +POWERED_UP
   +WEAPON.EXPLOSIVE
   States
   {
   Spawn:
      WFLM A -1
      Loop
   Ready:
      FLMG A 3 A_WeaponReady
      Loop
   Deselect:
      FLMG A 0 A_Lower
      FLMG A 1 A_Lower
      Loop
   Select:
      FLMG A 0 A_Raise
      FLMG A 1 A_Raise
      Loop
   Fire:
      FLMG A 0 Bright A_GunFlash
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,0,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 0 Bright A_GunFlash
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,0,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 0 Bright A_GunFlash
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,0,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 2 Bright A_Refire
      Goto Ready
   Hold:
      FLMG A 0 Bright A_GunFlash
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,0,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 0 Bright A_GunFlash
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,0,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 0 Bright A_GunFlash
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,0,random(-4,4),0)
      FLMG A 1 Bright A_FireCustomMissile("PowerFTFire",0,1,random(-4,4),0)
      FLMG A 2 Bright A_Refire
      Goto Ready
   Flash:
      TNT1 A 2 A_Light1
      TNT1 A 2 A_Light2
      TNT1 A 1 A_Light1
      TNT1 A 1 A_Light0
      stop
   }
}

ACTOR PowerFTFire
{
   Radius 2
   Height 4
   Speed 16
   Damage 2
   Translation Ice
   PROJECTILE
   RENDERSTYLE ADD
   DamageType Ice
   ALPHA 0.67
   Scale 0.67
   SeeSound "weapons/flamer"
   DeathSound "weapons/scorch"
   DONTHURTSHOOTER
   +THRUGHOST
   States
   {
   Spawn:
      TNT1 A 2 Bright
      STEM ABCD 2 Bright A_Explode(7,8,0)
      STEM D 0 Bright A_Lowgravity
      STEM EFG 2 Bright A_Explode(8,16,0)
      STEM HIJ 2 Bright A_Explode(7,32,0)
      STEM KJI 2 Bright A_Explode(8,64,0)
      STEM HGFEDCBA 1 Bright
      stop
   Death:
      STEM J 1 Bright A_Explode(7,32,0)
      STEM I 1 Bright A_Explode(8,64,0)
      STEM HGECA 1 Bright
      stop
   }
}