actor SSTPlasmaRifle : PlasmaRifle// replaces plasmarifle
{
  Game Doom
  SpawnID 30
  Weapon.SelectionOrder 98
  Weapon.AmmoUse 2
  Weapon.AmmoGive 40
  Weapon.AmmoType "Cell"
  Inventory.PickupMessage "$GOTPLASMA" // "You got the plasma gun!"
  Obituary "%o was fried by %k's plasma rifle."
  Weapon.preferredSkin "PlasmaSkin"
  +NOALERT
	+FORCEXYBILLBOARD
  States
  {
  Ready:
    TNT1 A 0 A_JumpIfInventory("InstantSwitch",1, "ActualReady")
	SSPL CB 2
  ActualReady:
    SSPL A 1 A_WeaponReady
    Loop
  Deselect:
    TNT1 A 0 ACS_ExecuteAlways(779,0, 2,0,0)
    TNT1 A 0
    SSPL A 1 A_Lower
    Goto DeSelect+2
  Select:
    TNT1 A 0 A_JumpIfInventory("InstantSwitch",1, "ActualReady")
    TNT1 A 0 ACS_ExecuteAlways(779,0, 11,0,0)
    TNT1 A 0
    SSPL D 1 A_Raise
    Goto Select+3
  Fire:
    //PLSG A 0 A_JumpIfInventory("RedPlasmaChecker", 1, "FireRed")
    PLSG A 0 A_GunFlash
    PLSG A 0 A_PlaySoundEx ("weapons/plasmaf", "Weapon") 
    PLSG A 0
    SSPL A 5
    SSPL B 0 A_ReFire
	SSPL BDEFFFEEDCB 1
    Goto ActualReady
	
  Flash:
    NULL A 0 A_SpawnItemEx ("PlasmaEcho", 0,0,0, 0,0,0, 0, 160)
	TNT1 A 0 A_SetPitch(pitch-1)
	
    PLSG A 0 A_JumpIfInventory("PurplePlasmaChecker", 1, "purpleball1")
    PLSG A 0 A_JumpIfInventory("GreenPlasmaChecker", 1, "greenball1")
    PLSG A 0 A_JumpIfInventory("RedPlasmaChecker", 1, "redball1")
	
  BlueBall1:
    PLSG A 0 A_Jump(127, "BlueBall2")
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBall", 0, 1, 0, 1) 
	Goto BlueFlashEnd
  BlueBall2:
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBall2", 0, 1, 0, 1) 
	Goto BlueFlashEnd
  BlueFlashEnd:
    PLSF A 2 Bright A_Light1
    PLSF B 0 A_Light0
	PLSF BB 1 Bright A_SetPitch(pitch+0.5)
	RLGG E 0 A_AlertMonsters
    Goto LightDone
  RedBall1:
    PLSG A 0 A_Jump(127, "RedBall2")
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBallRed", 0, 1, 0, 1) 
	Goto RedFlashEnd
  RedBall2:
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBallRed2", 0, 1, 0, 1) 
	Goto RedFlashEnd
  RedFlashEnd:
    PLSF C 2 Bright A_Light1
    PLSF D 0 A_Light0
	PLSF DD 1 Bright A_SetPitch(pitch+0.5)
	RLGG E 0 A_AlertMonsters
    Goto LightDone
  GreenBall1:
    PLSG A 0 A_Jump(127, "GreenBall2")
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBallGreen", 0, 1, 0, 1) 
	Goto GreenFlashEnd
  GreenBall2:
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBallGreen2", 0, 1, 0, 1) 
	Goto GreenFlashEnd
  GreenFlashEnd:
    PLSF E 2 Bright A_Light1
    PLSF E 0 A_Light0
	PLSF FF 1 Bright A_SetPitch(pitch+0.5)
	RLGG E 0 A_AlertMonsters
    Goto LightDone
  PurpleBall1:
    PLSG A 0 A_Jump(127, "PurpleBall2")
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBallPurple", 0, 1, 0, 1) 
	Goto PurpleFlashEnd
  PurpleBall2:
    PLSG A 0 A_FireCustomMissile ("SSTPlasmaBallPurple2", 0, 1, 0, 1) 
	Goto PurpleFlashEnd
  PurpleFlashEnd:
    PLSF G 2 Bright A_Light1
    PLSF E 0 A_Light0
	PLSF HH 1 Bright A_SetPitch(pitch+0.5)
	RLGG E 0 A_AlertMonsters
    Goto LightDone
  Spawn:
    PLAG A -1
    Stop
  }
}

actor SSTPlasmaBall
{
  Radius 10
  Height 8
  Speed 50
  Damage 8
  Projectile
  +RANDOMIZE
	+FORCEXYBILLBOARD
  RenderStyle Add
  Alpha 0.75
  scale 0.75
  //SeeSound "weapons/plasmaf"
  DeathSound "weapons/plasmax"
  Obituary "$OB_MPPLASMARIFLE"
  damagetype "Plasma"
  States
  {
  Spawn:
    PLSE AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrail", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 
    PLSE A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PLSE B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PLSE C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    PLSE DE 4 bright
    stop
  Death:
    TNT1 A 0 bright A_SpawnItemEx("blueflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("BlueParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    PLSE ABCDE 4 bright
    stop
  }
}

actor SSTPlasmaBall2 : SSTPlasmaBall
{
  Damage 7 //this was 6 in 1.3
  States
  {
  Spawn:
    PLSE AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrail", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 
    PLSE A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
	
    PLSE A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PLSE B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PLSE C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    PLSE DE 4 bright
    stop
  Death:
    TNT1 A 0 bright A_SpawnItemEx("blueflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("BlueParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    PLSE A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
    PLSE A 3 bright
    PLSE ABCDE 4 bright
    stop
  }
}

actor PlasmaTrail
{
  Radius 1
  Height 1
  Speed 0
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
	+FORCEXYBILLBOARD
  RenderStyle Add
  Alpha 0.21
  //scale 0.85
  scale 1.2
  //SeeSound "weapons/plasmaf"
  DeathSound "plasma/smallzap"
  States
  {
  Spawn:
    PLSE A 0
    PLSE A 0 Thing_ChangeTID (0, 1330) 
	//PLSS ABABAB 1 BRIGHT
	NBMC ABCDEF 1 BRIGHT
  Spawn2:
    NBMC G 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(40,"Crackle")
    NBMC H 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(80,"Crackle")
    NBMC I 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(40,"Crackle")
    NBMC J 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(40,"Crackle")
    NBMC K 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(40,"Crackle")
    NBMC L 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(20,"Crackle")
    NBMC M 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(20,"Crackle")
    NBMC N 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(20,"Crackle")
    NBMC O 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(20,"Crackle")
    NBMC P 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(20,"Crackle")
    NBMC Q 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(20,"Crackle")
    NBMC R 1 bright A_Fadeout(0.01)
	NBMC A 0 A_Jump(20,"Crackle")
    NBMC STUVWXYZ 1 bright A_Fadeout(0.02)
    Stop
  Crackle:
    TNT1 A 0 A_Scream
    TNT1 A 0 Bright A_CustomMissile("PlasmaBallCrackle1",0,0,random(-180,180),2,random(-90,90))
    TNT1 A 0 Bright A_CustomMissile("PlasmaBallCrackle2",0,0,random(-180,180),2,random(-90,90))
	Stop
//  Crackle2:
//	PLSS AB 1 bright A_Fadeout(0.05)
//	Loop
  }
}

actor SSTPlasmaBallRed : SSTPlasmaBall
{
  States
  {
  Spawn:
    IPLE AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrailRed", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 

    IPLE A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    IPLE B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    IPLE C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    IPLE DE 4 bright
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("redflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("RedParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    IPLE ABCDE 4 bright
    stop
  }
}

actor PlasmaTrailRed : PlasmaTrail
{
translation "192:207=32:47"
}

actor SSTPlasmaBallRed2 : SSTPlasmaBallRed
{
  Damage 7 //this was 6 in 1.3
  States
  {
  Spawn:
    IPLE AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrailRed", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 
    IPLE A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
    IPLE A 3 bright
    IPLE ABCDE 4 bright
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("redflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("RedParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    IPLE A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
    IPLE A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    IPLE B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    IPLE C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    IPLE DE 4 bright
    stop
  }
}

actor SSTPlasmaBallGreen : SSTPlasmaBall
{
  States
  {
  Spawn:
    GPLE AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrailGreen", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 

    GPLE A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    GPLE B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    GPLE C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    GPLE DE 4 bright
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("greenflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("GreenParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    GPLE ABCDE 4 bright
    stop
  }
}

actor PlasmaTrailGreen : PlasmaTrail
{
Translation "192:207=112:127"
}

actor SSTPlasmaBallGreen2 : SSTPlasmaBallGreen
{
  Damage 7 //this was 6 in 1.3
  States
  {
  Spawn:
    GPLE AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrailGreen", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 
    GPLE A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
    GPLE A 3 bright
    GPLE ABCDE 4 bright
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("greenflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("GreenParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    GPLE A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
    GPLE A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    GPLE B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    GPLE C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    GPLE DE 4 bright
    stop
  }
}

actor SSTPlasmaBallPurple : SSTPlasmaBall
{
  States
  {
  Spawn:
    PURP AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrailPurple", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 

    PURP A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PURP B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PURP C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    PURP DE 4 bright
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("purpleflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("PurpleParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    PURP ABCDE 4 bright
    stop
  }
}

actor PlasmaTrailPurple : PlasmaTrail
{
Translation "192:207=250:254"
}

actor SSTPlasmaBallPurple2 : SSTPlasmaBallPurple
{
  Damage 7
  States
  {
  Spawn:
    PURP AAAAAAAAAAAA 1 bright A_SpawnItemEx ("PlasmaTrailPurple", random(-0.25,0.25), random(-0.25,0.25), random(-0.25,0.25), 0, 0, 0, 0, 160) 
    loop
  XDeath:
  	TNT1 A 0 A_PlaySoundEx("plasma/zap", soundslot6)
	NULL AAAAAAAA 0 A_SpawnItemEx ("PlasmaBallCrackleSpawner", 0,0,0, 0,0,0, 0, 160) 
    PURP A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
    PURP A 3 bright
    PURP ABCDE 4 bright
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("purpleflare", 0,0,0, 0,0,0, 0, 160)
	NULL A 0 A_SpawnItemEx ("PurpleParticleSphere", 0,0,0, 0,0,0, 0, 160) 
    PURP A 1 bright
    PLSE A 0 A_Explode(1,18,0,0) //16 was 8
    PURP A 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PURP B 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-96,96),random(-96,96),random(-30,30), 0,0,0, 0, 160, 208) 
    PURP C 4 bright
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail1", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail2", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail3", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
	NULL A 0 A_SpawnItemEx ("CacodemonBallTrail4", random(-30,30),random(-30,30),random(-30,30), 0,0,0, 0, 160, 240) 
    PURP DE 4 bright
    stop
  }
}





ACTOR PlasmaBallCrackleSpawner
{
	+NOTELEPORT
  Radius 1
  Height 1
  +NOBLOCKMAP
  +NOTELEPORT
  +NOGRAVITY
  +NOCLIP
  -SOLID
  -SHOOTABLE
  RENDERSTYLE NONE
  States
  {
  Spawn:
    TNT1 A 0
      TNT1 A 0 Bright A_CustomMissile("PlasmaBallCrackle1",0,0,random(-180,180),2,random(-90,90))
      TNT1 A 0 Bright A_CustomMissile("PlasmaBallCrackle2",0,0,random(-180,180),2,random(-90,90))
	  TNT1 A 0 A_SpawnItemEx ("RagDollSmoke", 0,0,0, random(-2,2),random(-2,2),random(-2,2), 0, 160, 128)  
      Stop
  }
}
ACTOR PlasmaBallCrackle1
{
  Radius 1
  Height 1
  Speed 6
  Damage 0
  Projectile
  -RANDOMIZE
  +NOCLIP
  RenderStyle Add
  Alpha 0.85
  scale 0.02
  States
  {
  Spawn:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    N0VA ABCDABCD 1 bright A_FadeOut(0.1)
    stop
  }
}
ACTOR PlasmaBallCrackle2 : PlasmaBallCrackle1
{
  Speed 5
  Alpha 0.8
  scale 0.04
  States
  {
  Spawn:
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    N0VA ABCDABCD 1 bright A_FadeOut(0.1)
    stop
  }
}

ACTOR RedPlasmaChecker : Inventory
{
   +INVENTORY.UNDROPPABLE
Inventory.Amount 1
Inventory.MaxAmount 1
}
ACTOR GreenPlasmaChecker : RedPlasmaChecker
{
}
ACTOR PurplePlasmaChecker : RedPlasmaChecker
{
}