ACTOR ChasmPlasmaThrower : Weapon
{
Inventory.PickupMessage "Picked up a Plasma Thrower."
Inventory.PickupSound "Weapon/Pickup"
Weapon.AmmoType1 "CPlasmaCell"
Weapon.AmmoType2 "CPlasmaCell"
Weapon.AmmoUse1 1
Weapon.AmmoUse2 5
Weapon.AmmoGive 20
Weapon.UpSound "PlasmaThrower/Up"
Weapon.SlotNumber 9
Weapon.SelectionOrder 1
Weapon.KickBack 1
Weapon.BobStyle Alpha
Weapon.BobRangeX 0.07
Weapon.BobRangeY 0.45
Weapon.BobSpeed 1.90
Inventory.Icon "HUPLS1"
States
{
Spawn:
TNT1 A 0 NoDelay
PLWX Z -1
Stop
Ready:
PLWX Y 0 A_WeaponReady
PLW1 E 1 A_WeaponReady
Loop
Select:
TNT1 A 0 SetPlayerProperty(0,1,2)
PLW1 AABBCCDDEE 1
PLWX Y 0
Goto Ready
Deselect:
TNT1 A 0 A_StopSound(CHAN_WEAPON)
PLW1 E 1 A_Lower
Loop
Fire:
TNT1 A 0
TNT1 A 0 A_PlaySound("PlasmaThrower/Start", 7)
PLW1 E 1 BRIGHT
PLW1 E 0 A_PlaySound("PlasmaThrower/FireLoop", CHAN_WEAPON, 1, 1)
TNT1 A 0
Hold:
TNT1 A 0
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),1,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW2 A 2 BRIGHT Offset(1, 34)
PLW1 E 1 BRIGHT
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),1,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW2 A 2 BRIGHT 
PLW1 E 1 BRIGHT
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),1,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW2 A 2 BRIGHT Offset(-1, 30)
PLW1 E 1 BRIGHT
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),1,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW2 A 2 BRIGHT
PLW1 E 1 BRIGHT
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),1,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW2 A 2 BRIGHT Offset(1, 34)
PLW1 E 1 BRIGHT
TNT1 A 0 A_ReFire
LetGo:
TNT1 A 0 A_StopSound(CHAN_WEAPON)
TNT1 A 0 A_PlaySound("PlasmaThrower/Stop", 1)
PLW2 A 1
TNT1 A 0 A_SetPitch(pitch-2.00)
TNT1 A 0 A_SetAngle(angle-0.1)
PLW2 A 1 OffSet(2, 28)
TNT1 A 0 A_SetPitch(pitch-1.00)
TNT1 A 0 A_SetAngle(angle-0.1)
PLW2 A 1 OffSet(4, 24)
TNT1 A 0 A_SetPitch(pitch-0.50)
TNT1 A 0 A_SetAngle(angle-0.1)
PLW2 A 1 OffSet(6, 20)
TNT1 A 0 A_SetPitch(pitch+1.50)
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 B 1
TNT1 A 0 A_SetPitch(pitch+0.75)
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 B 1 OffSet(7, 16)
TNT1 A 0 A_SetPitch(pitch+0.75)
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 B 1 OffSet(8, 12)
TNT1 A 0 A_SetPitch(pitch+0.25)
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 B 1 OffSet(9, 8)
PLW2 C 1
PLW2 C 1 OffSet(1, 30)
PLW2 C 1 OffSet(2, 28)
PLW2 C 1 OffSet(3, 26)
PLW2 C 3 OffSet(4, 24)
PLW2 C 1 OffSet(3, 28)
PLW2 C 1 OffSet(2, 30)
PLW2 C 1 OffSet(1, 32)
PLW2 D 4
PLW2 E 4
Goto Ready
//////ALT
AltFire:
TNT1 A 0
TNT1 A 0 A_PlaySound("PlasmaThrower/Charge", 7)
TNT1 A 0 A_Quake(2, 25, 0, 50, "None")
TNT1 A 0 BRIGHT A_SetBlend("Blue",0.08,5)
PLW1 E 1 BRIGHT Offset(1, 33)
PLW1 E 1 BRIGHT Offset(2, 34)
PLW1 E 1 BRIGHT Offset(3, 35)
PLW1 E 1 BRIGHT Offset(4, 36)
PLW1 E 1 BRIGHT Offset(5, 37)
PLW1 E 1 BRIGHT Offset(6, 38)
PLW1 E 1 BRIGHT Offset(7, 39)
PLW1 E 1 BRIGHT Offset(8, 40)
PLW1 E 1 BRIGHT Offset(9, 41)
PLW1 E 1 BRIGHT Offset(10, 42)
PLW1 E 1 BRIGHT Offset(11, 43)
PLW1 E 1 BRIGHT Offset(12, 44)
PLW1 E 1 BRIGHT Offset(12, 44)
PLW1 E 1 BRIGHT Offset(12, 44)
PLW1 E 1 BRIGHT Offset(12, 44)
PLW1 E 1 BRIGHT Offset(12, 44)
PLW1 E 1 BRIGHT Offset(12, 44)
AltFiring:
PLW2 A 1 BRIGHT A_PlaySound("PlasmaThrower/Fire", 1)
PLW2 AAAAAAAA 0 BRIGHT A_FireCustomMissile("PlasmaPellet",frandom(-11.6,11.1),0,6,0,0,frandom(-1.1,0.9))
PLW2 AAAAAAAA 0 BRIGHT A_FireCustomMissile("PlasmaPellet",frandom(11.6,-11.1),0,6,0,0,frandom(-1.1,0.9))
PLW2 A 0 BRIGHT A_FireCustomMissile("PlasmaPellet",0,1,6,0,0,frandom(-1.1,0.9))
PLW1 E 0 A_FireCustomMissile("PlasmaShortFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaShortFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaShortFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaShortFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaShortFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
PLW1 E 0 A_FireCustomMissile("PlasmaShortFlame",frandom(-4.6,4.1),0,6,0,0,frandom(-2.1,1.9))
//Recoil
PLW2 A 1
TNT1 A 0 A_SetPitch(pitch-5.00)
TNT1 A 0 A_SetAngle(angle-0.1)
PLW2 A 1 OffSet(1, 30)
TNT1 A 0 A_SetPitch(pitch-4.00)
TNT1 A 0 A_SetAngle(angle-0.1)
PLW2 A 1 OffSet(2, 28)
TNT1 A 0 A_SetPitch(pitch-2.00)
TNT1 A 0 A_SetAngle(angle-0.1)
PLW2 A 1 OffSet(3, 26)
TNT1 A 0 A_SetPitch(pitch-1.00)
TNT1 A 0 A_SetAngle(angle-0.1) //12
PLW2 A 1 OffSet(4, 24)
TNT1 A 0 A_SetPitch(pitch+4.50)
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 A 1 OffSet(5, 22)
TNT1 A 0 A_SetPitch(pitch+3.50) //8
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 A 1 OffSet(6, 20)
TNT1 A 0 A_SetPitch(pitch+2.50)
TNT1 A 0 A_SetAngle(angle+0.1) //10.50
TNT1 A 0 A_PlaySound("PlasmaThrower/Recoil", 3)
PLW2 B 1
TNT1 A 0 A_SetPitch(pitch+0.75)
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 B 1 OffSet(5, 20)
TNT1 A 0 A_SetPitch(pitch+0.75) //12
TNT1 A 0 A_SetAngle(angle+0.1)
PLW2 B 1 OffSet(7, 16)
PLW2 B 1 OffSet(8, 12)
PLW2 B 1 OffSet(9, 8)
PLW2 C 1
PLW2 C 1 OffSet(1, 30)
PLW2 C 1 OffSet(2, 28)
PLW2 C 1 OffSet(3, 26)
PLW2 C 1 OffSet(4, 24)
PLW2 C 1 OffSet(5, 22)
PLW2 C 2 OffSet(6, 20)
PLW2 C 3 OffSet(7, 18)
PLW2 C 1 OffSet(6, 20)
PLW2 C 1 OffSet(4, 24)
PLW2 C 1 OffSet(3, 28)
PLW2 C 1 OffSet(2, 30)
PLW2 C 1 OffSet(1, 32)
PLW2 D 4
PLW2 E 2
Goto Ready
}
}

//Effects

Actor PlasmaFlame
{
	Speed 26
	RenderStyle Add
	Alpha 0.67
	Scale 0.20
	SeeSound ""
	PROJECTILE
	Damage 1
	Height 4
	Radius 4
	+FORCERADIUSDMG
	+ROLLCENTER
	+ROLLSPRITE
  States
  {
  Spawn:
    TNT1 A 0 NoDelay
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 BBCCDDEE 1 BRIGHT A_FadeOut
    Stop
  Death:
    TNT1 A 0
	TNT1 A 0 A_PlaySound("PlasmaThrower/Hit")
	TNT1 A 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
	TNT1 A 0 A_CustomMissile("PlasmaSparks", random(1,8), random(18,-18), random (0, 360), 2, random (0, 160))
	PLB1 BBCC 1 Bright
    PLB1 DDEE 1 Bright A_FadeOut
	PLB1 EE 1 A_Fadeout
    Stop
  XDeath:
    TNT1 A 0
	TNT1 A 0 A_PlaySound("PlasmaThrower/Hit")
    TNT1 A 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
	TNT1 A 0 A_CustomMissile("PlasmaSparks", random(1,8), random(18,-18), random (0, 360), 2, random (0, 160))
	PLB1 BBCC 1 Bright
    PLB1 DDEE 1 Bright A_FadeOut
	PLB1 EE 1 A_Fadeout
	Stop
  Crash:
    TNT1 A 0
	TNT1 A 0 A_PlaySound("PlasmaThrower/Hit")
	TNT1 A 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
	TNT1 A 0 A_CustomMissile("PlasmaSparks", random(1,8), random(18,-18), random (0, 360), 2, random (0, 160))
	PLB1 BBCC 1 Bright
    PLB1 DDEE 1 Bright A_FadeOut
	PLB1 EE 1 A_Fadeout
	Stop
  }
}

Actor PlasmaShortFlame
{
	Speed 25
	RenderStyle Add
	Alpha 0.67
	Scale 0.20
	SeeSound ""
	PROJECTILE
	Damage 1
	+FORCERADIUSDMG
	+ROLLCENTER
	+ROLLSPRITE
  States
  {
  Spawn:
    TNT1 A 0 NoDelay
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 A 2 Bright A_SetRoll(frandom(-360.0,360.0))
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "White", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	TNT1 A 0 A_CustomRailgun (0, 0, "None", "Blue", RGF_SILENT | RGF_FULLBRIGHT, 0, 25, "MDHarmlessPuff", frandom(0,359), frandom(-70,70), random(8,12), random(1,10), 0.2, 0, "None", -8)
	PLB1 BBCCDDEE 1 BRIGHT A_FadeOut
    Stop
  Death:
    TNT1 A 0
	TNT1 A 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
	PLB1 BBCC 1 Bright
    PLB1 DDEE 1 Bright A_FadeOut
	PLB1 EE 1 A_Fadeout
    Stop
	}
	}

ACTOR UnstablePlasmaBall
{
  Radius 3
  Height 3
  Speed 50
  Damage 20
  Projectile
  +RANDOMIZE
  +ROLLSPRITE
  +ROLLCENTER
  +RIPPER
  BounceCount 8
  BounceType Hexen
  BounceFactor 1
  WallBounceFactor 1
  DeathSound "PlasmaBall/Exp"
  BounceSound "PlasmaBall/Bounce"
  DamageType "Explosive"
  Decal "Scorch"
  Scale 0.1
  RenderStyle Add
  Alpha 0.97
  States
  {
  Spawn:
  	TNT1 A 0 NoDelay A_PlaySound("PlasmaBall/Fly",CHAN_WEAPON,1.0,1)
	PLBA A 1 BRIGHT { A_SetScale(0.50); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	PLBA A 1 BRIGHT { A_SetScale(0.60); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	PLBA A 1 BRIGHT { A_SetScale(0.70); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	PLBA A 1 BRIGHT { A_SetScale(0.80); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	PLBA A 1 BRIGHT { A_SetScale(0.90); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	PLBA A 1 BRIGHT { A_SetScale(0.80); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	PLBA A 1 BRIGHT { A_SetScale(0.70); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	PLBA A 1 BRIGHT { A_SetScale(0.60); A_SetRoll(frandom(-360.0,360.0)); }
	PLBA A 0 Bright A_SpawnItemEx("UnstablePlasmaBallTrail",0,0,0,0,0,0,0,2)
	Loop
  Death:
    TNT1 A 0 A_StopSound(CHAN_WEAPON)
	TNT1 A 0 Radius_Quake(6, 5, 0, 4, 0)
	TNT1 A 0 Radius_Quake(1, 20, 0, 18, 0)
	TNT1 A 0 A_PlaySound("PlasmaBall/Exp")
	TNT1 A 0 A_Explode
	TNT1 AAAAAAAAAA 0 A_SpawnParticle ("Blue", SPF_FULLBRIGHT | SPF_RELATIVE, random(30,60), random(2,5), frandom(0,360), 0,0,0, frandom(0.2,12.0),frandom(-0.2,0.2),frandom(-2.0,3.0), 0,0,-0.1, 0.98, -1)
	TNT1 AAAAAA 0 A_CustomMissile("PlasmaExplosionFX", random(1,12), random(16,-16), random (0, 360), 2, random (0, 160))
	TNT1 AAAAAA 0 A_CustomMissile("PlasmaExplosionFX", random(1,-12), random(16,-16), random (0, 360), 2, random (0, 160))
    TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,11), random(15,-15), random (0, 360), 2, random (0, 160))
	TNT1 AAAAAA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,-11), random(15,-15), random (0, 360), 2, random (0, 160))
	TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,-12), random(15,-15), random (0, 360), 2, random (0, 160))
	TNT1 AAA 0 A_CustomMissile("BigExplosionSmokeSpawner", random(1,12), random(1,-1), random (0, 360), 2, random (0, 160))
	PLBA A 0 A_SetScale(0.60)
	PLBA ABCDEFGH 2 BRIGHT
    Stop
  }
}

ACTOR UnstablePlasmaBallTrail
{ 
	RenderStyle Add
	Alpha 0.97
	Scale 0.90
	+NOGRAVITY
	+BRIGHT
	+ROLLSPRITE
	+ROLLCENTER
	States
	{
	Spawn:
		PLBA A 1 A_SetRoll(frandom(-360.0,360.0))
		Stop
	}
}

ACTOR PlasmaExplosionFX
{
  +NOBLOCKMAP
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  +NOCLIP
  +BRIGHT
  RenderStyle Add
  Alpha 0.97
  Scale 0.1
  Mass 5
  +clientsideonly
	States
	{
	    Spawn:
		TNT1 A 0 A_SetScale(0.50)
		PLB1 A 1 
		TNT1 A 0 A_SetScale(0.70)
		PLB1 A 1 
		TNT1 A 0 A_SetScale(0.90)
		PLB1 A 1 
		TNT1 A 0 A_SetScale(1.00)
		PLB1 B 1 
		TNT1 A 0 A_SetScale(1.10)
		PLB1 B 1 
		TNT1 A 0 A_SetScale(0.90)
		PLB1 C 1 
		TNT1 A 0 A_SetScale(0.70)
		PLB1 D 1 
		TNT1 A 0 A_SetScale(0.50)
		PLB1 E 1 
		Goto Death
		Death:
		PLB1 E 1
		Stop
	}
}

ACTOR PlasmaPellet : FastProjectile
{
	Radius 2
	Height 2
	PROJECTILE
	MissileType "TracerTrail"
	MissileHeight 8
	RenderStyle Add
	Speed 50
	Alpha 0.95
	Damage 4
    +FORCEXYBILLBOARD
	+BRIGHT
	Decal "PlasmaScorchLower"
	States
	{
	Spawn:
	    TNT1 A 0 NoDelay
		PLP1 X 1 BRIGHT
		Loop
  Death:
    TNT1 A 0
	TNT1 A 0 A_PlaySound("PlasmaThrower/Hit")
	TNT1 AAA 0 A_CustomMissile("PlasmaSparks", random(1,8), random(18,-18), random (0, 360), 2, random (0, 160))
	TNT1 AA 0 A_CustomMissile("ExplosionSmokeSpawner", random(1,8), random(15,-15), random (0, 360), 2, random (0, 160))
	PLBA ABCDEFGH 1 BRIGHT A_FadeOut
    Stop
	}
}

ACTOR PlasmaSparks
{
    Radius 0
    Height 0
    Speed 7
    Scale 0.06
	Mass 10
    +NOBLOCKMAP
	+THRUGHOST
	-SOLID
	+MISSILE
	+BRIGHT
	RenderStyle Add
	Alpha 0.95
    States
    {
    Spawn:
	    TNT1 A 0 NoDelay
        PLBA AAA 1 A_SpawnItemEx("PlasmaSparksTrail",0,0,0,0,0,0,0,2)
        Loop
	Death:
	    TNT1 A 0
		PLBA AAAAA 1 A_FadeOut
		Stop
    }
}

ACTOR PlasmaSparksTrail
{ 
	Speed 0
	Scale 0.05
	Alpha 0.67
	RenderStyle Add
	+NOGRAVITY
	States
	{
	Spawn:
		PLBA AA 1 BRIGHT
		PLBA AA 1 BRIGHT A_SetScale(0.03)
		PLBA AA 1 BRIGHT A_SetScale(0.02)
		PLBA AA 1 BRIGHT A_SetScale(0.01)
		Stop
	}
}

//Ammo
actor CPlasmaCell : Ammo
{
Inventory.Amount 10
Inventory.MaxAmount 100
ammo.backpackamount 30
ammo.backpackmaxamount 200
Inventory.PickupSound "PlasmaAmmo/Pickup"
Inventory.PickupMessage "Picked up a Plasma Cell."
states
{
Spawn:
TNT1 A 0 NoDelay
PLWA X -1
stop
}
}