actor FlashBulbWep_NormalBar : NormalBar { args 4, 239 }

actor FlashBulbWep : BaseMM8BDMWep
{
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 7
Inventory.Pickupmessage "$PU_FLASHBULB"
Obituary "$OB_FLASHBULB"
Tag "$TAG_FLASHBULB"
weapon.ammotype "FlashBulbAmmo"
inventory.icon "XTR0WI_I"
States
{
SpawnLoop:
XWI0 I -1
loop

Deselect:
XH0I A 0
goto DeselectSwap
Select:
XH0I A 0
goto SelectSwap

Ready:
XH0I A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_FLASHBULB)
XH0I A 0 A_JumpIfNoAmmo("ReadyNoAmmo")
XH0I A 1 A_WeaponReady
wait
ReadyNoAmmo:
XH0I B 1 A_WeaponReady
XH0I B 0 A_JumpIfNoAmmo("ReadyNoAmmo")
Goto Ready+1

Fire:
XH0I A 0 A_JumpIfNoAmmo("NoAmmo")
XH0I A 0 A_PlaySoundEx("weapon/BombThrow","Weapon")
XH0I A 0 A_FireCustomMissile("FlashBulbToss",0,1,8,0)
XH0I C 2
XH0I C 2 OffSet(-70,74)
XH0I C 2 OffSet(-121,114)
XH0I D 2 OffSet(1,31)
XH0I D 2 OffSet(-21,56)
XH0I D 2 OffSet(-33,84)
TNT1 A 20
XH0I A 0 A_JumpIfNoAmmo("FireNoAmmoEnd")
XH0I A 1 OffSet(-4,64)
XH0I A 1 OffSet(-2,48)
XH0I A 2 A_WeaponReady(14)
Goto Ready+1
FireNoAmmoEnd:
XH0I B 1 OffSet(-4,64)
XH0I B 1 OffSet(-2,48)
XH0I B 2 A_WeaponReady(14)
Goto ReadyNoAmmo
NoAmmo:
XH0I B 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto ReadyNoAmmo
}
}

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

actor FlashBulbToss : ProjSpawnFuncActor
{
PROJECTILE
damagetype "FlashBulb"
Obituary "$OB_FLASHBULB"
-NOGRAVITY
+SKYEXPLODE
+EXPLODEONWATER
+BRIGHT
Damage (130)
Radius 20
Height 16
Speed 25
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ChangeVelocity(0,0,7.5)
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8)
Spawn2:
XH0I KLMN 2
loop
Spawn3:
XH0I NMLK 2
loop

Death:
TNT1 A 0 A_SetGravity(0.0)
TNT1 A 0 A_SetArg(2,(ceilingz-z<=16)*-4+(z-floorz==0)*4)
TNT1 AAAAAAA 0 A_SpawnItemEx("FlashBulbShardFX",0,0,Args[2],random(-10+abs(Args[2]),10-abs(Args[2])),random(-10+abs(Args[2]),10-abs(Args[2])),random(-2+abs(Args[2]),2+abs(Args[2])),0,1,32)
TNT1 A 0 A_SpawnItemEx("FlashBulbTossBoom",0,0,10)
TNT1 A 2
stop
}
}

actor FlashBulbShardFX : BasicGraphicEffectM
{
-NOGRAVITY
+THRUACTORS
+DOOMBOUNCE
BounceFactor 0.3
WallBounceFactor 0.3
Radius 4
Height 4
Speed 20
States
{
SpawnFrame:
XH0I O 0
XH0I O 0 A_Jump(256,1,2,3,4)
XH0I OPQRSOPQRSOPQRSOPQRSOPQRSOPQRSOPQRSOPQRSOPQRSOPQRSOPQRS 4
stop
Death:
XH0I S 0 A_Jump(256,1,2,3)
XH0I SSSSSSSSSSSS 2
XH0I SSSSS 1 A_FadeOut(0.175)
stop
}
}

actor FlashBulbTossBoom : BasicExplosion
{
damagetype "FlashBulb"
Obituary "$OB_FLASHBULB"
+FORCEXYBILLBOARD
+BRIGHT
scale 3.0
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/centaurflash","Voice")
TNT1 A 1 A_Explode(130,156,0,0,32)
TNT1 A 0 ACS_NamedExecuteAlways("core_flashstopperlight",0,156)
TNT1 A 9 A_SpawnItemEx("BasicBoom6FX_4_210",0,0,0,0,0,0,0,1+SXF_TRANSFERSCALE)//16384
//211
stop
}
}

