actor RhythmUpgrade : BaseMM8BDMBusterUpgrade
{
inventory.amount 1
inventory.maxamount 1
Tag "$TAG_RHYTHMBUSTER"
inventory.pickupmessage "$PU_RHYTHMBUSTER"
inventory.icon "RYBSICON"
Inventory.PickupSound "item/1up"
Inventory.RespawnTics 350
scale 2.0
+COUNTITEM
+INVBAR
states
{
SpawnLoop:
RYBS Z 1 
loop
Use:
TRBB I 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("BusterGiven",1)
TRBB I 0 A_GiveInventory("RhythmBuster",1)
TRBB I 0 A_SelectWeapon("RhythmBuster")
stop
}
}

actor RhythmUpgrade_Respawn : 8BDMItemRespawn
{
	translation "192:192=71:71", "198:198=42:42"
	mass 350
}
actor RhythmUpgrade_RespawnShadow : 8BDMItemRespawnShadow
{
	mass 350
	States
	{
	Spawn:
		RYBS Z 0
		goto Super::Spawn
	}
}


actor RhythmBuster_ScriptBar : ScriptBar{}
actor RhythmBuster : BaseMM8BDMWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 3
Weapon.SlotNumber 1
weapon.ammotype "BusterAmmo"
inventory.icon "NULLICON"
Dropitem ""
Inventory.Pickupmessage "$PU_RHYTHMBUSTER"
Obituary "$OB_RHYTHMBUSTER"
Tag "$TAG_RHYTHMBUSTER"
States
{
SpawnLoop:
RYBS Z 1
stop
Ready:
RYBS A 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready2
TakeBusters:
TNT1 Q 0 A_GiveInventory("TakeBuster", 1)
Goto Ready2
Ready2:
RYBS A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_RHYTHMBUSTER)
RYBS A 0 A_TakeInventory("WeaponCharge",999)
ReadyC:
RYBS A 2 A_WeaponReady
Goto Ready2+2
Deselect:
RYBS A 0
goto DeselectSwap
Select:
RYBS A 0
goto SelectSwap
AltFire:
RYBS A 0 A_JumpIfInventory("Vile_ClassAltfire", 1, "ClassAltfire")
RYBS A 0 A_JumpIf(CallACS("Vile_class_altfire"), "ClassAltfire")
RYBS A 1 A_JumpIfInventory("MM8BDMPlayer", 1, "Fire")
wait
ClassAltfire:
RYBS A 0 
goto Super::Altfire
Fire:
RYBS A 0 A_JumpIfNoAmmo("Hold")
RYBS A 0 A_PlaySoundEx("weapon/RhythmBuster","Weapon")
RYBS A 0 A_FireCustomMissile("RhythmShot",0,0,8,0)
RYBS A 1 A_TakeInventory("WeaponCharge",999)
RYBS B 3
RYBS C 2
RYBS A 1
RYBS A 0 A_Refire
goto Ready2+2
Fire2:
RYBS A 0 A_TakeInventory("WeaponCharge",999)
RYBS A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_RHYTHMBUSTER,TCLR_NONE)
RYBS A 0 A_PlaySoundEx("weapon/RhythmBusterMid","Weapon")
RYBS B 0 A_FireCustomMissile("RhythmMidShot",0,0,8,0)
RYBS BC 3
RYBS A 0 A_Refire
goto Ready2+2
Fire3:
RYBS A 0 A_TakeInventory("WeaponCharge",999)
TNT1 A 0 A_StopSoundEx("SoundSlot5")
RYBS A 0 A_PlaySoundEx("weapon/RhythmBusterLarge","Weapon")
RYBS A 0 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_RHYTHMBUSTER,TCLR_NONE)
RYBS A 0 A_FireCustomMissile("RhythmCShot",0,0,8,0)
RYB0 ABCDEF 2
RYBS A 2
RYBS A 0 A_Refire
goto Ready2+2
Hold:
//BUST B 0 A_JumpIfInventory("WeaponCharge",34,"Charge2Start")
RYBS A 0 A_JumpIfInventory("WeaponCharge",9,"Charge")
RYBS A 1 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
RYBS A 0 A_Refire
Goto Ready2+2
Charge:
//BUST B 0 A_JumpIfInventory("WeaponCharge",34,"Charge2Start")
RYBS A 0 A_JumpIfInventory("WeaponCharge",10,"Charge1")
RYBS A 0 A_PlaySoundEx("weapon/RhythmCharge","Weapon")
Goto Charge1
Charge1:
RYBS D 0 A_JumpIfInventory("WeaponCharge",22,"Charge2Start")
RYBS D 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_RHYTHMBUSTERCHG1,TCLR_CHARGE1)
RYBS D 0 A_Refire("Charge1.a")
Goto Fire2
Charge1.a:
RYBS A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_RHYTHMBUSTER,TCLR_NONE)
RYBS A 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
RYBS A 0 A_Refire("Charge")
Goto Fire2
BotFire:
RYBS A 0 A_Jump(16, "Fire3")
RYBS B 0 A_Refire
Goto Fire3
Charge2Start:
RYBS A 0 A_GunFlash("Sound.BusterCharge", GFF_NOEXTCHANGE)
Goto Charge2
Charge2:
RYBS E 1 ACS_NamedExecuteWithResult("core_chargecolor",COLOR_RHYTHMBUSTERCHG2,TCLR_CHARGE2)
RYBS F 0 A_Refire("Charge2.a")
Goto Fire3
Charge2.a:
RYBS F 1 ACS_NamedExecuteWithResult("core_chargecolor",COLOR_RHYTHMBUSTERCHG3,TCLR_CHARGE3)
RYBS F 0 A_Refire("Charge2.b")
Goto Fire3
Charge2.b:
RYBS A 1 ACS_NamedExecuteWithResult("core_chargecolor",COLOR_RHYTHMBUSTER,TCLR_NONE)
RYBS A 0 A_JumpIfInventory("IsBot", 1, "BotFire")
RYBS A 0 A_JumpIfInventory("WeaponCharge", 22, 2)
RYBS A 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
RYBS A 0 A_Refire("Charge2")
Goto Fire3
Sound.BusterCharge:
		TNT1 A 12 A_PlaySoundEx("weapon/RhythmCharged","Weapon",0)
		TNT1 A 1 A_JumpIfInventory("WeaponCharge",1,"Sound.BusterCharge")
        stop
}
}

actor RhythmShot : MegaShot
{
+BRIGHT
damagetype "Buster"
Obituary "$OB_RHYTHMBUSTER"
Speed 42
+RIPPER
var int user_PierceRipper;
Damage (CallACS("vile_cbm_damage",9))
radius 10
height 8
States
{
Spawn:
TNT1 A 2
RYBS G 2 A_ScaleVelocity(1.05)
wait
}
}

actor RhythmMidShot : BasicProjectile
{
+BRIGHT
damagetype "ChargeBuster"
Obituary "$OB_RHYTHMBUSTER"
Speed 32
var int user_PierceRipper;
Damage (CallACS("vile_cbm_damage",12))
+RIPPER
radius 20
height 20
States
{
Spawn:
TNT1 A 2
RYBS HI 2 A_ScaleVelocity(1.05)
Goto Spawn+1
}
}


actor RhythmCShot : BasicProjectile
{
+FORCEXYBILLBOARD
+BRIGHT
+RIPPER
damagetype "ChargeBuster"
Obituary "$OB_RHYTHMBUSTER"
Speed 54
Damage (CallACS("vile_cbm_damage",40))
radius 28
height 24
scale 3.0
var int user_PierceRipper;
States
{
Spawn:
RYBS IJK 2 A_ScaleVelocity(1.1)
Loop
}
}