diff options
Diffstat (limited to 'src/baseq2/g_items.c')
-rw-r--r-- | src/baseq2/g_items.c | 1064 |
1 files changed, 494 insertions, 570 deletions
diff --git a/src/baseq2/g_items.c b/src/baseq2/g_items.c index 3f4a23e..8926c8d 100644 --- a/src/baseq2/g_items.c +++ b/src/baseq2/g_items.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,21 +20,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "g_local.h" -qboolean Pickup_Weapon (edict_t *ent, edict_t *other); -void Use_Weapon (edict_t *ent, gitem_t *inv); -void Drop_Weapon (edict_t *ent, gitem_t *inv); +qboolean Pickup_Weapon(edict_t *ent, edict_t *other); +void Use_Weapon(edict_t *ent, gitem_t *inv); +void Drop_Weapon(edict_t *ent, gitem_t *inv); -void Weapon_Blaster (edict_t *ent); -void Weapon_Shotgun (edict_t *ent); -void Weapon_SuperShotgun (edict_t *ent); -void Weapon_Machinegun (edict_t *ent); -void Weapon_Chaingun (edict_t *ent); -void Weapon_HyperBlaster (edict_t *ent); -void Weapon_RocketLauncher (edict_t *ent); -void Weapon_Grenade (edict_t *ent); -void Weapon_GrenadeLauncher (edict_t *ent); -void Weapon_Railgun (edict_t *ent); -void Weapon_BFG (edict_t *ent); +void Weapon_Blaster(edict_t *ent); +void Weapon_Shotgun(edict_t *ent); +void Weapon_SuperShotgun(edict_t *ent); +void Weapon_Machinegun(edict_t *ent); +void Weapon_Chaingun(edict_t *ent); +void Weapon_HyperBlaster(edict_t *ent); +void Weapon_RocketLauncher(edict_t *ent); +void Weapon_Grenade(edict_t *ent); +void Weapon_GrenadeLauncher(edict_t *ent); +void Weapon_Railgun(edict_t *ent); +void Weapon_BFG(edict_t *ent); gitem_armor_t jacketarmor_info = { 25, 50, .30, .00, ARMOR_JACKET}; gitem_armor_t combatarmor_info = { 50, 100, .60, .30, ARMOR_COMBAT}; @@ -49,7 +49,7 @@ static int power_shield_index; #define HEALTH_IGNORE_MAX 1 #define HEALTH_TIMED 2 -void Use_Quad (edict_t *ent, gitem_t *item); +void Use_Quad(edict_t *ent, gitem_t *item); static int quad_drop_timeout_hack; //====================================================================== @@ -59,7 +59,7 @@ static int quad_drop_timeout_hack; GetItemByIndex =============== */ -gitem_t *GetItemByIndex (int index) +gitem_t *GetItemByIndex(int index) { if (index == 0 || index >= game.num_items) return NULL; @@ -74,14 +74,13 @@ FindItemByClassname =============== */ -gitem_t *FindItemByClassname (char *classname) +gitem_t *FindItemByClassname(char *classname) { int i; gitem_t *it; it = itemlist; - for (i=0 ; i<game.num_items ; i++, it++) - { + for (i = 0 ; i < game.num_items ; i++, it++) { if (!it->classname) continue; if (!Q_stricmp(it->classname, classname)) @@ -97,14 +96,13 @@ FindItem =============== */ -gitem_t *FindItem (char *pickup_name) +gitem_t *FindItem(char *pickup_name) { int i; gitem_t *it; it = itemlist; - for (i=0 ; i<game.num_items ; i++, it++) - { + for (i = 0 ; i < game.num_items ; i++, it++) { if (!it->pickup_name) continue; if (!Q_stricmp(it->pickup_name, pickup_name)) @@ -116,10 +114,9 @@ gitem_t *FindItem (char *pickup_name) //====================================================================== -void DoRespawn (edict_t *ent) +void DoRespawn(edict_t *ent) { - if (ent->team) - { + if (ent->team) { edict_t *master; int count; int choice; @@ -137,26 +134,26 @@ void DoRespawn (edict_t *ent) ent->svflags &= ~SVF_NOCLIENT; ent->solid = SOLID_TRIGGER; - gi.linkentity (ent); + gi.linkentity(ent); // send an effect ent->s.event = EV_ITEM_RESPAWN; } -void SetRespawn (edict_t *ent, float delay) +void SetRespawn(edict_t *ent, float delay) { ent->flags |= FL_RESPAWN; ent->svflags |= SVF_NOCLIENT; ent->solid = SOLID_NOT; ent->nextthink = level.time + delay; ent->think = DoRespawn; - gi.linkentity (ent); + gi.linkentity(ent); } //====================================================================== -qboolean Pickup_Powerup (edict_t *ent, edict_t *other) +qboolean Pickup_Powerup(edict_t *ent, edict_t *other) { int quantity; @@ -169,32 +166,30 @@ qboolean Pickup_Powerup (edict_t *ent, edict_t *other) other->client->pers.inventory[ITEM_INDEX(ent->item)]++; - if (deathmatch->value) - { - if (!(ent->spawnflags & DROPPED_ITEM) ) - SetRespawn (ent, ent->item->quantity); - if (((int)dmflags->value & DF_INSTANT_ITEMS) || ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM))) - { + if (deathmatch->value) { + if (!(ent->spawnflags & DROPPED_ITEM)) + SetRespawn(ent, ent->item->quantity); + if (((int)dmflags->value & DF_INSTANT_ITEMS) || ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM))) { if ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM)) quad_drop_timeout_hack = (ent->nextthink - level.time) / FRAMETIME; - ent->item->use (other, ent->item); + ent->item->use(other, ent->item); } } return qtrue; } -void Drop_General (edict_t *ent, gitem_t *item) +void Drop_General(edict_t *ent, gitem_t *item) { - Drop_Item (ent, item); + Drop_Item(ent, item); ent->client->pers.inventory[ITEM_INDEX(item)]--; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); } //====================================================================== -qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other) +qboolean Pickup_Adrenaline(edict_t *ent, edict_t *other) { if (!deathmatch->value) other->max_health += 1; @@ -203,22 +198,22 @@ qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other) other->health = other->max_health; if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value)) - SetRespawn (ent, ent->item->quantity); + SetRespawn(ent, ent->item->quantity); return qtrue; } -qboolean Pickup_AncientHead (edict_t *ent, edict_t *other) +qboolean Pickup_AncientHead(edict_t *ent, edict_t *other) { other->max_health += 2; if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value)) - SetRespawn (ent, ent->item->quantity); + SetRespawn(ent, ent->item->quantity); return qtrue; } -qboolean Pickup_Bandolier (edict_t *ent, edict_t *other) +qboolean Pickup_Bandolier(edict_t *ent, edict_t *other) { gitem_t *item; int index; @@ -233,8 +228,7 @@ qboolean Pickup_Bandolier (edict_t *ent, edict_t *other) other->client->pers.max_slugs = 75; item = FindItem("Bullets"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_bullets) @@ -242,8 +236,7 @@ qboolean Pickup_Bandolier (edict_t *ent, edict_t *other) } item = FindItem("Shells"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_shells) @@ -251,12 +244,12 @@ qboolean Pickup_Bandolier (edict_t *ent, edict_t *other) } if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value)) - SetRespawn (ent, ent->item->quantity); + SetRespawn(ent, ent->item->quantity); return qtrue; } -qboolean Pickup_Pack (edict_t *ent, edict_t *other) +qboolean Pickup_Pack(edict_t *ent, edict_t *other) { gitem_t *item; int index; @@ -275,8 +268,7 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other) other->client->pers.max_slugs = 100; item = FindItem("Bullets"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_bullets) @@ -284,8 +276,7 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other) } item = FindItem("Shells"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_shells) @@ -293,8 +284,7 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other) } item = FindItem("Cells"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_cells) @@ -302,8 +292,7 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other) } item = FindItem("Grenades"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_grenades) @@ -311,8 +300,7 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other) } item = FindItem("Rockets"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_rockets) @@ -320,8 +308,7 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other) } item = FindItem("Slugs"); - if (item) - { + if (item) { index = ITEM_INDEX(item); other->client->pers.inventory[index] += item->quantity; if (other->client->pers.inventory[index] > other->client->pers.max_slugs) @@ -329,27 +316,24 @@ qboolean Pickup_Pack (edict_t *ent, edict_t *other) } if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value)) - SetRespawn (ent, ent->item->quantity); + SetRespawn(ent, ent->item->quantity); return qtrue; } //====================================================================== -void Use_Quad (edict_t *ent, gitem_t *item) +void Use_Quad(edict_t *ent, gitem_t *item) { int timeout; ent->client->pers.inventory[ITEM_INDEX(item)]--; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); - if (quad_drop_timeout_hack) - { + if (quad_drop_timeout_hack) { timeout = quad_drop_timeout_hack; quad_drop_timeout_hack = 0; - } - else - { + } else { timeout = 300; } @@ -363,10 +347,10 @@ void Use_Quad (edict_t *ent, gitem_t *item) //====================================================================== -void Use_Breather (edict_t *ent, gitem_t *item) +void Use_Breather(edict_t *ent, gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); if (ent->client->breather_framenum > level.framenum) ent->client->breather_framenum += 300; @@ -378,10 +362,10 @@ void Use_Breather (edict_t *ent, gitem_t *item) //====================================================================== -void Use_Envirosuit (edict_t *ent, gitem_t *item) +void Use_Envirosuit(edict_t *ent, gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); if (ent->client->enviro_framenum > level.framenum) ent->client->enviro_framenum += 300; @@ -393,10 +377,10 @@ void Use_Envirosuit (edict_t *ent, gitem_t *item) //====================================================================== -void Use_Invulnerability (edict_t *ent, gitem_t *item) +void Use_Invulnerability(edict_t *ent, gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); if (ent->client->invincible_framenum > level.framenum) ent->client->invincible_framenum += 300; @@ -408,10 +392,10 @@ void Use_Invulnerability (edict_t *ent, gitem_t *item) //====================================================================== -void Use_Silencer (edict_t *ent, gitem_t *item) +void Use_Silencer(edict_t *ent, gitem_t *item) { ent->client->pers.inventory[ITEM_INDEX(item)]--; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); ent->client->silencer_shots += 30; // gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0); @@ -419,19 +403,15 @@ void Use_Silencer (edict_t *ent, gitem_t *item) //====================================================================== -qboolean Pickup_Key (edict_t *ent, edict_t *other) +qboolean Pickup_Key(edict_t *ent, edict_t *other) { - if (coop->value) - { - if (strcmp(ent->classname, "key_power_cube") == 0) - { - if (other->client->pers.power_cubes & ((ent->spawnflags & 0x0000ff00)>> 8)) + if (coop->value) { + if (strcmp(ent->classname, "key_power_cube") == 0) { + if (other->client->pers.power_cubes & ((ent->spawnflags & 0x0000ff00) >> 8)) return qfalse; other->client->pers.inventory[ITEM_INDEX(ent->item)]++; other->client->pers.power_cubes |= ((ent->spawnflags & 0x0000ff00) >> 8); - } - else - { + } else { if (other->client->pers.inventory[ITEM_INDEX(ent->item)]) return qfalse; other->client->pers.inventory[ITEM_INDEX(ent->item)] = 1; @@ -444,7 +424,7 @@ qboolean Pickup_Key (edict_t *ent, edict_t *other) //====================================================================== -qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count) +qboolean Add_Ammo(edict_t *ent, gitem_t *item, int count) { int index; int max; @@ -480,14 +460,14 @@ qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count) return qtrue; } -qboolean Pickup_Ammo (edict_t *ent, edict_t *other) +qboolean Pickup_Ammo(edict_t *ent, edict_t *other) { int oldcount; int count; qboolean weapon; weapon = (ent->item->flags & IT_WEAPON); - if ( (weapon) && ( (int)dmflags->value & DF_INFINITE_AMMO ) ) + if ((weapon) && ((int)dmflags->value & DF_INFINITE_AMMO)) count = 1000; else if (ent->count) count = ent->count; @@ -496,64 +476,62 @@ qboolean Pickup_Ammo (edict_t *ent, edict_t *other) oldcount = other->client->pers.inventory[ITEM_INDEX(ent->item)]; - if (!Add_Ammo (other, ent->item, count)) + if (!Add_Ammo(other, ent->item, count)) return qfalse; - if (weapon && !oldcount) - { - if (other->client->pers.weapon != ent->item && ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) ) + if (weapon && !oldcount) { + if (other->client->pers.weapon != ent->item && (!deathmatch->value || other->client->pers.weapon == FindItem("blaster"))) other->client->newweapon = ent->item; } if (!(ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)) && (deathmatch->value)) - SetRespawn (ent, 30); + SetRespawn(ent, 30); return qtrue; } -void Drop_Ammo (edict_t *ent, gitem_t *item) +void Drop_Ammo(edict_t *ent, gitem_t *item) { edict_t *dropped; int index; index = ITEM_INDEX(item); - dropped = Drop_Item (ent, item); + dropped = Drop_Item(ent, item); if (ent->client->pers.inventory[index] >= item->quantity) dropped->count = item->quantity; else dropped->count = ent->client->pers.inventory[index]; - if (ent->client->pers.weapon && + if (ent->client->pers.weapon && ent->client->pers.weapon->tag == AMMO_GRENADES && item->tag == AMMO_GRENADES && ent->client->pers.inventory[index] - dropped->count <= 0) { - gi.cprintf (ent, PRINT_HIGH, "Can't drop current weapon\n"); + gi.cprintf(ent, PRINT_HIGH, "Can't drop current weapon\n"); G_FreeEdict(dropped); return; } ent->client->pers.inventory[index] -= dropped->count; - ValidateSelectedItem (ent); + ValidateSelectedItem(ent); } //====================================================================== -void MegaHealth_think (edict_t *self) +void MegaHealth_think(edict_t *self) { - if (self->owner->health > self->owner->max_health) - { + if (self->owner->health > self->owner->max_health) { self->nextthink = level.time + 1; self->owner->health -= 1; return; } if (!(self->spawnflags & DROPPED_ITEM) && (deathmatch->value)) - SetRespawn (self, 20); + SetRespawn(self, 20); else - G_FreeEdict (self); + G_FreeEdict(self); } -qboolean Pickup_Health (edict_t *ent, edict_t *other) +qboolean Pickup_Health(edict_t *ent, edict_t *other) { if (!(ent->style & HEALTH_IGNORE_MAX)) if (other->health >= other->max_health) @@ -561,25 +539,21 @@ qboolean Pickup_Health (edict_t *ent, edict_t *other) other->health += ent->count; - if (!(ent->style & HEALTH_IGNORE_MAX)) - { + if (!(ent->style & HEALTH_IGNORE_MAX)) { if (other->health > other->max_health) other->health = other->max_health; } - if (ent->style & HEALTH_TIMED) - { + if (ent->style & HEALTH_TIMED) { ent->think = MegaHealth_think; ent->nextthink = level.time + 5; ent->owner = other; ent->flags |= FL_RESPAWN; ent->svflags |= SVF_NOCLIENT; ent->solid = SOLID_NOT; - } - else - { + } else { if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value)) - SetRespawn (ent, 30); + SetRespawn(ent, 30); } return qtrue; @@ -587,7 +561,7 @@ qboolean Pickup_Health (edict_t *ent, edict_t *other) //====================================================================== -int ArmorIndex (edict_t *ent) +int ArmorIndex(edict_t *ent) { if (!ent->client) return 0; @@ -604,7 +578,7 @@ int ArmorIndex (edict_t *ent) return 0; } -qboolean Pickup_Armor (edict_t *ent, edict_t *other) +qboolean Pickup_Armor(edict_t *ent, edict_t *other) { int old_armor_index; gitem_armor_t *oldinfo; @@ -616,11 +590,10 @@ qboolean Pickup_Armor (edict_t *ent, edict_t *other) // get info on new armor newinfo = (gitem_armor_t *)ent->item->info; - old_armor_index = ArmorIndex (other); + old_armor_index = ArmorIndex(other); // handle armor shards specially - if (ent->item->tag == ARMOR_SHARD) - { + if (ent->item->tag == ARMOR_SHARD) { if (!old_armor_index) other->client->pers.inventory[jacket_armor_index] = 2; else @@ -628,14 +601,12 @@ qboolean Pickup_Armor (edict_t *ent, edict_t *other) } // if player has no armor, just use it - else if (!old_armor_index) - { + else if (!old_armor_index) { other->client->pers.inventory[ITEM_INDEX(ent->item)] = newinfo->base_count; } // use the better armor - else - { + else { // get info on old armor if (old_armor_index == jacket_armor_index) oldinfo = &jacketarmor_info; @@ -644,8 +615,7 @@ qboolean Pickup_Armor (edict_t *ent, edict_t *other) else // (old_armor_index == body_armor_index) oldinfo = &bodyarmor_info; - if (newinfo->normal_protection > oldinfo->normal_protection) - { + if (newinfo->normal_protection > oldinfo->normal_protection) { // calc new armor values salvage = oldinfo->normal_protection / newinfo->normal_protection; salvagecount = salvage * other->client->pers.inventory[old_armor_index]; @@ -658,9 +628,7 @@ qboolean Pickup_Armor (edict_t *ent, edict_t *other) // change armor to new item with computed value other->client->pers.inventory[ITEM_INDEX(ent->item)] = newcount; - } - else - { + } else { // calc new armor values salvage = newinfo->normal_protection / oldinfo->normal_protection; salvagecount = salvage * newinfo->base_count; @@ -678,14 +646,14 @@ qboolean Pickup_Armor (edict_t *ent, edict_t *other) } if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value)) - SetRespawn (ent, 20); + SetRespawn(ent, 20); return qtrue; } //====================================================================== -int PowerArmorType (edict_t *ent) +int PowerArmorType(edict_t *ent) { if (!ent->client) return POWER_ARMOR_NONE; @@ -702,21 +670,17 @@ int PowerArmorType (edict_t *ent) return POWER_ARMOR_NONE; } -void Use_PowerArmor (edict_t *ent, gitem_t *item) +void Use_PowerArmor(edict_t *ent, gitem_t *item) { int index; - if (ent->flags & FL_POWER_ARMOR) - { + if (ent->flags & FL_POWER_ARMOR) { ent->flags &= ~FL_POWER_ARMOR; gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0); - } - else - { + } else { index = ITEM_INDEX(FindItem("cells")); - if (!ent->client->pers.inventory[index]) - { - gi.cprintf (ent, PRINT_HIGH, "No cells for power armor.\n"); + if (!ent->client->pers.inventory[index]) { + gi.cprintf(ent, PRINT_HIGH, "No cells for power armor.\n"); return; } ent->flags |= FL_POWER_ARMOR; @@ -724,7 +688,7 @@ void Use_PowerArmor (edict_t *ent, gitem_t *item) } } -qboolean Pickup_PowerArmor (edict_t *ent, edict_t *other) +qboolean Pickup_PowerArmor(edict_t *ent, edict_t *other) { int quantity; @@ -732,23 +696,22 @@ qboolean Pickup_PowerArmor (edict_t *ent, edict_t *other) other->client->pers.inventory[ITEM_INDEX(ent->item)]++; - if (deathmatch->value) - { - if (!(ent->spawnflags & DROPPED_ITEM) ) - SetRespawn (ent, ent->item->quantity); + if (deathmatch->value) { + if (!(ent->spawnflags & DROPPED_ITEM)) + SetRespawn(ent, ent->item->quantity); // auto-use for DM only if we didn't already have one if (!quantity) - ent->item->use (other, ent->item); + ent->item->use(other, ent->item); } return qtrue; } -void Drop_PowerArmor (edict_t *ent, gitem_t *item) +void Drop_PowerArmor(edict_t *ent, gitem_t *item) { if ((ent->flags & FL_POWER_ARMOR) && (ent->client->pers.inventory[ITEM_INDEX(item)] == 1)) - Use_PowerArmor (ent, item); - Drop_General (ent, item); + Use_PowerArmor(ent, item); + Drop_General(ent, item); } //====================================================================== @@ -758,7 +721,7 @@ void Drop_PowerArmor (edict_t *ent, gitem_t *item) Touch_Item =============== */ -void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) +void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { qboolean taken; @@ -771,22 +734,20 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf taken = ent->item->pickup(ent, other); - if (taken) - { + if (taken) { // flash the screen - other->client->bonus_alpha = 0.25; + other->client->bonus_alpha = 0.25; // show icon and name on status bar other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(ent->item->icon); - other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS+ITEM_INDEX(ent->item); + other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ITEM_INDEX(ent->item); other->client->pickup_msg_time = level.time + 3.0; // change selected item if (ent->item->use) other->client->pers.selected_item = other->client->ps.stats[STAT_SELECTED_ITEM] = ITEM_INDEX(ent->item); - if (ent->item->pickup == Pickup_Health) - { + if (ent->item->pickup == Pickup_Health) { if (ent->count == 2) gi.sound(other, CHAN_ITEM, gi.soundindex("items/s_health.wav"), 1, ATTN_NORM, 0); else if (ent->count == 10) @@ -795,52 +756,47 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf gi.sound(other, CHAN_ITEM, gi.soundindex("items/l_health.wav"), 1, ATTN_NORM, 0); else // (ent->count == 100) gi.sound(other, CHAN_ITEM, gi.soundindex("items/m_health.wav"), 1, ATTN_NORM, 0); - } - else if (ent->item->pickup_sound) - { + } else if (ent->item->pickup_sound) { gi.sound(other, CHAN_ITEM, gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0); } } - if (!(ent->spawnflags & ITEM_TARGETS_USED)) - { - G_UseTargets (ent, other); + if (!(ent->spawnflags & ITEM_TARGETS_USED)) { + G_UseTargets(ent, other); ent->spawnflags |= ITEM_TARGETS_USED; } if (!taken) return; - if (!((coop->value) && (ent->item->flags & IT_STAY_COOP)) || (ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM))) - { + if (!((coop->value) && (ent->item->flags & IT_STAY_COOP)) || (ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM))) { if (ent->flags & FL_RESPAWN) ent->flags &= ~FL_RESPAWN; else - G_FreeEdict (ent); + G_FreeEdict(ent); } } //====================================================================== -void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) +void drop_temp_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { if (other == ent->owner) return; - Touch_Item (ent, other, plane, surf); + Touch_Item(ent, other, plane, surf); } -void drop_make_touchable (edict_t *ent) +void drop_make_touchable(edict_t *ent) { ent->touch = Touch_Item; - if (deathmatch->value) - { + if (deathmatch->value) { ent->nextthink = level.time + 29; ent->think = G_FreeEdict; } } -edict_t *Drop_Item (edict_t *ent, gitem_t *item) +edict_t *Drop_Item(edict_t *ent, gitem_t *item) { edict_t *dropped; vec3_t forward, right; @@ -853,59 +809,53 @@ edict_t *Drop_Item (edict_t *ent, gitem_t *item) dropped->spawnflags = DROPPED_ITEM; dropped->s.effects = item->world_model_flags; dropped->s.renderfx = RF_GLOW; - VectorSet (dropped->mins, -15, -15, -15); - VectorSet (dropped->maxs, 15, 15, 15); - gi.setmodel (dropped, dropped->item->world_model); + VectorSet(dropped->mins, -15, -15, -15); + VectorSet(dropped->maxs, 15, 15, 15); + gi.setmodel(dropped, dropped->item->world_model); dropped->solid = SOLID_TRIGGER; - dropped->movetype = MOVETYPE_TOSS; + dropped->movetype = MOVETYPE_TOSS; dropped->touch = drop_temp_touch; dropped->owner = ent; - if (ent->client) - { + if (ent->client) { trace_t trace; - AngleVectors (ent->client->v_angle, forward, right, NULL); + AngleVectors(ent->client->v_angle, forward, right, NULL); VectorSet(offset, 24, 0, -16); - G_ProjectSource (ent->s.origin, offset, forward, right, dropped->s.origin); - trace = gi.trace (ent->s.origin, dropped->mins, dropped->maxs, - dropped->s.origin, ent, CONTENTS_SOLID); - VectorCopy (trace.endpos, dropped->s.origin); - } - else - { - AngleVectors (ent->s.angles, forward, right, NULL); - VectorCopy (ent->s.origin, dropped->s.origin); + G_ProjectSource(ent->s.origin, offset, forward, right, dropped->s.origin); + trace = gi.trace(ent->s.origin, dropped->mins, dropped->maxs, + dropped->s.origin, ent, CONTENTS_SOLID); + VectorCopy(trace.endpos, dropped->s.origin); + } else { + AngleVectors(ent->s.angles, forward, right, NULL); + VectorCopy(ent->s.origin, dropped->s.origin); } - VectorScale (forward, 100, dropped->velocity); + VectorScale(forward, 100, dropped->velocity); dropped->velocity[2] = 300; dropped->think = drop_make_touchable; dropped->nextthink = level.time + 1; - gi.linkentity (dropped); + gi.linkentity(dropped); return dropped; } -void Use_Item (edict_t *ent, edict_t *other, edict_t *activator) +void Use_Item(edict_t *ent, edict_t *other, edict_t *activator) { ent->svflags &= ~SVF_NOCLIENT; ent->use = NULL; - if (ent->spawnflags & ITEM_NO_TOUCH) - { + if (ent->spawnflags & ITEM_NO_TOUCH) { ent->solid = SOLID_BBOX; ent->touch = NULL; - } - else - { + } else { ent->solid = SOLID_TRIGGER; ent->touch = Touch_Item; } - gi.linkentity (ent); + gi.linkentity(ent); } //====================================================================== @@ -915,69 +865,64 @@ void Use_Item (edict_t *ent, edict_t *other, edict_t *activator) droptofloor ================ */ -void droptofloor (edict_t *ent) +void droptofloor(edict_t *ent) { trace_t tr; vec3_t dest; float *v; - v = tv(-15,-15,-15); - VectorCopy (v, ent->mins); - v = tv(15,15,15); - VectorCopy (v, ent->maxs); + v = tv(-15, -15, -15); + VectorCopy(v, ent->mins); + v = tv(15, 15, 15); + VectorCopy(v, ent->maxs); if (ent->model) - gi.setmodel (ent, ent->model); + gi.setmodel(ent, ent->model); else - gi.setmodel (ent, ent->item->world_model); + gi.setmodel(ent, ent->item->world_model); ent->solid = SOLID_TRIGGER; - ent->movetype = MOVETYPE_TOSS; + ent->movetype = MOVETYPE_TOSS; ent->touch = Touch_Item; - v = tv(0,0,-128); - VectorAdd (ent->s.origin, v, dest); + v = tv(0, 0, -128); + VectorAdd(ent->s.origin, v, dest); - tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID); - if (tr.startsolid) - { - gi.dprintf ("droptofloor: %s startsolid at %s\n", ent->classname, vtos(ent->s.origin)); - G_FreeEdict (ent); + tr = gi.trace(ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID); + if (tr.startsolid) { + gi.dprintf("droptofloor: %s startsolid at %s\n", ent->classname, vtos(ent->s.origin)); + G_FreeEdict(ent); return; } - VectorCopy (tr.endpos, ent->s.origin); + VectorCopy(tr.endpos, ent->s.origin); - if (ent->team) - { + if (ent->team) { ent->flags &= ~FL_TEAMSLAVE; ent->chain = ent->teamchain; ent->teamchain = NULL; ent->svflags |= SVF_NOCLIENT; ent->solid = SOLID_NOT; - if (ent == ent->teammaster) - { + if (ent == ent->teammaster) { ent->nextthink = level.time + FRAMETIME; ent->think = DoRespawn; } } - if (ent->spawnflags & ITEM_NO_TOUCH) - { + if (ent->spawnflags & ITEM_NO_TOUCH) { ent->solid = SOLID_BBOX; ent->touch = NULL; ent->s.effects &= ~EF_ROTATE; ent->s.renderfx &= ~RF_GLOW; } - if (ent->spawnflags & ITEM_TRIGGER_SPAWN) - { + if (ent->spawnflags & ITEM_TRIGGER_SPAWN) { ent->svflags |= SVF_NOCLIENT; ent->solid = SOLID_NOT; ent->use = Use_Item; } - gi.linkentity (ent); + gi.linkentity(ent); } @@ -990,7 +935,7 @@ This will be called for each item spawned in a level, and for each item in each client's inventory. =============== */ -void PrecacheItem (gitem_t *it) +void PrecacheItem(gitem_t *it) { char *s, *start; char data[MAX_QPATH]; @@ -1001,20 +946,19 @@ void PrecacheItem (gitem_t *it) return; if (it->pickup_sound) - gi.soundindex (it->pickup_sound); + gi.soundindex(it->pickup_sound); if (it->world_model) - gi.modelindex (it->world_model); + gi.modelindex(it->world_model); if (it->view_model) - gi.modelindex (it->view_model); + gi.modelindex(it->view_model); if (it->icon) - gi.imageindex (it->icon); + gi.imageindex(it->icon); // parse everything for its ammo - if (it->ammo && it->ammo[0]) - { - ammo = FindItem (it->ammo); + if (it->ammo && it->ammo[0]) { + ammo = FindItem(it->ammo); if (ammo != it) - PrecacheItem (ammo); + PrecacheItem(ammo); } // parse the space seperated precache string for other items @@ -1022,29 +966,28 @@ void PrecacheItem (gitem_t *it) if (!s || !s[0]) return; - while (*s) - { + while (*s) { start = s; while (*s && *s != ' ') s++; - len = s-start; + len = s - start; if (len >= MAX_QPATH || len < 5) - gi.error ("PrecacheItem: %s has bad precache string", it->classname); - memcpy (data, start, len); + gi.error("PrecacheItem: %s has bad precache string", it->classname); + memcpy(data, start, len); data[len] = 0; if (*s) s++; // determine type based on extension - if (!strcmp(data+len-3, "md2")) - gi.modelindex (data); - else if (!strcmp(data+len-3, "sp2")) - gi.modelindex (data); - else if (!strcmp(data+len-3, "wav")) - gi.soundindex (data); - if (!strcmp(data+len-3, "pcx")) - gi.imageindex (data); + if (!strcmp(data + len - 3, "md2")) + gi.modelindex(data); + else if (!strcmp(data + len - 3, "sp2")) + gi.modelindex(data); + else if (!strcmp(data + len - 3, "wav")) + gi.soundindex(data); + if (!strcmp(data + len - 3, "pcx")) + gi.imageindex(data); } } @@ -1058,65 +1001,52 @@ Items can't be immediately dropped to floor, because they might be on an entity that hasn't spawned yet. ============ */ -void SpawnItem (edict_t *ent, gitem_t *item) +void SpawnItem(edict_t *ent, gitem_t *item) { - PrecacheItem (item); + PrecacheItem(item); - if (ent->spawnflags) - { - if (strcmp(ent->classname, "key_power_cube") != 0) - { + if (ent->spawnflags) { + if (strcmp(ent->classname, "key_power_cube") != 0) { ent->spawnflags = 0; gi.dprintf("%s at %s has invalid spawnflags set\n", ent->classname, vtos(ent->s.origin)); } } // some items will be prevented in deathmatch - if (deathmatch->value) - { - if ( (int)dmflags->value & DF_NO_ARMOR ) - { - if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor) - { - G_FreeEdict (ent); + if (deathmatch->value) { + if ((int)dmflags->value & DF_NO_ARMOR) { + if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor) { + G_FreeEdict(ent); return; } } - if ( (int)dmflags->value & DF_NO_ITEMS ) - { - if (item->pickup == Pickup_Powerup) - { - G_FreeEdict (ent); + if ((int)dmflags->value & DF_NO_ITEMS) { + if (item->pickup == Pickup_Powerup) { + G_FreeEdict(ent); return; } } - if ( (int)dmflags->value & DF_NO_HEALTH ) - { - if (item->pickup == Pickup_Health || item->pickup == Pickup_Adrenaline || item->pickup == Pickup_AncientHead) - { - G_FreeEdict (ent); + if ((int)dmflags->value & DF_NO_HEALTH) { + if (item->pickup == Pickup_Health || item->pickup == Pickup_Adrenaline || item->pickup == Pickup_AncientHead) { + G_FreeEdict(ent); return; } } - if ( (int)dmflags->value & DF_INFINITE_AMMO ) - { - if ( (item->flags == IT_AMMO) || (strcmp(ent->classname, "weapon_bfg") == 0) ) - { - G_FreeEdict (ent); + if ((int)dmflags->value & DF_INFINITE_AMMO) { + if ((item->flags == IT_AMMO) || (strcmp(ent->classname, "weapon_bfg") == 0)) { + G_FreeEdict(ent); return; } } } - if (coop->value && (strcmp(ent->classname, "key_power_cube") == 0)) - { + if (coop->value && (strcmp(ent->classname, "key_power_cube") == 0)) { ent->spawnflags |= (1 << (8 + level.power_cubes)); level.power_cubes++; } // don't let them drop items that stay in a coop game - if ((coop->value) && (item->flags & IT_STAY_COOP)) - { + if ((coop->value) && (item->flags & IT_STAY_COOP)) { item->drop = NULL; } @@ -1126,13 +1056,12 @@ void SpawnItem (edict_t *ent, gitem_t *item) ent->s.effects = item->world_model_flags; ent->s.renderfx = RF_GLOW; if (ent->model) - gi.modelindex (ent->model); + gi.modelindex(ent->model); } //====================================================================== -gitem_t itemlist[] = -{ +gitem_t itemlist[] = { { NULL }, // leave index 0 alone @@ -1141,10 +1070,10 @@ gitem_t itemlist[] = // ARMOR // -/*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "item_armor_body", + "item_armor_body", Pickup_Armor, NULL, NULL, @@ -1152,22 +1081,22 @@ gitem_t itemlist[] = "misc/ar1_pkup.wav", "models/items/armor/body/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_bodyarmor", -/* pickup */ "Body Armor", -/* width */ 3, + /* icon */ "i_bodyarmor", + /* pickup */ "Body Armor", + /* width */ 3, 0, NULL, IT_ARMOR, 0, &bodyarmor_info, ARMOR_BODY, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "item_armor_combat", + "item_armor_combat", Pickup_Armor, NULL, NULL, @@ -1175,22 +1104,22 @@ gitem_t itemlist[] = "misc/ar1_pkup.wav", "models/items/armor/combat/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_combatarmor", -/* pickup */ "Combat Armor", -/* width */ 3, + /* icon */ "i_combatarmor", + /* pickup */ "Combat Armor", + /* width */ 3, 0, NULL, IT_ARMOR, 0, &combatarmor_info, ARMOR_COMBAT, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_armor_jacket (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_armor_jacket (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "item_armor_jacket", + "item_armor_jacket", Pickup_Armor, NULL, NULL, @@ -1198,22 +1127,22 @@ gitem_t itemlist[] = "misc/ar1_pkup.wav", "models/items/armor/jacket/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_jacketarmor", -/* pickup */ "Jacket Armor", -/* width */ 3, + /* icon */ "i_jacketarmor", + /* pickup */ "Jacket Armor", + /* width */ 3, 0, NULL, IT_ARMOR, 0, &jacketarmor_info, ARMOR_JACKET, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "item_armor_shard", + "item_armor_shard", Pickup_Armor, NULL, NULL, @@ -1221,23 +1150,23 @@ gitem_t itemlist[] = "misc/ar2_pkup.wav", "models/items/armor/shard/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_jacketarmor", -/* pickup */ "Armor Shard", -/* width */ 3, + /* icon */ "i_jacketarmor", + /* pickup */ "Armor Shard", + /* width */ 3, 0, NULL, IT_ARMOR, 0, NULL, ARMOR_SHARD, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_power_screen (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_power_screen (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "item_power_screen", + "item_power_screen", Pickup_PowerArmor, Use_PowerArmor, Drop_PowerArmor, @@ -1245,20 +1174,20 @@ gitem_t itemlist[] = "misc/ar3_pkup.wav", "models/items/armor/screen/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_powerscreen", -/* pickup */ "Power Screen", -/* width */ 0, + /* icon */ "i_powerscreen", + /* pickup */ "Power Screen", + /* width */ 0, 60, NULL, IT_ARMOR, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_power_shield (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_power_shield (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "item_power_shield", Pickup_PowerArmor, @@ -1268,28 +1197,28 @@ gitem_t itemlist[] = "misc/ar3_pkup.wav", "models/items/armor/shield/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_powershield", -/* pickup */ "Power Shield", -/* width */ 0, + /* icon */ "i_powershield", + /* pickup */ "Power Shield", + /* width */ 0, 60, NULL, IT_ARMOR, 0, NULL, 0, -/* precache */ "misc/power2.wav misc/power1.wav" + /* precache */ "misc/power2.wav misc/power1.wav" }, // - // WEAPONS + // WEAPONS // -/* weapon_blaster (.3 .3 1) (-16 -16 -16) (16 16 16) -always owned, never in the world -*/ + /* weapon_blaster (.3 .3 1) (-16 -16 -16) (16 16 16) + always owned, never in the world + */ { - "weapon_blaster", + "weapon_blaster", NULL, Use_Weapon, NULL, @@ -1297,22 +1226,22 @@ always owned, never in the world "misc/w_pkup.wav", NULL, 0, "models/weapons/v_blast/tris.md2", -/* icon */ "w_blaster", -/* pickup */ "Blaster", + /* icon */ "w_blaster", + /* pickup */ "Blaster", 0, 0, NULL, - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_BLASTER, NULL, 0, -/* precache */ "weapons/blastf1a.wav misc/lasfly.wav" + /* precache */ "weapons/blastf1a.wav misc/lasfly.wav" }, -/*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "weapon_shotgun", + "weapon_shotgun", Pickup_Weapon, Use_Weapon, Drop_Weapon, @@ -1320,22 +1249,22 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_shotg/tris.md2", EF_ROTATE, "models/weapons/v_shotg/tris.md2", -/* icon */ "w_shotgun", -/* pickup */ "Shotgun", + /* icon */ "w_shotgun", + /* pickup */ "Shotgun", 0, 1, "Shells", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_SHOTGUN, NULL, 0, -/* precache */ "weapons/shotgf1b.wav weapons/shotgr1b.wav" + /* precache */ "weapons/shotgf1b.wav weapons/shotgr1b.wav" }, -/*QUAKED weapon_supershotgun (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_supershotgun (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "weapon_supershotgun", + "weapon_supershotgun", Pickup_Weapon, Use_Weapon, Drop_Weapon, @@ -1343,22 +1272,22 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_shotg2/tris.md2", EF_ROTATE, "models/weapons/v_shotg2/tris.md2", -/* icon */ "w_sshotgun", -/* pickup */ "Super Shotgun", + /* icon */ "w_sshotgun", + /* pickup */ "Super Shotgun", 0, 2, "Shells", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_SUPERSHOTGUN, NULL, 0, -/* precache */ "weapons/sshotf1b.wav" + /* precache */ "weapons/sshotf1b.wav" }, -/*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "weapon_machinegun", + "weapon_machinegun", Pickup_Weapon, Use_Weapon, Drop_Weapon, @@ -1366,22 +1295,22 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_machn/tris.md2", EF_ROTATE, "models/weapons/v_machn/tris.md2", -/* icon */ "w_machinegun", -/* pickup */ "Machinegun", + /* icon */ "w_machinegun", + /* pickup */ "Machinegun", 0, 1, "Bullets", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_MACHINEGUN, NULL, 0, -/* precache */ "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav" + /* precache */ "weapons/machgf1b.wav weapons/machgf2b.wav weapons/machgf3b.wav weapons/machgf4b.wav weapons/machgf5b.wav" }, -/*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "weapon_chaingun", + "weapon_chaingun", Pickup_Weapon, Use_Weapon, Drop_Weapon, @@ -1389,20 +1318,20 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_chain/tris.md2", EF_ROTATE, "models/weapons/v_chain/tris.md2", -/* icon */ "w_chaingun", -/* pickup */ "Chaingun", + /* icon */ "w_chaingun", + /* pickup */ "Chaingun", 0, 1, "Bullets", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_CHAINGUN, NULL, 0, -/* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav" + /* precache */ "weapons/chngnu1a.wav weapons/chngnl1a.wav weapons/machgf3b.wav` weapons/chngnd1a.wav" }, -/*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "ammo_grenades", Pickup_Ammo, @@ -1412,20 +1341,20 @@ always owned, never in the world "misc/am_pkup.wav", "models/items/ammo/grenades/medium/tris.md2", 0, "models/weapons/v_handgr/tris.md2", -/* icon */ "a_grenades", -/* pickup */ "Grenades", -/* width */ 3, + /* icon */ "a_grenades", + /* pickup */ "Grenades", + /* width */ 3, 5, "grenades", - IT_AMMO|IT_WEAPON, + IT_AMMO | IT_WEAPON, WEAP_GRENADES, NULL, AMMO_GRENADES, -/* precache */ "weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav " + /* precache */ "weapons/hgrent1a.wav weapons/hgrena1b.wav weapons/hgrenc1b.wav weapons/hgrenb1a.wav weapons/hgrenb2a.wav " }, -/*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "weapon_grenadelauncher", Pickup_Weapon, @@ -1435,20 +1364,20 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_launch/tris.md2", EF_ROTATE, "models/weapons/v_launch/tris.md2", -/* icon */ "w_glauncher", -/* pickup */ "Grenade Launcher", + /* icon */ "w_glauncher", + /* pickup */ "Grenade Launcher", 0, 1, "Grenades", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_GRENADELAUNCHER, NULL, 0, -/* precache */ "models/objects/grenade/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav" + /* precache */ "models/objects/grenade/tris.md2 weapons/grenlf1a.wav weapons/grenlr1b.wav weapons/grenlb1b.wav" }, -/*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "weapon_rocketlauncher", Pickup_Weapon, @@ -1458,22 +1387,22 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_rocket/tris.md2", EF_ROTATE, "models/weapons/v_rocket/tris.md2", -/* icon */ "w_rlauncher", -/* pickup */ "Rocket Launcher", + /* icon */ "w_rlauncher", + /* pickup */ "Rocket Launcher", 0, 1, "Rockets", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_ROCKETLAUNCHER, NULL, 0, -/* precache */ "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2" + /* precache */ "models/objects/rocket/tris.md2 weapons/rockfly.wav weapons/rocklf1a.wav weapons/rocklr1b.wav models/objects/debris2/tris.md2" }, -/*QUAKED weapon_hyperblaster (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_hyperblaster (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "weapon_hyperblaster", + "weapon_hyperblaster", Pickup_Weapon, Use_Weapon, Drop_Weapon, @@ -1481,22 +1410,22 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_hyperb/tris.md2", EF_ROTATE, "models/weapons/v_hyperb/tris.md2", -/* icon */ "w_hyperblaster", -/* pickup */ "HyperBlaster", + /* icon */ "w_hyperblaster", + /* pickup */ "HyperBlaster", 0, 1, "Cells", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_HYPERBLASTER, NULL, 0, -/* precache */ "weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav" + /* precache */ "weapons/hyprbu1a.wav weapons/hyprbl1a.wav weapons/hyprbf1a.wav weapons/hyprbd1a.wav misc/lasfly.wav" }, -/*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "weapon_railgun", + "weapon_railgun", Pickup_Weapon, Use_Weapon, Drop_Weapon, @@ -1504,20 +1433,20 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_rail/tris.md2", EF_ROTATE, "models/weapons/v_rail/tris.md2", -/* icon */ "w_railgun", -/* pickup */ "Railgun", + /* icon */ "w_railgun", + /* pickup */ "Railgun", 0, 1, "Slugs", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_RAILGUN, NULL, 0, -/* precache */ "weapons/rg_hum.wav" + /* precache */ "weapons/rg_hum.wav" }, -/*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "weapon_bfg", Pickup_Weapon, @@ -1527,24 +1456,24 @@ always owned, never in the world "misc/w_pkup.wav", "models/weapons/g_bfg/tris.md2", EF_ROTATE, "models/weapons/v_bfg/tris.md2", -/* icon */ "w_bfg", -/* pickup */ "BFG10K", + /* icon */ "w_bfg", + /* pickup */ "BFG10K", 0, 50, "Cells", - IT_WEAPON|IT_STAY_COOP, + IT_WEAPON | IT_STAY_COOP, WEAP_BFG, NULL, 0, -/* precache */ "sprites/s_bfg1.sp2 sprites/s_bfg2.sp2 sprites/s_bfg3.sp2 weapons/bfg__f1y.wav weapons/bfg__l1a.wav weapons/bfg__x1b.wav weapons/bfg_hum.wav" + /* precache */ "sprites/s_bfg1.sp2 sprites/s_bfg2.sp2 sprites/s_bfg3.sp2 weapons/bfg__f1y.wav weapons/bfg__l1a.wav weapons/bfg__x1b.wav weapons/bfg_hum.wav" }, // // AMMO ITEMS // -/*QUAKED ammo_shells (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED ammo_shells (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "ammo_shells", Pickup_Ammo, @@ -1554,20 +1483,20 @@ always owned, never in the world "misc/am_pkup.wav", "models/items/ammo/shells/medium/tris.md2", 0, NULL, -/* icon */ "a_shells", -/* pickup */ "Shells", -/* width */ 3, + /* icon */ "a_shells", + /* pickup */ "Shells", + /* width */ 3, 10, NULL, IT_AMMO, 0, NULL, AMMO_SHELLS, -/* precache */ "" + /* precache */ "" }, -/*QUAKED ammo_bullets (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED ammo_bullets (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "ammo_bullets", Pickup_Ammo, @@ -1577,20 +1506,20 @@ always owned, never in the world "misc/am_pkup.wav", "models/items/ammo/bullets/medium/tris.md2", 0, NULL, -/* icon */ "a_bullets", -/* pickup */ "Bullets", -/* width */ 3, + /* icon */ "a_bullets", + /* pickup */ "Bullets", + /* width */ 3, 50, NULL, IT_AMMO, 0, NULL, AMMO_BULLETS, -/* precache */ "" + /* precache */ "" }, -/*QUAKED ammo_cells (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED ammo_cells (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "ammo_cells", Pickup_Ammo, @@ -1600,20 +1529,20 @@ always owned, never in the world "misc/am_pkup.wav", "models/items/ammo/cells/medium/tris.md2", 0, NULL, -/* icon */ "a_cells", -/* pickup */ "Cells", -/* width */ 3, + /* icon */ "a_cells", + /* pickup */ "Cells", + /* width */ 3, 50, NULL, IT_AMMO, 0, NULL, AMMO_CELLS, -/* precache */ "" + /* precache */ "" }, -/*QUAKED ammo_rockets (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED ammo_rockets (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "ammo_rockets", Pickup_Ammo, @@ -1623,20 +1552,20 @@ always owned, never in the world "misc/am_pkup.wav", "models/items/ammo/rockets/medium/tris.md2", 0, NULL, -/* icon */ "a_rockets", -/* pickup */ "Rockets", -/* width */ 3, + /* icon */ "a_rockets", + /* pickup */ "Rockets", + /* width */ 3, 5, NULL, IT_AMMO, 0, NULL, AMMO_ROCKETS, -/* precache */ "" + /* precache */ "" }, -/*QUAKED ammo_slugs (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED ammo_slugs (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "ammo_slugs", Pickup_Ammo, @@ -1646,26 +1575,26 @@ always owned, never in the world "misc/am_pkup.wav", "models/items/ammo/slugs/medium/tris.md2", 0, NULL, -/* icon */ "a_slugs", -/* pickup */ "Slugs", -/* width */ 3, + /* icon */ "a_slugs", + /* pickup */ "Slugs", + /* width */ 3, 10, NULL, IT_AMMO, 0, NULL, AMMO_SLUGS, -/* precache */ "" + /* precache */ "" }, // // POWERUP ITEMS // -/*QUAKED item_quad (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_quad (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { - "item_quad", + "item_quad", Pickup_Powerup, Use_Quad, Drop_General, @@ -1673,20 +1602,20 @@ always owned, never in the world "items/pkup.wav", "models/items/quaddama/tris.md2", EF_ROTATE, NULL, -/* icon */ "p_quad", -/* pickup */ "Quad Damage", -/* width */ 2, + /* icon */ "p_quad", + /* pickup */ "Quad Damage", + /* width */ 2, 60, NULL, IT_POWERUP, 0, NULL, 0, -/* precache */ "items/damage.wav items/damage2.wav items/damage3.wav" + /* precache */ "items/damage.wav items/damage2.wav items/damage3.wav" }, -/*QUAKED item_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "item_invulnerability", Pickup_Powerup, @@ -1696,20 +1625,20 @@ always owned, never in the world "items/pkup.wav", "models/items/invulner/tris.md2", EF_ROTATE, NULL, -/* icon */ "p_invulnerability", -/* pickup */ "Invulnerability", -/* width */ 2, + /* icon */ "p_invulnerability", + /* pickup */ "Invulnerability", + /* width */ 2, 300, NULL, IT_POWERUP, 0, NULL, 0, -/* precache */ "items/protect.wav items/protect2.wav items/protect4.wav" + /* precache */ "items/protect.wav items/protect2.wav items/protect4.wav" }, -/*QUAKED item_silencer (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_silencer (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "item_silencer", Pickup_Powerup, @@ -1719,20 +1648,20 @@ always owned, never in the world "items/pkup.wav", "models/items/silencer/tris.md2", EF_ROTATE, NULL, -/* icon */ "p_silencer", -/* pickup */ "Silencer", -/* width */ 2, + /* icon */ "p_silencer", + /* pickup */ "Silencer", + /* width */ 2, 60, NULL, IT_POWERUP, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_breather (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_breather (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "item_breather", Pickup_Powerup, @@ -1742,20 +1671,20 @@ always owned, never in the world "items/pkup.wav", "models/items/breather/tris.md2", EF_ROTATE, NULL, -/* icon */ "p_rebreather", -/* pickup */ "Rebreather", -/* width */ 2, + /* icon */ "p_rebreather", + /* pickup */ "Rebreather", + /* width */ 2, 60, NULL, - IT_STAY_COOP|IT_POWERUP, + IT_STAY_COOP | IT_POWERUP, 0, NULL, 0, -/* precache */ "items/airout.wav" + /* precache */ "items/airout.wav" }, -/*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "item_enviro", Pickup_Powerup, @@ -1765,21 +1694,21 @@ always owned, never in the world "items/pkup.wav", "models/items/enviro/tris.md2", EF_ROTATE, NULL, -/* icon */ "p_envirosuit", -/* pickup */ "Environment Suit", -/* width */ 2, + /* icon */ "p_envirosuit", + /* pickup */ "Environment Suit", + /* width */ 2, 60, NULL, - IT_STAY_COOP|IT_POWERUP, + IT_STAY_COOP | IT_POWERUP, 0, NULL, 0, -/* precache */ "items/airout.wav" + /* precache */ "items/airout.wav" }, -/*QUAKED item_ancient_head (.3 .3 1) (-16 -16 -16) (16 16 16) -Special item that gives +2 to maximum health -*/ + /*QUAKED item_ancient_head (.3 .3 1) (-16 -16 -16) (16 16 16) + Special item that gives +2 to maximum health + */ { "item_ancient_head", Pickup_AncientHead, @@ -1789,21 +1718,21 @@ Special item that gives +2 to maximum health "items/pkup.wav", "models/items/c_head/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_fixme", -/* pickup */ "Ancient Head", -/* width */ 2, + /* icon */ "i_fixme", + /* pickup */ "Ancient Head", + /* width */ 2, 60, NULL, 0, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_adrenaline (.3 .3 1) (-16 -16 -16) (16 16 16) -gives +1 to maximum health -*/ + /*QUAKED item_adrenaline (.3 .3 1) (-16 -16 -16) (16 16 16) + gives +1 to maximum health + */ { "item_adrenaline", Pickup_Adrenaline, @@ -1813,20 +1742,20 @@ gives +1 to maximum health "items/pkup.wav", "models/items/adrenal/tris.md2", EF_ROTATE, NULL, -/* icon */ "p_adrenaline", -/* pickup */ "Adrenaline", -/* width */ 2, + /* icon */ "p_adrenaline", + /* pickup */ "Adrenaline", + /* width */ 2, 60, NULL, 0, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_bandolier (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_bandolier (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "item_bandolier", Pickup_Bandolier, @@ -1836,20 +1765,20 @@ gives +1 to maximum health "items/pkup.wav", "models/items/band/tris.md2", EF_ROTATE, NULL, -/* icon */ "p_bandolier", -/* pickup */ "Bandolier", -/* width */ 2, + /* icon */ "p_bandolier", + /* pickup */ "Bandolier", + /* width */ 2, 60, NULL, 0, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED item_pack (.3 .3 1) (-16 -16 -16) (16 16 16) -*/ + /*QUAKED item_pack (.3 .3 1) (-16 -16 -16) (16 16 16) + */ { "item_pack", Pickup_Pack, @@ -1859,24 +1788,24 @@ gives +1 to maximum health "items/pkup.wav", "models/items/pack/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_pack", -/* pickup */ "Ammo Pack", -/* width */ 2, + /* icon */ "i_pack", + /* pickup */ "Ammo Pack", + /* width */ 2, 180, NULL, 0, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, // // KEYS // -/*QUAKED key_data_cd (0 .5 .8) (-16 -16 -16) (16 16 16) -key for computer centers -*/ + /*QUAKED key_data_cd (0 .5 .8) (-16 -16 -16) (16 16 16) + key for computer centers + */ { "key_data_cd", Pickup_Key, @@ -1891,16 +1820,16 @@ key for computer centers 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_power_cube (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN NO_TOUCH -warehouse circuits -*/ + /*QUAKED key_power_cube (0 .5 .8) (-16 -16 -16) (16 16 16) TRIGGER_SPAWN NO_TOUCH + warehouse circuits + */ { "key_power_cube", Pickup_Key, @@ -1915,16 +1844,16 @@ warehouse circuits 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_pyramid (0 .5 .8) (-16 -16 -16) (16 16 16) -key for the entrance of jail3 -*/ + /*QUAKED key_pyramid (0 .5 .8) (-16 -16 -16) (16 16 16) + key for the entrance of jail3 + */ { "key_pyramid", Pickup_Key, @@ -1939,16 +1868,16 @@ key for the entrance of jail3 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_data_spinner (0 .5 .8) (-16 -16 -16) (16 16 16) -key for the city computer -*/ + /*QUAKED key_data_spinner (0 .5 .8) (-16 -16 -16) (16 16 16) + key for the city computer + */ { "key_data_spinner", Pickup_Key, @@ -1963,16 +1892,16 @@ key for the city computer 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_pass (0 .5 .8) (-16 -16 -16) (16 16 16) -security pass for the security level -*/ + /*QUAKED key_pass (0 .5 .8) (-16 -16 -16) (16 16 16) + security pass for the security level + */ { "key_pass", Pickup_Key, @@ -1987,16 +1916,16 @@ security pass for the security level 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_blue_key (0 .5 .8) (-16 -16 -16) (16 16 16) -normal door key - blue -*/ + /*QUAKED key_blue_key (0 .5 .8) (-16 -16 -16) (16 16 16) + normal door key - blue + */ { "key_blue_key", Pickup_Key, @@ -2011,16 +1940,16 @@ normal door key - blue 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_red_key (0 .5 .8) (-16 -16 -16) (16 16 16) -normal door key - red -*/ + /*QUAKED key_red_key (0 .5 .8) (-16 -16 -16) (16 16 16) + normal door key - red + */ { "key_red_key", Pickup_Key, @@ -2035,16 +1964,16 @@ normal door key - red 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_commander_head (0 .5 .8) (-16 -16 -16) (16 16 16) -tank commander's head -*/ + /*QUAKED key_commander_head (0 .5 .8) (-16 -16 -16) (16 16 16) + tank commander's head + */ { "key_commander_head", Pickup_Key, @@ -2054,21 +1983,21 @@ tank commander's head "items/pkup.wav", "models/monsters/commandr/head/tris.md2", EF_GIB, NULL, -/* icon */ "k_comhead", -/* pickup */ "Commander's Head", -/* width */ 2, + /* icon */ "k_comhead", + /* pickup */ "Commander's Head", + /* width */ 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, -/*QUAKED key_airstrike_target (0 .5 .8) (-16 -16 -16) (16 16 16) -tank commander's head -*/ + /*QUAKED key_airstrike_target (0 .5 .8) (-16 -16 -16) (16 16 16) + tank commander's head + */ { "key_airstrike_target", Pickup_Key, @@ -2078,16 +2007,16 @@ tank commander's head "items/pkup.wav", "models/items/keys/target/tris.md2", EF_ROTATE, NULL, -/* icon */ "i_airstrike", -/* pickup */ "Airstrike Marker", -/* width */ 2, + /* icon */ "i_airstrike", + /* pickup */ "Airstrike Marker", + /* width */ 2, 0, NULL, - IT_STAY_COOP|IT_KEY, + IT_STAY_COOP | IT_KEY, 0, NULL, 0, -/* precache */ "" + /* precache */ "" }, { @@ -2099,16 +2028,16 @@ tank commander's head "items/pkup.wav", NULL, 0, NULL, -/* icon */ "i_health", -/* pickup */ "Health", -/* width */ 3, + /* icon */ "i_health", + /* pickup */ "Health", + /* width */ 3, 0, NULL, 0, 0, NULL, 0, -/* precache */ "items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav" + /* precache */ "items/s_health.wav items/n_health.wav items/l_health.wav items/m_health.wav" }, // end of list marker @@ -2118,74 +2047,70 @@ tank commander's head /*QUAKED item_health (.3 .3 1) (-16 -16 -16) (16 16 16) */ -void SP_item_health (edict_t *self) +void SP_item_health(edict_t *self) { - if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) ) - { - G_FreeEdict (self); + if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH)) { + G_FreeEdict(self); return; } self->model = "models/items/healing/medium/tris.md2"; self->count = 10; - SpawnItem (self, FindItem ("Health")); - gi.soundindex ("items/n_health.wav"); + SpawnItem(self, FindItem("Health")); + gi.soundindex("items/n_health.wav"); } /*QUAKED item_health_small (.3 .3 1) (-16 -16 -16) (16 16 16) */ -void SP_item_health_small (edict_t *self) +void SP_item_health_small(edict_t *self) { - if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) ) - { - G_FreeEdict (self); + if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH)) { + G_FreeEdict(self); return; } self->model = "models/items/healing/stimpack/tris.md2"; self->count = 2; - SpawnItem (self, FindItem ("Health")); + SpawnItem(self, FindItem("Health")); self->style = HEALTH_IGNORE_MAX; - gi.soundindex ("items/s_health.wav"); + gi.soundindex("items/s_health.wav"); } /*QUAKED item_health_large (.3 .3 1) (-16 -16 -16) (16 16 16) */ -void SP_item_health_large (edict_t *self) +void SP_item_health_large(edict_t *self) { - if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) ) - { - G_FreeEdict (self); + if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH)) { + G_FreeEdict(self); return; } self->model = "models/items/healing/large/tris.md2"; self->count = 25; - SpawnItem (self, FindItem ("Health")); - gi.soundindex ("items/l_health.wav"); + SpawnItem(self, FindItem("Health")); + gi.soundindex("items/l_health.wav"); } /*QUAKED item_health_mega (.3 .3 1) (-16 -16 -16) (16 16 16) */ -void SP_item_health_mega (edict_t *self) +void SP_item_health_mega(edict_t *self) { - if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) ) - { - G_FreeEdict (self); + if (deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH)) { + G_FreeEdict(self); return; } self->model = "models/items/mega_h/tris.md2"; self->count = 100; - SpawnItem (self, FindItem ("Health")); - gi.soundindex ("items/m_health.wav"); - self->style = HEALTH_IGNORE_MAX|HEALTH_TIMED; + SpawnItem(self, FindItem("Health")); + gi.soundindex("items/m_health.wav"); + self->style = HEALTH_IGNORE_MAX | HEALTH_TIMED; } -void InitItems (void) +void InitItems(void) { - game.num_items = sizeof(itemlist)/sizeof(itemlist[0]) - 1; + game.num_items = sizeof(itemlist) / sizeof(itemlist[0]) - 1; } @@ -2197,15 +2122,14 @@ SetItemNames Called by worldspawn =============== */ -void SetItemNames (void) +void SetItemNames(void) { int i; gitem_t *it; - for (i=0 ; i<game.num_items ; i++) - { + for (i = 0 ; i < game.num_items ; i++) { it = &itemlist[i]; - gi.configstring (CS_ITEMS+i, it->pickup_name); + gi.configstring(CS_ITEMS + i, it->pickup_name); } jacket_armor_index = ITEM_INDEX(FindItem("Jacket Armor")); |