//This is a copy from v6b but edited so the buster lights are different color

actor ArrowBuster_ScriptBar : ScriptBar {}

actor ArrowBuster : LaserBuster
{
Inventory.Pickupmessage "$PU_ARROWBUSTER"
Obituary "$OB_ARROWBUSTER"
Tag "$TAG_ARROWBUSTER"
States
{
SpawnLoop:
WEA4 L 1
stop
Ready:
CHBU Q 0 A_JumpIfInventory("BusterGiven",1,"TakeBusters")
Goto Ready2
TakeBusters:
CHBU Q 0 A_GiveInventory("TakeBuster", 1)
Goto Ready2
Ready2:
CHBU Q 0 ACS_NamedExecuteWithResult("core_weaponcolor",CLR_MEGABUSTER)
CHBU Q 0 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGABUSTER,TCLR_NONE)
CHBU Q 0 A_TakeInventory("WeaponCharge",999)
CHBU Q 2 A_WeaponReady
Goto Ready2+2
Deselect:
CHBU Q 0
goto DeselectSwap
Select:
CHBU Q 0
goto SelectSwap
Fire:
Altfire:
CHBU Q 0 A_JumpIfNoAmmo("Hold")
CHBU Q 0 A_PlaySoundEx("weapons/busters/arrowbusterfire","Weapon")
CHBU Q 0 A_FireCustomMissile("MegaShot",0,0,8,0)
CHBU Q 1 A_TakeInventory("WeaponCharge",999)
CHBU RS 3
CHBU Q 1
CHBU Q 0 A_Refire
goto Ready2+2
Fire2:
CHBU Q 0 A_TakeInventory("WeaponCharge",999)
CHBU R 0 A_PlaySoundEx("weapons/busters/arrowbusterfire2","Weapon")
CHBU Q 1 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGABUSTER,TCLR_NONE)
CHBU R 0 A_FireCustomMissile("MidShot",0,0,8,0)
CHBU RS 3
CHBU Q 0 A_Refire
goto Ready2+2
Fire3:
CHBU Q 0 A_TakeInventory("WeaponCharge",999)
CHBU Q 0 A_PlaySoundEx("weapons/busters/arrowbusterfire3","Weapon")
CHBU Q 0 
CHBU R 0 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGABUSTER,TCLR_NONE)
CHBU R 0 A_FireCustomMissile("ArrowShot",0,0,8,0)
CHBU RS 3 
CHBU R 9
CHBU Q 0 A_Refire
goto Ready2+2
BotFire:
CHBU Q 0 A_Jump(16, "Fire3")
CHBU T 0 A_Refire("Charge2")
Goto Fire3
Hold:
CHBU Q 0 A_JumpIfInventory("WeaponCharge",18,"Charge")
CHBU Q 1 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
CHBU Q 0 A_Refire
Goto Ready2+2
Charge:
CHBU Q 0 A_JumpIfInventory("WeaponCharge",19,"Charge1")
CHBU Q 0 A_PlaySoundEx("weapons/busters/laserbustercharge","Weapon")
Goto Charge1
Charge1:
CHBU Q 0 A_JumpIfInventory("WeaponCharge",35,"Charge2Start")
CHBU T 1 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGACHARGE1,TCLR_CHARGE1)
CHBU T 0 A_Refire("Charge1.a")
Goto Fire2
Charge1.a:
CHBU Q 1 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGABUSTER,TCLR_NONE)
CHBU Q 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
CHBU T 0 A_Refire("Charge1")
Goto Fire2
Charge2Start:
CHBU Q 0 A_GunFlash("Sound.BusterCharge", GFF_NOEXTCHANGE)
Goto Charge2
Charge2:
CHBU Q 1 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGACHARGE2,TCLR_CHARGE2)
CHBU T 0 A_Refire("Charge2.a")
Goto Fire3
Charge2.a:
CHBU U 1 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGACHARGE3,TCLR_CHARGE3)
CHBU T 0 A_Refire("Charge2.b")
Goto Fire3
Charge2.b:
CHBU V 1 ACS_NamedExecuteWithResult("core_chargecolor",CLR_MEGABUSTER,TCLR_NONE)
CHBU Q 0 A_JumpIfInventory("IsBot", 1, "BotFire")
CHBU Q 0 A_JumpIfInventory("WeaponCharge", 35, 2)
CHBU Q 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
CHBU Q 0 A_Refire("Charge2")
Goto Fire3
}
}

actor MidShot : BasicProjectile
{
+BRIGHT
damagetype "ChargeBuster"
Obituary "$OB_MEGABUSTER"
Speed 26
Damage (15)
radius 20
height 20
States
{
Spawn:
TNT1 A 2
MBUS AB 2
Goto Spawn+1
}
}


actor ArrowShot : BasicProjectile
{
+FORCEXYBILLBOARD
+BRIGHT
damagetype "ArrowBuster"
Obituary "$OB_ARROWBUSTER"
Speed 54
Damage (20)
radius 20
height 16
States
{
Spawn:
ARRS ABACAD 1
Loop
Death:
ARRS F 0 A_PlaySoundEx("weapons/busters/arrowbustersplit", "Weapon")
ARRS F 0 A_SpawnItemEx ("ArrowFrag1",0,0,0,54,0,0,165,0,0)
ARRS F 0 A_SpawnItemEx ("ArrowFrag1",0,0,0,54,0,0,150,0,0)
ARRS F 0 A_SpawnItemEx ("ArrowFrag1",0,0,0,54,0,0,135,0,0)
ARRS F 0 A_SpawnItemEx ("ArrowFrag1",0,0,0,54,0,0,-135,0,0)
ARRS F 0 A_SpawnItemEx ("ArrowFrag1",0,0,0,54,0,0,-150,0,0)
ARRS F 0 A_SpawnItemEx ("ArrowFrag1",0,0,0,54,0,0,-165,0,0)
stop
}
}

actor ArrowFrag1 : BasicProjectile
{
+NOINTERACTION
+FORCEXYBILLBOARD
+BRIGHT
damagetype "ArrowBuster"
Obituary "$OB_ARROWBUSTER"
Damage (7)
radius 5
height 5
scale 1.5
Speed 26
States
{
Spawn:
ARRS G 1
ARRS G 1
ARRS G 0 A_Stop
ARRS G 0 A_ChangeFlag("NOINTERACTION", 0)
ARRS GGGG 1 A_SetScale(scalex + 0.28, scaley + 0.28)
ARRS G 0 A_SpawnItemEx("ArrowFrag2",0,0,0,cos(-pitch)*60,0,sin(-pitch)*60,180,0,0)
Stop
Death:
TNT1 A 0 
TNT1 A 0
stop
}
}

actor ArrowFrag2 : ArrowFrag1
{
-NOINTERACTION
-NOCLIP
States
{
Spawn:
ARRS G 3
ARRS H 1
Goto Spawn+1
}
}
