actor FlashMan_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_2F"
dropitem "TimeBenderWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Obituary "$OB_TIMEBUSTER"
weapon.ammotype "ZaWarudoAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_02 F 1
loop

Deselect:
FLSA A 0
goto DeselectSwap
Select:
FLSA A 0 A_TakeInventory("FlashM_TimeStopper_F")
goto SelectSwap

Ready:
FLSA A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_FLASHMAN)
FLSA A 0 A_GunFlash
goto Ready1
Ready1:
FLSA A 0 A_JumpIfInventory("ZaWarudoAmmo",1960,"Ready2")
FLSA A 2 A_WeaponReady(8)
FLSA A 0 A_JumpIfInventory("VivifyCycle1",1,2)
FLSA A 0 A_GiveInventory("ZaWarudoAmmo",2)
FLSA A 0
loop
Ready2:
FLSA A 2 A_WeaponReady
FLSA A 0 A_GiveInventory("ZaWarudoAmmo",2)
loop

Fire:
FLSA B 0 A_JumpIfInventory("IsBot",1,"BotFire")
FLSA B 2
goto Fire1
Fire1:
FLSA C 0 A_JumpIfInventory("IsBot",1,"BotFire3")
FLSA C 3 A_GiveInventory("Flashman_Fire1_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire2_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire3_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire4_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire3_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire2_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire1_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire5_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire6_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire7_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire6_P")
FLSA C 0 A_ReFire(1)
goto FireE
FLSA C 3 A_GiveInventory("Flashman_Fire5_P")
FLSA C 0 A_ReFire("Fire1")
goto FireE


FireE:
FLSA BA 2
Goto Ready1

AltFire:
FLSA DEF 3
FLSA G 1 A_GiveInventory("FlashM_TimeStopper_F",28)
FLSA G 0 A_GiveInventory("VivifyCycle1",1)
FLSA G 0 A_GunFlash("Flash.Deplete",GFF_NOEXTCHANGE)
FLSA G 0 A_PlaySoundEx("weapon/timestopper","SoundSlot7")
FLSA G 0 A_TakeInventory("ZaWarudoAmmo",980)
FLSA G 0 A_TakeInventory("ZaWarudoAmmo",980,1)
FLSA G 0 A_FireCustomMissile("FlashM_TimeBender",0,1,0,0)
//FLSA G 0 A_Blast(BF_NOIMPACTDAMAGE,255,192,20.0,"FlashmanSparkleFX_Aura")
FLSA G 4 A_SetBlend(white,0.95,5)
FLSA FEHA 3
Goto Ready1

Flash:
TNT1 A 0 A_JumpIfInventory("ZaWarudoAmmo",1960,"Flash.Full")
TNT1 A 2 A_GiveInventory("ZaWarudoAmmo",8)
loop
Flash.Full:
TNT1 AAAA 1 A_RailWait
TNT1 A 0 A_SpawnItemEx("FlashmanSparkleFX_Aura",random(16,48),0,Random(16,48),0,0,0,random(0,359),1)
loop
Flash.Deplete:
TNT1 A 1 A_RailWait
TNT1 A 1 A_TakeInventory("FlashM_TimeStopper_F",1)
TNT1 AA 1 A_RailWait
TNT1 A 0 A_JumpIfInventory("FlashM_TimeStopper_F",1,"Flash.Deplete")
TNT1 AA 2 A_RailWait
TNT1 A 0 A_TakeInventory("VivifyCycle1")
goto Flash

BotFire:
FLSA A 0 A_JumpIfCloser(450,"BotFire2")
FLSA A 2
FLSA A 0 A_GiveInventory("ZaWarudoAmmo",2)
Goto Ready1
BotFire2:
FLSA A 0 A_JumpIfInventory("ZaWarudoAmmo",1960,"Altfire")
goto Fire+1
BotFire3:
FLSA C 0 A_JumpIfCloser(450,1)
goto Fire1+1
FLSA C 0 A_JumpIfInventory("ZaWarudoAmmo",1960,"Altfire")
goto Fire1+1
}
}

actor ZaWarudoAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 1960
+INVENTORY.IGNORESKILL
}

actor FlashM_TimeStopper_F : Inventory
{
inventory.amount 1
inventory.maxamount 28
}

actor Flashman_Fire1_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_FireCustomMissile("FlashBullet",0,0,8,0)
End:
TNT1 C 0 A_PlaySoundEx("weapon/rbuster","Weapon")
stop
}
}
actor Flashman_Fire2_P : Flashman_Fire1_P{states{Pickup:TNT1 A 0 A_FireCustomMissile("FlashBullet",5,0,8,0)goto End}}
actor Flashman_Fire3_P : Flashman_Fire1_P{states{Pickup:TNT1 A 0 A_FireCustomMissile("FlashBullet",10,0,8,0)goto End}}
actor Flashman_Fire4_P : Flashman_Fire1_P{states{Pickup:TNT1 A 0 A_FireCustomMissile("FlashBullet",15,0,8,0)goto End}}
actor Flashman_Fire5_P : Flashman_Fire1_P{states{Pickup:TNT1 A 0 A_FireCustomMissile("FlashBullet",-5,0,8,0)goto End}}
actor Flashman_Fire6_P : Flashman_Fire1_P{states{Pickup:TNT1 A 0 A_FireCustomMissile("FlashBullet",-10,0,8,0)goto End}}
actor Flashman_Fire7_P : Flashman_Fire1_P{states{Pickup:TNT1 A 0 A_FireCustomMissile("FlashBullet",-15,0,8,0)goto End}}

actor FlashBullet : ProjSpawnFuncActorFast
{
PROJECTILE
damagetype "FlashM_Shot"
Obituary "$OB_TIMEBUSTER"
+FORCEXYBILLBOARD
+BRIGHT
Damage (60)
radius 10
height 6
Speed 65
scale 2.5
States
{
Spawn:
TNT1 A 1
Q_0D B 7
Q_0D B 2
stop
}
}

actor FlashM_TimeBender : BasicExplosion
{
damagetype "FlashM_Stopper"
Obituary "$OB_TIMEBENDER"
+PIERCEARMOR
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("FlashM_TimeBenderFX",0,0,0,0,0,0,0,1)
TNT1 A 4 A_Explode(50,512,0,0,256)
stop
}
}

actor FlashM_TimeBenderFX : BasicGraphicEffect
{
ReactionTime 3
States
{
SpawnFrame:
TNT1 A 0
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("FlashmanSparkleFX_X",random(-384,384),random(-384,384),random(-384,384),0,0,0,0,1+128)
TNT1 AAAAAAAAAA 0 A_SpawnItemEx("FlashmanSparkleFX_V",random(-384,384),random(-384,384),random(-384,384),0,0,0,0,1+128)
TNT1 A 2 A_CountDown
loop
}
}

actor FlashM_GenesisSparkleFX : BasicGraphicEffect
{
Translation "192:192=4:4","198:198=4:4"
+FORCEXYBILLBOARD
+BRIGHT
Renderstyle "Translucent"
Alpha 0.95
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_Jump(256,1,5,9,13,17)
FLSA MNOP 3
stop
FLSA M random(1,3)
FLSA NO 3
FLSA P random(1,3)
stop
FLSA MNOP 2
stop
FLSA MNOP random(2,3)
stop
FLSA MNOP random(1,3)
stop
}
}

actor FlashM_SparkleFX_Base : BasicGraphicEffect
{
+FORCEXYBILLBOARD
+BRIGHT
Renderstyle "Translucent"
Alpha 0.95
ReactionTime 10
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0
SpawnX:
TNT1 A 0 A_Jump(256,1,2,3)
Spawn1:
FLSA QRS 2 A_CountDown
loop
SpawnV:
TNT1 A 0 A_Jump(256,1,2,3,4,5,6)
Spawn7:
FLSA TUV 2 A_CountDown
loop
Spawn8:
FLSA WXY 2 A_CountDown
loop
}
}

actor FlashmanSparkleFX_X : FlashM_SparkleFX_Base
{
States
{
SpawnFrame:
TNT1 A 0
goto SpawnX
}
}

actor FlashmanSparkleFX_V : FlashM_SparkleFX_Base
{
States
{
SpawnFrame:
TNT1 A 0
goto SpawnV
}
}
actor FlashmanSparkleFX_Aura : FlashM_SparkleFX_Base
{
States
{
SpawnFrame:
TNT1 A 0 A_Jump(32,"SpawnV")
goto SpawnX
}
}



actor FlashMan_W_NormalBar : NormalBar {Args 34,239}
actor FlashMan_W_ScriptBar : ScriptBar {}