ACTOR PDLaser : Weapon
{
  Weapon.Kickback 100
  Scale 0.1
  
  Tag "Laser"
  Inventory.PickupMessage "Picked up a Laser."
  Obituary  "%o was electrified by %k's Laser."
  	Inventory.PickupSound "PerfectDark/Weapons/LaserUp"
  States
  {
  Spawn:
    TKB4 P -1
    Loop
  Ready:
  TNT1 A 0 A_PlaySound ("PerfectDark/Weapons/LaserUp","Weapon")
    TL25 A 2 
    TL25 B 2
    TL25 C 2
    TL25 D 2
    TL25 EFGH 2 A_WeaponReady
    TL25 IJKLMNOPQRSTUVXYZ 1 A_WeaponReady
	TL26 A 1 A_WeaponReady
    Goto Ready+11
	

  Deselect:
  TNT1 A 0 A_Stopsound(7)
    TL26 DEFG 2
    TK08 A 0 A_Lower
    wait
  Select: 
    TK08 A 0 A_Raise 
    Loop  
  Fire:
    TL26 A 0 bright A_PlayWeaponSound ("PerfectDark/Weapons/Laser")
	TL16 J 0 A_FireCustomMissile ("PDLaserBeam")
	TL26 HIJKLMNO 1
	TL26 PQRSTUVX 1
	Goto Ready+11
	
	Altfire:
    TL26 A 0 bright A_PlaySound ("PerfectDark/Weapons/LaserAltLoop",7,1,TRUE)
    TL26 B 1 bright A_CustomPunch (12,1,0,"PDBluePuff",120)
    TL26 C 1 bright
    TL26 B 1 bright A_CustomPunch (12,1,0,"PDBluePuff",120)
    TL26 C 1 bright
    TL26 B 1 bright A_CustomPunch (12,1,0,"PDBluePuff",120)
    TL26 C 1 A_ReFire
	TNT1 A 0 A_Stopsound(7)
    goto Ready+11
		Reload:
		TK04 A 0
		goto ReloadCheck
  }
}

ACTOR PDLaserPickup : Custominventory
{
   Scale 0.1
  Inventory.PickupMessage "Picked up a Laser."
  	Inventory.PickupSound "PerfectDark/Weapons/LaserUp"
   States
   {
   Spawn:
	  TKB4 P -1
	  loop
   Pickup:
	  TNT1 A 0 A_GiveInventory("PDLaser")
	  TNT1 A 0 A_JumpIfInventory("PlayingasPerfectKirby",1,"PickupPerfectKirby")
	  TNT1 A 0 A_JumpIfInventory("PlayingasRED",1,"PickupRED")
	  stop
	  PickupPerfectKirby:
	 	TNT1 A 0 A_PlaySound ("PerfectDark/Player/PerfectKirby/PerfectKirbyWeaponPickup")
		Stop
	  PickupRED:
	 	TNT1 A 0 A_PlaySound ("PerfectDark/Player/RED/REDWeaponPickup")
		Stop
   }
}


ACTOR PDLaserBeam : FastProjectile
{
	Game Doom
	Radius 4
	Height 4
	Speed 200
	Damage 3
	Projectile
	RenderStyle Add
	Alpha 0.9
	Scale 0.5
	DeathSound "PD/Weapons/Lazerhit"
  Obituary  "%o was electrified by %k's Laser."
	States
	{
	Spawn:
		PLSS AB 1 Bright A_SpawnItemEx("PDLaserTrail", 0, 0, 0, 0, 0, 0, 0, 128, 0)
		Loop
	Death:
	Crash:
		TNT1 A 0
		TNT1 A 1 A_SpawnItemEx("PDBluePuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
		Stop
	}
}

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