actor LightningFlashWep_NormalBar : NormalBar{args 228, 232}
actor LightningFlashWep : BaseMM8BDMWep
{
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 2
Obituary "$OB_LIGHTNINGFLASH"
Inventory.Pickupmessage "$PU_LIGHTNINGFLASH" 
Tag "$TAG_LIGHTNINGFLASH"
weapon.ammotype "LightningFlashAmmo"
inventory.icon "LGFSICON"
Scale 2.0
States
{
SpawnLoop: 
LFSI I 1
loop
Ready: 
LFSW A 0
LFSW A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_LIGHTNINGFLASH) 
LFSW A 1 A_WeaponReady
Goto Ready+2
ReadyC: Goto Ready+2
Deselect: 
LFSW A 0
goto DeselectSwap
Select: 
LFSW A 0
goto SelectSwap
Fire: 
LFSW A 0 A_JumpIfNoAmmo("NoAmmo") 
LFSW A 0 A_PlaySoundEx("weapon/rokkolightning","Weapon")
LFSW A 0 A_FireCustomMissile("W_LightningFlash",0,1,8,0)
LFSW BC 3
LFSW A 14
Goto Ready+2 
NoAmmo: 
LFSW A 1 ACS_NamedExecute("core_noammo",0)
Goto Ready+2

}
}

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

actor W_LightningFlash : BasicProjectile
{
+BRIGHT
var int user_PierceRipper;
translation "139:139=232:232"
Obituary "$OB_LIGHTNINGFLASH"
PROJECTILE
Damage (CallACS("vile_cbm_damage",35))
damagetype "LightningFlash"
speed 40
+RIPPER
Scale 2.5
Height 16
Radius 16
States
{
Spawn:
TNT1 A 0
LNFH ABCD 2
loop
}
}

actor LightningFlash_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/rokkolightninghit","Body",0,0)
TNT1 A 0 A_JumpIfInventory("LightningFlashSpeedCooldown", 1, 2)
TNT1 A 0 A_SpawnItemEx("LightningFlash_Watcher")
TNT1 A 0 A_GiveInventory("LightningFlashSpeedCooldown", 1)
TNT1 A 0 A_GiveInventory("LightningFlashSpeedTime", 1)
TNT1 A 0 A_GiveInventory("LightningFlash_Speed", 1)
TNT1 A 0 A_GiveInventory("LightningFlash_Slow", 1)
stop
}
}

actor LightningFlash_Watcher : BasicWatcher
{
States
{
Spawn:
TNT1 A 0 
TNT1 A 2 A_GiveToTarget("LightningFlashFX", 1)
TNT1 A 0 A_JumpIfInTargetInventory("LightningFlashSpeedTime", 1, "Spawn")
TNT1 A 2
stop
}
}


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

actor LightningFlashGFX : BasicGraphicEffect
{
translation "139:139=232:232"
scale 1.75
+FLOATBOB
+FORCEXYBILLBOARD
+BRIGHT
Height 0
Radius 0
States
{
SpawnFrame:
LNFH E 3 A_Fadeout(0.2)
loop
}
}

actor LightningFlashSpeedCooldown : PowerUp {Powerup.duration 40}
actor LightningFlashSpeedTime : PowerUp {Powerup.duration 24}
actor LightningFlash_Speed : PowerSpeed {Powerup.Duration 11 Speed 3.65}
actor LightningFlash_Slow : PowerSpeed {Powerup.Duration 35 Speed 0.44}