actor MachineGunWep : Weapon {}

actor MachineGunWepSH : BaseMM8BDMWep replaces MachineGunWep
{
Weapon.AmmoUse 1
Weapon.AmmoGive 50
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_MACHINEGUN"
Obituary "$OB_MACHINEGUN"
Tag "$TAG_MACHINEGUN"
weapon.ammotype "MachineGunAmmo"
inventory.pickupsound "weapon/weaponup"
inventory.icon "X601ICON"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
+INVENTORY.RESTRICTABSOLUTELY Inventory.RestrictedTo megamans
States
{
Spawn:
W601 B 1 A_SpawnItemEx("MachineGunMapMarker")
loop
Ready:
Y601 A 0 ACS_ExecuteAlways(998,0,9601)
Y601 A 1 A_WeaponReady
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
Y601 A 1
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
Y601 A 1
Loop
Fire:
Y601 A 0 A_JumpIfNoAmmo("NoAmmo")
Y601 A 0 A_PlaySoundEx("CaveStory/ProjectilePure","Weapon")
Y601 A 0 A_JumpIf(pitch>15 && pitch<=90, "Thrusting")
Y601 A 0 A_FireCustomMissile("W_MachineGunShot",random(-2,2),1,8,0)
goto MachineGunFireEnd
Thrusting:
Y601 A 0 ThrustThingZ(0,27,0,0)
Y601 A 0 A_FireCustomMissile("W_MachineGunShot",random(-2,2),1,8,0)
goto MachineGunFireEnd
MachineGunFireEnd:
Y601 B 2
Y601 CA 1 A_TakeInventory("SpurDoubleCheck", 999)
goto Ready+1
AltFire:
Y601 A 0 A_JumpIfNoAmmo("NoAmmo")
Y601 A 0 A_PlaySoundEx("CaveStory/ProjectilePure","Weapon")
Y601 A 0 A_FireCustomMissile("W_MachineGunShot",random(-2,2),1,8,0)
Y601 B 2
Y601 CA 1
goto Ready+1
NoAmmo:
Y601 A 0 ACS_Execute(979,0)
Goto Ready+1
}
}

actor W_MachineGunShot
{
translation "206:206=179:179", "64:67=229:229"
PROJECTILE
Radius 16
Height 16
Obituary "$OB_MACHINEGUN"
damagetype "W_MachineGun"
scale 2.5
damage (14)
speed 60
States
{
Spawn:
MGUN A 26
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0,0,1)
stop
Death:
TNT1 A 0 A_SpawnItemEx("W_SpurShotFlashyEnd", 5, 0, -3, 0, 0, 0,0,1)
stop
}
}

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

actor MachineGunMapMarker : MapMarker
{
height 0
radius 0
+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
-SOLID
+NOTIMEFREEZE
States
{
Spawn:
W601 B 2
stop
}
}