actor ScrapCannonWep_NormalBar : NormalBar { args 92, 47 }
actor ScrapCannonWep : BaseMM8BDMWep
{
Weapon.AmmoUse 3
Weapon.AmmoGive 27
Weapon.SlotNumber 5
Inventory.Pickupmessage "$PU_SCRAPCANNON"
Obituary "$OB_SCRAPCANNON"
Tag "$TAG_SCRAPCANNON" 
inventory.icon "SCNNICON" 
Weapon.AmmoType "ScrapCannonAmmo"
States
{
SpawnLoop:
SCNN Z -1 
loop
Ready: 
SCNN A 0 ACS_NamedExecuteWithResult("core_weaponcolor",CLR_SCRAPCANNON)
SCNN A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
SCNN A 0
goto DeselectSwap
Select:
SCNN A 0
goto SelectSwap
Fire:
SCNN A 0 A_JumpIfNoAmmo("NoAmmo")
SCNN A 0 A_PlaySoundEX("weapons/mmqg/scrapcannonfire","Weapon")
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(5,4),1,8,0,0,random(5,-5))
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(4,3),0,8,0,0,random(5,-5))
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(3,2),0,8,0,0,random(5,-5))
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(2,1),0,8,0,0,random(5,-5))
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(-1,-2),0,8,0,0,random(5,-5))
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(-2,-3),0,8,0,0,random(5,-5))
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(-3,-4),0,8,0,0,random(5,-5))
SCNN A 0 A_FireCustomMissile("ScrapBurst",random(-4,-5),0,8,0,0,random(5,-5))
SCNN BCDEFG 3
SCNN A 9
SCNN A 0 A_Refire
Goto Ready+1
NoAmmo:
SCNN A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor ScrapCannonAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 27
+INVENTORY.IGNORESKILL
}

actor ScrapBurst : BasicProjectile
{
Height 9
Radius 9
Obituary "$OB_SCRAPCANNON"
damagetype "ScrapCannon"
Bouncetype Classic
-NoGravity
+BOUNCEONWALLS
bouncecount 2
bouncefactor 0.85
wallbouncefactor 0.75
BOUNCESOUND "weapon/freezecrackerhit"
+FORCEYBILLBOARD 
damage (CallACS("mmqg_cbm_damage",8))
speed 30
States
{
Spawn:
SCNN B 0
SCNN B 0 ThrustThingZ(0, random(22,24), 0, 1)
SCNN A 0 A_Jump(256,"FRa","FRb","FRc","FRd")
FRa:
SCNN K 16
SCNN K 0 A_ChangeFlag("NOGRAVITY",0) 
SCNN K 0 A_ScaleVelocity(0.75)
SCNN K 1
wait
FRb:
SCNN L 16
SCNN L 0 A_ChangeFlag("NOGRAVITY",0) 
SCNN L 0 A_ScaleVelocity(0.75)
SCNN L 1
wait
FRc:
SCNN M 16 
SCNN M 0 A_ChangeFlag("NOGRAVITY",0) 
SCNN M 0 A_ScaleVelocity(0.75)
SCNN M 1
wait
FRd:
SCNN N 16
SCNN N 0 A_ChangeFlag("NOGRAVITY",0) 
SCNN N 0 A_ScaleVelocity(0.75)
SCNN N 1
wait
Xdeath:
Crash:
SCNN B 0
stop
Death:
SCNN "#" 0
SCNN "#" 5 A_ChangeVelocity(0,0,random(6,8),CVF_RELATIVE)
SCNN "#" 1 A_FadeOut(0.99)
SCNN "#" 1 A_FadeIn(0.99)
SCNN "#" 1 A_FadeOut(0.99)
SCNN "#" 1 A_FadeIn(0.99)
SCNN "#" 1 A_FadeOut(0.99)
SCNN "#" 1 A_FadeIn(0.99)
SCNN "#" 1 A_FadeOut(0.99)
SCNN "#" 1 A_FadeIn(0.99)
SCNN "#" 1 A_FadeOut(0.99)
SCNN "#" 1 A_FadeIn(0.99)
SCNN "#" 1 A_FadeOut(0.99)
stop
}
}