icculus quake2 doxygen  1.0 dev
g_items.c File Reference
#include "g_local.h"

Go to the source code of this file.

Macros

#define HEALTH_IGNORE_MAX   1
 
#define HEALTH_TIMED   2
 

Functions

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 Use_Quad (edict_t *ent, gitem_t *item)
 
gitem_tGetItemByIndex (int index)
 
gitem_tFindItemByClassname (char *classname)
 
gitem_tFindItem (char *pickup_name)
 
void DoRespawn (edict_t *ent)
 
void SetRespawn (edict_t *ent, float delay)
 
qboolean Pickup_Powerup (edict_t *ent, edict_t *other)
 
void Drop_General (edict_t *ent, gitem_t *item)
 
qboolean Pickup_Adrenaline (edict_t *ent, edict_t *other)
 
qboolean Pickup_AncientHead (edict_t *ent, edict_t *other)
 
qboolean Pickup_Bandolier (edict_t *ent, edict_t *other)
 
qboolean Pickup_Pack (edict_t *ent, edict_t *other)
 
void Use_Breather (edict_t *ent, gitem_t *item)
 
void Use_Envirosuit (edict_t *ent, gitem_t *item)
 
void Use_Invulnerability (edict_t *ent, gitem_t *item)
 
void Use_Silencer (edict_t *ent, gitem_t *item)
 
qboolean Pickup_Key (edict_t *ent, edict_t *other)
 
qboolean Add_Ammo (edict_t *ent, gitem_t *item, int count)
 
qboolean Pickup_Ammo (edict_t *ent, edict_t *other)
 
void Drop_Ammo (edict_t *ent, gitem_t *item)
 
void MegaHealth_think (edict_t *self)
 
qboolean Pickup_Health (edict_t *ent, edict_t *other)
 
int ArmorIndex (edict_t *ent)
 
qboolean Pickup_Armor (edict_t *ent, edict_t *other)
 
int PowerArmorType (edict_t *ent)
 
void Use_PowerArmor (edict_t *ent, gitem_t *item)
 
qboolean Pickup_PowerArmor (edict_t *ent, edict_t *other)
 
void Drop_PowerArmor (edict_t *ent, gitem_t *item)
 
void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
 
static void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
 
static void drop_make_touchable (edict_t *ent)
 
edict_tDrop_Item (edict_t *ent, gitem_t *item)
 
void Use_Item (edict_t *ent, edict_t *other, edict_t *activator)
 
void droptofloor (edict_t *ent)
 
void PrecacheItem (gitem_t *it)
 
void SpawnItem (edict_t *ent, gitem_t *item)
 
void SP_item_health (edict_t *self)
 
void SP_item_health_small (edict_t *self)
 
void SP_item_health_large (edict_t *self)
 
void SP_item_health_mega (edict_t *self)
 
void InitItems (void)
 
void SetItemNames (void)
 

Variables

gitem_armor_t jacketarmor_info = { 25, 50, .30, .00, ARMOR_JACKET}
 
gitem_armor_t combatarmor_info = { 50, 100, .60, .30, ARMOR_COMBAT}
 
gitem_armor_t bodyarmor_info = {100, 200, .80, .60, ARMOR_BODY}
 
static int jacket_armor_index
 
static int combat_armor_index
 
static int body_armor_index
 
static int power_screen_index
 
static int power_shield_index
 
static int quad_drop_timeout_hack
 
gitem_t itemlist []
 

Macro Definition Documentation

◆ HEALTH_IGNORE_MAX

#define HEALTH_IGNORE_MAX   1

Definition at line 49 of file g_items.c.

◆ HEALTH_TIMED

#define HEALTH_TIMED   2

Definition at line 50 of file g_items.c.

Function Documentation

◆ Add_Ammo()

qboolean Add_Ammo ( edict_t ent,
gitem_t item,
int  count 
)

Definition at line 447 of file g_items.c.

448 {
449  int index;
450  int max;
451 
452  if (!ent->client)
453  return false;
454 
455  if (item->tag == AMMO_BULLETS)
456  max = ent->client->pers.max_bullets;
457  else if (item->tag == AMMO_SHELLS)
458  max = ent->client->pers.max_shells;
459  else if (item->tag == AMMO_ROCKETS)
460  max = ent->client->pers.max_rockets;
461  else if (item->tag == AMMO_GRENADES)
462  max = ent->client->pers.max_grenades;
463  else if (item->tag == AMMO_CELLS)
464  max = ent->client->pers.max_cells;
465  else if (item->tag == AMMO_SLUGS)
466  max = ent->client->pers.max_slugs;
467  else
468  return false;
469 
470  index = ITEM_INDEX(item);
471 
472  if (ent->client->pers.inventory[index] == max)
473  return false;
474 
475  ent->client->pers.inventory[index] += count;
476 
477  if (ent->client->pers.inventory[index] > max)
478  ent->client->pers.inventory[index] = max;
479 
480  return true;
481 }

Referenced by Cmd_Give_f(), Pickup_Ammo(), and Pickup_Weapon().

◆ ArmorIndex()

int ArmorIndex ( edict_t ent)

Definition at line 590 of file g_items.c.

591 {
592  if (!ent->client)
593  return 0;
594 
595  if (ent->client->pers.inventory[jacket_armor_index] > 0)
596  return jacket_armor_index;
597 
598  if (ent->client->pers.inventory[combat_armor_index] > 0)
599  return combat_armor_index;
600 
601  if (ent->client->pers.inventory[body_armor_index] > 0)
602  return body_armor_index;
603 
604  return 0;
605 }

Referenced by CheckArmor(), G_SetStats(), and Pickup_Armor().

◆ DoRespawn()

void DoRespawn ( edict_t ent)

Definition at line 119 of file g_items.c.

120 {
121  if (ent->team)
122  {
123  edict_t *master;
124  int count;
125  int choice;
126 
127  master = ent->teammaster;
128 
129  for (count = 0, ent = master; ent; ent = ent->chain, count++)
130  ;
131 
132  choice = rand() % count;
133 
134  for (count = 0, ent = master; count < choice; ent = ent->chain, count++)
135  ;
136  }
137 
138  ent->svflags &= ~SVF_NOCLIENT;
139  ent->solid = SOLID_TRIGGER;
140  gi.linkentity (ent);
141 
142  // send an effect
143  ent->s.event = EV_ITEM_RESPAWN;
144 }

Referenced by droptofloor(), and SetRespawn().

◆ Drop_Ammo()

void Drop_Ammo ( edict_t ent,
gitem_t item 
)

Definition at line 513 of file g_items.c.

514 {
515  edict_t *dropped;
516  int index;
517 
518  index = ITEM_INDEX(item);
519  dropped = Drop_Item (ent, item);
520  if (ent->client->pers.inventory[index] >= item->quantity)
521  dropped->count = item->quantity;
522  else
523  dropped->count = ent->client->pers.inventory[index];
524 
525  if (ent->client->pers.weapon &&
526  ent->client->pers.weapon->tag == AMMO_GRENADES &&
527  item->tag == AMMO_GRENADES &&
528  ent->client->pers.inventory[index] - dropped->count <= 0) {
529  gi.cprintf (ent, PRINT_HIGH, "Can't drop current weapon\n");
530  G_FreeEdict(dropped);
531  return;
532  }
533 
534  ent->client->pers.inventory[index] -= dropped->count;
535  ValidateSelectedItem (ent);
536 }

◆ Drop_General()

void Drop_General ( edict_t ent,
gitem_t item 
)

Definition at line 187 of file g_items.c.

188 {
189  Drop_Item (ent, item);
190  ent->client->pers.inventory[ITEM_INDEX(item)]--;
191  ValidateSelectedItem (ent);
192 }

Referenced by Drop_PowerArmor().

◆ Drop_Item()

edict_t* Drop_Item ( edict_t ent,
gitem_t item 
)

Definition at line 843 of file g_items.c.

844 {
845  edict_t *dropped;
847  vec3_t offset;
848 
849  dropped = G_Spawn();
850 
851  dropped->classname = item->classname;
852  dropped->item = item;
853  dropped->spawnflags = DROPPED_ITEM;
854  dropped->s.effects = item->world_model_flags;
855  dropped->s.renderfx = RF_GLOW;
856  VectorSet (dropped->mins, -15, -15, -15);
857  VectorSet (dropped->maxs, 15, 15, 15);
858  gi.setmodel (dropped, dropped->item->world_model);
859  dropped->solid = SOLID_TRIGGER;
860  dropped->movetype = MOVETYPE_TOSS;
861  dropped->touch = drop_temp_touch;
862  dropped->owner = ent;
863 
864  if (ent->client)
865  {
866  trace_t trace;
867 
869  VectorSet(offset, 24, 0, -16);
870  G_ProjectSource (ent->s.origin, offset, forward, right, dropped->s.origin);
871  trace = gi.trace (ent->s.origin, dropped->mins, dropped->maxs,
872  dropped->s.origin, ent, CONTENTS_SOLID);
873  VectorCopy (trace.endpos, dropped->s.origin);
874  }
875  else
876  {
878  VectorCopy (ent->s.origin, dropped->s.origin);
879  }
880 
881  VectorScale (forward, 100, dropped->velocity);
882  dropped->velocity[2] = 300;
883 
884  dropped->think = drop_make_touchable;
885  dropped->nextthink = level.time + 1;
886 
887  gi.linkentity (dropped);
888 
889  return dropped;
890 }

Referenced by Drop_Ammo(), Drop_General(), Drop_Weapon(), monster_death_use(), and TossClientWeapon().

◆ drop_make_touchable()

static void drop_make_touchable ( edict_t ent)
static

Definition at line 833 of file g_items.c.

834 {
835  ent->touch = Touch_Item;
836  if (deathmatch->value)
837  {
838  ent->nextthink = level.time + 29;
839  ent->think = G_FreeEdict;
840  }
841 }

Referenced by Drop_Item().

◆ Drop_PowerArmor()

void Drop_PowerArmor ( edict_t ent,
gitem_t item 
)

Definition at line 747 of file g_items.c.

748 {
749  if ((ent->flags & FL_POWER_ARMOR) && (ent->client->pers.inventory[ITEM_INDEX(item)] == 1))
750  Use_PowerArmor (ent, item);
751  Drop_General (ent, item);
752 }

◆ drop_temp_touch()

static void drop_temp_touch ( edict_t ent,
edict_t other,
cplane_t plane,
csurface_t surf 
)
static

Definition at line 825 of file g_items.c.

826 {
827  if (other == ent->owner)
828  return;
829 
830  Touch_Item (ent, other, plane, surf);
831 }

Referenced by Drop_Item().

◆ Drop_Weapon()

void Drop_Weapon ( edict_t ent,
gitem_t inv 
)

Definition at line 349 of file p_weapon.c.

350 {
351  int index;
352 
353  if ((int)(dmflags->value) & DF_WEAPONS_STAY)
354  return;
355 
356  index = ITEM_INDEX(item);
357  // see if we're already using it
358  if ( ((item == ent->client->pers.weapon) || (item == ent->client->newweapon))&& (ent->client->pers.inventory[index] == 1) )
359  {
360  gi.cprintf (ent, PRINT_HIGH, "Can't drop current weapon\n");
361  return;
362  }
363 
364  Drop_Item (ent, item);
365  ent->client->pers.inventory[index]--;
366 }

◆ droptofloor()

void droptofloor ( edict_t ent)

Definition at line 918 of file g_items.c.

919 {
920  trace_t tr;
921  vec3_t dest;
922  float *v;
923 
924  v = tv(-15,-15,-15);
925  VectorCopy (v, ent->mins);
926  v = tv(15,15,15);
927  VectorCopy (v, ent->maxs);
928 
929  if (ent->model)
930  gi.setmodel (ent, ent->model);
931  else
932  gi.setmodel (ent, ent->item->world_model);
933  ent->solid = SOLID_TRIGGER;
934  ent->movetype = MOVETYPE_TOSS;
935  ent->touch = Touch_Item;
936 
937  v = tv(0,0,-128);
938  VectorAdd (ent->s.origin, v, dest);
939 
940  tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID);
941  if (tr.startsolid)
942  {
943  gi.dprintf ("droptofloor: %s startsolid at %s\n", ent->classname, vtos(ent->s.origin));
944  G_FreeEdict (ent);
945  return;
946  }
947 
948  VectorCopy (tr.endpos, ent->s.origin);
949 
950  if (ent->team)
951  {
952  ent->flags &= ~FL_TEAMSLAVE;
953  ent->chain = ent->teamchain;
954  ent->teamchain = NULL;
955 
956  ent->svflags |= SVF_NOCLIENT;
957  ent->solid = SOLID_NOT;
958  if (ent == ent->teammaster)
959  {
960  ent->nextthink = level.time + FRAMETIME;
961  ent->think = DoRespawn;
962  }
963  }
964 
965  if (ent->spawnflags & ITEM_NO_TOUCH)
966  {
967  ent->solid = SOLID_BBOX;
968  ent->touch = NULL;
969  ent->s.effects &= ~EF_ROTATE;
970  ent->s.renderfx &= ~RF_GLOW;
971  }
972 
973  if (ent->spawnflags & ITEM_TRIGGER_SPAWN)
974  {
975  ent->svflags |= SVF_NOCLIENT;
976  ent->solid = SOLID_NOT;
977  ent->use = Use_Item;
978  }
979 
980  gi.linkentity (ent);
981 }

Referenced by SpawnItem().

◆ FindItem()

gitem_t* FindItem ( char *  pickup_name)

Definition at line 100 of file g_items.c.

101 {
102  int i;
103  gitem_t *it;
104 
105  it = itemlist;
106  for (i=0 ; i<game.num_items ; i++, it++)
107  {
108  if (!it->pickup_name)
109  continue;
110  if (!Q_stricmp(it->pickup_name, pickup_name))
111  return it;
112  }
113 
114  return NULL;
115 }

Referenced by ChangeWeapon(), CheckPowerArmor(), Cmd_Drop_f(), Cmd_Give_f(), Cmd_Use_f(), G_SetStats(), InitClientPersistant(), NoAmmoWeaponChange(), Pickup_Ammo(), Pickup_Bandolier(), Pickup_Pack(), Pickup_Weapon(), PrecacheItem(), SetItemNames(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), SP_item_health_small(), SP_worldspawn(), Use_PowerArmor(), and Use_Weapon().

◆ FindItemByClassname()

gitem_t* FindItemByClassname ( char *  classname)

Definition at line 77 of file g_items.c.

78 {
79  int i;
80  gitem_t *it;
81 
82  it = itemlist;
83  for (i=0 ; i<game.num_items ; i++, it++)
84  {
85  if (!it->classname)
86  continue;
87  if (!Q_stricmp(it->classname, classname))
88  return it;
89  }
90 
91  return NULL;
92 }

Referenced by monster_start(), SP_trigger_key(), SP_turret_driver(), and TossClientWeapon().

◆ GetItemByIndex()

gitem_t* GetItemByIndex ( int  index)

Definition at line 62 of file g_items.c.

63 {
64  if (index == 0 || index >= game.num_items)
65  return NULL;
66 
67  return &itemlist[index];
68 }

Referenced by CheckArmor(), and G_SetStats().

◆ InitItems()

void InitItems ( void  )

Definition at line 2186 of file g_items.c.

2187 {
2188  game.num_items = sizeof(itemlist)/sizeof(itemlist[0]) - 1;
2189 }

Referenced by InitGame().

◆ MegaHealth_think()

void MegaHealth_think ( edict_t self)

Definition at line 541 of file g_items.c.

542 {
543  if (self->owner->health > self->owner->max_health)
544  {
545  self->nextthink = level.time + 1;
546  self->owner->health -= 1;
547  return;
548  }
549 
550  if (!(self->spawnflags & DROPPED_ITEM) && (deathmatch->value))
551  SetRespawn (self, 20);
552  else
553  G_FreeEdict (self);
554 }

Referenced by Pickup_Health().

◆ Pickup_Adrenaline()

qboolean Pickup_Adrenaline ( edict_t ent,
edict_t other 
)

Definition at line 197 of file g_items.c.

198 {
199  if (!deathmatch->value)
200  other->max_health += 1;
201 
202  if (other->health < other->max_health)
203  other->health = other->max_health;
204 
205  if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
206  SetRespawn (ent, ent->item->quantity);
207 
208  return true;
209 }

Referenced by SpawnItem().

◆ Pickup_Ammo()

qboolean Pickup_Ammo ( edict_t ent,
edict_t other 
)

Definition at line 483 of file g_items.c.

484 {
485  int oldcount;
486  int count;
487  qboolean weapon;
488 
489  weapon = (ent->item->flags & IT_WEAPON);
490  if ( (weapon) && ( (int)dmflags->value & DF_INFINITE_AMMO ) )
491  count = 1000;
492  else if (ent->count)
493  count = ent->count;
494  else
495  count = ent->item->quantity;
496 
497  oldcount = other->client->pers.inventory[ITEM_INDEX(ent->item)];
498 
499  if (!Add_Ammo (other, ent->item, count))
500  return false;
501 
502  if (weapon && !oldcount)
503  {
504  if (other->client->pers.weapon != ent->item && ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) )
505  other->client->newweapon = ent->item;
506  }
507 
509  SetRespawn (ent, 30);
510  return true;
511 }

◆ Pickup_AncientHead()

qboolean Pickup_AncientHead ( edict_t ent,
edict_t other 
)

Definition at line 211 of file g_items.c.

212 {
213  other->max_health += 2;
214 
215  if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
216  SetRespawn (ent, ent->item->quantity);
217 
218  return true;
219 }

Referenced by SpawnItem().

◆ Pickup_Armor()

qboolean Pickup_Armor ( edict_t ent,
edict_t other 
)

Definition at line 607 of file g_items.c.

608 {
609  int old_armor_index;
610  gitem_armor_t *oldinfo;
611  gitem_armor_t *newinfo;
612  int newcount;
613  float salvage;
614  int salvagecount;
615 
616  // get info on new armor
617  newinfo = (gitem_armor_t *)ent->item->info;
618 
619  old_armor_index = ArmorIndex (other);
620 
621  // handle armor shards specially
622  if (ent->item->tag == ARMOR_SHARD)
623  {
624  if (!old_armor_index)
626  else
627  other->client->pers.inventory[old_armor_index] += 2;
628  }
629 
630  // if player has no armor, just use it
631  else if (!old_armor_index)
632  {
633  other->client->pers.inventory[ITEM_INDEX(ent->item)] = newinfo->base_count;
634  }
635 
636  // use the better armor
637  else
638  {
639  // get info on old armor
640  if (old_armor_index == jacket_armor_index)
641  oldinfo = &jacketarmor_info;
642  else if (old_armor_index == combat_armor_index)
643  oldinfo = &combatarmor_info;
644  else // (old_armor_index == body_armor_index)
645  oldinfo = &bodyarmor_info;
646 
647  if (newinfo->normal_protection > oldinfo->normal_protection)
648  {
649  // calc new armor values
650  salvage = oldinfo->normal_protection / newinfo->normal_protection;
651  salvagecount = salvage * other->client->pers.inventory[old_armor_index];
652  newcount = newinfo->base_count + salvagecount;
653  if (newcount > newinfo->max_count)
654  newcount = newinfo->max_count;
655 
656  // zero count of old armor so it goes away
657  other->client->pers.inventory[old_armor_index] = 0;
658 
659  // change armor to new item with computed value
660  other->client->pers.inventory[ITEM_INDEX(ent->item)] = newcount;
661  }
662  else
663  {
664  // calc new armor values
665  salvage = newinfo->normal_protection / oldinfo->normal_protection;
666  salvagecount = salvage * newinfo->base_count;
667  newcount = other->client->pers.inventory[old_armor_index] + salvagecount;
668  if (newcount > oldinfo->max_count)
669  newcount = oldinfo->max_count;
670 
671  // if we're already maxed out then we don't need the new armor
672  if (other->client->pers.inventory[old_armor_index] >= newcount)
673  return false;
674 
675  // update current armor value
676  other->client->pers.inventory[old_armor_index] = newcount;
677  }
678  }
679 
680  if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
681  SetRespawn (ent, 20);
682 
683  return true;
684 }

Referenced by SpawnItem().

◆ Pickup_Bandolier()

qboolean Pickup_Bandolier ( edict_t ent,
edict_t other 
)

Definition at line 221 of file g_items.c.

222 {
223  gitem_t *item;
224  int index;
225 
226  if (other->client->pers.max_bullets < 250)
227  other->client->pers.max_bullets = 250;
228  if (other->client->pers.max_shells < 150)
229  other->client->pers.max_shells = 150;
230  if (other->client->pers.max_cells < 250)
231  other->client->pers.max_cells = 250;
232  if (other->client->pers.max_slugs < 75)
233  other->client->pers.max_slugs = 75;
234 
235  item = FindItem("Bullets");
236  if (item)
237  {
238  index = ITEM_INDEX(item);
239  other->client->pers.inventory[index] += item->quantity;
240  if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
241  other->client->pers.inventory[index] = other->client->pers.max_bullets;
242  }
243 
244  item = FindItem("Shells");
245  if (item)
246  {
247  index = ITEM_INDEX(item);
248  other->client->pers.inventory[index] += item->quantity;
249  if (other->client->pers.inventory[index] > other->client->pers.max_shells)
250  other->client->pers.inventory[index] = other->client->pers.max_shells;
251  }
252 
253  if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
254  SetRespawn (ent, ent->item->quantity);
255 
256  return true;
257 }

◆ Pickup_Health()

qboolean Pickup_Health ( edict_t ent,
edict_t other 
)

Definition at line 556 of file g_items.c.

557 {
558  if (!(ent->style & HEALTH_IGNORE_MAX))
559  if (other->health >= other->max_health)
560  return false;
561 
562  other->health += ent->count;
563 
564  if (!(ent->style & HEALTH_IGNORE_MAX))
565  {
566  if (other->health > other->max_health)
567  other->health = other->max_health;
568  }
569 
570  if (ent->style & HEALTH_TIMED)
571  {
572  ent->think = MegaHealth_think;
573  ent->nextthink = level.time + 5;
574  ent->owner = other;
575  ent->flags |= FL_RESPAWN;
576  ent->svflags |= SVF_NOCLIENT;
577  ent->solid = SOLID_NOT;
578  }
579  else
580  {
581  if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
582  SetRespawn (ent, 30);
583  }
584 
585  return true;
586 }

Referenced by SpawnItem(), and Touch_Item().

◆ Pickup_Key()

qboolean Pickup_Key ( edict_t ent,
edict_t other 
)

Definition at line 422 of file g_items.c.

423 {
424  if (coop->value)
425  {
426  if (strcmp(ent->classname, "key_power_cube") == 0)
427  {
428  if (other->client->pers.power_cubes & ((ent->spawnflags & 0x0000ff00)>> 8))
429  return false;
430  other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
431  other->client->pers.power_cubes |= ((ent->spawnflags & 0x0000ff00) >> 8);
432  }
433  else
434  {
435  if (other->client->pers.inventory[ITEM_INDEX(ent->item)])
436  return false;
437  other->client->pers.inventory[ITEM_INDEX(ent->item)] = 1;
438  }
439  return true;
440  }
441  other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
442  return true;
443 }

◆ Pickup_Pack()

qboolean Pickup_Pack ( edict_t ent,
edict_t other 
)

Definition at line 259 of file g_items.c.

260 {
261  gitem_t *item;
262  int index;
263 
264  if (other->client->pers.max_bullets < 300)
265  other->client->pers.max_bullets = 300;
266  if (other->client->pers.max_shells < 200)
267  other->client->pers.max_shells = 200;
268  if (other->client->pers.max_rockets < 100)
269  other->client->pers.max_rockets = 100;
270  if (other->client->pers.max_grenades < 100)
271  other->client->pers.max_grenades = 100;
272  if (other->client->pers.max_cells < 300)
273  other->client->pers.max_cells = 300;
274  if (other->client->pers.max_slugs < 100)
275  other->client->pers.max_slugs = 100;
276 
277  item = FindItem("Bullets");
278  if (item)
279  {
280  index = ITEM_INDEX(item);
281  other->client->pers.inventory[index] += item->quantity;
282  if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
283  other->client->pers.inventory[index] = other->client->pers.max_bullets;
284  }
285 
286  item = FindItem("Shells");
287  if (item)
288  {
289  index = ITEM_INDEX(item);
290  other->client->pers.inventory[index] += item->quantity;
291  if (other->client->pers.inventory[index] > other->client->pers.max_shells)
292  other->client->pers.inventory[index] = other->client->pers.max_shells;
293  }
294 
295  item = FindItem("Cells");
296  if (item)
297  {
298  index = ITEM_INDEX(item);
299  other->client->pers.inventory[index] += item->quantity;
300  if (other->client->pers.inventory[index] > other->client->pers.max_cells)
301  other->client->pers.inventory[index] = other->client->pers.max_cells;
302  }
303 
304  item = FindItem("Grenades");
305  if (item)
306  {
307  index = ITEM_INDEX(item);
308  other->client->pers.inventory[index] += item->quantity;
309  if (other->client->pers.inventory[index] > other->client->pers.max_grenades)
310  other->client->pers.inventory[index] = other->client->pers.max_grenades;
311  }
312 
313  item = FindItem("Rockets");
314  if (item)
315  {
316  index = ITEM_INDEX(item);
317  other->client->pers.inventory[index] += item->quantity;
318  if (other->client->pers.inventory[index] > other->client->pers.max_rockets)
319  other->client->pers.inventory[index] = other->client->pers.max_rockets;
320  }
321 
322  item = FindItem("Slugs");
323  if (item)
324  {
325  index = ITEM_INDEX(item);
326  other->client->pers.inventory[index] += item->quantity;
327  if (other->client->pers.inventory[index] > other->client->pers.max_slugs)
328  other->client->pers.inventory[index] = other->client->pers.max_slugs;
329  }
330 
331  if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
332  SetRespawn (ent, ent->item->quantity);
333 
334  return true;
335 }

◆ Pickup_PowerArmor()

qboolean Pickup_PowerArmor ( edict_t ent,
edict_t other 
)

Definition at line 727 of file g_items.c.

728 {
729  int quantity;
730 
731  quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
732 
733  other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
734 
735  if (deathmatch->value)
736  {
737  if (!(ent->spawnflags & DROPPED_ITEM) )
738  SetRespawn (ent, ent->item->quantity);
739  // auto-use for DM only if we didn't already have one
740  if (!quantity)
741  ent->item->use (other, ent->item);
742  }
743 
744  return true;
745 }

Referenced by SpawnItem().

◆ Pickup_Powerup()

qboolean Pickup_Powerup ( edict_t ent,
edict_t other 
)

Definition at line 159 of file g_items.c.

160 {
161  int quantity;
162 
163  quantity = other->client->pers.inventory[ITEM_INDEX(ent->item)];
164  if ((skill->value == 1 && quantity >= 2) || (skill->value >= 2 && quantity >= 1))
165  return false;
166 
167  if ((coop->value) && (ent->item->flags & IT_STAY_COOP) && (quantity > 0))
168  return false;
169 
170  other->client->pers.inventory[ITEM_INDEX(ent->item)]++;
171 
172  if (deathmatch->value)
173  {
174  if (!(ent->spawnflags & DROPPED_ITEM) )
175  SetRespawn (ent, ent->item->quantity);
176  if (((int)dmflags->value & DF_INSTANT_ITEMS) || ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM)))
177  {
178  if ((ent->item->use == Use_Quad) && (ent->spawnflags & DROPPED_PLAYER_ITEM))
180  ent->item->use (other, ent->item);
181  }
182  }
183 
184  return true;
185 }

Referenced by SpawnItem().

◆ Pickup_Weapon()

qboolean Pickup_Weapon ( edict_t ent,
edict_t other 
)

Definition at line 118 of file p_weapon.c.

119 {
120  int index;
121  gitem_t *ammo;
122 
123  index = ITEM_INDEX(ent->item);
124 
125  if ( ( ((int)(dmflags->value) & DF_WEAPONS_STAY) || coop->value)
126  && other->client->pers.inventory[index])
127  {
128  if (!(ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM) ) )
129  return false; // leave the weapon for others to pickup
130  }
131 
132  other->client->pers.inventory[index]++;
133 
134  if (!(ent->spawnflags & DROPPED_ITEM) )
135  {
136  // give them some ammo with it
137  ammo = FindItem (ent->item->ammo);
138  if ( (int)dmflags->value & DF_INFINITE_AMMO )
139  Add_Ammo (other, ammo, 1000);
140  else
141  Add_Ammo (other, ammo, ammo->quantity);
142 
143  if (! (ent->spawnflags & DROPPED_PLAYER_ITEM) )
144  {
145  if (deathmatch->value)
146  {
147  if ((int)(dmflags->value) & DF_WEAPONS_STAY)
148  ent->flags |= FL_RESPAWN;
149  else
150  SetRespawn (ent, 30);
151  }
152  if (coop->value)
153  ent->flags |= FL_RESPAWN;
154  }
155  }
156 
157  if (other->client->pers.weapon != ent->item &&
158  (other->client->pers.inventory[index] == 1) &&
159  ( !deathmatch->value || other->client->pers.weapon == FindItem("blaster") ) )
160  other->client->newweapon = ent->item;
161 
162  return true;
163 }

◆ PowerArmorType()

int PowerArmorType ( edict_t ent)

Definition at line 688 of file g_items.c.

689 {
690  if (!ent->client)
691  return POWER_ARMOR_NONE;
692 
693  if (!(ent->flags & FL_POWER_ARMOR))
694  return POWER_ARMOR_NONE;
695 
696  if (ent->client->pers.inventory[power_shield_index] > 0)
697  return POWER_ARMOR_SHIELD;
698 
699  if (ent->client->pers.inventory[power_screen_index] > 0)
700  return POWER_ARMOR_SCREEN;
701 
702  return POWER_ARMOR_NONE;
703 }

Referenced by CheckPowerArmor(), G_SetClientEffects(), and G_SetStats().

◆ PrecacheItem()

void PrecacheItem ( gitem_t it)

Definition at line 993 of file g_items.c.

994 {
995  char *s, *start;
996  char data[MAX_QPATH];
997  int len;
998  gitem_t *ammo;
999 
1000  if (!it)
1001  return;
1002 
1003  if (it->pickup_sound)
1004  gi.soundindex (it->pickup_sound);
1005  if (it->world_model)
1006  gi.modelindex (it->world_model);
1007  if (it->view_model)
1008  gi.modelindex (it->view_model);
1009  if (it->icon)
1010  gi.imageindex (it->icon);
1011 
1012  // parse everything for its ammo
1013  if (it->ammo && it->ammo[0])
1014  {
1015  ammo = FindItem (it->ammo);
1016  if (ammo != it)
1017  PrecacheItem (ammo);
1018  }
1019 
1020  // parse the space seperated precache string for other items
1021  s = it->precaches;
1022  if (!s || !s[0])
1023  return;
1024 
1025  while (*s)
1026  {
1027  start = s;
1028  while (*s && *s != ' ')
1029  s++;
1030 
1031  len = s-start;
1032  if (len >= MAX_QPATH || len < 5)
1033  gi.error ("PrecacheItem: %s has bad precache string", it->classname);
1034  memcpy (data, start, len);
1035  data[len] = 0;
1036  if (*s)
1037  s++;
1038 
1039  // determine type based on extension
1040  if (!strcmp(data+len-3, "md2"))
1041  gi.modelindex (data);
1042  else if (!strcmp(data+len-3, "sp2"))
1043  gi.modelindex (data);
1044  else if (!strcmp(data+len-3, "wav"))
1045  gi.soundindex (data);
1046  if (!strcmp(data+len-3, "pcx"))
1047  gi.imageindex (data);
1048  }
1049 }

Referenced by PrecacheItem(), SP_worldspawn(), and SpawnItem().

◆ SetItemNames()

void SetItemNames ( void  )

Definition at line 2200 of file g_items.c.

2201 {
2202  int i;
2203  gitem_t *it;
2204 
2205  for (i=0 ; i<game.num_items ; i++)
2206  {
2207  it = &itemlist[i];
2209  }
2210 
2211  jacket_armor_index = ITEM_INDEX(FindItem("Jacket Armor"));
2212  combat_armor_index = ITEM_INDEX(FindItem("Combat Armor"));
2213  body_armor_index = ITEM_INDEX(FindItem("Body Armor"));
2214  power_screen_index = ITEM_INDEX(FindItem("Power Screen"));
2215  power_shield_index = ITEM_INDEX(FindItem("Power Shield"));
2216 }

Referenced by SP_worldspawn().

◆ SetRespawn()

void SetRespawn ( edict_t ent,
float  delay 
)

Definition at line 146 of file g_items.c.

147 {
148  ent->flags |= FL_RESPAWN;
149  ent->svflags |= SVF_NOCLIENT;
150  ent->solid = SOLID_NOT;
151  ent->nextthink = level.time + delay;
152  ent->think = DoRespawn;
153  gi.linkentity (ent);
154 }

Referenced by MegaHealth_think(), Pickup_Adrenaline(), Pickup_Ammo(), Pickup_AncientHead(), Pickup_Armor(), Pickup_Bandolier(), Pickup_Health(), Pickup_Pack(), Pickup_PowerArmor(), Pickup_Powerup(), and Pickup_Weapon().

◆ SP_item_health()

void SP_item_health ( edict_t self)

Definition at line 2121 of file g_items.c.

2122 {
2123  if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
2124  {
2125  G_FreeEdict (self);
2126  return;
2127  }
2128 
2129  self->model = "models/items/healing/medium/tris.md2";
2130  self->count = 10;
2131  SpawnItem (self, FindItem ("Health"));
2132  gi.soundindex ("items/n_health.wav");
2133 }

◆ SP_item_health_large()

void SP_item_health_large ( edict_t self)

Definition at line 2154 of file g_items.c.

2155 {
2156  if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
2157  {
2158  G_FreeEdict (self);
2159  return;
2160  }
2161 
2162  self->model = "models/items/healing/large/tris.md2";
2163  self->count = 25;
2164  SpawnItem (self, FindItem ("Health"));
2165  gi.soundindex ("items/l_health.wav");
2166 }

◆ SP_item_health_mega()

void SP_item_health_mega ( edict_t self)

Definition at line 2170 of file g_items.c.

2171 {
2172  if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
2173  {
2174  G_FreeEdict (self);
2175  return;
2176  }
2177 
2178  self->model = "models/items/mega_h/tris.md2";
2179  self->count = 100;
2180  SpawnItem (self, FindItem ("Health"));
2181  gi.soundindex ("items/m_health.wav");
2182  self->style = HEALTH_IGNORE_MAX|HEALTH_TIMED;
2183 }

◆ SP_item_health_small()

void SP_item_health_small ( edict_t self)

Definition at line 2137 of file g_items.c.

2138 {
2139  if ( deathmatch->value && ((int)dmflags->value & DF_NO_HEALTH) )
2140  {
2141  G_FreeEdict (self);
2142  return;
2143  }
2144 
2145  self->model = "models/items/healing/stimpack/tris.md2";
2146  self->count = 2;
2147  SpawnItem (self, FindItem ("Health"));
2148  self->style = HEALTH_IGNORE_MAX;
2149  gi.soundindex ("items/s_health.wav");
2150 }

◆ SpawnItem()

void SpawnItem ( edict_t ent,
gitem_t item 
)

Definition at line 1061 of file g_items.c.

1062 {
1063  PrecacheItem (item);
1064 
1065  if (ent->spawnflags)
1066  {
1067  if (strcmp(ent->classname, "key_power_cube") != 0)
1068  {
1069  ent->spawnflags = 0;
1070  gi.dprintf("%s at %s has invalid spawnflags set\n", ent->classname, vtos(ent->s.origin));
1071  }
1072  }
1073 
1074  // some items will be prevented in deathmatch
1075  if (deathmatch->value)
1076  {
1077  if ( (int)dmflags->value & DF_NO_ARMOR )
1078  {
1079  if (item->pickup == Pickup_Armor || item->pickup == Pickup_PowerArmor)
1080  {
1081  G_FreeEdict (ent);
1082  return;
1083  }
1084  }
1085  if ( (int)dmflags->value & DF_NO_ITEMS )
1086  {
1087  if (item->pickup == Pickup_Powerup)
1088  {
1089  G_FreeEdict (ent);
1090  return;
1091  }
1092  }
1093  if ( (int)dmflags->value & DF_NO_HEALTH )
1094  {
1095  if (item->pickup == Pickup_Health || item->pickup == Pickup_Adrenaline || item->pickup == Pickup_AncientHead)
1096  {
1097  G_FreeEdict (ent);
1098  return;
1099  }
1100  }
1101  if ( (int)dmflags->value & DF_INFINITE_AMMO )
1102  {
1103  if ( (item->flags == IT_AMMO) || (strcmp(ent->classname, "weapon_bfg") == 0) )
1104  {
1105  G_FreeEdict (ent);
1106  return;
1107  }
1108  }
1109  }
1110 
1111  if (coop->value && (strcmp(ent->classname, "key_power_cube") == 0))
1112  {
1113  ent->spawnflags |= (1 << (8 + level.power_cubes));
1114  level.power_cubes++;
1115  }
1116 
1117  // don't let them drop items that stay in a coop game
1118  if ((coop->value) && (item->flags & IT_STAY_COOP))
1119  {
1120  item->drop = NULL;
1121  }
1122 
1123  ent->item = item;
1124  ent->nextthink = level.time + 2 * FRAMETIME; // items start after other solids
1125  ent->think = droptofloor;
1126  ent->s.effects = item->world_model_flags;
1127  ent->s.renderfx = RF_GLOW;
1128  if (ent->model)
1129  gi.modelindex (ent->model);
1130 }

Referenced by Cmd_Give_f(), ED_CallSpawn(), SP_item_health(), SP_item_health_large(), SP_item_health_mega(), and SP_item_health_small().

◆ Touch_Item()

void Touch_Item ( edict_t ent,
edict_t other,
cplane_t plane,
csurface_t surf 
)

Definition at line 761 of file g_items.c.

762 {
763  qboolean taken;
764 
765  if (!other->client)
766  return;
767  if (other->health < 1)
768  return; // dead people can't pickup
769  if (!ent->item->pickup)
770  return; // not a grabbable item?
771 
772  taken = ent->item->pickup(ent, other);
773 
774  if (taken)
775  {
776  // flash the screen
777  other->client->bonus_alpha = 0.25;
778 
779  // show icon and name on status bar
780  other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(ent->item->icon);
782  other->client->pickup_msg_time = level.time + 3.0;
783 
784  // change selected item
785  if (ent->item->use)
787 
788  if (ent->item->pickup == Pickup_Health)
789  {
790  if (ent->count == 2)
791  gi.sound(other, CHAN_ITEM, gi.soundindex("items/s_health.wav"), 1, ATTN_NORM, 0);
792  else if (ent->count == 10)
793  gi.sound(other, CHAN_ITEM, gi.soundindex("items/n_health.wav"), 1, ATTN_NORM, 0);
794  else if (ent->count == 25)
795  gi.sound(other, CHAN_ITEM, gi.soundindex("items/l_health.wav"), 1, ATTN_NORM, 0);
796  else // (ent->count == 100)
797  gi.sound(other, CHAN_ITEM, gi.soundindex("items/m_health.wav"), 1, ATTN_NORM, 0);
798  }
799  else if (ent->item->pickup_sound)
800  {
801  gi.sound(other, CHAN_ITEM, gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0);
802  }
803  }
804 
805  if (!(ent->spawnflags & ITEM_TARGETS_USED))
806  {
807  G_UseTargets (ent, other);
809  }
810 
811  if (!taken)
812  return;
813 
814  if (!((coop->value) && (ent->item->flags & IT_STAY_COOP)) || (ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)))
815  {
816  if (ent->flags & FL_RESPAWN)
817  ent->flags &= ~FL_RESPAWN;
818  else
819  G_FreeEdict (ent);
820  }
821 }

Referenced by Cmd_Give_f(), drop_make_touchable(), drop_temp_touch(), droptofloor(), TossClientWeapon(), and Use_Item().

◆ Use_Breather()

void Use_Breather ( edict_t ent,
gitem_t item 
)

Definition at line 366 of file g_items.c.

367 {
368  ent->client->pers.inventory[ITEM_INDEX(item)]--;
369  ValidateSelectedItem (ent);
370 
371  if (ent->client->breather_framenum > level.framenum)
372  ent->client->breather_framenum += 300;
373  else
374  ent->client->breather_framenum = level.framenum + 300;
375 
376 // gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
377 }

◆ Use_Envirosuit()

void Use_Envirosuit ( edict_t ent,
gitem_t item 
)

Definition at line 381 of file g_items.c.

382 {
383  ent->client->pers.inventory[ITEM_INDEX(item)]--;
384  ValidateSelectedItem (ent);
385 
386  if (ent->client->enviro_framenum > level.framenum)
387  ent->client->enviro_framenum += 300;
388  else
389  ent->client->enviro_framenum = level.framenum + 300;
390 
391 // gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
392 }

◆ Use_Invulnerability()

void Use_Invulnerability ( edict_t ent,
gitem_t item 
)

Definition at line 396 of file g_items.c.

397 {
398  ent->client->pers.inventory[ITEM_INDEX(item)]--;
399  ValidateSelectedItem (ent);
400 
401  if (ent->client->invincible_framenum > level.framenum)
402  ent->client->invincible_framenum += 300;
403  else
404  ent->client->invincible_framenum = level.framenum + 300;
405 
406  gi.sound(ent, CHAN_ITEM, gi.soundindex("items/protect.wav"), 1, ATTN_NORM, 0);
407 }

◆ Use_Item()

void Use_Item ( edict_t ent,
edict_t other,
edict_t activator 
)

Definition at line 892 of file g_items.c.

893 {
894  ent->svflags &= ~SVF_NOCLIENT;
895  ent->use = NULL;
896 
897  if (ent->spawnflags & ITEM_NO_TOUCH)
898  {
899  ent->solid = SOLID_BBOX;
900  ent->touch = NULL;
901  }
902  else
903  {
904  ent->solid = SOLID_TRIGGER;
905  ent->touch = Touch_Item;
906  }
907 
908  gi.linkentity (ent);
909 }

Referenced by droptofloor().

◆ Use_PowerArmor()

void Use_PowerArmor ( edict_t ent,
gitem_t item 
)

Definition at line 705 of file g_items.c.

706 {
707  int index;
708 
709  if (ent->flags & FL_POWER_ARMOR)
710  {
711  ent->flags &= ~FL_POWER_ARMOR;
712  gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
713  }
714  else
715  {
716  index = ITEM_INDEX(FindItem("cells"));
717  if (!ent->client->pers.inventory[index])
718  {
719  gi.cprintf (ent, PRINT_HIGH, "No cells for power armor.\n");
720  return;
721  }
722  ent->flags |= FL_POWER_ARMOR;
723  gi.sound(ent, CHAN_AUTO, gi.soundindex("misc/power1.wav"), 1, ATTN_NORM, 0);
724  }
725 }

Referenced by Drop_PowerArmor().

◆ Use_Quad()

void Use_Quad ( edict_t ent,
gitem_t item 
)

Definition at line 339 of file g_items.c.

340 {
341  int timeout;
342 
343  ent->client->pers.inventory[ITEM_INDEX(item)]--;
344  ValidateSelectedItem (ent);
345 
347  {
350  }
351  else
352  {
353  timeout = 300;
354  }
355 
356  if (ent->client->quad_framenum > level.framenum)
357  ent->client->quad_framenum += timeout;
358  else
359  ent->client->quad_framenum = level.framenum + timeout;
360 
361  gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
362 }

Referenced by Pickup_Powerup().

◆ Use_Silencer()

void Use_Silencer ( edict_t ent,
gitem_t item 
)

Definition at line 411 of file g_items.c.

412 {
413  ent->client->pers.inventory[ITEM_INDEX(item)]--;
414  ValidateSelectedItem (ent);
415  ent->client->silencer_shots += 30;
416 
417 // gi.sound(ent, CHAN_ITEM, gi.soundindex("items/damage.wav"), 1, ATTN_NORM, 0);
418 }

◆ Use_Weapon()

void Use_Weapon ( edict_t ent,
gitem_t inv 
)

Definition at line 311 of file p_weapon.c.

312 {
313  int ammo_index;
314  gitem_t *ammo_item;
315 
316  // see if we're already using it
317  if (item == ent->client->pers.weapon)
318  return;
319 
320  if (item->ammo && !g_select_empty->value && !(item->flags & IT_AMMO))
321  {
322  ammo_item = FindItem(item->ammo);
323  ammo_index = ITEM_INDEX(ammo_item);
324 
325  if (!ent->client->pers.inventory[ammo_index])
326  {
327  gi.cprintf (ent, PRINT_HIGH, "No %s for %s.\n", ammo_item->pickup_name, item->pickup_name);
328  return;
329  }
330 
331  if (ent->client->pers.inventory[ammo_index] < item->quantity)
332  {
333  gi.cprintf (ent, PRINT_HIGH, "Not enough %s for %s.\n", ammo_item->pickup_name, item->pickup_name);
334  return;
335  }
336  }
337 
338  // change to this weapon when down
339  ent->client->newweapon = item;
340 }

◆ Weapon_BFG()

void Weapon_BFG ( edict_t ent)

Definition at line 1425 of file p_weapon.c.

1426 {
1427  static int pause_frames[] = {39, 45, 50, 55, 0};
1428  static int fire_frames[] = {9, 17, 0};
1429 
1430  Weapon_Generic (ent, 8, 32, 55, 58, pause_frames, fire_frames, weapon_bfg_fire);
1431 }

◆ Weapon_Blaster()

void Weapon_Blaster ( edict_t ent)

Definition at line 859 of file p_weapon.c.

860 {
861  static int pause_frames[] = {19, 32, 0};
862  static int fire_frames[] = {5, 0};
863 
864  Weapon_Generic (ent, 4, 8, 52, 55, pause_frames, fire_frames, Weapon_Blaster_Fire);
865 }

◆ Weapon_Chaingun()

void Weapon_Chaingun ( edict_t ent)

Definition at line 1167 of file p_weapon.c.

1168 {
1169  static int pause_frames[] = {38, 43, 51, 61, 0};
1170  static int fire_frames[] = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0};
1171 
1172  Weapon_Generic (ent, 4, 31, 61, 64, pause_frames, fire_frames, Chaingun_Fire);
1173 }

◆ Weapon_Grenade()

void Weapon_Grenade ( edict_t ent)

Definition at line 595 of file p_weapon.c.

596 {
597  if ((ent->client->newweapon) && (ent->client->weaponstate == WEAPON_READY))
598  {
599  ChangeWeapon (ent);
600  return;
601  }
602 
603  if (ent->client->weaponstate == WEAPON_ACTIVATING)
604  {
606  ent->client->ps.gunframe = 16;
607  return;
608  }
609 
610  if (ent->client->weaponstate == WEAPON_READY)
611  {
612  if ( ((ent->client->latched_buttons|ent->client->buttons) & BUTTON_ATTACK) )
613  {
615  if (ent->client->pers.inventory[ent->client->ammo_index])
616  {
617  ent->client->ps.gunframe = 1;
619  ent->client->grenade_time = 0;
620  }
621  else
622  {
623  if (level.time >= ent->pain_debounce_time)
624  {
625  gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/noammo.wav"), 1, ATTN_NORM, 0);
626  ent->pain_debounce_time = level.time + 1;
627  }
628  NoAmmoWeaponChange (ent);
629  }
630  return;
631  }
632 
633  if ((ent->client->ps.gunframe == 29) || (ent->client->ps.gunframe == 34) || (ent->client->ps.gunframe == 39) || (ent->client->ps.gunframe == 48))
634  {
635  if (rand()&15)
636  return;
637  }
638 
639  if (++ent->client->ps.gunframe > 48)
640  ent->client->ps.gunframe = 16;
641  return;
642  }
643 
644  if (ent->client->weaponstate == WEAPON_FIRING)
645  {
646  if (ent->client->ps.gunframe == 5)
647  gi.sound(ent, CHAN_WEAPON, gi.soundindex("weapons/hgrena1b.wav"), 1, ATTN_NORM, 0);
648 
649  if (ent->client->ps.gunframe == 11)
650  {
651  if (!ent->client->grenade_time)
652  {
653  ent->client->grenade_time = level.time + GRENADE_TIMER + 0.2;
654  ent->client->weapon_sound = gi.soundindex("weapons/hgrenc1b.wav");
655  }
656 
657  // they waited too long, detonate it in their hand
658  if (!ent->client->grenade_blew_up && level.time >= ent->client->grenade_time)
659  {
660  ent->client->weapon_sound = 0;
661  weapon_grenade_fire (ent, true);
662  ent->client->grenade_blew_up = true;
663  }
664 
665  if (ent->client->buttons & BUTTON_ATTACK)
666  return;
667 
668  if (ent->client->grenade_blew_up)
669  {
670  if (level.time >= ent->client->grenade_time)
671  {
672  ent->client->ps.gunframe = 15;
673  ent->client->grenade_blew_up = false;
674  }
675  else
676  {
677  return;
678  }
679  }
680  }
681 
682  if (ent->client->ps.gunframe == 12)
683  {
684  ent->client->weapon_sound = 0;
685  weapon_grenade_fire (ent, false);
686  }
687 
688  if ((ent->client->ps.gunframe == 15) && (level.time < ent->client->grenade_time))
689  return;
690 
691  ent->client->ps.gunframe++;
692 
693  if (ent->client->ps.gunframe == 16)
694  {
695  ent->client->grenade_time = 0;
697  }
698  }
699 }

◆ Weapon_GrenadeLauncher()

void Weapon_GrenadeLauncher ( edict_t ent)

Definition at line 743 of file p_weapon.c.

744 {
745  static int pause_frames[] = {34, 51, 59, 0};
746  static int fire_frames[] = {6, 0};
747 
748  Weapon_Generic (ent, 5, 16, 59, 64, pause_frames, fire_frames, weapon_grenadelauncher_fire);
749 }

◆ Weapon_HyperBlaster()

void Weapon_HyperBlaster ( edict_t ent)

Definition at line 937 of file p_weapon.c.

938 {
939  static int pause_frames[] = {0};
940  static int fire_frames[] = {6, 7, 8, 9, 10, 11, 0};
941 
942  Weapon_Generic (ent, 5, 20, 49, 53, pause_frames, fire_frames, Weapon_HyperBlaster_Fire);
943 }

◆ Weapon_Machinegun()

void Weapon_Machinegun ( edict_t ent)

Definition at line 1039 of file p_weapon.c.

1040 {
1041  static int pause_frames[] = {23, 45, 0};
1042  static int fire_frames[] = {4, 5, 0};
1043 
1044  Weapon_Generic (ent, 3, 5, 45, 49, pause_frames, fire_frames, Machinegun_Fire);
1045 }

◆ Weapon_Railgun()

void Weapon_Railgun ( edict_t ent)

Definition at line 1350 of file p_weapon.c.

1351 {
1352  static int pause_frames[] = {56, 0};
1353  static int fire_frames[] = {4, 0};
1354 
1355  Weapon_Generic (ent, 3, 18, 56, 61, pause_frames, fire_frames, weapon_railgun_fire);
1356 }

◆ Weapon_RocketLauncher()

void Weapon_RocketLauncher ( edict_t ent)

Definition at line 799 of file p_weapon.c.

800 {
801  static int pause_frames[] = {25, 33, 42, 50, 0};
802  static int fire_frames[] = {5, 0};
803 
804  Weapon_Generic (ent, 4, 12, 50, 54, pause_frames, fire_frames, Weapon_RocketLauncher_Fire);
805 }

◆ Weapon_Shotgun()

void Weapon_Shotgun ( edict_t ent)

Definition at line 1230 of file p_weapon.c.

1231 {
1232  static int pause_frames[] = {22, 28, 34, 0};
1233  static int fire_frames[] = {8, 9, 0};
1234 
1235  Weapon_Generic (ent, 7, 18, 36, 39, pause_frames, fire_frames, weapon_shotgun_fire);
1236 }

◆ Weapon_SuperShotgun()

void Weapon_SuperShotgun ( edict_t ent)

Definition at line 1284 of file p_weapon.c.

1285 {
1286  static int pause_frames[] = {29, 42, 57, 0};
1287  static int fire_frames[] = {7, 0};
1288 
1289  Weapon_Generic (ent, 6, 17, 57, 61, pause_frames, fire_frames, weapon_supershotgun_fire);
1290 }

Variable Documentation

◆ body_armor_index

int body_armor_index
static

Definition at line 45 of file g_items.c.

Referenced by ArmorIndex(), and SetItemNames().

◆ bodyarmor_info

gitem_armor_t bodyarmor_info = {100, 200, .80, .60, ARMOR_BODY}

Definition at line 41 of file g_items.c.

Referenced by Pickup_Armor().

◆ combat_armor_index

int combat_armor_index
static

Definition at line 44 of file g_items.c.

Referenced by ArmorIndex(), Pickup_Armor(), and SetItemNames().

◆ combatarmor_info

gitem_armor_t combatarmor_info = { 50, 100, .60, .30, ARMOR_COMBAT}

Definition at line 40 of file g_items.c.

Referenced by Pickup_Armor().

◆ itemlist

◆ jacket_armor_index

int jacket_armor_index
static

Definition at line 43 of file g_items.c.

Referenced by ArmorIndex(), Pickup_Armor(), and SetItemNames().

◆ jacketarmor_info

gitem_armor_t jacketarmor_info = { 25, 50, .30, .00, ARMOR_JACKET}

Definition at line 39 of file g_items.c.

Referenced by Pickup_Armor().

◆ power_screen_index

int power_screen_index
static

Definition at line 46 of file g_items.c.

Referenced by PowerArmorType(), and SetItemNames().

◆ power_shield_index

int power_shield_index
static

Definition at line 47 of file g_items.c.

Referenced by PowerArmorType(), and SetItemNames().

◆ quad_drop_timeout_hack

int quad_drop_timeout_hack
static

Definition at line 53 of file g_items.c.

Referenced by Pickup_Powerup(), and Use_Quad().

FindItem
gitem_t * FindItem(char *pickup_name)
Definition: g_items.c:100
gi
game_import_t gi
Definition: g_main.c:25
IT_AMMO
#define IT_AMMO
Definition: g_local.h:215
G_ProjectSource
void G_ProjectSource(vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result)
Definition: g_utils.c:25
game_import_t::dprintf
void(* dprintf)(char *fmt,...)
Definition: game.h:106
edict_s::s
entity_state_t s
Definition: g_local.h:964
gitem_armor_t::max_count
int max_count
Definition: g_local.h:206
deathmatch
cvar_t * deathmatch
Definition: g_main.c:35
client_persistant_t::selected_item
int selected_item
Definition: g_local.h:841
client_persistant_t::max_grenades
int max_grenades
Definition: g_local.h:848
Pickup_Armor
qboolean Pickup_Armor(edict_t *ent, edict_t *other)
Definition: g_items.c:607
player_state_t::gunframe
int gunframe
Definition: q_shared.h:1212
AMMO_ROCKETS
@ AMMO_ROCKETS
Definition: g_local.h:103
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:73
gclient_s::v_angle
vec3_t v_angle
Definition: g_local.h:921
game_import_t::trace
trace_t(* trace)(vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, edict_t *passent, int contentmask)
Definition: game.h:128
edict_s::model
char * model
Definition: g_local.h:998
DF_WEAPONS_STAY
#define DF_WEAPONS_STAY
Definition: q_shared.h:1050
G_Spawn
edict_t * G_Spawn(void)
Definition: g_utils.c:420
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
gitem_armor_t::normal_protection
float normal_protection
Definition: g_local.h:207
CHAN_ITEM
#define CHAN_ITEM
Definition: q_shared.h:1010
gclient_s::grenade_blew_up
qboolean grenade_blew_up
Definition: g_local.h:944
edict_s::count
int count
Definition: g_local.h:1067
AMMO_BULLETS
@ AMMO_BULLETS
Definition: g_local.h:101
SOLID_BBOX
@ SOLID_BBOX
Definition: game.h:37
gitem_s::precaches
char * precaches
Definition: g_local.h:260
weapon_supershotgun_fire
void weapon_supershotgun_fire(edict_t *ent)
Definition: p_weapon.c:1239
FRAMETIME
#define FRAMETIME
Definition: g_local.h:73
combatarmor_info
gitem_armor_t combatarmor_info
Definition: g_items.c:40
WEAPON_READY
@ WEAPON_READY
Definition: g_local.h:93
ITEM_TARGETS_USED
#define ITEM_TARGETS_USED
Definition: g_local.h:559
Add_Ammo
qboolean Add_Ammo(edict_t *ent, gitem_t *item, int count)
Definition: g_items.c:447
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1181
AMMO_SHELLS
@ AMMO_SHELLS
Definition: g_local.h:102
v
GLdouble v
Definition: qgl_win.c:143
gclient_s::buttons
int buttons
Definition: g_local.h:895
Use_PowerArmor
void Use_PowerArmor(edict_t *ent, gitem_t *item)
Definition: g_items.c:705
combat_armor_index
static int combat_armor_index
Definition: g_items.c:44
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1173
SVF_NOCLIENT
#define SVF_NOCLIENT
Definition: game.h:27
CS_ITEMS
#define CS_ITEMS
Definition: q_shared.h:1140
gitem_s::pickup
qboolean(* pickup)(struct edict_s *ent, struct edict_s *other)
Definition: g_local.h:237
bodyarmor_info
gitem_armor_t bodyarmor_info
Definition: g_items.c:41
ITEM_INDEX
#define ITEM_INDEX(x)
Definition: g_local.h:610
FL_POWER_ARMOR
#define FL_POWER_ARMOR
Definition: g_local.h:69
weapon_grenade_fire
void weapon_grenade_fire(edict_t *ent, qboolean held)
Definition: p_weapon.c:546
VectorScale
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
Definition: q_shared.c:782
gitem_s::world_model_flags
int world_model_flags
Definition: g_local.h:243
qboolean
qboolean
Definition: q_shared.h:56
NoAmmoWeaponChange
void NoAmmoWeaponChange(edict_t *ent)
Definition: p_weapon.c:234
SpawnItem
void SpawnItem(edict_t *ent, gitem_t *item)
Definition: g_items.c:1061
trace_t
Definition: q_shared.h:449
i
int i
Definition: q_shared.c:305
DF_INFINITE_AMMO
#define DF_INFINITE_AMMO
Definition: q_shared.h:1061
edict_s::max_health
int max_health
Definition: g_local.h:1052
Pickup_Health
qboolean Pickup_Health(edict_t *ent, edict_t *other)
Definition: g_items.c:556
SOLID_TRIGGER
@ SOLID_TRIGGER
Definition: game.h:36
edict_s::client
struct gclient_s * client
Definition: g_local.h:965
entity_state_s::event
int event
Definition: q_shared.h:1186
game_import_t::sound
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
Definition: game.h:109
DoRespawn
void DoRespawn(edict_t *ent)
Definition: g_items.c:119
gclient_s::grenade_time
float grenade_time
Definition: g_local.h:945
Pickup_PowerArmor
qboolean Pickup_PowerArmor(edict_t *ent, edict_t *other)
Definition: g_items.c:727
GRENADE_TIMER
#define GRENADE_TIMER
Definition: p_weapon.c:542
WEAPON_ACTIVATING
@ WEAPON_ACTIVATING
Definition: g_local.h:94
Weapon_HyperBlaster_Fire
void Weapon_HyperBlaster_Fire(edict_t *ent)
Definition: p_weapon.c:868
CONTENTS_SOLID
#define CONTENTS_SOLID
Definition: qfiles.h:333
edict_s::mins
vec3_t mins
Definition: g_local.h:984
DF_NO_ITEMS
#define DF_NO_ITEMS
Definition: q_shared.h:1049
tv
float * tv(float x, float y, float z)
Definition: g_utils.c:266
client_persistant_t::max_slugs
int max_slugs
Definition: g_local.h:850
body_armor_index
static int body_armor_index
Definition: g_items.c:45
gclient_s::pickup_msg_time
float pickup_msg_time
Definition: g_local.h:949
ArmorIndex
int ArmorIndex(edict_t *ent)
Definition: g_items.c:590
STAT_SELECTED_ITEM
#define STAT_SELECTED_ITEM
Definition: q_shared.h:1037
ATTN_NORM
#define ATTN_NORM
Definition: q_shared.h:1019
STAT_PICKUP_ICON
#define STAT_PICKUP_ICON
Definition: q_shared.h:1032
client_persistant_t::max_bullets
int max_bullets
Definition: g_local.h:845
IT_WEAPON
#define IT_WEAPON
Definition: g_local.h:214
itemlist
gitem_t itemlist[]
Definition: g_items.c:1134
PrecacheItem
void PrecacheItem(gitem_t *it)
Definition: g_items.c:993
BUTTON_ATTACK
#define BUTTON_ATTACK
Definition: q_shared.h:507
gclient_s::bonus_alpha
float bonus_alpha
Definition: g_local.h:919
edict_s::movetype
int movetype
Definition: g_local.h:995
client_persistant_t::inventory
int inventory[MAX_ITEMS]
Definition: g_local.h:842
weapon_railgun_fire
void weapon_railgun_fire(edict_t *ent)
Definition: p_weapon.c:1302
MegaHealth_think
void MegaHealth_think(edict_t *self)
Definition: g_items.c:541
entity_state_s::effects
unsigned int effects
Definition: q_shared.h:1180
drop_temp_touch
static void drop_temp_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_items.c:825
gitem_s::icon
char * icon
Definition: g_local.h:247
game_import_t::imageindex
int(* imageindex)(char *name)
Definition: game.h:123
gclient_s::enviro_framenum
float enviro_framenum
Definition: g_local.h:942
gclient_s::pers
client_persistant_t pers
Definition: g_local.h:884
client_persistant_t::max_shells
int max_shells
Definition: g_local.h:846
MASK_SOLID
#define MASK_SOLID
Definition: q_shared.h:391
DF_INSTANT_ITEMS
#define DF_INSTANT_ITEMS
Definition: q_shared.h:1052
gitem_s::use
void(* use)(struct edict_s *ent, struct gitem_s *item)
Definition: g_local.h:238
gclient_s::newweapon
gitem_t * newweapon
Definition: g_local.h:901
CHAN_AUTO
#define CHAN_AUTO
Definition: q_shared.h:1007
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
DF_NO_HEALTH
#define DF_NO_HEALTH
Definition: q_shared.h:1048
jacket_armor_index
static int jacket_armor_index
Definition: g_items.c:43
POWER_ARMOR_SHIELD
#define POWER_ARMOR_SHIELD
Definition: g_local.h:159
edict_s::chain
edict_t * chain
Definition: g_local.h:1069
POWER_ARMOR_SCREEN
#define POWER_ARMOR_SCREEN
Definition: g_local.h:158
edict_s::svflags
int svflags
Definition: g_local.h:983
CHAN_VOICE
#define CHAN_VOICE
Definition: q_shared.h:1009
edict_s::item
gitem_t * item
Definition: g_local.h:1104
Pickup_Adrenaline
qboolean Pickup_Adrenaline(edict_t *ent, edict_t *other)
Definition: g_items.c:197
edict_s::classname
char * classname
Definition: g_local.h:1005
edict_s
Definition: g_local.h:962
gitem_s::world_model
char * world_model
Definition: g_local.h:242
Chaingun_Fire
void Chaingun_Fire(edict_t *ent)
Definition: p_weapon.c:1047
FL_RESPAWN
#define FL_RESPAWN
Definition: g_local.h:70
G_FreeEdict
void G_FreeEdict(edict_t *e)
Definition: g_utils.c:452
ITEM_TRIGGER_SPAWN
#define ITEM_TRIGGER_SPAWN
Definition: g_local.h:553
client_persistant_t::weapon
gitem_t * weapon
Definition: g_local.h:852
gitem_s::ammo
char * ammo
Definition: g_local.h:252
droptofloor
void droptofloor(edict_t *ent)
Definition: g_items.c:918
DROPPED_PLAYER_ITEM
#define DROPPED_PLAYER_ITEM
Definition: g_local.h:558
game_locals_t::num_items
int num_items
Definition: g_local.h:291
game_import_t::configstring
void(* configstring)(int num, char *string)
Definition: game.h:116
HEALTH_TIMED
#define HEALTH_TIMED
Definition: g_items.c:50
game_import_t::soundindex
int(* soundindex)(char *name)
Definition: game.h:122
forward
static vec3_t forward
Definition: p_view.c:29
edict_s::spawnflags
int spawnflags
Definition: g_local.h:1006
edict_s::owner
edict_t * owner
Definition: g_local.h:988
game_import_t::modelindex
int(* modelindex)(char *name)
Definition: game.h:121
gitem_armor_t
Definition: g_local.h:203
edict_s::nextthink
float nextthink
Definition: g_local.h:1036
cvar_s::value
float value
Definition: q_shared.h:324
vtos
char * vtos(vec3_t v)
Definition: g_utils.c:293
Touch_Item
void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_items.c:761
game
game_locals_t game
Definition: g_main.c:23
edict_s::think
void(* think)(edict_t *self)
Definition: g_local.h:1038
EF_ROTATE
#define EF_ROTATE
Definition: q_shared.h:558
PRINT_HIGH
#define PRINT_HIGH
Definition: q_shared.h:92
WEAPON_FIRING
@ WEAPON_FIRING
Definition: g_local.h:96
gitem_s::pickup_name
char * pickup_name
Definition: g_local.h:248
gclient_s::ps
player_state_t ps
Definition: g_local.h:880
NULL
#define NULL
Definition: q_shared.h:60
Use_Quad
void Use_Quad(edict_t *ent, gitem_t *item)
Definition: g_items.c:339
edict_s::solid
solid_t solid
Definition: g_local.h:986
weapon_shotgun_fire
void weapon_shotgun_fire(edict_t *ent)
Definition: p_weapon.c:1184
gclient_s::weaponstate
weaponstate_t weaponstate
Definition: g_local.h:913
AMMO_GRENADES
@ AMMO_GRENADES
Definition: g_local.h:104
SetRespawn
void SetRespawn(edict_t *ent, float delay)
Definition: g_items.c:146
RF_GLOW
#define RF_GLOW
Definition: q_shared.h:622
Use_Item
void Use_Item(edict_t *ent, edict_t *other, edict_t *activator)
Definition: g_items.c:892
Q_stricmp
int Q_stricmp(char *s1, char *s2)
Definition: q_shared.c:1192
EV_ITEM_RESPAWN
@ EV_ITEM_RESPAWN
Definition: q_shared.h:1156
edict_s::team
char * team
Definition: g_local.h:1014
skill
cvar_t * skill
Definition: g_main.c:38
gitem_s::quantity
int quantity
Definition: g_local.h:251
SOLID_NOT
@ SOLID_NOT
Definition: game.h:35
edict_s::velocity
vec3_t velocity
Definition: g_local.h:1024
Drop_General
void Drop_General(edict_t *ent, gitem_t *item)
Definition: g_items.c:187
gclient_s::breather_framenum
float breather_framenum
Definition: g_local.h:941
game_import_t::setmodel
void(* setmodel)(edict_t *ent, char *name)
Definition: game.h:125
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:157
Weapon_RocketLauncher_Fire
void Weapon_RocketLauncher_Fire(edict_t *ent)
Definition: p_weapon.c:759
gclient_s::quad_framenum
float quad_framenum
Definition: g_local.h:939
game_import_t::error
void(* error)(char *fmt,...)
Definition: game.h:118
DROPPED_ITEM
#define DROPPED_ITEM
Definition: g_local.h:557
gitem_s::pickup_sound
char * pickup_sound
Definition: g_local.h:241
ValidateSelectedItem
void ValidateSelectedItem(edict_t *ent)
Definition: g_cmds.c:130
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
coop
cvar_t * coop
Definition: g_main.c:36
edict_s::pain_debounce_time
float pain_debounce_time
Definition: g_local.h:1046
g_select_empty
cvar_t * g_select_empty
Definition: g_main.c:47
ARMOR_SHARD
#define ARMOR_SHARD
Definition: g_local.h:154
edict_s::use
void(* use)(edict_t *self, edict_t *other, edict_t *activator)
Definition: g_local.h:1041
timeout
cvar_t * timeout
Definition: sv_main.c:32
game_import_t::cprintf
void(* cprintf)(edict_t *ent, int printlevel, char *fmt,...)
Definition: game.h:107
client_persistant_t::max_rockets
int max_rockets
Definition: g_local.h:847
HEALTH_IGNORE_MAX
#define HEALTH_IGNORE_MAX
Definition: g_items.c:49
trace_t::endpos
vec3_t endpos
Definition: q_shared.h:454
power_screen_index
static int power_screen_index
Definition: g_items.c:46
STAT_PICKUP_STRING
#define STAT_PICKUP_STRING
Definition: q_shared.h:1033
client_persistant_t::power_cubes
int power_cubes
Definition: g_local.h:855
CHAN_WEAPON
#define CHAN_WEAPON
Definition: q_shared.h:1008
edict_s::style
int style
Definition: g_local.h:1102
level
GLint level
Definition: qgl_win.c:116
ChangeWeapon
void ChangeWeapon(edict_t *ent)
Definition: p_weapon.c:174
G_UseTargets
void G_UseTargets(edict_t *ent, edict_t *activator)
Definition: g_utils.c:173
edict_s::flags
int flags
Definition: g_local.h:996
IT_STAY_COOP
#define IT_STAY_COOP
Definition: g_local.h:217
Drop_Item
edict_t * Drop_Item(edict_t *ent, gitem_t *item)
Definition: g_items.c:843
weapon_grenadelauncher_fire
void weapon_grenadelauncher_fire(edict_t *ent)
Definition: p_weapon.c:709
gclient_s::invincible_framenum
float invincible_framenum
Definition: g_local.h:940
FL_TEAMSLAVE
#define FL_TEAMSLAVE
Definition: g_local.h:67
gitem_s::drop
void(* drop)(struct edict_s *ent, struct gitem_s *item)
Definition: g_local.h:239
Weapon_Blaster_Fire
void Weapon_Blaster_Fire(edict_t *ent)
Definition: p_weapon.c:847
edict_s::maxs
vec3_t maxs
Definition: g_local.h:984
gclient_s::ammo_index
int ammo_index
Definition: g_local.h:893
trace_t::startsolid
qboolean startsolid
Definition: q_shared.h:452
edict_s::teammaster
edict_t * teammaster
Definition: g_local.h:1076
quad_drop_timeout_hack
static int quad_drop_timeout_hack
Definition: g_items.c:53
edict_s::touch
void(* touch)(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
Definition: g_local.h:1040
MOVETYPE_TOSS
@ MOVETYPE_TOSS
Definition: g_local.h:196
VectorSet
#define VectorSet(v, x, y, z)
Definition: q_shared.h:161
Weapon_Generic
void Weapon_Generic(edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, int FRAME_IDLE_LAST, int FRAME_DEACTIVATE_LAST, int *pause_frames, int *fire_frames, void(*fire)(edict_t *ent))
Definition: p_weapon.c:380
right
GLdouble right
Definition: qgl_win.c:159
ITEM_NO_TOUCH
#define ITEM_NO_TOUCH
Definition: g_local.h:554
dmflags
cvar_t * dmflags
Definition: g_main.c:37
power_shield_index
static int power_shield_index
Definition: g_items.c:47
client_persistant_t::max_cells
int max_cells
Definition: g_local.h:849
weapon_bfg_fire
void weapon_bfg_fire(edict_t *ent)
Definition: p_weapon.c:1367
gitem_s::view_model
char * view_model
Definition: g_local.h:244
gitem_armor_t::base_count
int base_count
Definition: g_local.h:205
Pickup_AncientHead
qboolean Pickup_AncientHead(edict_t *ent, edict_t *other)
Definition: g_items.c:211
edict_s::teamchain
edict_t * teamchain
Definition: g_local.h:1075
game_import_t::linkentity
void(* linkentity)(edict_t *ent)
Definition: game.h:138
gclient_s::latched_buttons
int latched_buttons
Definition: g_local.h:897
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1174
gclient_s::weapon_sound
int weapon_sound
Definition: g_local.h:947
gitem_s::flags
int flags
Definition: g_local.h:253
DF_NO_ARMOR
#define DF_NO_ARMOR
Definition: q_shared.h:1059
Machinegun_Fire
void Machinegun_Fire(edict_t *ent)
Definition: p_weapon.c:953
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
POWER_ARMOR_NONE
#define POWER_ARMOR_NONE
Definition: g_local.h:157
gitem_s::tag
int tag
Definition: g_local.h:258
Pickup_Powerup
qboolean Pickup_Powerup(edict_t *ent, edict_t *other)
Definition: g_items.c:159
player_state_t::stats
short stats[MAX_STATS]
Definition: q_shared.h:1220
count
GLint GLsizei count
Definition: qgl_win.c:128
gitem_s::info
void * info
Definition: g_local.h:257
AMMO_CELLS
@ AMMO_CELLS
Definition: g_local.h:105
edict_s::health
int health
Definition: g_local.h:1051
gitem_s::classname
char * classname
Definition: g_local.h:236
gclient_s::silencer_shots
int silencer_shots
Definition: g_local.h:946
jacketarmor_info
gitem_armor_t jacketarmor_info
Definition: g_items.c:39
drop_make_touchable
static void drop_make_touchable(edict_t *ent)
Definition: g_items.c:833
gitem_s
Definition: g_local.h:234
AMMO_SLUGS
@ AMMO_SLUGS
Definition: g_local.h:106