// Plasma Beam

ACTOR PlasmaBeam : IDMWeapon
{
  Weapon.AmmoUse 1
  Weapon.AmmoGive 40
  Weapon.SelectionOrder 100
  Weapon.KickBack 0
  //Weapon.PreferredSkin "PulseMarine"
  Weapon.AmmoType "IDMCell"
  Inventory.PickupMessage "Plasma Beam! (Slot 6)"
  Tag "Plasma Beam"
  Obituary "%o was zapped by %k's Plasma Beam."
  DamageType "HitPlasma"
  Decal RailScorchLower
  +WEAPON.NOAUTOAIM
  +WEAPON.NOLMS
  States
  {
  Ready:
    LECH A 1 A_WeaponReady
    Loop
  Deselect:
    LECH A 0 A_StopSoundEx(Weapon)
    LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 0 A_StopSoundEx(Weapon)
    LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 0 A_Lower
    LECH A 0 A_Lower
    LECH A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
    LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 0 A_Raise
    LECH A 0 A_Raise
    LECH A 1 A_Raise
    Loop
  Fire:
	LECH A 7 Bright A_PlaysoundEx("Weapons/plsbmwind",Weapon)
	LECH BC 4 Bright
	LECH A 0 A_PlaysoundEx("weapons/plsbmfire",Soundslot6)
  Hold:
	TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
    LECH A 0 A_GunFlash
    LECH A 1 A_RailAttack(random(8,32),0,0,none,none,RGF_NOPIERCING|RGF_FULLBRIGHT|RGF_CENTERZ,1,"BeamPuff",1,0,1024,0,0.5,1,"BeamTrail")//A_FireCustomMissile("PBeamBall", 0, 1, 0, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
    LECH A 1 A_RailAttack(random(8,32),0,1,none,none,RGF_NOPIERCING|RGF_FULLBRIGHT|RGF_CENTERZ,1,"BeamPuff",1,0,1024,0,0.5,1,"BeamTrail")//A_FireCustomMissile("PBeamBall", 0, 0, 0, 0, 0)
	TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
    LECH A 1 A_ReFire
  FireEnd:
	LECH A 0 A_StopSoundEx(Weapon)
	LECH A 0 A_StopSoundEx(soundslot7)
    LECH A 1 A_PlaysoundEx("weapons/plsbmstop",Weapon)
    LECH AAAA 6 A_StopSoundEx(soundslot7)
	TNT1 A 0 A_Refire("Fire")
    Goto Ready
  Level2:
	TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
    LECH A 0 A_GunFlash
	LECH A 0 A_RailAttack(random(8,32),0,0,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"BeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("PBeamBall2", frandom(-5,1), 0, 3, 0, 0)
	LECH A 1 A_RailAttack(random(8,32),0,0,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"BeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("PBeamBall2", frandom(-1,5), 1, -3, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
	LECH A 0 A_RailAttack(random(8,32),0,0,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"BeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("PBeamBall2", 0, 0, 3, 0, 0)
	LECH A 1 A_RailAttack(random(8,32),0,1,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"BeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("PBeamBall2", 0, 0, -3, 0, 0)
	TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
    LECH A 1 A_ReFire("Hold")
    Goto FireEnd
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
    LECH A 0 A_GunFlash
    LECH A 1 A_RailAttack(random(8,32),0,0,none,none,RGF_NOPIERCING|RGF_FULLBRIGHT|RGF_CENTERZ,1,"ExtremeBeamPuff",1,0,1024,0,0.5,1,"BeamTrail")//A_FireCustomMissile("ExtremePBeamBall", 0, 1, 0, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
    LECH A 1 A_RailAttack(random(8,32),0,1,none,none,RGF_NOPIERCING|RGF_FULLBRIGHT|RGF_CENTERZ,1,"ExtremeBeamPuff",1,0,1024,0,0.5,1,"BeamTrail")//A_FireCustomMissile("ExtremePBeamBall", 0, 0, 0, 0, 0)
	TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
    LECH A 1 A_ReFire("Hold")
	Goto FireEnd
  QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
    LECH A 0 A_GunFlash
	LECH A 0 A_RailAttack(random(8,32),0,0,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"ExtremeBeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("ExtremePBeamBall2", frandom(-5,1), 0, 3, 0, 0)
	LECH A 1 A_RailAttack(random(8,32),0,0,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"ExtremeBeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("ExtremePBeamBall2", frandom(-1,5), 0, -3, 0, 0)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop", soundslot7, 1)
    LECH A 0 A_PlaySoundEx("weapons/plsbmloop2", Weapon, 1)
	LECH A 0 A_RailAttack(random(8,32),0,0,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"ExtremeBeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("ExtremePBeamBall2", 0, 0, 3, 0, 0)
	LECH A 1 A_RailAttack(random(8,32),0,1,none,none,RGF_FULLBRIGHT|RGF_CENTERZ,1,"ExtremeBeamPuff",6,0,1024,0,0.5,1,"BeamTrail2")//A_FireCustomMissile("ExtremePBeamBall2", 0, 1, -3, 0, 0)
	TNT1 A 0 A_JumpIfNoAmmo("FireEnd")
    LECH A 1 A_ReFire("Hold")
    Goto FireEnd
  Flash:
    LECH B 1 bright A_Light1
    LECH C 1 bright A_Light2
    LECH B 1 bright A_Light0
    Stop
  Spawn:
    BEMP A -1 Bright
    Stop
  }
}

ACTOR BeamPuff
{
  Radius 4
  Height 8
  RenderStyle Add
  Scale 0.45
  +ALWAYSPUFF
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +SKYEXPLODE
  +CLIENTSIDEONLY
  +NOTIMEFREEZE
  States
  {
  Spawn:
  See:
  Crash:
  Death:
  XDeath:
    APBX C 1 bright
    APBX C 1 bright A_Playsound("weapons/bmimpct",CHAN_AUTO)
    APBX DE 1 bright
    Stop
  }
}

ACTOR ExtremeBeamPuff : BeamPuff
{
  +EXTREMEDEATH
  States
  {
  XDeath:
	TNT1 A 2
    APBX C 1 bright A_Playsound("misc/crit",CHAN_AUTO)
    APBX C 1 bright A_Playsound("weapons/bmimpct",CHAN_AUTO)
    APBX DE 1 bright
    Stop
  }
}

// Plasma Beam's Plasma
/*
ACTOR PBeamBall : MageWandMissile
{
  Speed 400
  Radius 13
  Height 8
  Damage 5
  Scale 0.45
  Decal DoomImpScorch
  Damagetype "HitPlasma"
  Deathsound "weapons/bmimpct"
  Projectile
  ProjectileKickBack 50
  Obituary "%o was zapped by %k's Plasma Beam."
  -RIPPER
  -CANNOTPUSH
  -NOTELEPORT
  +SKYEXPLODE
  States
  {
  Spawn:
	TNT1 A 1
	Loop
  Death:
    APBX CDE 3 bright
    Stop
  }
}

ACTOR ExtremePBeamBall : PBeamBall
{
	+EXTREMEDEATH
	States
	{
	XDeath:
		TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
		APBX CDE 3 bright
		Stop
	}
}

ACTOR PBeamBall2 : PBeamBall
{
	Projectile
	ProjectileKickBack 100
	MissileType "BeamTrail2"
	+RIPPER
	-NOTELEPORT
	+SKYEXPLODE
	States
	{
	Death:
	  TNT1 A 2
      APBX BCDE 3 Bright
      Stop
	}
}

ACTOR ExtremePBeamBall2 : PBeamBall2
{
	+EXTREMEDEATH
}*/

ACTOR BeamTrail : MageWandSmoke replaces MageWandSmoke
{
  RenderStyle Add
  MissileHeight 12
  Scale 0.45
  +CLIENTSIDEONLY
  States
  {
  Spawn:
	APBX BCD 1 Bright
    Stop
  }
}

ACTOR BeamTrail2 : BeamTrail
{
  States
  {
  Spawn:
	APBX BCDE 2 Bright
    Stop
  }
}