Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
|
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_FlareGun (edict_t *ent) |
|
void | Use_Quad (edict_t *ent, gitem_t *item) |
|
gitem_t * | GetItemByIndex (int index) |
|
gitem_t * | FindItemByClassname (char *classname) |
|
gitem_t * | FindItem (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) |
|
void | drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) |
|
void | drop_make_touchable (edict_t *ent) |
|
edict_t * | Drop_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) |
|
|
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 [] |
|
◆ HEALTH_IGNORE_MAX
#define HEALTH_IGNORE_MAX 1 |
◆ HEALTH_TIMED
◆ Add_Ammo()
qboolean Add_Ammo |
( |
edict_t * |
ent, |
|
|
gitem_t * |
item, |
|
|
int |
count |
|
) |
| |
Definition at line 426 of file g_items.c.
435 max = ent->client->pers.max_bullets;
437 max = ent->client->pers.max_shells;
439 max = ent->client->pers.max_rockets;
441 max = ent->client->pers.max_grenades;
443 max = ent->client->pers.max_cells;
445 max = ent->client->pers.max_slugs;
451 if (ent->client->pers.inventory[index] == max)
454 ent->client->pers.inventory[index] += count;
456 if (ent->client->pers.inventory[index] > max)
457 ent->client->pers.inventory[index] = max;
Referenced by Cmd_Give_f(), Pickup_Ammo(), and Pickup_Weapon().
◆ ArmorIndex()
int ArmorIndex |
( |
edict_t * |
ent | ) |
|
◆ DoRespawn()
void DoRespawn |
( |
edict_t * |
ent | ) |
|
Definition at line 116 of file g_items.c.
123 master = ent->teammaster;
125 for (count = 0, ent = master; ent; ent = ent->chain, count++)
128 choice = rand() % count;
130 for (count = 0, ent = master; count < choice; ent = ent->chain, count++)
134 ent->svflags &= ~SVF_NOCLIENT;
135 ent->solid = SOLID_TRIGGER;
139 ent->s.event = EV_ITEM_RESPAWN;
Referenced by droptofloor(), and SetRespawn().
◆ Drop_Ammo()
Definition at line 491 of file g_items.c.
498 if (ent->client->pers.inventory[index] >= item->
quantity)
501 dropped->count = ent->client->pers.inventory[index];
503 if (ent->client->pers.weapon &&
506 ent->client->pers.inventory[index] - dropped->count <= 0) {
507 gi.cprintf(ent, PRINT_HIGH,
"Can't drop current weapon\n");
512 ent->client->pers.inventory[index] -= dropped->count;
◆ Drop_General()
◆ Drop_Item()
edict_t* Drop_Item |
( |
edict_t * |
ent, |
|
|
gitem_t * |
item |
|
) |
| |
Definition at line 798 of file g_items.c.
807 dropped->item = item;
810 dropped->s.renderfx = RF_GLOW;
811 VectorSet(dropped->mins, -15, -15, -15);
812 VectorSet(dropped->maxs, 15, 15, 15);
813 gi.setmodel(dropped, dropped->item->world_model);
814 dropped->solid = SOLID_TRIGGER;
817 dropped->owner = ent;
823 VectorSet(offset, 24, 0, -16);
825 trace =
gi.trace(ent->s.origin, dropped->mins, dropped->maxs,
826 dropped->s.origin, ent, CONTENTS_SOLID);
827 VectorCopy(trace.endpos, dropped->s.origin);
830 VectorCopy(ent->s.origin, dropped->s.origin);
833 VectorScale(
forward, 100, dropped->velocity);
834 dropped->velocity[2] = 300;
839 gi.linkentity(dropped);
Referenced by Drop_Ammo(), Drop_General(), Drop_Weapon(), monster_death_use(), and TossClientWeapon().
◆ drop_make_touchable()
void drop_make_touchable |
( |
edict_t * |
ent | ) |
|
◆ Drop_PowerArmor()
◆ drop_temp_touch()
void drop_temp_touch |
( |
edict_t * |
ent, |
|
|
edict_t * |
other, |
|
|
cplane_t * |
plane, |
|
|
csurface_t * |
surf |
|
) |
| |
◆ Drop_Weapon()
Definition at line 322 of file p_weapon.c.
326 if ((
int)(
dmflags->value) & DF_WEAPONS_STAY)
331 if (((item == ent->client->pers.weapon) || (item == ent->client->newweapon)) && (ent->client->pers.inventory[index] == 1)) {
332 gi.cprintf(ent, PRINT_HIGH,
"Can't drop current weapon\n");
337 ent->client->pers.inventory[index]--;
◆ droptofloor()
void droptofloor |
( |
edict_t * |
ent | ) |
|
Definition at line 867 of file g_items.c.
873 v =
tv(-15, -15, -15);
874 VectorCopy(v, ent->mins);
876 VectorCopy(v, ent->maxs);
879 gi.setmodel(ent, ent->model);
881 gi.setmodel(ent, ent->item->world_model);
882 ent->solid = SOLID_TRIGGER;
887 VectorAdd(ent->s.origin, v, dest);
889 tr =
gi.trace(ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID);
891 gi.dprintf(
"droptofloor: %s startsolid at %s\n", ent->classname,
vtos(ent->s.origin));
896 VectorCopy(tr.endpos, ent->s.origin);
900 ent->chain = ent->teamchain;
901 ent->teamchain = NULL;
903 ent->svflags |= SVF_NOCLIENT;
904 ent->solid = SOLID_NOT;
905 if (ent == ent->teammaster) {
912 ent->solid = SOLID_BBOX;
914 ent->s.effects &= ~EF_ROTATE;
915 ent->s.renderfx &= ~RF_GLOW;
919 ent->svflags |= SVF_NOCLIENT;
920 ent->solid = SOLID_NOT;
Referenced by SpawnItem().
◆ FindItem()
gitem_t* FindItem |
( |
char * |
pickup_name | ) |
|
Definition at line 98 of file g_items.c.
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 | ) |
|
◆ GetItemByIndex()
◆ InitItems()
◆ MegaHealth_think()
void MegaHealth_think |
( |
edict_t * |
self | ) |
|
Definition at line 519 of file g_items.c.
521 if (self->owner->health > self->owner->max_health) {
523 self->owner->health -= 1;
Referenced by Pickup_Health().
◆ Pickup_Adrenaline()
qboolean Pickup_Adrenaline |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
◆ Pickup_Ammo()
qboolean Pickup_Ammo |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 462 of file g_items.c.
469 if ((weapon) && ((
int)
dmflags->value & DF_INFINITE_AMMO))
474 count = ent->item->quantity;
481 if (weapon && !oldcount) {
483 other->client->newweapon = ent->item;
◆ Pickup_AncientHead()
qboolean Pickup_AncientHead |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
◆ Pickup_Armor()
qboolean Pickup_Armor |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 580 of file g_items.c.
596 if (!old_armor_index)
599 other->client->pers.inventory[old_armor_index] += 2;
603 else if (!old_armor_index) {
620 salvagecount = salvage *
other->client->pers.inventory[old_armor_index];
621 newcount = newinfo->
base_count + salvagecount;
626 other->client->pers.inventory[old_armor_index] = 0;
634 newcount =
other->client->pers.inventory[old_armor_index] + salvagecount;
639 if (
other->client->pers.inventory[old_armor_index] >= newcount)
643 other->client->pers.inventory[old_armor_index] = newcount;
Referenced by SpawnItem().
◆ Pickup_Bandolier()
qboolean Pickup_Bandolier |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 215 of file g_items.c.
220 if (
other->client->pers.max_bullets < 250)
221 other->client->pers.max_bullets = 250;
222 if (
other->client->pers.max_shells < 150)
223 other->client->pers.max_shells = 150;
224 if (
other->client->pers.max_cells < 250)
225 other->client->pers.max_cells = 250;
226 if (
other->client->pers.max_slugs < 75)
227 other->client->pers.max_slugs = 75;
233 if (
other->client->pers.inventory[index] >
other->client->pers.max_bullets)
234 other->client->pers.inventory[index] =
other->client->pers.max_bullets;
241 if (
other->client->pers.inventory[index] >
other->client->pers.max_shells)
242 other->client->pers.inventory[index] =
other->client->pers.max_shells;
◆ Pickup_Health()
qboolean Pickup_Health |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
◆ Pickup_Key()
qboolean Pickup_Key |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 405 of file g_items.c.
408 if (strcmp(ent->classname,
"key_power_cube") == 0) {
409 if (
other->client->pers.power_cubes & ((ent->spawnflags & 0x0000ff00) >> 8))
412 other->client->pers.power_cubes |= ((ent->spawnflags & 0x0000ff00) >> 8);
◆ Pickup_Pack()
qboolean Pickup_Pack |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 251 of file g_items.c.
256 if (
other->client->pers.max_bullets < 300)
257 other->client->pers.max_bullets = 300;
258 if (
other->client->pers.max_shells < 200)
259 other->client->pers.max_shells = 200;
260 if (
other->client->pers.max_rockets < 100)
261 other->client->pers.max_rockets = 100;
262 if (
other->client->pers.max_grenades < 100)
263 other->client->pers.max_grenades = 100;
264 if (
other->client->pers.max_cells < 300)
265 other->client->pers.max_cells = 300;
266 if (
other->client->pers.max_slugs < 100)
267 other->client->pers.max_slugs = 100;
273 if (
other->client->pers.inventory[index] >
other->client->pers.max_bullets)
274 other->client->pers.inventory[index] =
other->client->pers.max_bullets;
281 if (
other->client->pers.inventory[index] >
other->client->pers.max_shells)
282 other->client->pers.inventory[index] =
other->client->pers.max_shells;
289 if (
other->client->pers.inventory[index] >
other->client->pers.max_cells)
290 other->client->pers.inventory[index] =
other->client->pers.max_cells;
297 if (
other->client->pers.inventory[index] >
other->client->pers.max_grenades)
298 other->client->pers.inventory[index] =
other->client->pers.max_grenades;
305 if (
other->client->pers.inventory[index] >
other->client->pers.max_rockets)
306 other->client->pers.inventory[index] =
other->client->pers.max_rockets;
313 if (
other->client->pers.inventory[index] >
other->client->pers.max_slugs)
314 other->client->pers.inventory[index] =
other->client->pers.max_slugs;
◆ Pickup_PowerArmor()
qboolean Pickup_PowerArmor |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
◆ Pickup_Powerup()
qboolean Pickup_Powerup |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 155 of file g_items.c.
160 if ((
skill->value == 1 && quantity >= 2) || (
skill->value >= 2 && quantity >= 1))
174 ent->item->use(
other, ent->item);
Referenced by SpawnItem().
◆ Pickup_Weapon()
qboolean Pickup_Weapon |
( |
edict_t * |
ent, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 110 of file p_weapon.c.
117 if ((((
int)(
dmflags->value) & DF_WEAPONS_STAY) ||
coop->value)
118 &&
other->client->pers.inventory[index]) {
123 other->client->pers.inventory[index]++;
128 if ((
int)
dmflags->value & DF_INFINITE_AMMO)
135 if ((
int)(
dmflags->value) & DF_WEAPONS_STAY)
145 if (
other->client->pers.weapon != ent->item &&
146 (
other->client->pers.inventory[index] == 1) &&
148 other->client->newweapon = ent->item;
◆ PowerArmorType()
int PowerArmorType |
( |
edict_t * |
ent | ) |
|
◆ PrecacheItem()
Definition at line 937 of file g_items.c.
940 char data[MAX_QPATH];
970 while (*s && *s !=
' ')
974 if (len >= MAX_QPATH || len < 5)
975 gi.error(
"PrecacheItem: %s has bad precache string", it->
classname);
976 memcpy(data, start, len);
982 if (!strcmp(data + len - 3,
"md2"))
984 else if (!strcmp(data + len - 3,
"sp2"))
986 else if (!strcmp(data + len - 3,
"wav"))
988 if (!strcmp(data + len - 3,
"pcx"))
Referenced by PrecacheItem(), SP_worldspawn(), and SpawnItem().
◆ SetItemNames()
◆ SetRespawn()
void SetRespawn |
( |
edict_t * |
ent, |
|
|
float |
delay |
|
) |
| |
Definition at line 142 of file g_items.c.
145 ent->svflags |= SVF_NOCLIENT;
146 ent->solid = SOLID_NOT;
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 2071 of file g_items.c.
2078 self->model =
"models/items/healing/medium/tris.md2";
2081 gi.soundindex(
"items/n_health.wav");
◆ SP_item_health_large()
void SP_item_health_large |
( |
edict_t * |
self | ) |
|
Definition at line 2102 of file g_items.c.
2109 self->model =
"models/items/healing/large/tris.md2";
2112 gi.soundindex(
"items/l_health.wav");
◆ SP_item_health_mega()
void SP_item_health_mega |
( |
edict_t * |
self | ) |
|
Definition at line 2117 of file g_items.c.
2124 self->model =
"models/items/mega_h/tris.md2";
2127 gi.soundindex(
"items/m_health.wav");
◆ SP_item_health_small()
void SP_item_health_small |
( |
edict_t * |
self | ) |
|
Definition at line 2086 of file g_items.c.
2093 self->model =
"models/items/healing/stimpack/tris.md2";
2097 gi.soundindex(
"items/s_health.wav");
◆ SpawnItem()
Definition at line 1003 of file g_items.c.
1007 if (ent->spawnflags) {
1008 if (strcmp(ent->classname,
"key_power_cube") != 0) {
1009 ent->spawnflags = 0;
1010 gi.dprintf(
"%s at %s has invalid spawnflags set\n", ent->classname,
vtos(ent->s.origin));
1016 if ((
int)
dmflags->value & DF_NO_ARMOR) {
1022 if ((
int)
dmflags->value & DF_NO_ITEMS) {
1028 if ((
int)
dmflags->value & DF_NO_HEALTH) {
1034 if ((
int)
dmflags->value & DF_INFINITE_AMMO) {
1035 if ((item->
flags ==
IT_AMMO) || (strcmp(ent->classname,
"weapon_bfg") == 0)) {
1042 if (
coop->value && (strcmp(ent->classname,
"key_power_cube") == 0)) {
1056 ent->s.renderfx = RF_GLOW;
1058 gi.modelindex(ent->model);
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 723 of file g_items.c.
729 if (
other->health < 1)
731 if (!ent->item->pickup)
734 taken = ent->item->pickup(ent,
other);
738 other->client->bonus_alpha = 0.25;
741 other->client->ps.stats[STAT_PICKUP_ICON] =
gi.imageindex(ent->item->icon);
742 other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS +
ITEM_INDEX(ent->item);
747 other->client->pers.selected_item =
other->client->ps.stats[STAT_SELECTED_ITEM] =
ITEM_INDEX(ent->item);
751 gi.sound(
other, CHAN_ITEM,
gi.soundindex(
"items/s_health.wav"), 1, ATTN_NORM, 0);
752 else if (ent->count == 10)
753 gi.sound(
other, CHAN_ITEM,
gi.soundindex(
"items/n_health.wav"), 1, ATTN_NORM, 0);
754 else if (ent->count == 25)
755 gi.sound(
other, CHAN_ITEM,
gi.soundindex(
"items/l_health.wav"), 1, ATTN_NORM, 0);
757 gi.sound(
other, CHAN_ITEM,
gi.soundindex(
"items/m_health.wav"), 1, ATTN_NORM, 0);
758 }
else if (ent->item->pickup_sound) {
759 gi.sound(
other, CHAN_ITEM,
gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0);
Referenced by Cmd_Give_f(), drop_make_touchable(), drop_temp_touch(), droptofloor(), TossClientWeapon(), and Use_Item().
◆ Use_Breather()
Definition at line 349 of file g_items.c.
351 ent->client->pers.inventory[
ITEM_INDEX(item)]--;
355 ent->client->breather_framenum += 300;
◆ Use_Envirosuit()
Definition at line 364 of file g_items.c.
366 ent->client->pers.inventory[
ITEM_INDEX(item)]--;
370 ent->client->enviro_framenum += 300;
◆ Use_Invulnerability()
void Use_Invulnerability |
( |
edict_t * |
ent, |
|
|
gitem_t * |
item |
|
) |
| |
Definition at line 379 of file g_items.c.
381 ent->client->pers.inventory[
ITEM_INDEX(item)]--;
385 ent->client->invincible_framenum += 300;
389 gi.sound(ent, CHAN_ITEM,
gi.soundindex(
"items/protect.wav"), 1, ATTN_NORM, 0);
◆ Use_Item()
void Use_Item |
( |
edict_t * |
ent, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
Definition at line 844 of file g_items.c.
846 ent->svflags &= ~SVF_NOCLIENT;
850 ent->solid = SOLID_BBOX;
853 ent->solid = SOLID_TRIGGER;
Referenced by droptofloor().
◆ Use_PowerArmor()
Definition at line 672 of file g_items.c.
678 gi.sound(ent, CHAN_AUTO,
gi.soundindex(
"misc/power2.wav"), 1, ATTN_NORM, 0);
681 if (!ent->client->pers.inventory[index]) {
682 gi.cprintf(ent, PRINT_HIGH,
"No cells for power armor.\n");
686 gi.sound(ent, CHAN_AUTO,
gi.soundindex(
"misc/power1.wav"), 1, ATTN_NORM, 0);
Referenced by Drop_PowerArmor().
◆ Use_Quad()
Definition at line 325 of file g_items.c.
329 ent->client->pers.inventory[
ITEM_INDEX(item)]--;
340 ent->client->quad_framenum += timeout;
344 gi.sound(ent, CHAN_ITEM,
gi.soundindex(
"items/damage.wav"), 1, ATTN_NORM, 0);
Referenced by Pickup_Powerup().
◆ Use_Silencer()
Definition at line 394 of file g_items.c.
396 ent->client->pers.inventory[
ITEM_INDEX(item)]--;
398 ent->client->silencer_shots += 30;
◆ Use_Weapon()
Definition at line 287 of file p_weapon.c.
293 if (item == ent->client->pers.weapon)
300 if (!ent->client->pers.inventory[ammo_index]) {
301 gi.cprintf(ent, PRINT_HIGH,
"No %s for %s.\n", ammo_item->
pickup_name, item->pickup_name);
305 if (ent->client->pers.inventory[ammo_index] < item->quantity) {
306 gi.cprintf(ent, PRINT_HIGH,
"Not enough %s for %s.\n", ammo_item->
pickup_name, item->pickup_name);
312 ent->client->newweapon = item;
◆ Weapon_BFG()
void Weapon_BFG |
( |
edict_t * |
ent | ) |
|
Definition at line 1294 of file p_weapon.c.
1296 static int pause_frames[] = {39, 45, 50, 55, 0};
1297 static int fire_frames[] = {9, 17, 0};
◆ Weapon_Blaster()
void Weapon_Blaster |
( |
edict_t * |
ent | ) |
|
Definition at line 774 of file p_weapon.c.
776 static int pause_frames[] = {19, 32, 0};
777 static int fire_frames[] = {5, 0};
◆ Weapon_Chaingun()
void Weapon_Chaingun |
( |
edict_t * |
ent | ) |
|
Definition at line 1044 of file p_weapon.c.
1046 static int pause_frames[] = {38, 43, 51, 61, 0};
1047 static int fire_frames[] = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0};
◆ Weapon_FlareGun()
void Weapon_FlareGun |
( |
edict_t * |
ent | ) |
|
Definition at line 1364 of file p_weapon.c.
1366 static int pause_frames[] = { 39, 45, 50, 53, 0 };
1367 static int fire_frames[] = { 9, 17, 0 };
◆ Weapon_Grenade()
void Weapon_Grenade |
( |
edict_t * |
ent | ) |
|
Definition at line 530 of file p_weapon.c.
532 if ((ent->client->newweapon) && (ent->client->weaponstate ==
WEAPON_READY)) {
539 ent->client->ps.gunframe = 16;
544 if (((ent->client->latched_buttons | ent->client->buttons) & BUTTON_ATTACK)) {
545 ent->client->latched_buttons &= ~BUTTON_ATTACK;
546 if (ent->client->pers.inventory[ent->client->ammo_index]) {
547 ent->client->ps.gunframe = 1;
549 ent->client->grenade_time = 0;
551 if (
level.
time >= ent->pain_debounce_time) {
552 gi.sound(ent, CHAN_VOICE,
gi.soundindex(
"weapons/noammo.wav"), 1, ATTN_NORM, 0);
553 ent->pain_debounce_time =
level.
time + 1;
560 if ((ent->client->ps.gunframe == 29) || (ent->client->ps.gunframe == 34) || (ent->client->ps.gunframe == 39) || (ent->client->ps.gunframe == 48)) {
565 if (++ent->client->ps.gunframe > 48)
566 ent->client->ps.gunframe = 16;
571 if (ent->client->ps.gunframe == 5)
572 gi.sound(ent, CHAN_WEAPON,
gi.soundindex(
"weapons/hgrena1b.wav"), 1, ATTN_NORM, 0);
574 if (ent->client->ps.gunframe == 11) {
575 if (!ent->client->grenade_time) {
577 ent->client->weapon_sound =
gi.soundindex(
"weapons/hgrenc1b.wav");
581 if (!ent->client->grenade_blew_up &&
level.
time >= ent->client->grenade_time) {
582 ent->client->weapon_sound = 0;
584 ent->client->grenade_blew_up = qtrue;
587 if (ent->client->buttons & BUTTON_ATTACK)
590 if (ent->client->grenade_blew_up) {
591 if (
level.
time >= ent->client->grenade_time) {
592 ent->client->ps.gunframe = 15;
593 ent->client->grenade_blew_up = qfalse;
600 if (ent->client->ps.gunframe == 12) {
601 ent->client->weapon_sound = 0;
605 if ((ent->client->ps.gunframe == 15) && (
level.
time < ent->client->grenade_time))
608 ent->client->ps.gunframe++;
610 if (ent->client->ps.gunframe == 16) {
611 ent->client->grenade_time = 0;
◆ Weapon_GrenadeLauncher()
void Weapon_GrenadeLauncher |
( |
edict_t * |
ent | ) |
|
Definition at line 659 of file p_weapon.c.
661 static int pause_frames[] = {34, 51, 59, 0};
662 static int fire_frames[] = {6, 0};
◆ Weapon_HyperBlaster()
void Weapon_HyperBlaster |
( |
edict_t * |
ent | ) |
|
Definition at line 841 of file p_weapon.c.
843 static int pause_frames[] = {0};
844 static int fire_frames[] = {6, 7, 8, 9, 10, 11, 0};
◆ Weapon_Machinegun()
void Weapon_Machinegun |
( |
edict_t * |
ent | ) |
|
Definition at line 934 of file p_weapon.c.
936 static int pause_frames[] = {23, 45, 0};
937 static int fire_frames[] = {4, 5, 0};
◆ Weapon_Railgun()
void Weapon_Railgun |
( |
edict_t * |
ent | ) |
|
Definition at line 1221 of file p_weapon.c.
1223 static int pause_frames[] = {56, 0};
1224 static int fire_frames[] = {4, 0};
◆ Weapon_RocketLauncher()
void Weapon_RocketLauncher |
( |
edict_t * |
ent | ) |
|
Definition at line 714 of file p_weapon.c.
716 static int pause_frames[] = {25, 33, 42, 50, 0};
717 static int fire_frames[] = {5, 0};
◆ Weapon_Shotgun()
void Weapon_Shotgun |
( |
edict_t * |
ent | ) |
|
Definition at line 1105 of file p_weapon.c.
1107 static int pause_frames[] = {22, 28, 34, 0};
1108 static int fire_frames[] = {8, 9, 0};
◆ Weapon_SuperShotgun()
void Weapon_SuperShotgun |
( |
edict_t * |
ent | ) |
|
Definition at line 1158 of file p_weapon.c.
1160 static int pause_frames[] = {29, 42, 57, 0};
1161 static int fire_frames[] = {7, 0};
◆ body_armor_index
◆ bodyarmor_info
◆ combat_armor_index
◆ combatarmor_info
◆ itemlist
Definition at line 1063 of file g_items.c.
Referenced by BeginIntermission(), Cmd_Give_f(), Cmd_InvDrop_f(), Cmd_InvUse_f(), Cmd_WeapLast_f(), Cmd_WeapNext_f(), Cmd_WeapPrev_f(), ED_CallSpawn(), FindItem(), FindItemByClassname(), G_SetStats(), GetItemByIndex(), InitItems(), player_die(), read_field(), SelectNextItem(), SelectPrevItem(), SetItemNames(), and write_field().
◆ jacket_armor_index
◆ jacketarmor_info
◆ power_screen_index
◆ power_shield_index
◆ quad_drop_timeout_hack
int quad_drop_timeout_hack |
|
static |
gitem_t * FindItem(char *pickup_name)
void G_ProjectSource(const vec3_t point, const vec3_t distance, const vec3_t forward, const vec3_t right, vec3_t result)
qboolean Pickup_Armor(edict_t *ent, edict_t *other)
void weapon_supershotgun_fire(edict_t *ent)
gitem_armor_t combatarmor_info
#define ITEM_TARGETS_USED
qboolean Add_Ammo(edict_t *ent, gitem_t *item, int count)
void weapon_flaregun_fire(edict_t *ent)
void Use_PowerArmor(edict_t *ent, gitem_t *item)
static int combat_armor_index
qboolean(* pickup)(struct edict_s *ent, struct edict_s *other)
gitem_armor_t bodyarmor_info
void weapon_grenade_fire(edict_t *ent, qboolean held)
void NoAmmoWeaponChange(edict_t *ent)
void SpawnItem(edict_t *ent, gitem_t *item)
qboolean Pickup_Health(edict_t *ent, edict_t *other)
void DoRespawn(edict_t *ent)
qboolean Pickup_PowerArmor(edict_t *ent, edict_t *other)
void Weapon_HyperBlaster_Fire(edict_t *ent)
float * tv(float x, float y, float z)
static int body_armor_index
int ArmorIndex(edict_t *ent)
void PrecacheItem(gitem_t *it)
void weapon_railgun_fire(edict_t *ent)
void MegaHealth_think(edict_t *self)
void drop_make_touchable(edict_t *ent)
static int jacket_armor_index
#define POWER_ARMOR_SHIELD
#define POWER_ARMOR_SCREEN
qboolean Pickup_Adrenaline(edict_t *ent, edict_t *other)
void Chaingun_Fire(edict_t *ent)
void G_FreeEdict(edict_t *e)
#define ITEM_TRIGGER_SPAWN
void droptofloor(edict_t *ent)
#define DROPPED_PLAYER_ITEM
void Touch_Item(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void Use_Quad(edict_t *ent, gitem_t *item)
void weapon_shotgun_fire(edict_t *ent)
void SetRespawn(edict_t *ent, float delay)
void Use_Item(edict_t *ent, edict_t *other, edict_t *activator)
void Drop_General(edict_t *ent, gitem_t *item)
void Weapon_RocketLauncher_Fire(edict_t *ent)
void ValidateSelectedItem(edict_t *ent)
void drop_temp_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
#define HEALTH_IGNORE_MAX
static int power_screen_index
void ChangeWeapon(edict_t *ent)
void G_UseTargets(edict_t *ent, edict_t *activator)
edict_t * Drop_Item(edict_t *ent, gitem_t *item)
void weapon_grenadelauncher_fire(edict_t *ent)
void(* drop)(struct edict_s *ent, struct gitem_s *item)
void Weapon_Blaster_Fire(edict_t *ent)
static int quad_drop_timeout_hack
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))
static int power_shield_index
CONST PIXELFORMATDESCRIPTOR int
void weapon_bfg_fire(edict_t *ent)
qboolean Pickup_AncientHead(edict_t *ent, edict_t *other)
void Machinegun_Fire(edict_t *ent)
qboolean Pickup_Powerup(edict_t *ent, edict_t *other)
gitem_armor_t jacketarmor_info