actor MFist : Weapon
{
  Game Doom
  Weapon.SelectionOrder 3700
  Weapon.Kickback 100
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +INVENTORY.UNDROPPABLE
  Weapon.PreferredSkin "FistMarine"
  Obituary "$OB_MPFIST" // "%o chewed on %k's fist."
  States
  {
  Ready:
    PUNG A 1 A_WeaponReady
    loop
  Deselect:
    PUNG A 1 A_Lower
    loop
  Select: 
    PUNG A 1 A_Raise
    loop
  Fire:
    PUNG B 4
	PUNG A 0 A_JumpIfInventory("PowerStrength",1,5)
    PUNG C 4 A_CustomPunch (3,0,0,"MFistPuff",60)
    PUNG D 5
    PUNG C 4
    PUNG B 5 A_ReFire
    goto Ready
	PUNG C 4 A_CustomPunch (25,0,0,"MFistPuff",60)
	PUNG D 5
    PUNG C 4
    PUNG B 5 A_ReFire
    goto Ready
  Spawn:
    TNT1 A 1 Thing_Remove(0)
    Stop
  }
}

actor MFists : Fist 
{
  +WEAPON.WIMPY_WEAPON
  +WEAPON.MELEEWEAPON
  +INVENTORY.UNDROPPABLE
  Weapon.SelectionOrder 2200
  attacksound "marine/fists"
  Weapon.PreferredSkin "FistMarine"
  Obituary "$OB_MPFIST" // "%o chewed on %k's fist."
  
  States
  {
  Ready:
    MPNG A 1 A_WeaponReady
    loop
  Deselect:
    MPNG A 1 A_Lower
    loop
  Select: 
    MPNG A 1 A_Raise
    loop
  Fire:
    MPNG A 0 A_JumpIfInventory("MLeftFist",1,"Right")
	MPNG BCD 1
	MPNG A 0 A_JumpIfInventory("PowerStrength",1,6)
	MPNG E 1 A_CustomPunch (3,0,0,"MFistPuff",60)
	MPNG FGH 2
	MPNG A 2 A_GiveInventory("MLeftFist",1)
	Goto Ready
	MPNG E 1 A_CustomPunch (23,0,0,"MFistPuff",60)
	MPNG FGH 2
	MPNG A 2 A_GiveInventory("MLeftFist",1)
	Goto Ready
  Right:	
	MPNG IJK 1
	MPNG A 0 A_JumpIfInventory("PowerStrength",1,6)
	MPNG L 1 A_CustomPunch (3,0,0,"MFistPuff",60)
	MPNG MNO 2
	MPNG A 2 A_TakeInventory("MLeftFist",1)
	Goto Ready
	MPNG L 1 A_CustomPunch (23,0,0,"MFistPuff",60)
	MPNG MNO 2
	MPNG A 2 A_TakeInventory("MLeftFist",1)
	Goto Ready
  Spawn:
    TNT1 A 1 Thing_Remove(0)
    Stop
  }
}

Actor MFistPuff
{
+NOBLOCKMAP
+NOGRAVITY
+PUFFONACTORS
-ALLOWPARTICLES
DamageType "MarineDamage" 
attacksound "marine/fistswall"
}


ACTOR MLeftFist : Inventory
 {
  Inventory.Amount 0
  Inventory.MaxAmount 1
  States
   {
    Spawn:
    TNT1 A -1
    Loop 
   }
 }

// ChainSaw

actor MChainsaw : Chainsaw replaces Chainsaw
{
  Weapon.SelectionOrder 3700
  Weapon.PreferredSkin "ChainSawMarine"
  States
  {
  Fire:
    SAWG AB 4 A_Saw ("weapons/sawfull","weapons/sawhit",2,"MBulletPuff")
    SAWG B 0 A_ReFire
    goto Ready
  Spawn:
    CSAW A -1
    stop
  }
}

// Pistol

actor MPistol : Pistol replaces Pistol
{
  Weapon.AmmoUse2 1
  Weapon.AmmoType "MClip"
  Weapon.AmmoType2 "MClip"
  Weapon.PreferredSkin "PistolMarine"
  States
  {
  Fire:
    PISG A 4
    PISG B 0 A_FireBullets (3.2, 1.2, 1, 7, "MBulletPuff")
    PISG B 5 A_GunFlash
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
  AltFire:
    PISG A 1
    PISG A 1 A_JumpIfInventory ("RUnlock1",1,2)
    PISG A 1
    Goto Ready
    PISG A 3
    PISG B 0 A_FireBullets (5.6, 2.4, -1, 7, "MBulletPuff")
    PISG B 3 A_GunFlash
    PISG C 2
    PISG B 3 A_FireBullets (5.6, 2.4, -1, 7, "MBulletPuff")
    PISG C 2
    PISG B 5
    Goto Ready
  Flash:
    PISF A 5 Bright A_Light1
    PISF A 0 A_Light0
    Stop
  AltFlash:
    PISF A 3 Bright A_Light1
    TNT1 A 2 A_Light0
    PISF A 3 Bright A_Light1
    TNT1 A 0 A_Light0
    Stop
  }
}

// Advanced Pistol

actor ADMPistol : Weapon 
{
  Weapon.Kickback 100
  Weapon.SelectionOrder 1900
  Weapon.AmmoUse 1
  Weapon.AmmoUse2 1
  Weapon.AmmoGive 8
  Weapon.AmmoType "MClip"
  Weapon.AmmoType2 "MClip"
  Obituary "$OB_MPPISTOL" // 
  attacksound "weapons/adpistol"
  Weapon.PreferredSkin "PistolMarine"
  +WEAPON.WIMPY_WEAPON
  +INVENTORY.UNDROPPABLE
  Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED" // 
  States
  {
  Ready:
    ADPS A 1 A_WeaponReady
    Loop
  Deselect:
    ADPS A 1 A_Lower
    Loop
  Select:
    ADPS A 1 A_Raise
    Loop
  Fire:
    ADPS B 2 A_GunFlash
    ADPF A 4 Bright A_FireBullets (1.0,0.6, 1, 10, "MBulletPuff")
    ADPS CD 3 
    ADPS C 3 A_ReFire
    ADPS B 3
    Goto Ready
  AltFire:
    ADPS A 1
    ADPS A 1 A_JumpIfInventory ("RUnlock4",1,2)
    ADPS A 1
    Goto Ready
    ADPS B 3 A_GunFlash
	ADPF A 2 Bright A_FireBullets (5.0,3.0, -1, 10, "MBulletPuff")
	ADPF A 0 A_JumpIfInventory ("MClip",1,2)
	ADPF A 0 A_Jump (256, 7)
	ADPS B 1
	ADPF A 2 Bright A_FireBullets (5.0,3.0, -1, 10, "MBulletPuff")
	ADPF A 0 A_JumpIfInventory ("MClip",1,2)
	ADPF A 0 A_Jump (256, 3)
	ADPS B 1
	ADPF A 2 Bright A_FireBullets (5.0,3.0, -1, 10, "MBulletPuff")
	ADPS C 4 
	ADPS DCB 4
	ADPS A 0 A_CheckReload
    Goto Ready
  Flash:
	TNT1 A 2 A_Light0
	TNT1 A 4 BRIGHT A_Light1
	TNT1 A 3 BRIGHT A_Light2
	TNT1 A 0 A_Light0
	Stop
  AltFlash:
	TNT1 A 3 A_Light0
	TNT1 A 2 BRIGHT A_Light1
	TNT1 A 1 BRIGHT A_Light2
	TNT1 A 2 BRIGHT A_Light1
	TNT1 A 1 BRIGHT A_Light2
	TNT1 A 2 BRIGHT A_Light1
	TNT1 A 3 BRIGHT A_Light2
	TNT1 A 0 A_Light0
	Stop
  Spawn:
    TNT1 A 1 Thing_Remove(0)
    Stop
  }
}

// Advanced Shotgun (Assault Shotgun)

ACTOR AssaultShotgun : Shotgun
{
	Inventory.PickupMessage "AssaultShotgun"
	Weapon.SelectionOrder 40
	Weapon.AmmoType1 "MShell"
	Weapon.AmmoType2 "MShell"
	Weapon.AmmoGive1 8
	Weapon.AmmoUse1 1
	Weapon.AmmoUse2 1
	Weapon.Kickback 120
	AttackSound "weapons/Ashotgun/fire"
	Weapon.PreferredSkin "ShotGunMarine"
	+INVENTORY.UNDROPPABLE
	States
	{
	Ready:
		D3SG A 1 A_WeaponReady
		loop
	Deselect:
		D3SG A 1 A_Lower
		loop
	Select:
		D3SG A 1 A_Raise
		Loop
	Fire:
		D3SG A 0 A_FireBullets(3.6, 2.6, 7, 6, "MBulletPuff", 1)
		D3SG A 5 A_GunFlash
		D3SG B 4 A_PlaySound("weapons/Ashotgun/cock/back")
		D3SG C 6
		D3SG B 4 A_PlaySound("weapons/Ashotgun/cock/forward")
		D3SG A 6
		Goto Ready
	AltFire:
		D3SG A 0 A_FireBullets(9.2, 5.1, 9, 6, "MBulletPuff", 1)
		D3SG A 9 A_GunFlash
		D3SG A 0 A_CheckReload
		D3SG A 0 A_FireBullets(9.2, 5.1, 8, 6, "MBulletPuff", 1)
		D3SG A 10 A_GunFlash
		D3SG A 0 A_CheckReload
		D3SG A 0 A_JumpIfInventory ("MShell",2,2)
		D3SG A 0 A_Jump (256,5)
		D3SG B 4 A_PlaySound("weapons/Ashotgun/cock/back")
		D3SG C 6
		D3SG B 4 A_PlaySound("weapons/Ashotgun/cock/forward")
		D3SG A 6
		D3SG B 4 A_PlaySound("weapons/Ashotgun/cock/back")
		D3SG C 6
		D3SG B 4 A_PlaySound("weapons/Ashotgun/cock/forward")
		D3SG A 6
		Goto Ready
	Flash:
		D3SF A 3 BRIGHT A_Light1
		D3SF B 2 BRIGHT A_Light2
		D3SF B 0 A_Light0
		Stop
	AltFlash:
		D3SF A 3 BRIGHT A_Light1
		D3SF B 2 BRIGHT A_Light2
		D3SF B 0 A_Light0
		Stop
  Spawn:
    TNT1 A 1 Thing_Remove(0)
    Stop
	}
}


// Shotgun

actor MShotgun : Shotgun replaces Shotgun
{
  Weapon.AmmoType "MShell"
  Weapon.AmmoUse2 0
  attacksound ""
  Weapon.PreferredSkin "ShotGunMarine"
  States
  {
  Fire:
    SHTG A 2
    SHTG A 0 A_FireBullets (5.6, 1.8, 8, 5, "MBulletPuff")
    SHTG A 0 A_GunFlash
    SHTG A 10 A_PlaySound ("weapons/shotgf", CHAN_WEAPON)
    SHTG BCDEFG 2
    SHTG H 3
    SHTG GFEDCB 2
    SHTG A 3 A_ReFire
    Goto Ready
  Flash:
    SHTF A 4 Bright A_Light1
    SHTF B 3 Bright A_Light2
    SHTF A 0 A_Light0
    Stop
  AltFlash:
    SHTG B 2
    SHTG C 2
    SHTG D 2
    SHTG E 10
    SHTG D 3
    SHTG C 3
    SHTG B 3
    SHTG A 3
    TNT1 A 0
    Stop
  AltFire:
    SHTG A 1
    SHTG A 1 A_JumpIfInventory ("RUnlock2",1,2)
    SHTG A 1
    Goto Ready
    TNT1 A 4 A_Gunflash
    TNT1 A 0 A_JumpIfInventory("PowerStrength",1,8)
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (4,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (27,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
  AltHold:
    TNT1 A 4 A_Gunflash
    TNT1 A 0 A_JumpIfInventory("PowerStrength",1,8)
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (4,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (27,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
  }
}

// SuperShotGun

actor MSuperShotgun : SuperShotgun replaces SuperShotgun
{
  Weapon.AmmoType "MShell"
  Weapon.AmmoUse2 0
  attacksound ""
  Weapon.PreferredSkin "SSGMarine"
  States
  {
  Fire:
    SHT2 A 3
	SHT2 A 0 A_FireBullets (11.2, 7.1, 20, 5, "MBulletPuff")
    SHT2 A 0 A_GunFlash
    SHT2 A 7 A_PlaySound ("weapons/sshotf", CHAN_WEAPON)
    SHT2 B 0 A_CheckReload
	SHT2 BCDEF 3
    SHT2 F 0 A_OpenShotgun2
    SHT2 HUVKL 3
    SHT2 L 0 A_LoadShotgun2
    SHT2 OPQR 3
	SHT2 R 0 A_CloseShotgun2 
    SHT2 RS 3
    SHT2 A 3
    SHT2 A 5 A_ReFire
    Goto Ready
  Flash:
    SHT2 I 4 Bright A_Light1
    SHT2 J 3 Bright A_Light2
    SHT2 I 0 A_Light0
    Stop
  AltFlash:
    SHT2 B 2
    SHT2 C 2
    SHT2 D 2
    SHT2 E 10
    SHT2 D 3
    SHT2 C 3
    SHT2 B 3
    SHT2 A 3
    TNT1 A 0
    Stop
  AltFire:
    SHT2 A 1
    SHT2 A 1 A_JumpIfInventory ("RUnlock2",1,2)
    SHT2 A 1
    Goto Ready
    TNT1 A 4 A_Gunflash
    TNT1 A 0 A_JumpIfInventory("PowerStrength",1,8)
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (4,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (27,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
  AltHold:
    TNT1 A 4 A_Gunflash
    TNT1 A 0 A_JumpIfInventory("PowerStrength",1,8)
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (4,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
    MPNG JK 2
    MPNG L 0 A_PlaySound ("marine/fists", CHAN_WEAPON)
    MPNG L 2 A_CustomPunch (27,0,0,"MFistPuff",60)
    MPNG MN 6
    TNT1 A 4 A_ReFire
    Goto Ready
  }
}

// AssaultRifle 

actor AssaultRifle : Weapon 
{
   Weapon.SelectionOrder 600
   Weapon.AmmoUse 1
   Weapon.AmmoUse2 1 
   Weapon.AmmoGive 30
   Weapon.AmmoType "MClip"
   Weapon.AmmoType2 "MClip"
   attacksound "weapon/msmgfire"
   Inventory.PickupMessage "$GOTCHAINGUN" // "You got the Assault Rifle"
   Obituary "$OB_MPCHAINGUN" // "%o was peppered by %k's Assault Rifle."
   +INVENTORY.UNDROPPABLE
   States
   {
   Ready:
     MMCG A 1 A_WeaponReady
     Loop
   Deselect:
     MMCG A 1 A_Lower
     Loop
   Select:
     MMCG A 1 A_Raise
     Loop
   Fire:
	 MMCG B 1 A_GunFlash
	 MMCG C 2 bright A_FireBullets (5.7, 1.6, 1, 9, "MBulletPuff")
	 MMCG A 0 A_ReFire
	 MMCG DEB 2 bright
	 Goto Ready
   AltFire:
	 MMCG A 1
	 MMCG A 1 A_JumpIfInventory ("RUnlock4",1,2)
	 MMCG A 1
	 Goto Ready
	 MMCG B 1 A_GunFlash
	 MMCG C 2 bright A_FireBullets (2, 1, -1, 9, "MBulletPuff")
	 MMCG C 0 A_JumpIfInventory ("MClip",1,2)
	 CHGG B 0 A_Jump (256, 11)
	 MMCG B 1 A_GunFlash
	 MMCG C 2 bright A_FireBullets (2, 1, -1, 9, "MBulletPuff")
	 MMCG C 0 A_JumpIfInventory ("MClip",1,2)
	 CHGG B 0 A_Jump (256, 7)
	 MMCG B 1 A_GunFlash
	 MMCG C 2 bright A_FireBullets (2, 1, -1, 9, "MBulletPuff")
	 MMCG C 0 A_JumpIfInventory ("MClip",1,2)
	 CHGG B 0 A_Jump (256, 3)
	 MMCG B 1 A_GunFlash
	 MMCG C 2 bright A_FireBullets (2, 1, -1, 9, "MBulletPuff")
	 MMCG DE 3 bright
	 MMCG B 4
	 MMCG A 4
	 MMCG A 0 A_CheckReload
	 Goto Ready
  Flash:
	TNT1 A 1 BRIGHT A_Light1
	TNT1 A 2 BRIGHT A_Light2
	TNT1 A 2 BRIGHT A_Light1
	TNT1 A 0 A_Light0
	Stop
  AltFlash:
	TNT1 A 1 BRIGHT A_Light1
	TNT1 A 2 BRIGHT A_Light2
	TNT1 A 3 BRIGHT A_Light1
	TNT1 A 0 A_Light0
	Stop
  Spawn:
    TNT1 A 1 Thing_Remove(0)
    Stop
   }
}

// ChainGun

actor MChaingun : Chaingun replaces Chaingun
{
   Weapon.AmmoType "MClip"
   Weapon.AmmoUse2 1 
   Weapon.AmmoType2 "MClip"
   Weapon.PreferredSkin "ChainGunMarine"
   Weapon.AmmoGive 40
   States
   {
   Deselect: 
	 CHGG A 0 A_TakeInventory("Mspinch",5)
	 CHGG A 1 A_Lower
	 Loop
   Fire:
	 CHGG A 0 A_Gunflash
	 CHGG A 2 
	 CHGG B 2 A_FireBullets (5.2, 1.4, 1, 6, "MBulletPuff")
	 CHGG C 2
	 CHGG D 2 A_FireBullets (5.2, 1.4, 1, 6, "MBulletPuff")
	 CHGG A 0 A_ReFire
	 CHGG ABCD 2
	 CHGG ABCD 3 A_ReFire
	 CHGG ABCD 4 A_ReFire
         Goto Ready
   AltFire:
	 CHGG A 0 A_JumpIfInventory ("Mspinch3",0,14)
	 CHGG A 0 A_JumpIfInventory ("Mspinch3",4,8)
	 CHGG A 0 A_JumpIfInventory ("Mspinch3",3,7)
	 CHGG A 0 A_JumpIfInventory ("Mspinch3",2,4)
	 CHGG A 0 A_JumpIfInventory ("Mspinch3",1,3)
	 CHGG AB 3
	 CHGG CD 3
	 CHGG AB 2
	 CHGG CD 1
	 CHGG A 0 A_GiveInventory("Mspinch3",5)
	 CHGG A 0 A_Gunflash
	 CHGG A 1 
	 CHGG B 1 A_FireBullets (8.2, 3.2, -1, 6, "MBulletPuff")
	 CHGG C 1 
	 CHGG D 1 A_FireBullets (8.2, 3.2, -1, 6, "MBulletPuff")
	 CHGG A 0 A_ReFire
	 CHGG AB 1
	 CHGG CD 1 A_ReFire
	 CHGG AB 2 A_ReFire
	 CHGG A 0 A_TakeInventory("Mspinch3",1)
	 CHGG CD 2 A_ReFire
	 CHGG A 0 A_TakeInventory("Mspinch3",1)
	 CHGG AB 3 A_ReFire
	 CHGG A 0 A_TakeInventory("Mspinch3",1)
	 CHGG CD 3 A_ReFire
	 CHGG A 0 A_TakeInventory("Mspinch3",1)
	 CHGG AB 4 A_ReFire
	 CHGG A 0 A_TakeInventory("Mspinch3",5)
	 CHGG CD 4 A_ReFire
         Goto Ready
   Flash: 
	 CHGF A 2 bright A_Light1
	 TNT1 A 2 A_Light2
	 CHGF B 2 bright A_Light1
	 TNT1 A 2 A_Light2
	 TNT1 A 0 A_Light0
	 Stop
   AltFlash: 
	 CHGF A 1 bright A_Light1
	 CHGF A 1 bright A_Light2
	 CHGF B 1 bright A_Light1
	 TNT1 A 1 A_Light2
	 TNT1 A 0 A_Light0
	 Stop
   }
}

// Rocket Luncher

actor MRocketLauncher : RocketLauncher replaces RocketLauncher
{
  Weapon.Selectionorder 2400
  Weapon.AmmoType "MRocketAmmo"
  Weapon.AmmoType2 "MRocketAmmo"
  Weapon.AmmoUse2 1
  Weapon.PreferredSkin "RLMarine"
  +WEAPON.NOAUTOAIM
  States
  {
  Fire:
    MISG B 8 A_GunFlash
    MISG B 12 A_FireCustomMissile ("MMarineRocket")
    MISG B 0 A_ReFire
    Goto Ready
  AltFire:
    MISG A 1
    MISG A 1 A_JumpIfInventory ("RUnlock3",1,2)
    MISG A 1
    Goto Ready
    MISG B 8 A_GunFlash
    MISG B 0 A_PlaySoundEx ("weapons/mgren","weapon")
    MISG B 12 A_FireCustomMissile ("MGrenade",0,1,0,0,0,9)
    MISG B 0 A_ReFire
    Goto Ready
  Flash:
    MISF A 3 Bright A_Light1
    MISF B 4 Bright
    MISF CD 4 Bright A_Light2
    MISF A 0 A_Light0
    Stop
  AltFlash:
    MISF A 3 Bright A_Light1
    MISF B 4 Bright
    MISF CD 4 Bright A_Light2
    MISF A 0 A_Light0
    Stop
  }
}

// PlasmaRifle

actor MPlasmaRifle : PlasmaRifle replaces PlasmaRifle
{
  Weapon.PreferredSkin "PlsmMarine"
  Weapon.AmmoType "MCell"
  Weapon.AmmoType2 "MCell"
  Weapon.AmmoUse2 1
  States
  {
  Fire:
    PLSG A 1
    PLSG A 0 A_GunFlash
    PLSG A 2 A_FireCustomMissile ("MPlasmaBall",0,1,0,0,0)
    PLSG B 0 A_ReFire
    PLSG BCDE 4
    PLSG F 8
    PLSG EDCB 2
    Goto Ready
  AltFire:
    PLSG A 1
    PLSG A 1 A_JumpIfInventory ("RUnlock5",1,2)
    PLSG A 1
    Goto Ready
    PLSG A 1
    PLSG A 1 A_JumpIfInventory ("MCell",10,2)
    PLSG A 1
    Goto Ready
    PLSG A 1
    PLSG A 0 A_GunFlash
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",-18,-1,-9,0,0)
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",-10,-1,-5,0,0)
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",-2,-1,-1,0,0)
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",6,-1,3,0,0)
    PLSG A 2 A_FireCustomMissile ("MPlasmaBall",14,-1,7,0,0)
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",-14,-1,-7,0,0)
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",-6,-1,-3,0,0)
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",2,-1,1,0,0)
    PLSG A 0 A_FireCustomMissile ("MPlasmaBall",10,-1,5,0,0)
    PLSG A 2 A_FireCustomMissile ("MPlasmaBall",18,-1,9,0,0)
    PLSG BCDE 3
    PLSG F 8
    PLSG EDCB 2
    Goto Ready
   Flash:
    PLSF A 2 Bright A_Light1
    PLSF B 2 Bright A_Light0
    PLSF A 0 A_Light0
    Stop
   AltFlash:
    PLSF A 2 Bright A_Light1
    PLSF B 2 Bright A_Light2
    PLSF A 2 Bright A_Light1
    PLSF A 0 A_Light0
    Stop	
  }
}

actor MRailgun : Weapon replaces Railgun
{
   Weapon.Kickback 300
   Weapon.SelectionOrder 450
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "$GOTCHAINGUN" // "You got the Railgun"
   Obituary "$OB_MPCHAINGUN" // "%o was punctured by %k's Railgun."
   +INVENTORY.UNDROPPABLE
   Weapon.AmmoUse 25
   Weapon.Ammotype1 "MCell"
   Weapon.Ammogive 50
   AttackSound "weapons/RailAttack"
   Damagetype "MarineRail"
   +EXTREMEDEATH
   +INVENTORY.UNDROPPABLE
   +WEAPON.NOAUTOAIM
   States
   {
   Ready:
	SRCG B 0 A_CheckReload
	SRCG B 8 A_PlaySoundEx ("weapons/RailCharge","weapon")
	SRCG CDE 8
	SRCG E 1 A_WeaponReady
	Goto Ready+5
   Deselect:
	SRCG B 1 A_Lower
	LOOP
   Select:
	SRCG B 1 A_Raise
	LOOP
   Fire:
	SRCG G 0 A_CheckReload
	SRCG G 2 A_GunFlash
	SRCG G 8 bright A_RailAttack(random(400,600), 0, 1, "red", "white", 0, 0, "MRailPuff")
	SRCG F 6 bright
	SRCG B 10
	SRCG H 34
	Goto Ready
   Flash:
	TNT1 A 2 A_Light0
	TNT1 A 4 A_Light2
	TNT1 A 4 A_Light1
	TNT1 A 0 A_Light0
	Stop
  Spawn:
    TNT1 A 1 Thing_Remove(0)
    Stop
   }
}

// Bfg 9000

actor MBFG9000 : BFG9000 replaces BFG9000
{
  Weapon.AmmoUse 60
  Weapon.AmmoGive 60
  Weapon.Kickback 50
  Weapon.AmmoType "MCell"
  Weapon.PreferredSkin "BFGMarine"
  States
  {
  Fire:
    BFGG A 20 A_BFGSound
    BFGG B 10 A_GunFlash
    BFGG B 10 A_FireCustomMissile ("MBFGBall")
    BFGG B 5
    BFGG B 15 A_ReFire
    goto Ready
  Flash:
    BFGF A 11 bright A_Light1
    BFGF B 6 bright A_Light2
    BFGF A 0 A_Light0
    Stop
  }
}


actor MMarineRocket : Rocket
{
 DamageType "MarineRLDamage"
}

ACTOR MGrenade : Grenade
{
	Radius 8
	Height 8
	Speed 25
	Damage 20
	Projectile
	BounceCount 9
	Scale 1.5
	-NOGRAVITY
	-NOTELEPORT
	+DOOMBOUNCE
	+DEHEXPLOSION
	+ROCKETTRAIL
	//+GRENADETRAIL
	+EXPLODEONDEATH
	+USESTBOUNCESOUND
	SeeSound "weapons/mgrenbounce"
	DeathSound "weapons/rocklx"
	Obituary "$OB_GRENADE"
	DamageType "MarineRLDamage"
	States
	{
	Spawn:
		GRN2 ABCDEFGHIJK 3  
		loop
	Death:
		MISL B 8 bright A_Explode
		MISL C 6 bright
		MISL D 4 bright
		stop
	}

}

actor MBulletPuff : BulletPuff
{
 DamageType "MarineDamage"
 +NOEXTREMEDEATH
}

actor MRailPuff : MBulletPuff
{
 DamageType "MarineRail"
 -NOEXTREMEDEATH
}

actor MPlasmaBall : PlasmaBall replaces PlasmaBall 
{
 DamageType "MarineDamage"
}

actor MBFGBall : BFGBall
{
  DamageType "BFGSplash"
  States
  {
  Death:
    BFE1 AB 8 bright
    BFE1 C 8 bright A_BFGSpray("MBFGExtra")
    BFE1 DEF 8 bright
    stop
  }
}

actor MBFGExtra : BFGExtra 
{
DamageType "BFGSplash"
}

actor MBFG10K : BFG10K replaces BFG10K
{
  Weapon.AmmoUse 5
  Weapon.AmmoGive 50
  Weapon.Kickback 50
  DamageType "MarineDamage"
  Weapon.AmmoType "MCell"
  +INVENTORY.UNDROPPABLE
  +WEAPON.NOAUTOAIM
States
{
  Hold:
    BG2G K 2 Bright A_GunFlash
    BG2G L 2 Bright A_FireBullets(0,0,1,0,"MBFG10kShot")
    BG2G M 2 Bright 
    BG2G O 2
    BG2G N 0 A_ReFire
    BG2G O 35 A_PlaySound ("weapons/bfg10kcool")
    Goto Ready
  Flash:
    TNT1 A 2 Bright A_Light1
    TNT1 A 3 Bright
    TNT1 A 0 A_Light0
    Stop
  Spawn:
    TNT1 A 1 Thing_Remove(0)
    Stop
}
}

actor MBFG10kShot : BFG10kShot replaces BFG10kShot
{
  Damage 200
  DamageType "MarineDamage"
}

// Vulcan Minigun

ACTOR Vulcan : Minigun replaces Minigun
{
    Weapon.AmmoType "MClip"
    Weapon.PreferredSkin "MinigunMarine"
    +INVENTORY.UNDROPPABLE
    +WEAPON.DONTBOB
	States
	{
	Ready:
		MNGG A 1 A_WeaponReady
		MNGG A 0 A_JumpIfInventory ("Mspinch",0,1)
		Loop
        MNGG A 0 A_PlaySoundEx ("weapon/VulcanCannonLoop","weapon",0)
		MNGG BA 2
		goto ready
	Select: 
		MNGG A 1 A_Raise
		MNGG A 0 A_JumpIfInventory ("Mspinch",0,1)
		Loop
		MNGG A 0 A_PlaySoundEx ("weapon/VulcanCannonLoop","weapon",0)
		goto Ready
	Deselect: 
		MNGG A 0 A_TakeInventory("Mspinch",1)
		MNGG A 0 A_TakeInventory("Mspinch2",1)
		MNGG A 0 ACS_ExecuteAlways(426,0,3)
		MNGG A 0 A_StopSoundEx ("Weapon")
		MNGG A 1 A_Lower
		Loop
	Fire:
	    MNGG A 1
	    MNGG A 0 A_JumpIfInventory ("Mspinch",0,"Fire2")
		MNGG A 0 A_JumpIfInventory ("Mspinch2",0,17)
		MNGG A 0 A_PlaySoundEx ("weapon/VulcanCannonUp","weapon",0)
		MNGG A 0 ACS_ExecuteAlways(426,0,1)
		MNGG ABABA 4
		MNGG BABAB 3
		MNGG ABA 2
		MNGG A 0 A_GiveInventory("Mspinch2",1)
		MNGG A 0 A_GunFlash
		MNGG A 2 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG A 0 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG B 2 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG B 0 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG A 1 A_ReFire
		MNGG A 0 A_JumpIfInventory ("Mspinch",0,"Ready")
		MNGG A 0 A_PlaySoundEx ("weapon/VulcanCannonDown","weapon",0)
		MNGG ABA 2 
		MNGG BABAB 3
		MNGG A 0 ACS_ExecuteAlways(426,0,3)
		MNGG ABABA 4
		MNGG A 0 A_TakeInventory("Mspinch2",1)
		goto Ready
	Fire2:
	    MNGG A 0 A_GunFlash
		MNGG A 2 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG A 0 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG B 2 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG B 0 A_FireBullets(7.6, 3.5, -1, 12, "MBulletPuff")
		MNGG A 1 A_ReFire
		MNGG A 0 ACS_ExecuteAlways(426,0,1)
		goto Ready
	spawn:
	    TNT1 A 0 Thing_remove(0)
		stop
	AltFire:
	    MNGG A 0 A_JumpIfInventory ("Mspinch",0,"stopspin")
		MNGG A 0 A_PlaySoundEx ("weapon/VulcanCannonUp","weapon",0)
		MNGG A 0 ACS_ExecuteAlways(426,0,1)
		MNGG ABABA 4
		MNGG BABAB 3
		MNGG ABA 2
		MNGG A 0 A_GiveInventory("Mspinch",1)
		goto ready
	StopSpin:
	    MNGG A 0 A_TakeInventory("Mspinch",1)
		MNGG A 0 A_PlaySoundEx ("weapon/VulcanCannonDown","weapon",0)
		MNGG ABA 2 
		MNGG BABAB 3
		MNGG A 0 ACS_ExecuteAlways(426,0,3)
		MNGG ABABA 4
		goto ready
	Flash: 
		MNGF A 2 BRIGHT A_Light1 
		MNGF B 2 BRIGHT A_Light2 
		MNGF A 0 BRIGHT A_Light0
		Stop
	}
}

ACTOR Mspinch : Inventory
 {
  Inventory.Amount 0
  Inventory.MaxAmount 1
  States
   {
    Spawn:
    TNT1 A -1
    Loop 
   }
 }
ACTOR Mspinch2 : Inventory
 {
  Inventory.Amount 0
  Inventory.MaxAmount 1
  States
   {
    Spawn:
    TNT1 A -1
    Loop 
   }
 }
ACTOR Mspinch3 : Inventory
 {
  Inventory.Amount 0
  Inventory.MaxAmount 5
  States
   {
    Spawn:
    TNT1 A -1
    Loop 
   }
 }

// Items 

// Plasm Cells

ACTOR MCell : Ammo replaces Cell
{
  Inventory.PickupMessage "$GOTCELL" // "Picked up an energy cell."
  Inventory.Amount 20
  Inventory.MaxAmount 250
  Ammo.BackpackAmount 20
  Ammo.BackpackMaxAmount 500
  Inventory.Icon "ICONC"
  States
  {
  Spawn:
    CELL A -1
    Stop
  }
}

ACTOR MCellPack : MCell replaces CellPack
{
  Inventory.PickupMessage "$GOTCELLBOX" // "Picked up an energy cell pack."
  Inventory.Amount 60
  States
  {
  Spawn:
    CELP A -1
    Stop
  }
}

// Rockets

ACTOR MRocketAmmo : Ammo replaces RocketAmmo
{
  Inventory.PickupMessage "$GOTROCKET" // "Picked up a rocket."
  Inventory.Amount 1
  Inventory.MaxAmount 30
  Ammo.BackpackAmount 1
  Ammo.BackpackMaxAmount 50
  Inventory.Icon "ICONR"
  States
  {
  Spawn:
    ROCK A -1
    stop  }
}

ACTOR MRocketBox : MRocketAmmo replaces RocketBox
{
  Inventory.PickupMessage "$GOTROCKBOX" // "Picked up a box of rockets."
  Inventory.Amount 5
  States
  {
  Spawn:
    BROK A -1
    Stop
  }
}

// Shells

ACTOR MShell : Ammo replaces Shell
{
  Inventory.PickupMessage "$GOTSHELLS" // "Picked up 4 shotgun shells."
  Inventory.Amount 4
  Inventory.MaxAmount 50
  Ammo.BackpackAmount 4
  Ammo.BackpackMaxAmount 80
  Inventory.Icon "ICONS"
  States
  {
  Spawn:
    SHEL A -1
    Stop
  }
}

ACTOR MShellBox : MShell replaces ShellBox
{
  Inventory.PickupMessage "$GOTSHELLBOX" // "Picked up a box of shotgun shells."
  Inventory.Amount 16
  States
  {
  Spawn:
    SBOX A -1
    Stop
  }
}

// CLip 

ACTOR MClip : Ammo replaces Clip
{
  Inventory.PickupMessage "$GOTCLIP" // "Picked up a clip."
  Inventory.Amount 10
  Inventory.MaxAmount 400
  Ammo.BackpackAmount 20
  Ammo.BackpackMaxAmount 600
  Inventory.Icon "ICONB"
  States
  {
  Spawn:
    CLIP A -1
    Stop
  }
}

actor MClipBox : MClip replaces ClipBox
{
  Inventory.PickupMessage "$GOTCLIPBOX" // "Picked up a box of bullets."
  Inventory.Amount 50
  States
  {
  Spawn:
    AMMO A -1
    Stop
  }
}