IL_EACH(g_items, it.targetname == this.target,
{
if (it.classname == "weapon_devastator") {
- SetResourceExplicit(this, RES_ROCKETS, GetResource(this, RES_ROCKETS) + it.count * WEP_CVAR_PRI(devastator, ammo)); // WEAPONTODO
+ this.ammo_rockets = it.ammo_rockets;
this.netname = cons(this.netname, "devastator");
}
else if (it.classname == "weapon_vortex") {
- SetResourceExplicit(this, RES_CELLS, GetResource(this, RES_CELLS) + it.count * WEP_CVAR_PRI(vortex, ammo)); // WEAPONTODO
+ this.ammo_cells = it.ammo_cells;
this.netname = cons(this.netname, "vortex");
}
else if (it.classname == "weapon_electro") {
- SetResourceExplicit(this, RES_CELLS, GetResource(this, RES_CELLS) + it.count * WEP_CVAR_PRI(electro, ammo)); // WEAPONTODO
+ this.ammo_cells = it.ammo_cells;
this.netname = cons(this.netname, "electro");
}
else if (it.classname == "weapon_hagar") {
- SetResourceExplicit(this, RES_ROCKETS, GetResource(this, RES_ROCKETS) + it.count * WEP_CVAR_PRI(hagar, ammo)); // WEAPONTODO
+ this.ammo_rockets = it.ammo_rockets;
this.netname = cons(this.netname, "hagar");
}
else if (it.classname == "weapon_crylink") {
- SetResourceExplicit(this, RES_CELLS, GetResource(this, RES_CELLS) + it.count * WEP_CVAR_PRI(crylink, ammo)); // WEAPONTODO
+ this.ammo_cells = it.ammo_cells;
this.netname = cons(this.netname, "crylink");
}
else if (it.classname == "weapon_mortar") {
- SetResourceExplicit(this, RES_ROCKETS, GetResource(this, RES_ROCKETS) + it.count * WEP_CVAR_PRI(mortar, ammo)); // WEAPONTODO
+ this.ammo_rockets = it.ammo_rockets;
this.netname = cons(this.netname, "mortar");
}
else if (it.classname == "weapon_shotgun") {
- SetResourceExplicit(this, RES_SHELLS, GetResource(this, RES_SHELLS) + it.count * WEP_CVAR_PRI(shotgun, ammo)); // WEAPONTODO
+ this.ammo_shells = it.ammo_shells;
this.netname = cons(this.netname, "shotgun");
}
else if (it.classname == "weapon_machinegun") {
- SetResourceExplicit(this, RES_BULLETS, GetResource(this, RES_BULLETS) + it.count * WEP_CVAR(machinegun, burst_ammo)); // WEAPONTODO
+ this.ammo_nails = it.ammo_nails;
this.netname = cons(this.netname, "machinegun");
}
else if (it.classname == "item_armor_mega")
// if we don't already have ammo, give us some ammo
if ((wpn.ammo_type != RES_NONE) && !GetResource(this, wpn.ammo_type))
{
- switch (wpn.ammo_type)
+ int ammo = 0;
+ if (this.count > 0)
{
- case RES_SHELLS: SetResource(this, wpn.ammo_type, cvar("g_pickup_shells_weapon")); break;
- case RES_BULLETS: SetResource(this, wpn.ammo_type, cvar("g_pickup_nails_weapon")); break;
- case RES_ROCKETS: SetResource(this, wpn.ammo_type, cvar("g_pickup_rockets_weapon")); break;
- case RES_CELLS: SetResource(this, wpn.ammo_type, cvar("g_pickup_cells_weapon")); break;
- case RES_PLASMA: SetResource(this, wpn.ammo_type, cvar("g_pickup_plasma_weapon")); break;
- case RES_FUEL: SetResource(this, wpn.ammo_type, cvar("g_pickup_fuel_weapon")); break;
+ switch (wpn.netname)
+ {
+ case "arc": ammo = cvar("g_balance_arc_beam_ammo"); break;
+ case "devastator": ammo = cvar("g_balance_devastator_ammo"); break;
+ case "machinegun": ammo = cvar("g_balance_machinegun_sustained_ammo"); break;
+ case "minelayer": ammo = cvar("g_balance_minelayer_ammo"); break;
+ case "seeker": ammo = cvar("g_balance_seeker_tag_ammo"); break;
+ default: ammo = cvar(strcat("g_balance_", wpn.netname, "_primary_ammo"));
+ }
+
+ ammo *= this.count;
}
+ else
+ {
+ switch (wpn.ammo_type)
+ {
+ case RES_SHELLS: ammo = cvar("g_pickup_shells_weapon"); break;
+ case RES_BULLETS: ammo = cvar("g_pickup_nails_weapon"); break;
+ case RES_ROCKETS: ammo = cvar("g_pickup_rockets_weapon"); break;
+ case RES_CELLS: ammo = cvar("g_pickup_cells_weapon"); break;
+ case RES_PLASMA: ammo = cvar("g_pickup_plasma_weapon"); break;
+ case RES_FUEL: ammo = cvar("g_pickup_fuel_weapon"); break;
+ }
+ }
+
+ SetResource(this, wpn.ammo_type, ammo);
}
#if 0 // WEAPONTODO