actor NanoPhotonCannon : Weapon
{
  Weapon.SelectionOrder 9999
  Weapon.AmmoUse 100
  Weapon.AmmoGive 100
  Scale 0.7
  Weapon.AmmoType "Cell"
  Obituary "%o was Obliterated by %k's Photon Cannon."
  Weapon.UpSound "bfg/up"
  Tag "Photon Cannon"
  States
  {
  Ready:
	NAPC A 1 A_WeaponReady
    loop
  Deselect:
    NAPC A 1 A_Lower
	TNT1 A 0 A_Lower
	TNT1 A 0 A_Lower
	Loop
  Select:
	NAPC A 1 A_Raise
	TNT1 A 0 A_Raise
	TNT1 A 0 A_Raise
    Loop
  Fire:
    NAPC A 25 A_PlayWeaponSound("bfg/Charge")
	NAPC A 0
	NAPC K 2 bright
	NAPC K 0 bright A_GUNFLASH
	NAPC K 0 bright A_PlayWeaponSound("bfg/fire")
	NAPC K 0 bright Radius_Quake(25,10,0,10,0)
	NAPC K 0 bright A_Recoil(22.5)
	NAPC K 0 bright A_FireCustomMissile("PhotonTorpedo",0,1)
	NAPC L 2 bright
    NAPC M 2 bright
	NAPC N 2 bright
	NAPC O 2 bright
	NAPC P 2
	NAPC Q 2
	NAPC R 2
	NAPC S 2
	NAPC T 2
	NAPC U 3
	NAPC T 2
	NAPC S 1
	NAPC R 1
	NAPC Q 1
	NAPC P 1
	NAPC F 1
	NAPC E 1
	NAPC D 1
	NAPC C 1
	NAPC B 1
	NAPC A 1 A_ReFire
    Goto Ready
  Spawn:
    PHOT N -1
    Stop
  }
}

actor PhotonTorpedo
{
  PROJECTILE
  Damage 250
  Speed 30
  RenderStyle Add
  Scale 1.25
  Alpha 0.85
  +FRIENDLY
  +FORCERADIUSDMG
  SeeSound "photon/burst"
  DeathSound "weapons/NanoPlasmaGun/explode"
  Species "Player"
  Obituary "%o was Obliterated by %k's Photon Cannon."
  States
  {
  Spawn:
    PHOT GGHH 2 Bright A_SpawnItem("PhotonTrail",1)
	TNT1 A 0 BRIGHT A_Mushroom ("MiniPhotonTorpedo",8,MSF_DontHurt)
    Loop
  Death:
    PHOT I 0 A_Explode (1000,1000,0)
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
	PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
	PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
	PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
	PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
	PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
	PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
	PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT I 0 Bright A_CustomMissile("NanoPlasma",0,0,Random(0,360),2,Random(0,360))
    PHOT IJKLM 6 Bright
    Stop
  }
}

actor MiniPhotonTorpedo
{
  PROJECTILE
  Damage 250
  Speed 15
  RenderStyle Add
  Scale 0.50
  Alpha 0.85
  +FRIENDLY
  +FORCERADIUSDMG
  -NOGRAVITY
  SeeSound "weapons/camplasmafire"
  DeathSound "weapons/NanoPlasmaGun/explode"
  Species "Player"
  Obituary "%o was Obliterated by %k's Photon Cannon."
  States
  {
  Spawn:
    PHOT GGHH 2 Bright A_SpawnItem("MiniPhotonTrail",1)
    Loop
  Death:
    PHOT I 0 A_Explode (150,150,0)
    PHOT IJKLM 6 Bright
    Stop
  }
}

actor PhotonTrail : PhotonTorpedo
{
  Speed 0
  Scale 0.92
  SeeSound ""
  DeathSound ""
  Alpha 1.0
  States
  {
  Spawn:
    PHOT G 1
    Goto Death
  Death:
    PHOT G 1 A_SetTranslucent(1.0,1)
    PHOT G 1 A_SetTranslucent(0.95,1)
    PHOT H 1 A_SetTranslucent(0.9,1)
    PHOT H 1 A_SetTranslucent(0.85,1)
    PHOT G 1 A_SetTranslucent(0.8,1)
    PHOT G 1 A_SetTranslucent(0.75,1)
    PHOT H 1 A_SetTranslucent(0.7,1)
    PHOT H 1 A_SetTranslucent(0.65,1)
    PHOT G 1 A_SetTranslucent(0.6,1)
    PHOT G 1 A_SetTranslucent(0.55,1)
    PHOT H 1 A_SetTranslucent(0.5,1)
    PHOT H 1 A_SetTranslucent(0.45,1)
    PHOT G 1 A_SetTranslucent(0.4,1)
    PHOT G 1 A_SetTranslucent(0.35,1)
    PHOT H 1 A_SetTranslucent(0.3,1)
    PHOT H 1 A_SetTranslucent(0.25,1)
    PHOT G 1 A_SetTranslucent(0.2,1)
    PHOT G 1 A_SetTranslucent(0.15,1)
    PHOT H 1 A_SetTranslucent(0.1,1)
    PHOT H 1 A_SetTranslucent(0.05,1)
    Stop
  }
}

actor MiniPhotonTrail : PhotonTrail
{
  Speed 0
  Scale 0.75
  SeeSound ""
  DeathSound ""
  Alpha 1.0
  States
  {
  Spawn:
    PHOT G 1
    Goto Death
  Death:
    PHOT G 1 A_SetTranslucent(1.0,1)
    PHOT G 1 A_SetTranslucent(0.95,1)
    PHOT H 1 A_SetTranslucent(0.9,1)
    PHOT H 1 A_SetTranslucent(0.85,1)
    PHOT G 1 A_SetTranslucent(0.8,1)
    PHOT G 1 A_SetTranslucent(0.75,1)
    PHOT H 1 A_SetTranslucent(0.7,1)
    PHOT H 1 A_SetTranslucent(0.65,1)
    PHOT G 1 A_SetTranslucent(0.6,1)
    PHOT G 1 A_SetTranslucent(0.55,1)
    PHOT H 1 A_SetTranslucent(0.5,1)
    PHOT H 1 A_SetTranslucent(0.45,1)
    PHOT G 1 A_SetTranslucent(0.4,1)
    PHOT G 1 A_SetTranslucent(0.35,1)
    PHOT H 1 A_SetTranslucent(0.3,1)
    PHOT H 1 A_SetTranslucent(0.25,1)
    PHOT G 1 A_SetTranslucent(0.2,1)
    PHOT G 1 A_SetTranslucent(0.15,1)
    PHOT H 1 A_SetTranslucent(0.1,1)
    PHOT H 1 A_SetTranslucent(0.05,1)
    Stop
  }
}