actor MachineGunWep_NormalBar : NormalBar{args 229,179}
actor MachineGunWep : BaseMM8BDMWep 
{
Weapon.AmmoUse 1
Weapon.AmmoGive 50
Weapon.SlotNumber 3
Inventory.Pickupmessage "$PU_MACHINEGUN"
Obituary "$OB_MACHINEGUN"
Tag "$TAG_MACHINEGUN"
weapon.ammotype "MachineGunAmmo_V"
inventory.pickupsound "weapon/weaponup"
inventory.icon "MCHGICON"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
SpawnLoop:
MCHG Z 1
loop
Ready:
MCHG A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_MACHINEGUN)
MCHG A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
MCHG A 0 
goto DeselectSwap
Select:
MCHG A 0 
goto SelectSwap
Fire:
MCHG A 0 A_JumpIfNoAmmo("NoAmmo")
MCHG A 0 A_PlaySoundEx("Weapon/CaveStoryShot","Weapon")
MCHG A 0 A_JumpIf(pitch>35 && pitch<=90, "Thrusting")
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-4,4),1,8,0,0,random(-2,2))
goto MachineGunFireEnd
Thrusting:
MCHG A 0 ThrustThingZ(0,27,0,0)
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-4,4),1,8,0,0,random(-2,2))
goto MachineGunFireEnd
MachineGunFireEnd:
MCHG B 2
MCHG CA 1 A_TakeInventory("SpurDoubleCheck", 999)
goto Ready+1
AltFire:
MCHG A 0 A_JumpIfInventory("Vile_ClassAltfire", 1, "ClassAltfire")
MCHG A 0 A_JumpIf(CallACS("Vile_class_altfire"), "ClassAltfire")
MCHG A 1 A_JumpIfInventory("MM8BDMPlayer", 1, 1)
wait
MCHG A 0 A_JumpIfNoAmmo("NoAmmo")
MCHG A 0 A_PlaySoundEx("Weapon/CaveStoryShot","Weapon")
MCHG A 0 A_FireCustomMissile("MachineGunShot",random(-4,4),1,8,0,0,random(-2,2))
MCHG B 2
MCHG CA 1
goto Ready+1
ClassAltfire:
DATK A 0 
goto Super::Altfire
NoAmmo:
MCHG A 0 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor MachineGunShot : BasicProjectile
{
translation "60:60=179:179", "64:67=229:229"
PROJECTILE
Radius 16
Height 16
Obituary "$OB_MACHINEGUN"
damagetype "MachineGun"
scale 2.5
damage (CallACS("vile_cbm_damage",9))
speed 50
States
{
Spawn:
MGUN A 0
TNT1 A 0 A_JumpIf(momz>=45, "Up")
TNT1 A 0 A_JumpIf(momz<=-45, "Down")
goto Default
Default:
MGUN A 10
TNT1 A 0 A_SpawnItemEx("SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0,0,1)
stop
Up:
MGUN H 10
TNT1 H 0 A_SpawnItemEx("SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0,0,1)
stop
Down:
MGUN G 10
TNT1 G 0 A_SpawnItemEx("SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0,0,1)
stop
Death:
TNT1 A 0 A_SpawnItemEx("SpurShotFlashyEndStar", 5, 0, -3, 0, 0, 0,0,1)
stop
}
}

actor MachineGunAmmo_V : Ammo
{
inventory.amount 1
inventory.maxamount 50
+INVENTORY.IGNORESKILL
}
