X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ft_items.qc;h=60ee6c86681c9cea49083b2723a58b6028041ef7;hb=cf1edea8694548556934b5b05f526bc192f576cb;hp=72bfafd125460dd040405514e5cf1b3f8cdeca56;hpb=5a11b6645d5054238ea01f8a23d016f5bf98c7d1;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 72bfafd12..60ee6c866 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -15,7 +15,7 @@ #include "constants.qh" #include - #include + #include #include "triggers/subs.qh" #include "util.qh" @@ -152,134 +152,134 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew) if(sf & ISF_LOCATION) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); - self.oldorigin = self.origin; + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); + this.oldorigin = this.origin; } if(sf & ISF_ANGLES) { - self.angles_x = ReadAngle(); - self.angles_y = ReadAngle(); - self.angles_z = ReadAngle(); - self.move_angles = self.angles; + this.angles_x = ReadAngle(); + this.angles_y = ReadAngle(); + this.angles_z = ReadAngle(); + this.move_angles = this.angles; } if(sf & ISF_SIZE) { float use_bigsize = ReadByte(); - setsize(self, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); + setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); } if(sf & ISF_STATUS) // need to read/write status frist so model can handle simple, fb etc. { - self.ItemStatus = ReadByte(); + this.ItemStatus = ReadByte(); - Item_SetAlpha(self); + Item_SetAlpha(this); if(autocvar_cl_fullbright_items) - if(self.ItemStatus & ITS_ALLOWFB) - self.effects |= EF_FULLBRIGHT; + if(this.ItemStatus & ITS_ALLOWFB) + this.effects |= EF_FULLBRIGHT; - if(self.ItemStatus & ITS_POWERUP) + if(this.ItemStatus & ITS_POWERUP) { - if(self.ItemStatus & ITS_AVAILABLE) - self.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); + if(this.ItemStatus & ITS_AVAILABLE) + this.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); else - self.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT); + this.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT); } } if(sf & ISF_MODEL) { - self.drawmask = MASK_NORMAL; - self.move_movetype = MOVETYPE_TOSS; - self.draw = ItemDraw; - self.solid = SOLID_TRIGGER; - //self.move_flags |= FL_ITEM; + this.drawmask = MASK_NORMAL; + this.move_movetype = MOVETYPE_TOSS; + this.draw = ItemDraw; + this.solid = SOLID_TRIGGER; + //this.move_flags |= FL_ITEM; bool use_bigsize = ReadByte(); - self.fade_end = ReadShort(); - self.fade_start = ReadShort(); - if(self.fade_start && !autocvar_cl_items_nofade) - setpredraw(self, Item_PreDraw); + this.fade_end = ReadShort(); + this.fade_start = ReadShort(); + if(this.fade_start && !autocvar_cl_items_nofade) + setpredraw(this, Item_PreDraw); - if(self.mdl) - strunzone(self.mdl); + if(this.mdl) + strunzone(this.mdl); - self.mdl = ""; + this.mdl = ""; string _fn = ReadString(); - if(autocvar_cl_simple_items && (self.ItemStatus & ITS_ALLOWSI)) + if(autocvar_cl_simple_items && (this.ItemStatus & ITS_ALLOWSI)) { string _fn2 = substring(_fn, 0 , strlen(_fn) -4); - self.draw = ItemDrawSimple; + this.draw = ItemDrawSimple; if(fexists(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix)); else if(fexists(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix)); else if(fexists(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)); else if(fexists(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix))) - self.mdl = strzone(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix)); + this.mdl = strzone(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix)); else { - self.draw = ItemDraw; + this.draw = ItemDraw; LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it\n"); } } - if(self.draw != ItemDrawSimple) - self.mdl = strzone(_fn); + if(this.draw != ItemDrawSimple) + this.mdl = strzone(_fn); - if(self.mdl == "") - LOG_TRACE("^1WARNING!^7 self.mdl is unset for item ", self.classname, ", tell tZork about this!\n"); + if(this.mdl == "") + LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, ", tell tZork about this!\n"); - precache_model(self.mdl); - _setmodel(self, self.mdl); + precache_model(this.mdl); + _setmodel(this, this.mdl); - setsize(self, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); + setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32'); } if(sf & ISF_COLORMAP) - self.colormap = ReadShort(); + this.colormap = ReadShort(); if(sf & ISF_DROP) { - self.gravity = 1; - self.pushable = true; - //self.move_angles = '0 0 0'; - self.move_movetype = MOVETYPE_TOSS; - self.move_velocity_x = ReadCoord(); - self.move_velocity_y = ReadCoord(); - self.move_velocity_z = ReadCoord(); - self.velocity = self.move_velocity; - self.move_origin = self.oldorigin; - - if(!self.move_time) + this.gravity = 1; + this.pushable = true; + //this.move_angles = '0 0 0'; + this.move_movetype = MOVETYPE_TOSS; + this.move_velocity_x = ReadCoord(); + this.move_velocity_y = ReadCoord(); + this.move_velocity_z = ReadCoord(); + this.velocity = this.move_velocity; + this.move_origin = this.oldorigin; + + if(!this.move_time) { - self.move_time = time; - self.spawntime = time; + this.move_time = time; + this.spawntime = time; } else - self.move_time = max(self.move_time, time); + this.move_time = max(this.move_time, time); } if(autocvar_cl_animate_items) { - if(self.ItemStatus & ITS_ANIMATE1) - self.move_avelocity = '0 180 0'; + if(this.ItemStatus & ITS_ANIMATE1) + this.move_avelocity = '0 180 0'; - if(self.ItemStatus & ITS_ANIMATE2) - self.move_avelocity = '0 -90 0'; + if(this.ItemStatus & ITS_ANIMATE2) + this.move_avelocity = '0 -90 0'; } - self.entremove = ItemRemove; + this.entremove = ItemRemove; return true; } @@ -471,15 +471,15 @@ void Item_Show (entity e, float mode) e.SendFlags |= ISF_STATUS; } -void Item_Think() -{SELFPARAM(); +void Item_Think(entity this) +{ self.nextthink = time; if(self.origin != self.oldorigin) ItemUpdate(self); } bool Item_ItemsTime_SpectatorOnly(GameItem it); -bool Item_ItemsTime_Allow(GameItem it, WepSet _weapons); +bool Item_ItemsTime_Allow(GameItem it); float Item_ItemsTime_UpdateTime(entity e, float t); void Item_ItemsTime_SetTime(entity e, float t); void Item_ItemsTime_SetTimesForAllPlayers(); @@ -496,22 +496,22 @@ void Item_Respawn () sound (self, CH_TRIGGER, SND_ITEMRESPAWN, VOL_BASE, ATTEN_NORM); // play respawn sound setorigin (self, self.origin); - if (Item_ItemsTime_Allow(self.itemdef, self.weapons)) + if (Item_ItemsTime_Allow(self.itemdef) || self.weapons & WEPSET_SUPERWEAPONS) { float t = Item_ItemsTime_UpdateTime(self, 0); Item_ItemsTime_SetTime(self, t); Item_ItemsTime_SetTimesForAllPlayers(); } - self.think = Item_Think; + setthink(self, Item_Think); self.nextthink = time; //Send_Effect(EFFECT_ITEM_RESPAWN, self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1); Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(self), '0 0 0', 1); } -void Item_RespawnCountdown () -{SELFPARAM(); +void Item_RespawnCountdown (entity this) +{ if(self.count >= ITEM_RESPAWN_TICKS) { if(self.waypointsprite_attached) @@ -554,15 +554,13 @@ void Item_RespawnCountdown () if(self.waypointsprite_attached) { - setself(self.waypointsprite_attached); - FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA( - if(self.waypointsprite_visible_for_player(it)) + FOREACH_CLIENT(IS_REAL_CLIENT(it), { + if(self.waypointsprite_attached.waypointsprite_visible_for_player(self.waypointsprite_attached, it, it)) { msg_entity = it; soundto(MSG_ONE, this, CH_TRIGGER, SND(ITEMRESPAWNCOUNTDOWN), VOL_BASE, ATTEN_NORM); // play respawn sound } - )); - setself(this); + }); WaypointSprite_Ping(self.waypointsprite_attached); //WaypointSprite_UpdateHealth(self.waypointsprite_attached, self.count); @@ -570,8 +568,8 @@ void Item_RespawnCountdown () } } -void Item_RespawnThink() -{SELFPARAM(); +void Item_RespawnThink(entity this) +{ self.nextthink = time; if(self.origin != self.oldorigin) ItemUpdate(self); @@ -582,9 +580,10 @@ void Item_RespawnThink() void Item_ScheduleRespawnIn(entity e, float t) { - if (Item_ItemsTime_Allow(e.itemdef, e.weapons)) + // if the respawn time is longer than 10 seconds, show a waypoint, otherwise, just respawn normally + if ((Item_ItemsTime_Allow(e.itemdef) || e.weapons & WEPSET_SUPERWEAPONS) && (t - ITEM_RESPAWN_TICKS) > 0) { - e.think = Item_RespawnCountdown; + setthink(e, Item_RespawnCountdown); e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS); e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS; e.count = 0; @@ -594,7 +593,7 @@ void Item_ScheduleRespawnIn(entity e, float t) } else { - e.think = Item_RespawnThink; + setthink(e, Item_RespawnThink); e.nextthink = time; e.scheduledrespawntime = time + t; e.wait = time + t; @@ -615,7 +614,7 @@ void Item_ScheduleRespawn(entity e) void Item_ScheduleInitialRespawn(entity e) { Item_Show(e, 0); - Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e)); + Item_ScheduleRespawnIn(e, game_starttime - time + ((e.respawntimestart) ? e.respawntimestart : ITEM_RESPAWNTIME_INITIAL(e))); } float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode) @@ -643,7 +642,7 @@ float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax return false; -:YEAH +LABEL(YEAH) switch(mode) { case ITEM_MODE_FUEL: @@ -697,16 +696,24 @@ float Item_GiveTo(entity item, entity player) if (w || (item.spawnshieldtime && item.pickup_anyway > 0)) { pickedup = true; - FOREACH(Weapons, it != WEP_Null, LAMBDA( + FOREACH(Weapons, it != WEP_Null, { if(w & (it.m_wepset)) { W_DropEvent(wr_pickup, player, it.m_id, item); W_GiveWeapon(player, it.m_id); } - )); + }); } } + if (item.itemdef.instanceOfPowerup) + { + if ((item.itemdef == ITEM_JetpackRegen) && !(player.items & IT_FUEL_REGEN)) + Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ITEM_FUELREGEN_GOT); + else if ((item.itemdef == ITEM_Jetpack) && !(player.items & IT_JETPACK)) + Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_ITEM_JETPACK_GOT); + } + int its; if((its = (item.items - (item.items & player.items)) & IT_PICKUPMASK)) { @@ -731,7 +738,7 @@ float Item_GiveTo(entity item, entity player) player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished; } -:skip +LABEL(skip) // always eat teamed entities if(item.team) @@ -754,9 +761,8 @@ float Item_GiveTo(entity item, entity player) return 1; } -void Item_Touch() +void Item_Touch(entity this) { - SELFPARAM(); // remove the item if it's currnetly in a NODROP brush or hits a NOIMPACT surface (such as sky) if (this.classname == "droppedweapon") @@ -802,12 +808,12 @@ void Item_Touch() return; } - :pickup +LABEL(pickup) other.last_pickup = time; Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(this), '0 0 0', 1); - _sound (other, CH_TRIGGER, (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent)), VOL_BASE, ATTEN_NORM); + _sound (other, (this.itemdef.instanceOfPowerup ? CH_TRIGGER_SINGLE : CH_TRIGGER), (this.item_pickupsound ? this.item_pickupsound : Sound_fixpath(this.item_pickupsound_ent)), VOL_BASE, ATTEN_NORM); if (this.classname == "droppedweapon") remove (this); @@ -842,7 +848,7 @@ void Item_Reset(entity this) if (this.classname != "droppedweapon") { - this.think = Item_Think; + setthink(this, Item_Think); this.nextthink = time; if (this.waypointsprite_attached) @@ -854,8 +860,8 @@ void Item_Reset(entity this) } void Item_Reset_self() { SELFPARAM(); Item_Reset(this); } -void Item_FindTeam() -{SELFPARAM(); +void Item_FindTeam(entity this) +{ entity e; if(self.effects & EF_NODRAW) @@ -894,9 +900,8 @@ void Item_FindTeam() } // Savage: used for item garbage-collection -// TODO: perhaps nice special effect? -void RemoveItem() -{SELFPARAM(); +void RemoveItem(entity this) +{ if(wasfreed(self) || !self) { return; } Send_Effect(EFFECT_ITEM_PICKUP, CENTER_OR_VIEWOFS(self), '0 0 0', 1); remove(self); @@ -964,7 +969,7 @@ float commodity_pickupevalfunc(entity player, entity item) c = 0; // Detect needed ammo - FOREACH(Weapons, it != WEP_Null, LAMBDA( + FOREACH(Weapons, it != WEP_Null, { if(!(player.weapons & (it.m_wepset))) continue; @@ -980,7 +985,7 @@ float commodity_pickupevalfunc(entity player, entity item) need_plasma = true; else if(it.items & ITEM_JetpackFuel.m_itemid) need_fuel = true; - )); + }); // TODO: figure out if the player even has the weapon this ammo is for? // may not affect strategy much though... @@ -1022,7 +1027,7 @@ float commodity_pickupevalfunc(entity player, entity item) void Item_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) { if(ITEM_DAMAGE_NEEDKILL(deathtype)) - WITH(entity, self, this, RemoveItem()); + WITHSELF(this, RemoveItem(this)); } void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter) @@ -1076,7 +1081,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default this.movetype = MOVETYPE_TOSS; // Savage: remove thrown items after a certain period of time ("garbage collection") - this.think = RemoveItem; + setthink(this, RemoveItem); this.nextthink = time + 20; this.takedamage = DAMAGE_YES; @@ -1127,7 +1132,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default this.SendFlags |= ISF_SIZE; // note droptofloor returns false if stuck/or would fall too far if (!this.noalign) - WITH(entity, self, this, droptofloor()); + WITHSELF(this, droptofloor()); waypoint_spawnforitem(this); } @@ -1147,16 +1152,12 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default if(autocvar_spawn_debug >= 2) { - for(entity otheritem = findradius(this.origin, 3); otheritem; otheritem = otheritem.chain) - { - // why not flags & fl_item? - if(otheritem.is_item) - { - LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin)); - LOG_TRACE(" vs ", otheritem.netname, vtos(otheritem.origin), "\n"); - error("Mapper sucks."); - } - } + // why not flags & fl_item? + FOREACH_ENTITY_RADIUS(this.origin, 3, it.is_item, { + LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin)); + LOG_TRACE(" vs ", it.netname, vtos(it.origin), "\n"); + error("Mapper sucks."); + }); this.is_item = true; } @@ -1180,7 +1181,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default this.bot_pickupbasevalue = pickupbasevalue; this.mdl = this.model ? this.model : strzone(this.item_model_ent.model_str()); this.netname = itemname; - this.touch = Item_Touch; + settouch(this, Item_Touch); setmodel(this, MDL_Null); // precision set below //this.effects |= EF_LOWPRECISION; @@ -1417,29 +1418,31 @@ spawnfunc(item_invincible) // compatibility: spawnfunc(item_quad) { this.classname = "item_strength";spawnfunc_item_strength(this);} -void target_items_use() -{SELFPARAM(); - if(activator.classname == "droppedweapon") +void target_items_use(entity this, entity actor, entity trigger) +{ + other = trigger; // TODO + + if(actor.classname == "droppedweapon") { EXACTTRIGGER_TOUCH; - remove(activator); + remove(actor); return; } - if (!IS_PLAYER(activator)) + if (!IS_PLAYER(actor)) return; - if(IS_DEAD(activator)) + if(IS_DEAD(actor)) return; EXACTTRIGGER_TOUCH; - FOREACH_ENTITY_ENT(enemy, activator, + FOREACH_ENTITY_ENT(enemy, actor, { if(it.classname == "droppedweapon") remove(it); }); - if(GiveItems(activator, 0, tokenize_console(self.netname))) - centerprint(activator, self.message); + if(GiveItems(actor, 0, tokenize_console(this.netname))) + centerprint(actor, this.message); } spawnfunc(target_items) @@ -1474,7 +1477,7 @@ spawnfunc(target_items) else if(argv(i) == "fuel_regen") self.items |= ITEM_JetpackRegen.m_itemid; else { - FOREACH(Weapons, it != WEP_Null, LAMBDA( + FOREACH(Weapons, it != WEP_Null, { s = W_UndeprecateName(argv(i)); if(s == it.netname) { @@ -1483,7 +1486,7 @@ spawnfunc(target_items) it.wr_init(it); break; } - )); + }); } } @@ -1529,8 +1532,8 @@ spawnfunc(target_items) 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"); - FOREACH(Weapons, it != WEP_Null, LAMBDA(self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & (it.m_wepset)), it.netname))); + if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.armorvalue), "armor"); + FOREACH(Weapons, it != WEP_Null, self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.weapons & (it.m_wepset)), it.netname)); } self.netname = strzone(self.netname); //print(self.netname, "\n"); @@ -1538,13 +1541,10 @@ spawnfunc(target_items) n = tokenize_console(self.netname); for(i = 0; i < n; ++i) { - FOREACH(Weapons, it != WEP_Null, LAMBDA( - if(argv(i) == it.netname) - { - it.wr_init(it); - break; - } - )); + FOREACH(Weapons, it != WEP_Null && argv(i) == it.netname, { + it.wr_init(it); + break; + }); } } @@ -1610,19 +1610,19 @@ float GiveWeapon(entity e, float wpn, float op, float val) return (v0 != v1); } -void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string snd_decr) +void GiveSound(entity e, float v0, float v1, float t, Sound snd_incr, Sound snd_decr) { if(v1 == v0) return; if(v1 <= v0 - t) { - if(snd_decr != "") - _sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTEN_NORM); + if(snd_decr != NULL) + sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTEN_NORM); } else if(v0 >= v0 + t) { - if(snd_incr != "") - _sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTEN_NORM); + if(snd_incr != NULL) + sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTEN_NORM); } } @@ -1705,10 +1705,7 @@ float GiveItems(entity e, float beginarg, float endarg) got += GiveValue(e, health, op, val); got += GiveValue(e, armorvalue, op, val); case "allweapons": - FOREACH(Weapons, it != WEP_Null, LAMBDA( - if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED)) - got += GiveWeapon(e, it.m_id, op, val); - )); + FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & WEP_FLAG_MUTATORBLOCKED), got += GiveWeapon(e, it.m_id, op, val)); case "allammo": got += GiveValue(e, ammo_cells, op, val); got += GiveValue(e, ammo_plasma, op, val); @@ -1767,39 +1764,36 @@ float GiveItems(entity e, float beginarg, float endarg) got += GiveValue(e, ammo_fuel, op, val); break; default: - FOREACH(Weapons, it != WEP_Null, LAMBDA( - if(cmd == it.netname) - { - got += GiveWeapon(e, it.m_id, op, val); - break; - } - )); + FOREACH(Weapons, it != WEP_Null && cmd == it.netname, { + got += GiveWeapon(e, it.m_id, op, val); + break; + }); break; } val = 999; op = OP_SET; } - POSTGIVE_BIT(e, items, ITEM_JetpackRegen.m_itemid, SND(ITEMPICKUP), string_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, ITEM_Jetpack.m_itemid, SND(ITEMPICKUP), string_null); - FOREACH(Weapons, it != WEP_Null, LAMBDA( - POSTGIVE_WEAPON(e, it, SND(WEAPONPICKUP), string_null); + 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, ITEM_Jetpack.m_itemid, SND_ITEMPICKUP, SND_Null); + FOREACH(Weapons, it != WEP_Null, { + POSTGIVE_WEAPON(e, it, SND_WEAPONPICKUP, SND_Null); if(!(save_weapons & (it.m_wepset))) if(e.weapons & (it.m_wepset)) it.wr_init(it); - )); - POSTGIVE_VALUE(e, strength_finished, 1, SND(POWERUP), SND(POWEROFF)); - POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", SND(POWEROFF)); - POSTGIVE_VALUE(e, ammo_nails, 0, SND(ITEMPICKUP), string_null); - POSTGIVE_VALUE(e, ammo_cells, 0, SND(ITEMPICKUP), string_null); - POSTGIVE_VALUE(e, ammo_plasma, 0, SND(ITEMPICKUP), string_null); - POSTGIVE_VALUE(e, ammo_shells, 0, SND(ITEMPICKUP), string_null); - POSTGIVE_VALUE(e, ammo_rockets, 0, SND(ITEMPICKUP), 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, SND(ITEMPICKUP), string_null); - POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND(ARMOR25), string_null); - POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND(MEGAHEALTH), string_null); + }); + POSTGIVE_VALUE(e, strength_finished, 1, SND_POWERUP, SND_POWEROFF); + POSTGIVE_VALUE(e, invincible_finished, 1, SND_Shield, SND_POWEROFF); + POSTGIVE_VALUE(e, ammo_nails, 0, SND_ITEMPICKUP, SND_Null); + POSTGIVE_VALUE(e, ammo_cells, 0, SND_ITEMPICKUP, SND_Null); + POSTGIVE_VALUE(e, ammo_plasma, 0, SND_ITEMPICKUP, SND_Null); + POSTGIVE_VALUE(e, ammo_shells, 0, SND_ITEMPICKUP, SND_Null); + POSTGIVE_VALUE(e, ammo_rockets, 0, SND_ITEMPICKUP, SND_Null); + POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, SND_ITEMPICKUP, SND_Null); + POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_ARMOR25, SND_Null); + POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_MEGAHEALTH, SND_Null); if(e.superweapons_finished <= 0) if(self.weapons & WEPSET_SUPERWEAPONS)