entity wi = get_weaponinfo(self.weapon);
if(wi)
{
- name = wi.model2;
+ name = wi.wpmodel;
rgb = '1 0 0';
}
}
pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max, ITEM_MODE_NONE);
pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max, ITEM_MODE_NONE);
pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max, ITEM_MODE_NONE);
+ pickedup |= Item_GiveAmmoTo(item, player, ammo_plasma, g_pickup_plasma_max, ITEM_MODE_NONE);
pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health, ITEM_MODE_HEALTH);
pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue, ITEM_MODE_ARMOR);
pickedup = TRUE;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
if(it & WepSet_FromWeapon(i))
+ {
+ W_DropEvent(WR_PICKUP, player, i, item);
W_GiveWeapon(player, i);
+ }
}
}
{
pickedup = TRUE;
player.items |= it;
- sprint (player, strcat("You got the ^2", item.netname, "\n"));
+ Send_Notification(NOTIF_ONE, player, MSG_INFO, INFO_ITEM_WEAPON_GOT, item.netname);
}
if (item.strength_finished)
if (!IS_PLAYER(other))
return;
+ if (other.frozen)
+ return;
if (other.deadflag)
return;
if (self.solid != SOLID_TRIGGER)
// If I can pick it up
if(!item.spawnshieldtime)
c = 0;
- else if(player.ammo_cells || player.ammo_shells || player.ammo_nails || player.ammo_rockets)
+ else if(player.ammo_cells || player.ammo_shells || player.ammo_plasma || player.ammo_nails || player.ammo_rockets)
{
// Skilled bots will grab more
c = bound(0, skill / 10, 1) * 0.5;
float commodity_pickupevalfunc(entity player, entity item)
{
float c, i;
- float need_shells = FALSE, need_nails = FALSE, need_rockets = FALSE, need_cells = FALSE, need_fuel = FALSE;
+ float need_shells = FALSE, need_nails = FALSE, need_rockets = FALSE, need_cells = FALSE, need_plasma = FALSE, need_fuel = FALSE;
entity wi;
c = 0;
need_rockets = TRUE;
else if(wi.items & IT_CELLS)
need_cells = TRUE;
+ else if(wi.items & IT_PLASMA)
+ need_plasma = TRUE;
else if(wi.items & IT_FUEL)
- need_cells = TRUE;
+ need_fuel = TRUE;
}
// TODO: figure out if the player even has the weapon this ammo is for?
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)
StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "cells", IT_CELLS, 0, 0, commodity_pickupevalfunc, 2000);
}
+void spawnfunc_item_plasma()
+{
+ if(!self.ammo_plasma)
+ self.ammo_plasma = g_pickup_plasma;
+ if(!self.pickup_anyway)
+ self.pickup_anyway = g_pickup_ammo_anyway;
+ StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "plasma", IT_PLASMA, 0, 0, commodity_pickupevalfunc, 2000);
+}
+
void spawnfunc_item_shells (void) {
if(!weaponswapping)
if(autocvar_sv_q3acompat_machineshotgunswap)
if(self.ammo_nails != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_nails), "nails");
if(self.ammo_rockets != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_rockets), "rockets");
if(self.ammo_cells != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_cells), "cells");
+ if(self.ammo_plasma != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_plasma), "plasma");
if(self.ammo_fuel != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_fuel), "fuel");
if(self.health != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "health");
if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "armor");
PREGIVE(e, superweapons_finished);
PREGIVE(e, ammo_nails);
PREGIVE(e, ammo_cells);
+ PREGIVE(e, ammo_plasma);
PREGIVE(e, ammo_shells);
PREGIVE(e, ammo_rockets);
PREGIVE(e, ammo_fuel);
}
case "allammo":
got += GiveValue(e, ammo_cells, op, val);
+ got += GiveValue(e, ammo_plasma, op, val);
got += GiveValue(e, ammo_shells, op, val);
got += GiveValue(e, ammo_nails, op, val);
got += GiveValue(e, ammo_rockets, op, val);
case "cells":
got += GiveValue(e, ammo_cells, op, val);
break;
+ case "plasma":
+ got += GiveValue(e, ammo_plasma, op, val);
+ break;
case "shells":
got += GiveValue(e, ammo_shells, op, val);
break;
POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", "misc/poweroff.wav");
POSTGIVE_VALUE(e, ammo_nails, 0, "misc/itempickup.wav", string_null);
POSTGIVE_VALUE(e, ammo_cells, 0, "misc/itempickup.wav", string_null);
+ POSTGIVE_VALUE(e, ammo_plasma, 0, "misc/itempickup.wav", string_null);
POSTGIVE_VALUE(e, ammo_shells, 0, "misc/itempickup.wav", string_null);
POSTGIVE_VALUE(e, ammo_rockets, 0, "misc/itempickup.wav", string_null);
POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, "misc/itempickup.wav", string_null);