actor ParallelBeamWep_NormalBar : NormalBar{args 99,249}
actor ParallelBeamWep : BaseMM8BDMWep //by MegaVile
{
//$Category MM8BDM-Weapons
//$Title Parallel Beam
//$Sprite MGNBZ0
Weapon.AmmoUse 3
Weapon.AmmoGive 28
Weapon.SlotNumber 5
Inventory.Pickupmessage "$PU_PARALLELBEAM"
Obituary "$OB_PARALLELBEAM"
Tag "$TAG_PARALLELBEAM"
weapon.ammotype "ParallelBeamAmmo"
inventory.icon "MGNBI"
States
{
SpawnLoop:
MGNB Z -1
loop
Ready:
MGNB A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_PARALLELBEAM)
MGNB A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
MGNB A 0 A_TakeInventory("WeaponCharge", 9999)
MGNB A 0 A_GiveInventory("RemoteMineFlag", 10)//A_JumpIfInventory("RemoteMineFlag",1,"RemoveFlag")
MGNB A 0 
goto DeselectSwap
Select:
MGNB A 0 A_TakeInventory("RemoteMineFlag", 10)
MGNB A 0 
goto SelectSwap
Fire:
MGNB A 0 A_JumpIfNoAmmo("NoAmmo")
MGNB A 0 A_JumpIfInventory("WeaponCharge",1,"Boom")
MGNB C 0 A_GiveInventory("WeaponCharge", 1)
MGNB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
MGNB G 0 A_FireCustomMissile("ParallelBeam",0,1,8,0)
MGNB B 2
MGNB C 3
MGNB A 4
MGNB B 0 A_Refire
Goto Ready+1
Altfire:
MGNB A 0 A_JumpIfInventory("WeaponCharge",1,3)
MGNB A 0 A_JumpIfInventory("Vile_ClassAltfire", 1, "ClassAltfire")
MGNB A 0 A_JumpIf(CallACS("Vile_class_altfire"), "ClassAltfire")
MGNB A 0 A_JumpIfInventory("WeaponCharge",1,"Boom")
MGNB A 1 A_JumpIfInventory("MM8BDMPlayer", 1, "Fire")
wait
Boom:
MGNB A 0 A_TakeInventory("WeaponCharge", 999)
MGNB A 0 A_GiveInventory("RemoteMineFlag", 10)
MGNB DA 4
MGNB A 0 A_TakeInventory("RemoteMineFlag", 10)
goto Ready+1
ClassAltfire:
MGNB A 0 
goto Super::Altfire
NoAmmo:
MGNB A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor ParallelBeamAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor ParallelBeamProtection : PowerProtection
{
Powerup.Duration 3
DamageFactor "ParallelBeam", 0.0
}

///////////////////
// Parallel Beam //
///////////////////

actor ParallelBeam : BasicProjectile
{
translation "198:198=249:249", "192:192=99:99"
PROJECTILE
+RIPPER
+THRUSPECIES
+SKYEXPLODE
+NOTARGETSWITCH
species "ParallelBeamBlock"
Damagetype "ParallelBeam"
obituary "$OB_PARALLELBEAM"
SeeSound "Silence"
Damage (CallACS("vile_cbm_damage",5))
Radius 10
Height 12
Scale 2.5
Speed 30
reactiontime 70
States
{
Spawn:
TNT1 A 0 
Spawn2:
MGNB G 3 
MGNB G 0 A_JumpIfInTargetInventory("RemoteMineFlag",1,"Death")
MGNB H 3
MGNB H 0 A_JumpIfInTargetInventory("RemoteMineFlag",1,"Death")
MGNB H 0 A_GiveInventory("CutterFlag",1)
MGNB H 0 A_JumpIfInventory("CutterFlag",4,"Death")
Goto Spawn2

Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"SDeath")
TNT1 A 0 A_JumpIfInventory("WeaponCharge",1,"SDeath")
TNT1 A 0 A_GiveInventory("WeaponCharge",1)
TNT1 A 0 A_TakeFromTarget("WeaponCharge",1)
TNT1 A 0 A_JumpIfCloser(60,2)
TNT1 A 0 A_CustomMissile("ParallelBeamBlock",0,0,0,0)
MGNB G 3 A_Stop
Death2:
MGNB GGGHHH 1 A_Countdown
Goto Death2

SDeath:
TNT1 A 0
stop
}
}

actor ParallelBeamBlock : ProjSpawnFuncActor
{
translation "198:198=249:249", "192:192=99:99"
+FIXMAPTHINGPOS
+FORCEXYBILLBOARD
+NOEXPLODEFLOOR
//+SPECTRAL
+NOGRAVITY
+DONTBLAST
+DONTREFLECT
+DONTSPLASH
+RIPPER
+THRUSPECIES
-SOLID
+MISSILE

+NODAMAGETHRUST
+NOTARGETSWITCH
+NOBLOOD
+MOVEWITHSECTOR
+STEPMISSILE
+NOTAUTOAIMED
+ALLOWBOUNCEONACTORS

Species "ParallelBeamBlock"
Damagetype "ParallelBeam"
Radius 8
Height 8
scale 2.75
damage (CallACS("vile_cbm_damage",4))
obituary "$OB_PARALLELBEAM"
speed 7
ReactionTime 70
var int user_playerRiding[64];
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("MM8BDMProjSpawnFunc",1)
TNT1 A 0 A_JumpIfCloser(60,2)
TNT1 A 0 A_CustomMissile("ParallelBeamBlockReturn",0,0,0,0)
TNT1 A 0 //A_SpawnItemEx("ParallelBeamBlockForward",0,0,0,-momx,-momy,-momz,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION)
Spawn2:
TNT1 A 0 A_Stop
TNT1 A 0 A_PlaySoundEx("misc/electrap","Body")
MGNB F 3 A_ChangeFlag("SOLID",1)
Spawn3:
MGNB E 0 A_Explode(CallACS("vile_cbm_damage",4),12,0,0,12)
TNT1 A 0 A_RadiusGive("ParallelBeamBoost",42,RGF_PLAYERS)
MGNB EE 1 A_CountDown
MGNB E 0 A_Explode(CallACS("vile_cbm_damage",4),12,0,0,12)
TNT1 A 0 A_RadiusGive("ParallelBeamBoost",42,RGF_PLAYERS)
MGNB II 1 A_CountDown
MGNB E 0 A_Explode(CallACS("vile_cbm_damage",4),12,0,0,12)
TNT1 A 0 A_RadiusGive("ParallelBeamBoost",42,RGF_PLAYERS)
MGNB JJ 1 A_CountDown
MGNB E 0 A_Explode(CallACS("vile_cbm_damage",4),12,0,0,12)
TNT1 A 0 A_RadiusGive("ParallelBeamBoost",42,RGF_PLAYERS)
MGNB KK 1 A_CountDown
Goto Spawn3

Death:
TNT1 A 0 
MGNB EYIYJYKYEYIY 2 A_Explode(4,10,0,0,10)
MGNB F 3 A_ChangeFlag("SOLID",0)
TNT1 A 1
stop

}
}

actor ParallelBeamBlockForward : ParallelBeamBlock
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveInventory("MM8BDMProjSpawnFunc",1)
TNT1 A 0 A_SpawnItemEx("ParallelBeamBlockForward",0,0,0,momx,momy,momz,0,SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION)
goto Spawn2
}
}

actor ParallelBeamBlockReturn : ParallelBeamBlock
{
states
{
Spawn:
TNT1 A 0 
TNT1 A 0 A_GiveInventory("MM8BDMProjSpawnFunc",1)
TNT1 A 0 A_JumpIfCloser(60,"OtherDeath")
TNT1 A 0
TNT1 A 0 A_CustomMissile("ParallelBeamBlockReturn",0,0,0,0)
TNT1 A 0
goto Spawn2
OtherDeath:
TNT1 A 0 A_JumpIfInventory("WeaponCharge",1,"SDeath")
TNT1 A 0 A_GiveInventory("WeaponCharge",1)
MGNB GGG 1 A_Stop
Death2:
MGNB GGGHHH 1 A_Countdown
Goto Death2
SDeath:
TNT1 A 0
stop
}
}

actor ParallelBeamBoost : PowerSpeed {Powerup.Duration 4 Speed 1.44}
actor ParallelBeamFix : BasicWatcher
{
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("PlayerPropertySolidOff",1)
TNT1 A 2 A_GiveToTarget("PlayerPropertySolidOn",1)
stop
}
}