actor FlashStopperWep : BaseMM8BDMWep 10078
{
//$Category MM8BDM-Weapons
//$Title Flash Stopper
//$Sprite WEA3E0
Weapon.AmmoUse 7
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Inventory.Pickupmessage "$PU_FLASHSTOPPER"
Obituary "$OB_FLASHSTOPPER"
Tag "$TAG_FLASHSTOPPER"
weapon.ammotype "FlashStopperAmmo"
inventory.icon "BRIGHSI"
States
{
SpawnLoop:
WEA3 E -1
loop
Ready:
FSTO A 0 ACS_ExecuteAlways(998,0,49)
FSTO A 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
FSTO A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
FSTO A 1 A_Raise
Loop
Fire:
FSTO A 0 A_JumpIfInventory("FlashStopperWait", 1, "FireWait")
FSTO A 0 A_JumpIfNoAmmo("NoAmmo")
FSTO EF 1 
FSTO A 0 A_PlaySoundEX("weapon/flashstopperstart","Weapon")
FSTO A 0 A_FireCustomMissile("FlashStopperStarter",0,1,8,0)
FSTO A 0 A_SpawnItemEx("FlashStopper")
FSTO A 0 A_GiveInventory("FlashStopperWait", 1)
FSTO GHIJ 1
TNT1 A 8
FSTO KL 1
FSTO A 0 A_Refire
Goto Ready+1
FireWait:
FSTO A 1
goto Ready+1
NoAmmo:
FSTO A 1 ACS_Execute(979,0)
Goto Ready+1
}
}

actor FlashStopperWait : Powerup { powerup.duration 43 }

actor FlashStopperGiver : CustomInventory //10078
{
//$Category MM8BDM-Weapons
//$Title Flash Stopper
Inventory.Pickupmessage "$PU_FLASHSTOPPER"
inventory.pickupsound "weapon/weaponup"
Inventory.RespawnTics 1800
scale 2.0
states
{
Spawn:
WEA3 E 1
loop
Pickup:
WEA3 E 0 A_JumpIfInventory("FlashStopperWep",1,"Failure")
WEA3 E 0 A_GiveInventory("FlashStopperWep")
stop
Failure:
WEA3 E 0 
fail
}
}

actor FlashStopper
{
-SOLID
+NOGRAVITY
PROJECTILE
+DONTBLAST
+NOINTERACTION
damage 0
radius 1
height 1
damagetype "FlashStopper"
Obituary "$OB_FLASHSTOPPER"
States
{
Spawn:
TNT1 A 0
TNT1 A 25
TNT1 A 0 A_SpawnItemEx("FlashStopperFX",0,0,64)
TNT1 A 0 A_PlaySoundEx("weapon/flashstopper","Weapon")
//TNT1 A 0 A_GiveToTarget("FlashStopperFlash", 1)
TNT1 A 1 A_Explode(22, 450,0)
TNT1 A 0 ACS_NamedExecuteAlways("core_flashstopperlight", 0, 450)
TNT1 A 1
stop
}
}



actor FlashStopperStarter : FlashStopper
{
-NOINTERACTION
scale 2.5
+RIPPER
+BRIGHT
speed 2
States
{
Spawn:
FST2 G 0
FST2 G 0 ThrustThingZ(0,10,0,0)
FST2 GHGHG 5
FST2 G 0 A_Stop
Death:
FST2 G 0
stop
}
}

actor FlashStopperFlash : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	States
	{
	Use:
		TNT1 A 0 A_SetBlend("99 99 99", 0.95, 15)
		stop
	}
}

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

actor Flashed : PowerDamage
{
powerup.duration 105
damagefactor "normal", 1.0
}

actor BrightBlind : Inventory
{
inventory.amount 1
inventory.maxamount 175
}

actor FlashStopperFX
{
renderstyle translucent
+NOINTERACTION
+FORCEXYBILLBOARD
+CLIENTSIDEONLY
+BRIGHT
height 1
radius 1
alpha 1.0
scale 5.0
-SOLID
+NOGRAVITY
states
{
Spawn:
FST2 ABCDEF 1 A_FadeOut(0.12)
stop
}
}

actor FlashStopperHit : CustomInventory
{
    States
    {
    Pickup:
        TNT1 A 0 A_GiveInventory("FlashStopperHitCheck", 1)
        goto End
    End:
        TNT1 A 0
        stop
    }
}

actor FlashStopperHitCheck : powerup
{
    Powerup.duration 10
}

actor FlashStopperBlind : FlashStopperHit
{
    States
    {
    Pickup:
        TNT1 A 0 A_JumpIfInventory("BrightBlind", 1,3)
		TNT1 A 0 A_SpawnItemEx("FlashBlindWatcher")
        TNT1 A 0 A_GiveInventory("BrightBlind",175)
        TNT1 A 0 ACS_ExecuteAlways(249, 0)
        goto End
        TNT1 A 0 A_GiveInventory("BrightBlind",55)
        goto End
    }
}

actor FlashBlindWatcher
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0 
TNT1 A 4 A_GiveToTarget("FlashBlindFX", 1)
TNT1 A 0 A_JumpIfInTargetInventory("BrightBlind", 100, "Spawn")
stop
}
}

actor FlashBlindFX : CustomInventory
{
+INVENTORY.AUTOACTIVATE
-INVBAR
States
{
Use:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("FlashBlindGFX", random(16,20), random(16, -16), random (40,56), 0, 0, 0, 0)
stop
}
}

actor FlashBlindGFX
{
+NOGRAVITY
+THRUACTORS
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
+MISSILE
+DONTBLAST
Damage(0)
Scale 2.5
Height 0
Radius 0
States
{
Spawn:
FST2 IJK 4
stop
}
}