actor FlashStopperBoss : BaseMM8BDMWep_CBM 
{
dropitem "FlashBulbWepCDropped"
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Inventory.Pickupmessage "Power up! Flash Stopper!"
weapon.ammotype "FlashStopperClassAmmo"
weapon.ammotype2 "FlashStopperClass2Ammo"
+WEAPON.NOAUTOAIM
Obituary "$OB_BRIGHTBUSTER"
States
{
Spawn:
C_04 A 1
loop
Ready:
FSTB A 0 ACS_ExecuteAlways(998,0,780)
FSTB A 0 A_GunFlash
FSTB A 0 A_JumpIfInventory("FlashStopperClassAmmo",28,"Ready2")
FSTB A 0 A_JumpIfInventory("UseFlashStopperFlag",1,"FlashStopper")
FSTB A 2 A_WeaponReady(WRF_NOSECONDARY)
FSTB A 0 A_GiveInventory("FlashStopperClassAmmo",1)
Goto Ready+2
Ready2:
FSTB A 0 A_JumpIfInventory("UseFlashStopperFlag",1,"FlashStopper")
FSTB A 1 A_WeaponReady
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
FSTB A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
FSTB A 1 A_Raise
Loop
Fire:
FSTB A 0 A_GiveInventory("FlashStopperClassAmmo",1)
FSTB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
FSTB A 0 A_GiveInventory("BrightmanMain_CI",1)
FSTB BC 3
FSTB A 2
goto Ready+2
AltFire:
FSTB A 0 A_JumpIfInventory("FlashStopperClassAmmo",28,1)
goto NoAmmo
FSTB A 0 A_TakeInventory("FlashStopperClassAmmo",28)
FSTB A 0 A_PlaySoundEx("weapon/BombThrow","Weapon")
FSTB A 0 A_GiveInventory("BrightmanAlt_CI",1)
FSTB A 0 A_GiveInventory("FlashThrowFlag", 1)
FSTB I 4 A_GunFlash
FSTB JJJJI 4
Goto Ready+2
FlashStopper:
FSTB I 0 ACS_ExecuteAlways(648,0,1)
FSTB I 0 SetPlayerProperty(0,1,0)
FSTB I 0 A_PlaySoundEx("weapon/flashstopper","Weapon")
FSTB I 0 A_GiveInventory("BrightmanOther_CI",1)
FSTB I 0 A_TakeInventory("EndFlashStopperFlag",1)
FSTB I 0 A_GiveInventory("FlashStopperFlag",1)
FSTB I 15 ACS_ExecuteAlways(976,0)
FSTB I 0 A_TakeInventory("FlashStopperFlag",1)
FSTB I 0 A_GiveInventory("EndFlashStopperFlag",1)
FSTB I 0 A_TakeInventory("FlashStopperClass2Ammo",28)
FSTB I 0 A_TakeInventory("UseFlashStopperFlag",1)
FSTB I 0 A_TakeInventory("FlashThrowFlag",1)
FSTB I 0 A_GunFlash
FSTB I 0 ACS_ExecuteAlways(648,0,0)
FSTB I 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)
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("FlashStock",22,"Give")
loop
Give:
TNT1 A 0 A_TakeInventory("FlashStock",22)
TNT1 A 0 A_GiveInventory("FlashStopperClass2Ammo",2)
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 FlashStopperClassAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

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

actor FlashStopperUseItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "BriIcon"
scale 2.0
inventory.pickupmessage "Careful, this bulb is one of a kind, known as the 'Eternal Light' to some."
+INVBAR
states
{
Spawn:
WEA3 E 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("FlashStopperClass2Ammo",28,"Success")
fail
Success:
TNT1 A 0 A_GiveInventory("UseFlashStopperFlag",1)
fail
}
}

actor BrightBulb1
{
Translation "202:202=211:211"
Obituary "$OB_BRIGHTBULB"
PROJECTILE
-NOGRAVITY
Damage (10)
damagetype "FlashBulb"
Speed 20
scale 2.5
States
{
Spawn:
FSTB K 0
FSTB K 0 ThrustThingZ(0,20,0,1)
goto Spawn2
Spawn2:
FSTB KLMN 2
loop
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_Explode(10,156,0)
TNT1 A 0 A_PlaySoundEx("weapon/centaurflash","Voice")
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TN_B EFGHIJKLMNOPQRS 1
stop
}
}


actor BrightBulb2 : BrightBulb1
{
Speed 25
States
{
Spawn:
FSTB K 0
FSTB K 0 ThrustThingZ(0,30,0,1)
goto Spawn2
}
}

actor BrightBulb2B : BrightBulb2{translation "202:202=205:205"}
actor BrightBulb2R : BrightBulb2{translation "202:202=171:171"}
actor BrightBulb2O : BrightBulb2{translation "202:202=104:104"}
actor BrightBulb2P : BrightBulb2{translation "202:202=229:229"}

actor BrightBulb3 : BrightBulb1
{
Speed 30
States
{
Spawn:
FSTB K 0
FSTB K 0 ThrustThingZ(0,40,0,1)
goto Spawn2
}
}

actor BrightShot
{
Translation "202:202=211:211"
PROJECTILE
Obituary "$OB_BRIGHTBUSTER"
damagetype "Buster"
Speed 40
Damage (15)
radius 6
height 6
scale 2.5
States
{
Spawn:
TNT1 A 1
BRTS A 1
Goto Spawn+1
Death:
BRTS A 1
stop
}
}

actor BrightShotB : BrightShot{translation "202:202=205:205"}
actor BrightShotR : BrightShot{translation "202:202=171:171"}
actor BrightShotO : BrightShot{translation "202:202=104:104"}
actor BrightShotP : BrightShot{translation "202:202=229:229"}

actor BrightmanFlashStopper : BasicExplosion
{
translation "192:192=4:4", "198:198=225:225"
Obituary "$OB_BRIGHTFLASH"
damagetype "BrightB"

States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(6,512,0,0,256)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("BrightmanFlashStopperFX",random(0,512),0,random(-256,256),0,0,0,random(0,359),1)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("BrightmanFlashStopperFX",random(0,512),0,random(-256,256),0,0,0,random(0,359),1)
stop
}
}

actor BrightmanFlashStopperB : BrightmanFlashStopper{translation "192:192=205:205", "198:198=74:74"}
actor BrightmanFlashStopperR : BrightmanFlashStopper{translation "192:192=171:171", "198:198=41:41"}
actor BrightmanFlashStopperO : BrightmanFlashStopper{translation "192:192=104:104", "198:198=128:128"}
actor BrightmanFlashStopperP : BrightmanFlashStopper{translation "192:192=229:229", "198:198=232:232"}

actor BrightmanFlashStopperFX : BasicClientSide
{
renderstyle translucent
alpha 0.3
States
{
Spawn:
BRTS B 0
BRTS B 2
TNT1 A 2
BRTS B 2
TNT1 A 2
BRTS C 2
stop
}
}

actor BossFlashStoppered : BasicHelper
{
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
{
States
{
Pickup:
TNT1 A 0 A_Stop
stop
}
}

actor BrightmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("BrightShot",random(-2,2),0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("BrightShotB",random(-2,2),0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("BrightShotR",random(-2,2),0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("BrightShotO",random(-2,2),0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("BrightShotP",random(-2,2),0,8,0)
goto Done
}
}

actor BrightmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("BrightBulb2",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("BrightBulb2B",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("BrightBulb2R",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("BrightBulb2O",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("BrightBulb2P",0,0,-8,0)
goto Done
}
}

actor BrightmanOther_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("BrightmanFlashStopper",0,1,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("BrightmanFlashStopperB",0,1,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("BrightmanFlashStopperR",0,1,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("BrightmanFlashStopperO",0,1,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("BrightmanFlashStopperP",0,1,0,0)
goto Done
}
}