ACTOR Mag : Ammo
{
 Inventory.Pickupmessage "Picked up a used 10x24mm caseless magazine"
 inventory.amount 35
 inventory.maxamount 500
 ammo.backpackamount 35
 ammo.backpackmaxamount 800
 inventory.icon "SMAGA0"
 states
 {
  Spawn:
    SMAG A -1
	stop
  }
}

ACTOR MagBox : Mag
{
 Inventory.pickupmessage "Picked up a box of used 10x24mm mags."
 inventory.amount 60
 states
 {
  Spawn:
    AMMO A -1
	stop
  }
}

ACTOR Ninemm : Ammo
{
 Inventory.Pickupmessage "Picked up a used 9mm magazine."
 inventory.amount 35
 inventory.maxamount 500
 ammo.backpackamount 35
 ammo.backpackmaxamount 800
 inventory.icon "9MMAA0"
 states
 {
  Spawn:
    9MMA A -1
	stop
  }
}

ACTOR 9mmBox : Ninemm
{
 Inventory.pickupmessage "Picked up a box of used 9mm mags."
 inventory.amount 60
 scale 0.8
 states
 {
  Spawn:
    AMMO A -1
	stop
  }
}

ACTOR Shells : Ammo
{
 Inventory.Pickupmessage "Picked up some 12 gauge shotgun shells."
 inventory.amount 4
 inventory.maxamount 80
 ammo. backpackamount 4
 ammo.backpackmaxamount 140
 inventory.icon "SHELA0"
 states
 {
  Spawn:
    SHEL A -1
	stop
  }
}

ACTOR HeavyMag : Ammo
{
 Inventory.Pickupmessage "Picked up a used 10x28mm caseless magazine"
 inventory.amount 15
 inventory.maxamount 400
 ammo.backpackamount 15
 ammo.backpackmaxamount 600
 inventory.icon "HMAGA0"
 states
 {
  Spawn:
    CLIP A -1
	stop
  }
}

ACTOR FuelTank : Ammo
{
 Inventory.PickupMessage "Picked up a used fuel tank."
 inventory.amount 10
 inventory.maxamount 600
 ammo.backpackamount 20
 ammo.backpackmaxamount 800
 inventory.icon "FLAMA0"
 states
 {
  Spawn:
	FLAM A -1
	stop
  }
}

//REPLACERS

ACTOR AmmoBelt : CustomInventory replaces Clip
{
 inventory.pickupmessage "Picked up a belt full of ammo! (9mm and 10x24mm)"
 inventory.maxamount 0
 +COUNTITEM
 +INVENTORY.ALWAYSPICKUP
 scale 0.75
 states
 {
  Spawn:
    ABLT A -1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("Ninemm", 35)
	TNT1 A 0 A_GiveInventory("Shells", 2)
    TNT1 A 0 A_GiveInventory("Mag", 30)
	TNT1 A 0 A_JumpIfInventory("SmartgunnerItem", 1, "SmartAmmo")
	TNT1 A 0 A_JumpIfInventory("StandardItem", 1, "StandardAmmo")
    Stop
  StandardAmmo:
	TNT1 A 0 A_GiveInventory("Mag", 10)
	TNT1 A 0 A_GiveInventory("Ninemm", 15)
	stop
  SmartAmmo:
	TNT1 A 0 A_GiveInventory("HeavyMag", 25)
	TNT1 A 0 A_GiveInventory("Ninemm", 20)
	stop
  }
}

ACTOR AmmoBag : CustomInventory replaces ClipBox
{
 inventory.pickupmessage "Picked up a satchel full of ammo! (9mm and 10x24mm)"
 inventory.maxamount 0
 +COUNTITEM
 +INVENTORY.ALWAYSPICKUP
 states
 {
  Spawn:
    SATC A -1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("Ninemm", 45)
	TNT1 A 0 A_GiveInventory("Shells", 2)
    TNT1 A 0 A_GiveInventory("Mag", 70)
    TNT1 A 0 A_JumpIfInventory("SmartgunnerItem", 1, "SmartAmmo")
    TNT1 A 0 A_JumpIfInventory("StandardItem", 1, "StandardAmmo")
    Stop
  StandardAmmo:
	TNT1 A 0 A_GiveInventory("Mag", 20)
	TNT1 A 0 A_GiveInventory("Ninemm", 25)
	stop
  SmartAmmo:
	TNT1 A 0 A_GiveInventory("HeavyMag", 35)
	TNT1 A 0 A_GiveInventory("Ninemm", 20)
	stop
  }
}

ACTOR MarineBackpack : CustomInventory replaces Shell
{
 inventory.pickupmessage "Picked up a standard marine backpack full of ammo! (Shells and 10x24mm)"
 inventory.maxamount 0
 +COUNTITEM
 +INVENTORY.ALWAYSPICKUP
 scale 0.65
 states
 {
  Spawn:
    MPAK A -1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("Shells", 4)
    TNT1 A 0 A_GiveInventory("Mag", 30)
    TNT1 A 0 A_JumpIfInventory("SmartgunnerItem", 1, "SmartAmmo")
    TNT1 A 0 A_JumpIfInventory("StandardItem", 1, "StandardAmmo")
    Stop
  StandardAmmo:
	TNT1 A 0 A_GiveInventory("Mag", 15)
	TNT1 A 0 A_GiveInventory("Shells", 2)
	stop
  SmartAmmo:
	TNT1 A 0 A_GiveInventory("HeavyMag", 20)
	TNT1 A 0 A_GiveInventory("Ninemm", 10)
	stop
  }
}

ACTOR APMP : CustomInventory replaces ShellBox
{
 inventory.pickupmessage "Picked up an all purpose marine backpack full of ammo! (Shells and 10x24mm)"
 inventory.maxamount 0
 +COUNTITEM
 +INVENTORY.ALWAYSPICKUP
 states
 {
  Spawn:
    APMP A -1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("Shells", 8)
    TNT1 A 0 A_GiveInventory("Mag", 40)
    TNT1 A 0 A_JumpIfInventory("SmartgunnerItem", 1, "SmartAmmo")
    TNT1 A 0 A_JumpIfInventory("StandardItem", 1, "StandardAmmo")
    Stop
  StandardAmmo:
	TNT1 A 0 A_GiveInventory("Mag", 20)
	TNT1 A 0 A_GiveInventory("Shells", 4)
	stop
  SmartAmmo:
	TNT1 A 0 A_GiveInventory("HeavyMag", 25)
	TNT1 A 0 A_GiveInventory("Ninemm", 10)
	stop
  }
}

ACTOR LightAmmoBox : CustomInventory replaces Cell
{
 inventory.pickupmessage "Picked up a marine supply box full of ammo! (Fuel and 10x28mm)"
 inventory.maxamount 0
 +COUNTITEM
 +INVENTORY.ALWAYSPICKUP
 states
 {
  Spawn:
    AMBX A -1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("HeavyMag", 30)
    TNT1 A 0 A_GiveInventory("FuelTank", 20)
    TNT1 A 0 A_JumpIfInventory("SmartgunnerItem", 1, "SmartAmmo")
    TNT1 A 0 A_JumpIfInventory("StandardItem", 1, "StandardAmmo")
    Stop
  StandardAmmo:
	TNT1 A 0 A_GiveInventory("Mag", 20)
	TNT1 A 0 A_GiveInventory("Shells", 2)
	stop
  SmartAmmo:
	TNT1 A 0 A_GiveInventory("HeavyMag", 25)
	TNT1 A 0 A_GiveInventory("Ninemm", 10)
	stop
  }
}

ACTOR HeavyAmmoBox : CustomInventory replaces CellPack
{
 inventory.pickupmessage "Picked up an emergency marine supply box full of ammo! (Fuel and 10x28mm)"
 inventory.maxamount 0
 +COUNTITEM
 +INVENTORY.ALWAYSPICKUP
 states
 {
  Spawn:
    SMBX A -1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("HeavyMag", 50)
    TNT1 A 0 A_GiveInventory("FuelTank", 30)
    TNT1 A 0 A_JumpIfInventory("SmartgunnerItem", 1, "SmartAmmo")
    TNT1 A 0 A_JumpIfInventory("StandardItem", 1, "StandardAmmo")
    Stop
  StandardAmmo:
	TNT1 A 0 A_GiveInventory("Mag", 20)
	TNT1 A 0 A_GiveInventory("Shells", 2)
	stop
  SmartAmmo:
	TNT1 A 0 A_GiveInventory("HeavyMag", 30)
	TNT1 A 0 A_GiveInventory("Ninemm", 15)
	stop
  }
}