actor Quickman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_2D"
dropitem "QuickBoomerangWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 100
Obituary "$OB_QUICKBOOMERANG"
weapon.ammotype "QuickerOatsAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_02 D 1
loop

Deselect:
QUIK N 0
goto DeselectSwap
Select:
QUIK N 0
goto SelectSwap

Ready:
QUIK N 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_QUICKMAN)
goto Ready1
Ready1:
QUIK N 0 A_JumpIfInventory("QuickManTrail",1,"Ready2")
QUIK N 2 A_WeaponReady
QUIK N 0 A_GiveInventory("QuickerOatsAmmo",2)
goto Ready1+1
Ready2:
QUIK N 1 A_WeaponReady
goto Ready1

Fire:
QUIK N 0 A_JumpIfInventory("IsBot",1,"BotFire")
QUIK N 0 A_JumpIfInventory("QuickManTrail",1,"Fire2_Rapid")
goto Fire1_Spread
Fire1_Spread:
QUIK N 4 OffSet(10,42)A_GiveInventory("Quickman_Fire_P")
QUIK N 4 OffSet(20,52)A_GiveInventory("QuickerOatsAmmo",1)
QUIK N 4 OffSet(10,42)A_GiveInventory("QuickerOatsAmmo",1)
QUIK N 0 A_GiveInventory("QuickerOatsAmmo",1)
QUIK N 4 A_WeaponReady(14)
Goto Ready1

Fire2_Rapid:
QUIK N 0 A_PlaySoundEx("weapon/rbuster","Weapon")
QUIK N 0 A_FireCustomMissile("QuickmanBoomerangRapid",0,0,8,0)
QUIK N 2 OffSet(10,42)
QUIK N 2 A_WeaponReady(14)
Goto Ready1

Altfire:
QUIK N 0 A_JumpIfInventory("QuickManTrail",1,"Fire2_Rapid")
QUIK N 0 A_JumpIfInventory("QuickerOatsAmmo",0,"Altfire2")
goto Fire1_Spread
Altfire2:
QUIK N 0 A_PlaySoundEx("Class/QuickRun","SoundSlot7")
QUIK N 0 A_GiveInventory("QuickManTrail",1)
QUIK N 0 A_GiveInventory("CBM_QuickmanJumpPowerGiver",1)
QUIK N 1 A_GunFlash("Flash",1)
goto Fire2_Rapid

Flash:
TNT1 A 1 A_TakeInventory("QuickerOatsAmmo",1,1)
TNT1 A 0 A_JumpIfInventory("QuickerOatsAmmo",1,2)
TNT1 A 0 A_TakeInventory("QuickManTrail")
stop
TNT1 A 1 A_TakeInventory("QuickerOatsAmmo",1)
TNT1 A 0 A_JumpIfInventory("QuickerOatsAmmo",1,"Flash")
TNT1 A 0 A_TakeInventory("QuickManTrail")
stop

BotFire:
QUIK N 0
Goto AltFire

}
}

actor QuickerOatsAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 100
+INVENTORY.IGNORESKILL
}

actor CBM_QuickmanJumpPowerGiver : PowerApropGiver {}
actor CBM_QuickmanJumpPower : Base_CBM_PropertyPower {}

actor QuickManTrail : PowerSpeed
{
Speed 1.5
Powerup.Duration 0x7FFFFFFC
+INVENTORY.ALWAYSPICKUP
}

actor QuickTrailItem : BasicClassItem
{
inventory.icon "QuiIcon"
inventory.pickupmessage "Five hour energy packed into less than five seconds."
Tag "Drink 5 hour energy"
states
{
Spawn:
QUIK Z 1
loop
UseCBM:
TNT1 A 0 A_JumpIfInventory("QuickerOatsAmmo",100,"Success")
fail
Success:
QUIK N 0 A_PlaySoundEx("Class/QuickRun","SoundSlot7")
TNT1 A 0 A_GiveInventory("CBM_QuickmanJumpPowerGiver",1)
TNT1 A 0 A_TakeInventory("QuickerOatsAmmo",999)
fail
}
}

actor Quickman_Fire_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/rbuster","Weapon")
TNT1 A 0 OffSet(10,42)A_GiveInventory("QuickerOatsAmmo",1)
TNT1 A 0 A_FireCustomMissile("QuickmanBoomerang",15,0,8,0)
TNT1 A 0 A_FireCustomMissile("QuickmanBoomerang2",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("QuickmanBoomerang",-15,0,8,0)
stop
}
}

actor QuickmanBoomerang : ProjSpawnFuncActor
{
var int user_X;
var int user_Z;
PROJECTILE
damagetype "QuickM_Shot"
Obituary "$OB_QUICKBOOMERANG"
reactiontime 8
damage (70)
Radius 7
Height 7
Speed 60
scale 2.5
States
{
Spawn:
QUIK T 0
QUIK T 0 A_SetUserVar("user_X",sqrt(momx*momx+momy*momy)*10)
QUIK T 1 A_SetUserVar("user_Z",momz*10)
goto Spawn2+1
Spawn2:
QUIK Q 0 A_CountDown
QUIK QQRR 1 A_ChangeVelocity(-user_X/160.0f,0,-user_Z/160.0f,1)//CVF_RELATIVE
QUIK Q 0 A_CountDown
QUIK SSTT 1 A_ChangeVelocity(-user_X/160.0f,0,-user_Z/160.0f,1)//-3.5
loop
}
}

actor QuickmanBoomerang2 : QuickmanBoomerang{damage (80)}

actor QuickmanBoomerangRapid : QuickmanBoomerang
{
damagetype "QuickM_Rapid"
reactiontime 3
damage (70)
Speed 65
States
{
Spawn:
QUIK T 0
QUIK T 0 A_SetUserVar("user_X",sqrt(momx*momx+momy*momy)*10)
QUIK T 1 A_SetUserVar("user_Z",momz*10)
goto Spawn2+1
Spawn2:
QUIK Q 0 A_CountDown
QUIK QQRRSSTT 1 A_ChangeVelocity(-user_X/120.0f,0,-user_Z/120.0f,1)//-4.0
loop
}
}



actor Quickman_W_NormalBar : NormalBar {Args 34,39}
actor Quickman_W_ScriptBar : ScriptBar {}