Weapon wep = wepent.switchweapon;
int i;
- bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO);
+ bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_AMMO);
row = column = 0;
if(autocvar_hud_panel_ammo_onlycurrent)
{
float when = max(1, autocvar_hud_panel_weapons_complainbubble_time);
float fadetime = max(0, autocvar_hud_panel_weapons_complainbubble_fadetime);
- bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO);
+ bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_AMMO);
vector weapon_pos, weapon_size = '0 0 0';
vector color;
MUTATOR_HOOKFUNCTION(ca, SetStartItems)
{
- start_items &= ~IT_UNLIMITED_BOTH;
+ start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
start_health = warmup_start_health = cvar("g_lms_start_health");
start_armorvalue = warmup_start_armorvalue = cvar("g_lms_start_armor");
start_ammo_shells = warmup_start_ammo_shells = cvar("g_lms_start_ammo_shells");
MUTATOR_HOOKFUNCTION(ft, SetStartItems)
{
- start_items &= ~IT_UNLIMITED_BOTH;
+ start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
//start_health = warmup_start_health = cvar("g_lms_start_health");
//start_armorvalue = warmup_start_armorvalue = cvar("g_lms_start_armor");
start_ammo_shells = warmup_start_ammo_shells = cvar("g_lms_start_ammo_shells");
MUTATOR_HOOKFUNCTION(lms, SetStartItems)
{
- start_items &= ~IT_UNLIMITED_BOTH;
+ start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
start_health = warmup_start_health = cvar("g_lms_start_health");
start_armorvalue = warmup_start_armorvalue = cvar("g_lms_start_armor");
start_ammo_shells = warmup_start_ammo_shells = cvar("g_lms_start_ammo_shells");
#include <server/items.qh>
#endif
-const int IT_UNLIMITED_WEAPON_AMMO = BIT(0); // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
+const int IT_UNLIMITED_AMMO = BIT(0); // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
const int IT_UNLIMITED_SUPERWEAPONS = BIT(1); // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
const int IT_JETPACK = BIT(2); // actual item
const int IT_STRENGTH = BIT(22);
// item masks
-const int IT_UNLIMITED_BOTH = IT_UNLIMITED_WEAPON_AMMO | IT_UNLIMITED_SUPERWEAPONS;
-const int IT_PICKUPMASK = IT_UNLIMITED_BOTH | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
+const int IT_PICKUPMASK = IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
#ifdef SVQC
const .float strength_finished = _STAT(STRENGTH_FINISHED);
{
if (buff == BUFF_Null)
return false;
- if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_BOTH) || (cvar("g_melee_only"))))
+ if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_AMMO) || cvar("g_melee_only")))
return false;
if (buff == BUFF_VAMPIRE && cvar("g_vampire"))
return false;
BUFF_ONADD(BUFF_AMMO)
{
- player.buff_ammo_prev_infitems = (player.items & IT_UNLIMITED_WEAPON_AMMO);
- player.items |= IT_UNLIMITED_WEAPON_AMMO;
+ player.buff_ammo_prev_infitems = (player.items & IT_UNLIMITED_AMMO);
+ player.items |= IT_UNLIMITED_AMMO;
if(STAT(BUFFS, player) & BUFF_AMMO.m_itemid)
{
BUFF_ONREM(BUFF_AMMO)
{
if(player.buff_ammo_prev_infitems)
- player.items |= IT_UNLIMITED_WEAPON_AMMO;
+ player.items |= IT_UNLIMITED_AMMO;
else
- player.items &= ~IT_UNLIMITED_WEAPON_AMMO;
+ player.items &= ~IT_UNLIMITED_AMMO;
if(STAT(BUFFS, player) & BUFF_AMMO.m_itemid)
{
if(IS_DEAD(this) || game_stopped)
instagib_stop_countdown(this);
- else if (GetResource(this, RES_CELLS) > 0 || (this.items & IT_UNLIMITED_WEAPON_AMMO) || (this.flags & FL_GODMODE))
+ else if (GetResource(this, RES_CELLS) > 0 || (this.items & IT_UNLIMITED_AMMO) || (this.flags & FL_GODMODE))
instagib_stop_countdown(this);
else if(autocvar_g_rm && autocvar_g_rm_laser)
{
SetResource(this, RES_CELLS, 0);
SetResource(this, RES_PLASMA, 0);
SetResource(this, RES_FUEL, 0);
- if(this.items & IT_UNLIMITED_WEAPON_AMMO)
+ if(this.items & IT_UNLIMITED_AMMO)
{
switch (wpn.ammo_type)
{
Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_NIX_COUNTDOWN, nix_nextweapon, dt);
}
- if(!(this.items & IT_UNLIMITED_WEAPON_AMMO) && time > this.nix_nextincr)
+ if(!(this.items & IT_UNLIMITED_AMMO) && time > this.nix_nextincr)
{
switch (wpn.ammo_type)
{
return;
}
- if((!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !(actor.items & IT_UNLIMITED_WEAPON_AMMO)) || (!(actor.items & IT_SUPERWEAPON) && !(actor.items & IT_UNLIMITED_SUPERWEAPONS)))
+ if((!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !(actor.items & IT_UNLIMITED_AMMO)) || (!(actor.items & IT_SUPERWEAPON) && !(actor.items & IT_UNLIMITED_SUPERWEAPONS)))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
}
if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
// if(fire & 2) // only eat ammo when the button is pressed
// {
// dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
- // if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ // if(!(actor.items & IT_UNLIMITED_AMMO))
// {
// // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
// if(autocvar_g_balance_vortex_reload_ammo)
// this gives unlimited ammo (the 4 types) but not fuel
// using `g_use_ammunition` instead gives also fuel which is unnecessary and distracting in the HUD
- start_items |= IT_UNLIMITED_WEAPON_AMMO;
+ start_items |= IT_UNLIMITED_AMMO;
start_weapons = warmup_start_weapons = ok_start_items;
}
bool air_jump = !playerjump || M_ARGV(2, bool);
bool activate = JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this);
- bool has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO);
+ bool has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_AMMO);
if (!(ITEMS_STAT(this) & ITEM_Jetpack.m_itemid)) { }
else if (this.jetpack_stopped) { }
wishvel_z = (wishvel_z - PHYS_GRAVITY(this)) * fz + PHYS_GRAVITY(this);
fvel = min(1, vlen(wishvel) / best);
- if (PHYS_JETPACK_FUEL(this) && !(ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO))
+ if (PHYS_JETPACK_FUEL(this) && !(ITEMS_STAT(this) & IT_UNLIMITED_AMMO))
f = min(1, PHYS_AMMO_FUEL(this) / (PHYS_JETPACK_FUEL(this) * dt * fvel));
else
f = 1;
UNSET_ONGROUND(this);
#ifdef SVQC
- if (!(ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO))
+ if (!(ITEMS_STAT(this) & IT_UNLIMITED_AMMO))
TakeResource(this, RES_FUEL, PHYS_JETPACK_FUEL(this) * dt * fvel * f);
ITEMS_STAT(this) |= IT_USING_JETPACK;
spawnfunc(target_items)
{
- int n;
- string s;
-
this.use = target_items_use;
if(!this.strength_finished)
this.strength_finished = autocvar_g_balance_powerup_strength_time;
if(!this.superweapons_finished)
this.superweapons_finished = autocvar_g_balance_superweapons_time;
- n = tokenize_console(this.netname);
+ int n = tokenize_console(this.netname);
if(argv(0) == "give")
{
this.netname = substring(this.netname, argv_start_index(1), argv_end_index(-1) - argv_start_index(1));
{
for(int j = 0; j < n; ++j)
{
- if (argv(j) == "unlimited_ammo") this.items |= IT_UNLIMITED_BOTH;
- else if(argv(j) == "unlimited_weapon_ammo") this.items |= IT_UNLIMITED_WEAPON_AMMO;
+ // this is from a time when unlimited superweapons were handled together with ammo in some parts of the code
+ if (argv(j) == "unlimited_ammo") this.items |= IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS;
+ else if(argv(j) == "unlimited_weapon_ammo") this.items |= IT_UNLIMITED_AMMO;
else if(argv(j) == "unlimited_superweapons") this.items |= IT_UNLIMITED_SUPERWEAPONS;
else if(argv(j) == "strength") this.items |= ITEM_Strength.m_itemid;
else if(argv(j) == "invincible") this.items |= ITEM_Shield.m_itemid;
{
FOREACH(Buffs, it != BUFF_Null,
{
- s = Buff_UndeprecateName(argv(j));
+ string s = Buff_UndeprecateName(argv(j));
if(s == it.netname)
{
STAT(BUFFS, this) |= (it.m_itemid);
}
});
FOREACH(Weapons, it != WEP_Null, {
- s = W_UndeprecateName(argv(j));
+ string s = W_UndeprecateName(argv(j));
if(s == it.netname)
{
STAT(WEAPONS, this) |= (it.m_wepset);
}
this.netname = "";
- this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_WEAPON_AMMO), "unlimited_weapon_ammo");
+ this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_AMMO), "unlimited_weapon_ammo");
this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.strength_finished * boolean(this.items & ITEM_Strength.m_itemid), "strength");
this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.invincible_finished * boolean(this.items & ITEM_Shield.m_itemid), "invincible");
got += GiveValue(e, strength_finished, op, val);
got += GiveValue(e, invincible_finished, op, val);
got += GiveValue(e, superweapons_finished, op, val);
- got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
+ got += GiveBit(e, items, IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS, op, val);
case "all":
got += GiveBit(e, items, ITEM_Jetpack.m_itemid, op, val);
got += GiveResourceValue(e, RES_HEALTH, op, val);
got += GiveResourceValue(e, RES_FUEL, op, val);
break;
case "unlimited_ammo":
- got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
+ // this is from a time when unlimited superweapons were handled together with ammo in some parts of the code
+ got += GiveBit(e, items, IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS, op, val);
break;
case "unlimited_weapon_ammo":
- got += GiveBit(e, items, IT_UNLIMITED_WEAPON_AMMO, op, val);
+ got += GiveBit(e, items, IT_UNLIMITED_AMMO, op, val);
break;
case "unlimited_superweapons":
got += GiveBit(e, items, IT_UNLIMITED_SUPERWEAPONS, op, val);
POSTGIVE_BIT(e, items, ITEM_JetpackRegen.m_itemid, SND_ITEMPICKUP, SND_Null);
POSTGIVE_BIT(e, items, IT_UNLIMITED_SUPERWEAPONS, SND_POWERUP, SND_POWEROFF);
- POSTGIVE_BIT(e, items, IT_UNLIMITED_WEAPON_AMMO, SND_POWERUP, SND_POWEROFF);
+ POSTGIVE_BIT(e, items, IT_UNLIMITED_AMMO, SND_POWERUP, SND_POWEROFF);
POSTGIVE_BIT(e, items, ITEM_Jetpack.m_itemid, SND_ITEMPICKUP, SND_Null);
FOREACH(Weapons, it != WEP_Null, {
POSTGIVE_WEAPON(e, it, SND_WEAPONPICKUP, SND_Null);
}
if(this == own.(weaponentity).arc_beam) { own.(weaponentity).arc_beam = NULL; }
- if(!thiswep.wr_checkammo1(thiswep, own, weaponentity) && !(own.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!thiswep.wr_checkammo1(thiswep, own, weaponentity) && !(own.items & IT_UNLIMITED_AMMO))
{
// note: this doesn't force the switch
W_SwitchToOtherWeapon(own, weaponentity);
// decrease ammo
float coefficient = frametime;
- if(!(own.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(own.items & IT_UNLIMITED_AMMO))
{
float rootammo;
if(burst)
}
actor.(weaponentity).crylink_waitrelease = 0;
if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !thiswep.wr_checkammo2(thiswep, actor, weaponentity))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
// ran out of ammo!
actor.cnt = thiswep.m_id;
if(this.realowner.(weaponentity).m_weapon == thiswep)
{
if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo))
- if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(this.realowner.items & IT_UNLIMITED_AMMO))
{
this.realowner.cnt = thiswep.m_id;
ATTACK_FINISHED(this.realowner, weaponentity) = time;
if(this.realowner.(weaponentity).m_weapon == thiswep)
{
if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo))
- if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(this.realowner.items & IT_UNLIMITED_AMMO))
{
this.realowner.cnt = thiswep.m_id;
ATTACK_FINISHED(this.realowner, weaponentity) = time;
// this is different than WR_CHECKAMMO when it comes to reloading
bool enough_ammo;
- if(actor.items & IT_UNLIMITED_WEAPON_AMMO)
+ if(actor.items & IT_UNLIMITED_AMMO)
enough_ammo = true;
else if(autocvar_g_balance_hagar_reload_ammo)
enough_ammo = actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
// we aren't checking ammo during an attack, so we must do it here
if(!(thiswep.wr_checkammo1(thiswep, actor, weaponentity) + thiswep.wr_checkammo2(thiswep, actor, weaponentity)))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
// note: this doesn't force the switch
W_SwitchToOtherWeapon(actor, weaponentity);
}
if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
if(PHYS_INPUT_BUTTON_ATCK(actor))
{
if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + WEP_CVAR_PRI(hook, refire) * W_WeaponRateFactor(actor));
// hook also inhibits health regeneration, but only for 1 second
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
actor.pauseregen_finished = max(actor.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
}
{
if( time > actor.(weaponentity).hook_time_fueldecrease )
{
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
if( GetResource(actor, RES_FUEL) >= (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel )
{
if(PHYS_INPUT_BUTTON_ATCK(actor))
{
if(!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
}
if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
if(weapon_prepareattack(thiswep, actor, weaponentity, true, 0))
{
if(!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seeker_Attack
{
- float c;
- entity oldenemy;
this.cnt = this.cnt - 1;
Weapon thiswep = WEP_SEEKER;
.entity weaponentity = this.weaponentity_fld;
- if((!(this.realowner.items & IT_UNLIMITED_BOTH) && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (this.realowner.(weaponentity).m_switchweapon != thiswep))
+ if((!(this.realowner.items & IT_UNLIMITED_AMMO) && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (this.realowner.(weaponentity).m_switchweapon != thiswep))
{
delete(this);
return;
entity own = this.realowner;
- oldenemy = own.enemy;
+ entity oldenemy = own.enemy;
own.enemy = this.enemy;
- c = own.cnt % 4;
- switch(c)
+ switch(own.cnt % 4)
{
case 0:
W_Seeker_Fire_Missile(thiswep, own, weaponentity, '-1.25 -3.75 0', own.enemy); // TODO
void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
if (!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
- if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if (!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
if (!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
- if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if (!(actor.items & IT_UNLIMITED_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
w_ready(thiswep, actor, weaponentity, fire);
}
if(actor.(weaponentity).clip_load >= 0) // we are not currently reloading
if(WEP_CVAR(shotgun, secondary) == 1)
- if(((fire & 1) && GetResource(actor, thiswep.ammo_type) <= 0 && !(actor.items & IT_UNLIMITED_WEAPON_AMMO)) || (fire & 2))
+ if(((fire & 1) && GetResource(actor, thiswep.ammo_type) <= 0 && !(actor.items & IT_UNLIMITED_AMMO)) || (fire & 2))
if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(shotgun, refire)))
{
// attempt forcing playback of the anim by switching to another anim (that we never play) here...
if(fire & 2) // only eat ammo when the button is pressed
{
dt = min(dt, (1 - actor.(weaponentity).vortex_charge) / WEP_CVAR(vortex, charge_rate));
- if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(!(actor.items & IT_UNLIMITED_AMMO))
{
// if this weapon is reloadable, decrease its load. Else decrease the player's ammo
if(autocvar_g_balance_vortex_reload_ammo)
LOG_DEBUG("jetpack ai: required fuel ", ftos(fuel), ", have ", ftos(GetResource(this, RES_FUEL)));
// enough fuel ?
- if(GetResource(this, RES_FUEL) > fuel || (this.items & IT_UNLIMITED_WEAPON_AMMO))
+ if(GetResource(this, RES_FUEL) > fuel || (this.items & IT_UNLIMITED_AMMO))
{
// Estimate cost
// (as onground costs calculation is mostly based on distances, here we do the same establishing some relationship
this.event_damage(this, this, this, 1, DEATH_ROT.m_id, DMG_NOWEP, this.origin, '0 0 0');
}
- if (!(this.items & IT_UNLIMITED_WEAPON_AMMO))
+ if (!(this.items & IT_UNLIMITED_AMMO))
{
float minf, maxf, limitf;
{
g_weapon_stay = 0; // incompatible
start_weapons = g_weaponarena_weapons;
- start_items |= IT_UNLIMITED_BOTH;
+ start_items |= IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS;
}
else
{
start_items |= IT_UNLIMITED_SUPERWEAPONS;
if(!cvar("g_use_ammunition"))
- start_items |= IT_UNLIMITED_WEAPON_AMMO;
+ start_items |= IT_UNLIMITED_AMMO;
- if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+ if(start_items & IT_UNLIMITED_AMMO)
{
start_ammo_shells = 999;
start_ammo_nails = 999;
it = a;
PHYS_INPUT_BUTTON_ATCK(it) = true;
- it.items |= IT_UNLIMITED_BOTH;
+ it.items |= IT_UNLIMITED_AMMO;
Weapon wep = WEP_VORTEX;
W_GiveWeapon(it, wep.m_id);
W_SwitchWeapon_Force(it, wep, weaponentities[0]);
{
if (andammo)
{
- if(this.items & IT_UNLIMITED_WEAPON_AMMO)
+ if(this.items & IT_UNLIMITED_AMMO)
{
f = 1;
}
.float prevwarntime;
bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary, .entity weaponentity)
{
- if ((actor.items & IT_UNLIMITED_WEAPON_AMMO)) return true;
+ if ((actor.items & IT_UNLIMITED_AMMO)) return true;
bool ammo = false;
if (secondary) ammo = thiswep.wr_checkammo2(thiswep, actor, weaponentity);
else ammo = thiswep.wr_checkammo1(thiswep, actor, weaponentity);
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use, .entity weaponentity)
{
if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor, actor.(weaponentity), ammo_use)) return;
- if ((actor.items & IT_UNLIMITED_WEAPON_AMMO) && !wep.reloading_ammo) return;
+ if ((actor.items & IT_UNLIMITED_AMMO) && !wep.reloading_ammo) return;
ammo_use = M_ARGV(2, float);
w_ent.clip_load = w_ent.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
// if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load
- if (!w_ent.reload_ammo_min || (actor.items & IT_UNLIMITED_WEAPON_AMMO) || wpn.ammo_type == RES_NONE)
+ if (!w_ent.reload_ammo_min || (actor.items & IT_UNLIMITED_AMMO) || wpn.ammo_type == RES_NONE)
{
w_ent.clip_load = w_ent.reload_ammo_amount;
}
{
if (!GetResource(actor, e.ammo_type) && this.reload_ammo_min)
{
- if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+ if (!(actor.items & IT_UNLIMITED_AMMO))
{
if (IS_REAL_CLIENT(actor) && actor.reload_complain < time)
{