actor FlashStopperBoss : MegaBuster 
{
//Weapon.AmmoUse 28
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Inventory.Pickupmessage "Power up! Flash Stopper!"
weapon.ammotype "FlashStopperClassAmmo"
weapon.ammotype2 "FlashStopperClass2Ammo"
inventory.pickupsound "weapon/weaponup"
+WEAPON.AMMO_OPTIONAL
+WEAPON.Alt_AMMO_OPTIONAL
Obituary "%o was shot down by %k's Bright Buster."
//inventory.icon "BRIGHSI"
Scale 2.0
States
{
Spawn:
WEA3 E 1
loop
Ready:
FSTB A 0 ACS_ExecuteAlways(998,0,241)
FSTB I 0 A_GunFlash
STAC A 0 A_JumpIfInventory("FlashStopperClassAmmo",28,"Ready2")
FSTB A 1 A_WeaponReady(WRF_NOSECONDARY|WRF_NOSWITCH)
STAC A 0 A_JumpIfInventory("UseFlashStopperFlag",1,"FlashStopper")
FSTB A 1 A_WeaponReady(WRF_NOSECONDARY|WRF_NOSWITCH)
STAC A 0 A_JumpIfInventory("UseFlashStopperFlag",1,"FlashStopper")
FSTB A 0 A_GiveInventory("FlashStopperClassAmmo",1)
Goto Ready+2
Ready2:
FSTB A 1 A_WeaponReady(WRF_NOSWITCH)
STAC A 0 A_JumpIfInventory("UseFlashStopperFlag",1,"FlashStopper")
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
FSTB A 0
FSTB A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
FSTB A 1 A_Raise
Loop
Fire:
FSTB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
FSTB A 0 A_FireCustomMissile("BrightShot",random(-2,2),0,8,0)
FSTB BC 3
FSTB A 2
STAC A 0 A_JumpIfInventory("UseFlashStopperFlag",1,"FlashStopper")
FSTB A 0 A_Refire
goto Ready+2
AltFire:
STAC A 0 A_JumpIfInventory("FlashStopperClassAmmo",28,1)
goto NoAmmo
STAC A 0 A_TakeInventory("FlashStopperClassAmmo",28)
//FSTB A 0 A_FireCustomMissile("BrightBulb1",0,0,0,0)
FSTB A 0 A_FireCustomMissile("BrightBulb2",0,0,0,0)
//FSTB A 0 A_FireCustomMissile("BrightBulb3",0,0,0,0)
FSTB D 0 A_GiveInventory("FlashThrowFlag", 1)
FSTB I 4 A_GunFlash
FSTB JJJJI 4
STAC A 0 A_JumpIfInventory("UseFlashStopperFlag",1,"FlashStopper")
FSTB A 0 A_Refire
Goto Ready+2
FlashStopper:
TNT1 A 0 ACS_ExecuteAlways(648,0,1)
HEAA A 0 SetPlayerProperty(0,1,0)
FLSA A 0 A_PlaySoundEx("weapon/flashstopper","Weapon")
FLSA A 0 A_FireCustomMissile("BossFlashStopperRadius",0,1,8,0)
FSTB D 0 A_TakeInventory("EndFlashStopperFlag", 1)
FSTB D 0 A_GiveInventory("FlashStopperFlag", 1)
FSTB I 15 ACS_ExecuteAlways(976,0)
FSTB D 0 A_TakeInventory("FlashStopperFlag", 1)
FSTB D 0 A_GiveInventory("EndFlashStopperFlag", 1)
TNT1 A 0 A_TakeInventory("FlashStopperClass2Ammo",28)
FSTB D 0 A_TakeInventory("UseFlashStopperFlag", 1)
FSTB D 0 A_TakeInventory("FlashThrowFlag", 1)
FSTB I 0 A_GunFlash
TNT1 A 0 ACS_ExecuteAlways(648,0,0)
HEAA A 0 SetPlayerProperty(0,0,0)
goto Ready+2
NoAmmo:
FSTB A 0
//FSTB A 1 ACS_Execute(979,0)
Goto Ready+2
Flash:
TNT1 A 0 A_JumpIfInventory("FlashThrowFlag", 1, "FlashThrow")
TNT1 A 0 A_TakeInventory("FlashStock",999)
goto Reload
FlashThrow:
FSTB DEFGH 3 A_GiveInventory ("FlashStock", 3)
FSTB D 0 A_TakeInventory("FlashThrowFlag",999)
goto Reload
Reload:
TNT1 A 1 A_GiveInventory ("FlashStock", 1)
CRAA A 0 A_JumpIfInventory("FlashStock", 22, "Give")
loop
Give:
TNT1 A 0 A_TakeInventory("FlashStock",22)
TNT1 A 0 A_GiveInventory ("FlashStopperClass2Ammo", 1)
goto Reload+1
NoFlash:
TNT1 A 0
stop
}
}

actor FlashStock : Inventory
{
inventory.amount 1
inventory.maxamount 999
}

actor FlashThrowFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor FlashStopperFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor EndFlashStopperFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor UseFlashStopperFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor FlashStopperClass2Ammo : Ammo
{
inventory.amount 1
inventory.maxamount 28
}

actor FlashStopperUseItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "BriIcon"
scale 2.0
+COUNTITEM
+INVBAR
states
{
Spawn:
GRAI A 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("FlashStopperClass2Ammo",28,"Success")
fail
Success:
TNT1 A 0 A_GiveInventory("UseFlashStopperFlag",1)
fail
}
}

actor BrightBulb1
{
Obituary "%o's visuals were fried by %k's Flash Bulbs."
PROJECTILE
-NOGRAVITY
Damage (10)
damagetype "Bright"
Speed 20
scale 2.5
States
{
Spawn:
FSTB K 0
FSTB K 0 ThrustThingZ(0,20,0,1)
FSTB KLMN 2
Goto Spawn+2
Death:
NAPA E 0 A_Stop
NAPA E 0 A_Explode(10,156,0)
NAPA E 0 A_PlaySoundEx("weapon/centaurflash","Voice")
NAPA E 0 A_ChangeFlag("NOGRAVITY",1)
NAPA EFGHIJKLMNOPQRS 1
stop
}
}

actor BrightBulb2 : BrightBulb1
{
Speed 25
States
{
Spawn:
FSTB K 0
FSTB K 0 ThrustThingZ(0,30,0,1)
FSTB KLMN 2
Goto Spawn+2
}
}

actor BrightBulb3 : BrightBulb1
{
Speed 30
States
{
Spawn:
FSTB K 0
FSTB K 0 ThrustThingZ(0,40,0,1)
FSTB KLMN 2
Goto Spawn+2
}
}

actor FlashStopperClassAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
}

actor BrightShot : FastProjectile
{
PROJECTILE
+LOOKALLAROUND
+SKYEXPLODE
+DONTBLAST
damagetype "Buster"
//seesound "weapon/mbuster"
Speed 40
Damage (15)
radius 5
height 5
scale 2.5
States
{
Spawn:
TNT1 A 1
BRTS A 1
Goto Spawn+1
Death:
BRTS A 1
stop
}
}

actor BossFlashStopperRadius : TimeStopperRadius
{
Obituary "%k lit up %o's Life."
damagetype "BrightB"
}


actor BossFlashStoppered
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
reactiontime 60
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("BossFlashStopperedStop",1)
TNT1 A 0 A_TakeFromTarget("EndBossFlashStoppered",1)
TNT1 A 0 A_CountDown
goto Spawn2
Spawn2:
TNT1 A 0 A_JumpIfInTargetInventory("EndBossFlashStoppered",1,"Death")
TNT1 A 1 A_GiveToTarget("BossFlashStopperedStop",1)
TNT1 A 0 A_CountDown
loop
Death:
TNT1 A 1
stop
}
}

actor BossFlashStopperedStop : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 A_Stop
stop
}
}