actor SparkShockWepSH : BaseMM8BDMWep replaces SparkShockWep
{
//$Category MM8BDM-Weapons
//$Title Spark Shock
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_SPARKSHOCK"
Obituary "$OB_SPARKSHOCK"
Tag "$TAG_SPARKSHOCK"
weapon.ammotype "SparkShockAmmo"
inventory.icon "SPARSI"
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
States
{
Spawn:
WEA2 G 1
loop
Ready:
SPAS C 0 ACS_ExecuteAlways(998,0,26)
SPAS CCCCCC 1 A_WeaponReady(WRF_NOFIRE)
Ready2:
SPAS C 1 A_WeaponReady
Goto Ready2
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SPAS C 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SPAS C 1 A_Raise
Loop
Fire:
SPAS C 0 A_JumpIfNoAmmo("NoAmmo")
SPAS C 2 
SPAS C 0 A_PlaySoundEx("weapon/sparkshock","Weapon")
SPAS C 0 A_FireCustomMissile("SparkShockLob",0,1,8,0)
SPAS DE 4
SPAS D 8
SPAS CCCCCC 1 A_WeaponReady(WRF_NOFIRE)
SPAS D 0 A_Refire
Goto Ready2
NoAmmo:
SPAS C 1 ACS_Execute(979,0)
Goto Ready2
}
}

actor SparkShockLob
{
Translation "198:198=225:225"
PROJECTILE
-NOGRAVITY
//+RIPPER
+SKYEXPLODE
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+CANBOUNCEWATER
damagetype "SparkShock"
Obituary "$OB_SPARKSHOCK"
Radius 14
Height 14
Damage (3)
speed 24
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ThrustThingZ(0,40,0,1)
SPAS AAAABBBB 1 A_SpawnItemEX("SparkLobFX",random(0,28),0,random(-28,28),0,0,0,random(90,270),1)
goto Spawn+2
Crash:
Death:
TNT1 A 0 A_SpawnItemEx("SparkShockLob2",0,0,0,0,0,0,0,1)
stop
XDeath:
TNT1 A 0
stop
}
}

actor SparkShockLob2 : SparkShockLob
{
+NOGRAVITY
+THRUACTORS
+FLOORHUGGER
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEX("weapon/sparkshock","Voice", 1)
TNT1 AA 0 A_SpawnItemEX("SparkLobFX3",random(0,96),0,0,0,0,random(1,4),random(0,359),1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),0,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),45/2,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),45,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),135/2,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),90,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),225/2,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),135,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),315/2,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),180,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),405/2,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),225,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),495/2,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),270,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),585/2,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),315,1)
TNT1 A 0 A_SpawnItemEX("SparkLobFX2",96,0,0,0,0,random(1,2),675/2,1)
TNT1 AAAAA 1 A_Explode(5,96,0,0,96)
TNT1 A 0 A_GiveInventory("CutterFlag",1)
TNT1 A 0 A_JumpIfInventory("CutterFlag",7,"Death")
goto Spawn+2
Death:
TNT1 A 0 A_StopSound("Voice")
stop
}
}

actor SlowedSpark : CustomInventory
{
+INVENTORY.AUTOACTIVATE
-INVBAR
States
{
Use:
TNT1 A 0 A_JumpIfInventory("PowerSlowS", 1, 2)
TNT1 A 0 A_SpawnItemEx("SparkShockWatcher")
TNT1 A 0 A_GiveInventory("SlowedPowerS", 1)
stop
}
}

actor SparkShockWatcher
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0 
TNT1 A 3 A_GiveToTarget("SparkShockSlowFX", 1)
TNT1 A 0 A_JumpIfInTargetInventory("PowerSlowS", 1, "Spawn")
stop
}
}

actor SlowedPowerS : PowerupGiver
{
Speed 0.67
powerup.duration 105
powerup.type "PowerSlowS"
+INVENTORY.AUTOACTIVATE
+INVENTORY.ALWAYSPICKUP
states
{
Pickup:
TNT1 A 0 

TNT1 A 175
stop
}
}

actor PowerSlowS : PowerSpeed
{
Speed 0.67
}

actor SparkShockSlowFX : CustomInventory
{
+INVENTORY.AUTOACTIVATE
-INVBAR
States
{
Use:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ShockSlowFX", random(16, 48), 0, Random(16,48), 0, 0, 0, random(0, 359))
stop
}
}

actor ShockSlowFX
{
+FLOATBOB
+NOGRAVITY
+THRUACTORS
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
+MISSILE
+DONTBLAST
Damage(0)
Scale 1.25
Height 0
Radius 0
States
{
Spawn:
SPAS AB 4 A_Fadeout(0.2)
loop
}
}

actor SparkShockProtect : PowerProtection
{
Powerup.Duration 10
damagefactor "SparkShock", 0.0
}

actor SparkLobFX : BasicClientSide
{
Scale 1.15
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,"Spawn1","Spawn2")
Spawn1:
SPAS AABB 1 A_FadeOut(0.05)
loop
Spawn2:
SPAS BBAA 1 A_FadeOut(0.05)
loop
}
}

actor SparkLobFX2 : BasicClientSide
{
Scale 2.25
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,"Spawn1","Spawn2")
Spawn1:
SPAS AABB 1 A_FadeOut(0.08)
loop
Spawn2:
SPAS BBAA 1 A_FadeOut(0.08)
loop
}
}

actor SparkLobFX3 : SparkLobFX2 {}