actor Bass_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_0F"
dropitem "JetAdaptorUpgrade"

Weapon.AmmoUse 1
Weapon.AmmoGive 3
Weapon.SlotNumber 1
Inventory.Pickupmessage "$PU_BASSBUSTER"
Obituary "$OB_BASSBUSTER"
weapon.ammotype "EmulousDashAmmo"
States
{
Spawn:
C_00 F 1
loop

Deselect:
BASD A 0 A_TakeInventory("SlideVivifyFlag")
goto DeselectSwap
Select:
BASD A 0
goto SelectSwap

Ready:
BASD A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_BASSC)
Goto Ready2
Ready2:
BASD A 0
BASD A 0 //A_GiveInventory("AdaptorFlag")
BASD A 1 A_WeaponReady
wait

Fire:
BASD A 0 A_JumpIfInventory("SlideVivifyFlag",1,"ActionKick")
FireH:
BASD A 0 A_PlaySound("Bass/BusterFire",1)
BASD A 0 A_FireCustomMissile("BassShotB",frandom(-3,3),0,8,0,0,frandom(-0.25,0.25))
BASD B 2
BASD CA 1
BASD A 0 A_Refire("FireH")
goto Ready2+2

Altfire:
BASD E 0 A_GiveInventory("SlideVivifyFlag",1)
BASD E 0 A_Refire(1)
BASD E 0 A_PlaySound("Bass/Slide",1)//weapon/chargekick
BASD E 0 A_GiveInventory("BassSlideStop",1)
BASD E 0 A_GiveInventory("BassSlideCheck_P",1)
BASD E 2 A_WeaponReady(WRF_NOSWITCH|WRF_NOSECONDARY)//2+8
BASD F 8 A_WeaponReady(2+8)
BASD F 5 A_WeaponReady(2+8)
BASD F 0 A_TakeInventory("BassSlideSlow")
BASD F 5 A_WeaponReady(2+8)
BASD F 0 A_TakeInventory("SlideVivifyFlag",1)
BASD E 0 A_Refire("Altfire")
BASD E 5
BASD E 0
goto Ready2+2
ActionKick:
BASD G 0 A_GiveInventory("VivifyDelay7",1)
BASD G 0 A_GiveInventory("Bass_AltKick_P",1)
BASD G 0 A_Refire(1)
BASD G 1
BASD HI 2
BASD J 8
BASD K 3 A_TakeInventory("SlideVivifyFlag",1)
BASD G 2
//BASD G 0 A_CheckFloor("ActionLand")
//ActionWait:
//BASD G 2 A_WeaponReady(2)
//BASD G 0 A_CheckFloor("ActionLand")
//loop
ActionLand:
TNT1 A 2 A_WeaponReady(2+8)
BASD FEA 2 A_WeaponReady(2+8)
goto Ready2+2
}
}


actor EmulousDashAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 500
+INVENTORY.IGNORESKILL
}


actor BassSlideStop : PowerSpeed
{
powerup.duration 10
Speed 0.0
+POWERSPEED.NOTRAIL
}

actor BassSlideSlow : PowerSpeed
{
powerup.duration 20
Speed 0.85
+POWERSPEED.NOTRAIL
}

actor BassSlideDelay : Powerup
{
Powerup.Duration -2
+INVENTORY.ALWAYSPICKUP
}
actor BassHasSlid_F : Inventory{}

actor BassSlideRestore_H : BasicWatcher
{
+SERVERSIDEONLY
States
{
Spawn:
TNT1 A 1
TNT1 A 5
Spawn2:
TNT1 A 0 A_JumpIfInTargetInventory("BassSlideDelay",1,2)
TNT1 A 0 A_GiveToTarget("EmulousDashAmmo",5+CallACS("core_checkrune",RUNE_RAGE,2)*5)
TNT1 A 5
TNT1 A 0 A_JumpIfInTargetInventory("EmulousDashAmmo",0,"Death")
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIfInTargetInventory("BassHasSlid_F",1,"Spawn2")
goto Death
Death:
TNT1 A 1 A_TakeFromTarget("BassHasSlid_F",99)
stop
}
}

actor BassSlideCheck_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("BassDashThrust_P")
TNT1 A 0 A_GiveInventory("BassSlideSlow",1)
TNT1 A 0 A_GiveInventory("BassSlideDelay",1)
TNT1 A 0 A_JumpIfInventory("BassHasSlid_F",1,3)
TNT1 A 0 A_GiveInventory("BassHasSlid_F",1)
TNT1 A 0 A_SpawnItemEx("BassSlideRestore_H",0,0,24)
TNT1 A 0 A_JumpIfInventory("EmulousDashAmmo",100,1)
stop
TNT1 A 0 A_TakeInventory("EmulousDashAmmo",50,1)
TNT1 A 0 A_TakeInventory("EmulousDashAmmo",50)
stop
}
}

actor BassDashThrust_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("BasicSlideDashFX_P")
TNT1 A 0 A_JumpIfInventory("EmulousDashAmmo",100,"Thrust")
TNT1 A 0 A_JumpIf(z-floorz==0,"GroundWeak")
TNT1 A 0 A_Recoil(-11.5)
stop
GroundWeak:
TNT1 A 0 ThrustThingZ(0,20,0,0)
TNT1 A 0 A_Recoil(-16)
stop
Thrust:
TNT1 A 0 A_JumpIf(z-floorz==0,"Ground")
TNT1 A 0 A_Recoil(-23)
stop
Ground:
TNT1 A 0 ThrustThingZ(0,28,0,0)
TNT1 A 0 A_Recoil(-28)
stop
}
}
actor Bass_AltKick_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("VivifyDelay7",1)
TNT1 A 0 A_GiveInventory("BasicSlideDashFX_P")
TNT1 A 0 A_TakeInventory("SlideVivifyFlag",1)
TNT1 A 0 A_PlaySound("Bass/SomersaultKick",1,0.75)
TNT1 A 0 A_JumpIf(z-floorz==0,"Ground")
TNT1 A 0 A_SpawnItemEx("BassDashAssKick",cos(-pitch)*16,0,32+sin(-pitch)*24)
TNT1 A 0 A_Recoil(16)
TNT1 A 0 A_JumpIfInventory("AirFraudAchieved",3,3)
TNT1 A 0 A_GiveInventory("AirFraudAchieved",1)
TNT1 A 0 ThrustThingZ(0,36,0,(momz>0))
stop
TNT1 A 0 ThrustThingZ(0,18,0,1)
stop
Ground:
TNT1 A 0 A_SpawnItemEx("BassDashAssKick2",cos(-pitch)*16,0,32+sin(-pitch)*24)
//TNT1 A 0 A_ChangeVelocity(-12,0,8.5,3)
TNT1 A 0 ThrustThingZ(0,34,0,1)
TNT1 A 0 A_Recoil(12)
stop
}
}


actor BassShotB : ProjSpawnFuncActorFast
{
PROJECTILE
damagetype "Bass_Shot"
Obituary "$OB_BASSBUSTER"
+FORCEXYBILLBOARD
+BRIGHT
Damage (50)
Speed 64
radius 10
height 5
scale 2.5
States
{
Spawn:
TNT1 A 1
Q_0D B 1
wait
}
}


actor PainBass_KickHit : Basic_PainFling_H{Args 8,66,0}
actor DeathBass_KickHit : Basic_DeathFling_H{Args 12,80,0}

actor PainBass_Kick2Hit : Basic_PainFling_H{Args 10,88,0}
actor DeathBass_Kick2Hit : Basic_DeathFling_H{Args 16,100,0}

actor BassDashAssKick : BasicImplosion
{
damagetype "Bass_Kick"
Obituary "$OB_BASSKICK"
RenderStyle None
States
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(150+CallACS("core_checkrune",RUNE_SPREAD,2)*300,80,0,0,80)
stop
}
}
actor BassDashAssKick2 : BassDashAssKick{damagetype "Bass_Kick2"}

actor Bass_W_NormalBar : NormalBar {Args 217,95}
actor Bass_W_ScriptBar : ScriptBar {}