- // TODO: figure out if the player even has the weapon this ammo is for?
- // may not affect strategy much though...
- // find out how much more ammo/armor/health the player can hold
- if (need_shells)
- if (item.ammo_shells)
- if (player.ammo_shells < g_pickup_shells_max)
- c = c + max(0, 1 - player.ammo_shells / g_pickup_shells_max);
- if (need_nails)
- if (item.ammo_nails)
- if (player.ammo_nails < g_pickup_nails_max)
- c = c + max(0, 1 - player.ammo_nails / g_pickup_nails_max);
- if (need_rockets)
- if (item.ammo_rockets)
- if (player.ammo_rockets < g_pickup_rockets_max)
- c = c + max(0, 1 - player.ammo_rockets / g_pickup_rockets_max);
- if (need_cells)
- if (item.ammo_cells)
- if (player.ammo_cells < g_pickup_cells_max)
- c = c + max(0, 1 - player.ammo_cells / g_pickup_cells_max);
- if (need_plasma)
- if (item.ammo_plasma)
- if (player.ammo_plasma < g_pickup_plasma_max)
- c = c + max(0, 1 - player.ammo_plasma / g_pickup_plasma_max);
- if (need_fuel)
- if (item.ammo_fuel)
- if (player.ammo_fuel < g_pickup_fuel_max)
- c = c + max(0, 1 - player.ammo_fuel / g_pickup_fuel_max);
- if (item.armorvalue)
- if (player.armorvalue < item.max_armorvalue)
- c = c + max(0, 1 - player.armorvalue / item.max_armorvalue);
- if (item.health)
- if (player.health < item.max_health)
- c = c + max(0, 1 - player.health / item.max_health);