ACTOR GE007MilitaryLaser : Weapon
{
  Weapon.Kickback 100
  Scale 0.1
  tag "Military Laser"
  Inventory.PickupMessage "Picked up a Military Laser."
  Obituary  "%k's Military Laser showed %o what licking 20 batteries is like."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
  States
  {
  Spawn:
    TKA1 M -1
    Loop
  Ready:
   	TNT1 A 0 A_PlaySound ("GE007/Weapons/Lazerup","Weapon")
    TK46 A 1 
    TK46 B 1
    TK46 C 1
    TK46 D 1
    TK46 EFGHIJKLMNOPQ 1
    TK46 R -1 A_WeaponReady
    Goto Ready+6	
  Deselect:
    TK46 QPONMLKJIHGFEDCB 1
    TK46 A 1
    TK08 A 0 A_Lower
    wait
  Select: 
    TK08 A 0 A_Raise 
    Loop  
  Fire: 
 	TNT1 A 0 A_PlaySound ("GE007/Weapons/Lazer","Weapon")
    TK46 R 1 BRIGHT A_FireCustomMissile("GE007LaserBeam", 0, 1, 7, 1, 0)
	TK46 RR 4
    Goto Ready+18
  }
}

ACTOR GE007LaserBeam : FastProjectile
{
	Game Doom
	SpawnID 51
	Radius 4
	Height 4
	Speed 100
	Damage (10)
	Projectile
	+RANDOMIZE
	+STRIFEDAMAGE
	RenderStyle Add
	Alpha 0.9
	Scale 0.5
	DeathSound "GE007/Weapons/Lazerhit"
  Obituary  "%k's Military Laser showed %o what licking 20 batteries is like."
	States
	{
	Spawn:
		PLSS AB 1 Bright A_SpawnItemEx("LaserTrail", 0, 0, 0, 0, 0, 0, 0, 128, 0)
		Loop
	Death:
	Crash:
		TNT1 A 0
		TNT1 A 1 A_SpawnItemEx("LaserSpark", 0, 0, 0, 0, 0, 0, 0, 128, 0)
		Stop
	XDeath:
		TNT1 A 0
		TNT1 A 1 A_SpawnItemEx("HitSpark", 0, 0, 0, 0, 0, 0, 0, 128, 0)
		Stop
	}
}

actor LaserTrail
{
  Projectile
  Speed 1
  Radius 4
  Height 4
  Damage 0
  RenderStyle Add
  Alpha 0.75
  Scale 0.5
  +NOGRAVITY
  States
  {
  Spawn:
   PLSS AB 1 BRIGHT A_Fadeout
   loop
  Death:
   TNT1 A 1
   stop
  }
}

actor LaserSpark
{
  renderstyle Add
  alpha 0.9
  +NOBLOCKMAP
  +NOGRAVITY
  -ALLOWPARTICLES
  +DONTSPLASH
  +FORCEXYBILLBOARD
  Scale 0.17
  states
  {
  Spawn:
	SPRK A 0
	SPRK A 0 A_SpawnItemEx("BulletPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
	SPRK AAA 0 A_SpawnItemEx("Debris1", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK AAA 0 A_SpawnItemEx("Debris2", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK AAA 0 A_SpawnItemEx("Debris3", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK AAA 0 A_SpawnItemEx("Debris4", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK A 0 A_SpawnItemEx("Debris5", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK A 0 A_Jump(127, "Spawn2", "Spawn3", "Spawn4")
	SPRK ABCDE 1 bright
	stop
  Spawn2:
  	SPR2 ABCDE 1 bright
	stop
  Spawn3:
  	SPR3 ABCDE 1 bright
	stop
  Spawn4:
  	SPR4 ABCDE 1 bright
	stop
  Melee:
	PUFF CD 4
	stop
  }
}

ACTOR GE007MilitaryLaserPickup : Custominventory
{
   Scale 0.1
  Inventory.PickupMessage "Picked up a Military Laser."
  	Inventory.PickupSound "GE007/Weapons/WeaponSFX1"
   States
   {
   Spawn:
	  TKA5 G -1
	  loop
   Pickup:
	  TNT1 A 0 A_GiveInventory("GE007MilitaryLaser")
	  stop
   }
}
