Quake II RTX doxygen
1.0 dev
|
|
#include "g_local.h"
#include "m_player.h"
Go to the source code of this file.
|
void | weapon_grenade_fire (edict_t *ent, qboolean held) |
|
static void | P_ProjectSource (gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result) |
|
void | PlayerNoise (edict_t *who, vec3_t where, int type) |
|
qboolean | Pickup_Weapon (edict_t *ent, edict_t *other) |
|
void | ChangeWeapon (edict_t *ent) |
|
void | NoAmmoWeaponChange (edict_t *ent) |
|
void | Think_Weapon (edict_t *ent) |
|
void | Use_Weapon (edict_t *ent, gitem_t *item) |
|
void | Drop_Weapon (edict_t *ent, gitem_t *item) |
|
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)) |
|
void | Weapon_Grenade (edict_t *ent) |
|
void | weapon_grenadelauncher_fire (edict_t *ent) |
|
void | Weapon_GrenadeLauncher (edict_t *ent) |
|
void | Weapon_RocketLauncher_Fire (edict_t *ent) |
|
void | Weapon_RocketLauncher (edict_t *ent) |
|
void | Blaster_Fire (edict_t *ent, vec3_t g_offset, int damage, qboolean hyper, int effect) |
|
void | Weapon_Blaster_Fire (edict_t *ent) |
|
void | Weapon_Blaster (edict_t *ent) |
|
void | Weapon_HyperBlaster_Fire (edict_t *ent) |
|
void | Weapon_HyperBlaster (edict_t *ent) |
|
void | Machinegun_Fire (edict_t *ent) |
|
void | Weapon_Machinegun (edict_t *ent) |
|
void | Chaingun_Fire (edict_t *ent) |
|
void | Weapon_Chaingun (edict_t *ent) |
|
void | weapon_shotgun_fire (edict_t *ent) |
|
void | Weapon_Shotgun (edict_t *ent) |
|
void | weapon_supershotgun_fire (edict_t *ent) |
|
void | Weapon_SuperShotgun (edict_t *ent) |
|
void | weapon_railgun_fire (edict_t *ent) |
|
void | Weapon_Railgun (edict_t *ent) |
|
void | weapon_bfg_fire (edict_t *ent) |
|
void | Weapon_BFG (edict_t *ent) |
|
void | fire_flaregun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius) |
|
void | weapon_flaregun_fire (edict_t *ent) |
|
void | Weapon_FlareGun (edict_t *ent) |
|
◆ FRAME_DEACTIVATE_FIRST
#define FRAME_DEACTIVATE_FIRST (FRAME_IDLE_LAST + 1) |
◆ FRAME_FIRE_FIRST
#define FRAME_FIRE_FIRST (FRAME_ACTIVATE_LAST + 1) |
◆ FRAME_IDLE_FIRST
#define FRAME_IDLE_FIRST (FRAME_FIRE_LAST + 1) |
◆ GRENADE_MAXSPEED
#define GRENADE_MAXSPEED 800 |
◆ GRENADE_MINSPEED
#define GRENADE_MINSPEED 400 |
◆ GRENADE_TIMER
#define GRENADE_TIMER 3.0 |
◆ Blaster_Fire()
void Blaster_Fire |
( |
edict_t * |
ent, |
|
|
vec3_t |
g_offset, |
|
|
int |
damage, |
|
|
qboolean |
hyper, |
|
|
int |
effect |
|
) |
| |
Definition at line 731 of file p_weapon.c.
740 VectorSet(offset, 24, 8, ent->viewheight - 8);
741 VectorAdd(offset, g_offset, offset);
744 VectorScale(
forward, -2, ent->client->kick_origin);
745 ent->client->kick_angles[0] = -1;
756 gi.multicast(ent->s.origin, MULTICAST_PVS);
Referenced by Weapon_Blaster_Fire(), and Weapon_HyperBlaster_Fire().
◆ Chaingun_Fire()
void Chaingun_Fire |
( |
edict_t * |
ent | ) |
|
Definition at line 942 of file p_weapon.c.
958 if (ent->client->ps.gunframe == 5)
959 gi.sound(ent, CHAN_AUTO,
gi.soundindex(
"weapons/chngnu1a.wav"), 1, ATTN_IDLE, 0);
961 if ((ent->client->ps.gunframe == 14) && !(ent->client->buttons & BUTTON_ATTACK)) {
962 ent->client->ps.gunframe = 32;
963 ent->client->weapon_sound = 0;
965 }
else if ((ent->client->ps.gunframe == 21) && (ent->client->buttons & BUTTON_ATTACK)
966 && ent->client->pers.inventory[ent->client->ammo_index]) {
967 ent->client->ps.gunframe = 15;
969 ent->client->ps.gunframe++;
972 if (ent->client->ps.gunframe == 22) {
973 ent->client->weapon_sound = 0;
974 gi.sound(ent, CHAN_AUTO,
gi.soundindex(
"weapons/chngnd1a.wav"), 1, ATTN_IDLE, 0);
976 ent->client->weapon_sound =
gi.soundindex(
"weapons/chngnl1a.wav");
980 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
984 ent->s.frame =
FRAME_attack1 - (ent->client->ps.gunframe & 1);
988 if (ent->client->ps.gunframe <= 9)
990 else if (ent->client->ps.gunframe <= 14) {
991 if (ent->client->buttons & BUTTON_ATTACK)
998 if (ent->client->pers.inventory[ent->client->ammo_index] < shots)
999 shots = ent->client->pers.inventory[ent->client->ammo_index];
1002 if (
level.
time >= ent->pain_debounce_time) {
1003 gi.sound(ent, CHAN_VOICE,
gi.soundindex(
"weapons/noammo.wav"), 1, ATTN_NORM, 0);
1004 ent->pain_debounce_time =
level.
time + 1;
1015 for (i = 0 ; i < 3 ; i++) {
1016 ent->client->kick_origin[i] =
crandom() * 0.35;
1017 ent->client->kick_angles[i] =
crandom() * 0.7;
1020 for (i = 0 ; i < shots ; i++) {
1025 VectorSet(offset, 0, r, u + ent->viewheight - 8);
1035 gi.multicast(ent->s.origin, MULTICAST_PVS);
1039 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
1040 ent->client->pers.inventory[ent->client->ammo_index] -= shots;
Referenced by Weapon_Chaingun().
◆ ChangeWeapon()
void ChangeWeapon |
( |
edict_t * |
ent | ) |
|
Definition at line 162 of file p_weapon.c.
166 if (ent->client->grenade_time) {
168 ent->client->weapon_sound = 0;
170 ent->client->grenade_time = 0;
173 ent->client->pers.lastweapon = ent->client->pers.weapon;
174 ent->client->pers.weapon = ent->client->newweapon;
175 ent->client->newweapon = NULL;
176 ent->client->machinegun_shots = 0;
179 if (ent->s.modelindex == 255) {
180 if (ent->client->pers.weapon)
181 i = ((ent->client->pers.weapon->weapmodel & 0xff) << 8);
184 ent->s.skinnum = (ent -
g_edicts - 1) | i;
187 if (ent->client->pers.weapon && ent->client->pers.weapon->ammo)
190 ent->client->ammo_index = 0;
192 if (!ent->client->pers.weapon) {
194 ent->client->ps.gunindex = 0;
199 ent->client->ps.gunframe = 0;
200 ent->client->ps.gunindex =
gi.modelindex(ent->client->pers.weapon->view_model);
203 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
Referenced by PutClientInServer(), Think_Weapon(), Weapon_Generic(), and Weapon_Grenade().
◆ 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]--;
◆ fire_flaregun()
void fire_flaregun |
( |
edict_t * |
self, |
|
|
vec3_t |
start, |
|
|
vec3_t |
aimdir, |
|
|
int |
damage, |
|
|
int |
speed, |
|
|
float |
timer, |
|
|
float |
damage_radius |
|
) |
| |
Definition at line 956 of file g_weapon.c.
968 VectorCopy(start, flare->s.origin);
969 VectorScale(aimdir, speed, flare->velocity);
970 VectorSet(flare->avelocity, 300, 300, 300);
972 flare->clipmask = MASK_SHOT;
973 flare->solid = SOLID_BBOX;
975 const float size = 4;
976 VectorSet(flare->mins, -size, -size, -size);
977 VectorSet(flare->maxs, size, size, size);
979 flare->s.modelindex =
gi.modelindex(
"models/objects/flare/tris.md2");
984 flare->radius_dmg = damage;
985 flare->dmg_radius = damage_radius;
986 flare->classname =
"flare";
988 gi.linkentity(flare);
Referenced by weapon_flaregun_fire().
◆ Machinegun_Fire()
void Machinegun_Fire |
( |
edict_t * |
ent | ) |
|
Definition at line 857 of file p_weapon.c.
867 if (!(ent->client->buttons & BUTTON_ATTACK)) {
868 ent->client->machinegun_shots = 0;
869 ent->client->ps.gunframe++;
873 if (ent->client->ps.gunframe == 5)
874 ent->client->ps.gunframe = 4;
876 ent->client->ps.gunframe = 5;
878 if (ent->client->pers.inventory[ent->client->ammo_index] < 1) {
879 ent->client->ps.gunframe = 6;
880 if (
level.
time >= ent->pain_debounce_time) {
881 gi.sound(ent, CHAN_VOICE,
gi.soundindex(
"weapons/noammo.wav"), 1, ATTN_NORM, 0);
882 ent->pain_debounce_time =
level.
time + 1;
893 for (i = 1 ; i < 3 ; i++) {
894 ent->client->kick_origin[i] =
crandom() * 0.35;
895 ent->client->kick_angles[i] =
crandom() * 0.7;
897 ent->client->kick_origin[0] =
crandom() * 0.35;
898 ent->client->kick_angles[0] = ent->client->machinegun_shots * -1.5;
902 ent->client->machinegun_shots++;
903 if (ent->client->machinegun_shots > 9)
904 ent->client->machinegun_shots = 9;
908 VectorAdd(ent->client->v_angle, ent->client->kick_angles, angles);
910 VectorSet(offset, 0, 8, ent->viewheight - 8);
917 gi.multicast(ent->s.origin, MULTICAST_PVS);
921 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
922 ent->client->pers.inventory[ent->client->ammo_index]--;
925 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
Referenced by Weapon_Machinegun().
◆ NoAmmoWeaponChange()
void NoAmmoWeaponChange |
( |
edict_t * |
ent | ) |
|
◆ P_ProjectSource()
static void P_ProjectSource |
( |
gclient_t * |
client, |
|
|
vec3_t |
point, |
|
|
vec3_t |
distance, |
|
|
vec3_t |
forward, |
|
|
vec3_t |
right, |
|
|
vec3_t |
result |
|
) |
| |
|
static |
Definition at line 31 of file p_weapon.c.
35 VectorCopy(distance, _distance);
Referenced by Blaster_Fire(), Chaingun_Fire(), Machinegun_Fire(), weapon_bfg_fire(), weapon_flaregun_fire(), weapon_grenade_fire(), weapon_grenadelauncher_fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), and weapon_supershotgun_fire().
◆ 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;
◆ PlayerNoise()
void PlayerNoise |
( |
edict_t * |
who, |
|
|
vec3_t |
where, |
|
|
int |
type |
|
) |
| |
Definition at line 56 of file p_weapon.c.
61 if (who->client->silencer_shots) {
62 who->client->silencer_shots--;
76 noise->classname =
"player_noise";
77 VectorSet(noise->mins, -8, -8, -8);
78 VectorSet(noise->maxs, 8, 8, 8);
80 noise->svflags = SVF_NOCLIENT;
84 noise->classname =
"player_noise";
85 VectorSet(noise->mins, -8, -8, -8);
86 VectorSet(noise->maxs, 8, 8, 8);
88 noise->svflags = SVF_NOCLIENT;
89 who->mynoise2 = noise;
97 noise = who->mynoise2;
102 VectorCopy(where, noise->s.origin);
103 VectorSubtract(where, noise->maxs, noise->absmin);
104 VectorAdd(where, noise->maxs, noise->absmax);
106 gi.linkentity(noise);
Referenced by bfg_touch(), Blaster_Fire(), blaster_touch(), Chaingun_Fire(), ClientThink(), fire_lead(), fire_rail(), Grenade_Explode(), Machinegun_Fire(), P_WorldEffects(), rocket_touch(), weapon_bfg_fire(), weapon_flaregun_fire(), weapon_grenadelauncher_fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), and weapon_supershotgun_fire().
◆ Think_Weapon()
void Think_Weapon |
( |
edict_t * |
ent | ) |
|
Definition at line 260 of file p_weapon.c.
263 if (ent->health < 1) {
264 ent->client->newweapon = NULL;
269 if (ent->client->pers.weapon && ent->client->pers.weapon->weaponthink) {
271 if (ent->client->silencer_shots)
275 ent->client->pers.weapon->weaponthink(ent);
Referenced by ClientBeginServerFrame(), and ClientThink().
◆ 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]) {
305 if (ent->client->pers.inventory[ammo_index] < item->
quantity) {
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_bfg_fire()
void weapon_bfg_fire |
( |
edict_t * |
ent | ) |
|
Definition at line 1238 of file p_weapon.c.
1240 vec3_t offset, start;
1243 float damage_radius = 1000;
1250 if (ent->client->ps.gunframe == 9) {
1255 gi.multicast(ent->s.origin, MULTICAST_PVS);
1257 ent->client->ps.gunframe++;
1265 if (ent->client->pers.inventory[ent->client->ammo_index] < 50) {
1266 ent->client->ps.gunframe++;
1275 VectorScale(
forward, -2, ent->client->kick_origin);
1278 ent->client->v_dmg_pitch = -40;
1279 ent->client->v_dmg_roll =
crandom() * 8;
1282 VectorSet(offset, 8, 8, ent->viewheight - 8);
1286 ent->client->ps.gunframe++;
1290 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
1291 ent->client->pers.inventory[ent->client->ammo_index] -= 50;
Referenced by Weapon_BFG().
◆ 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_Blaster_Fire()
void Weapon_Blaster_Fire |
( |
edict_t * |
ent | ) |
|
◆ 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_flaregun_fire()
void weapon_flaregun_fire |
( |
edict_t * |
ent | ) |
|
Definition at line 1319 of file p_weapon.c.
1327 VectorSet(offset, 8, 8, ent->viewheight - 8);
1331 VectorScale(
forward, -2, ent->client->kick_origin);
1332 ent->client->kick_angles[0] = -1;
1341 gi.multicast(ent->s.origin, MULTICAST_PVS);
1345 ent->client->ps.gunframe++;
1351 ent->client->pers.inventory[ent->client->ammo_index]--;
Referenced by Weapon_FlareGun().
◆ 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(*)(edict_t *ent) |
fire |
|
) |
| |
Definition at line 352 of file p_weapon.c.
356 if (ent->deadflag || ent->s.modelindex != 255) {
361 if (ent->client->ps.gunframe == FRAME_DEACTIVATE_LAST) {
364 }
else if ((FRAME_DEACTIVATE_LAST - ent->client->ps.gunframe) == 4) {
366 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
376 ent->client->ps.gunframe++;
381 if (ent->client->ps.gunframe == FRAME_ACTIVATE_LAST) {
387 ent->client->ps.gunframe++;
391 if ((ent->client->newweapon) && (ent->client->weaponstate !=
WEAPON_FIRING)) {
397 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
410 if (((ent->client->latched_buttons | ent->client->buttons) & BUTTON_ATTACK)) {
411 ent->client->latched_buttons &= ~BUTTON_ATTACK;
412 if ((!ent->client->ammo_index) ||
413 (ent->client->pers.inventory[ent->client->ammo_index] >= ent->client->pers.weapon->quantity)) {
419 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
427 if (
level.
time >= ent->pain_debounce_time) {
428 gi.sound(ent, CHAN_VOICE,
gi.soundindex(
"weapons/noammo.wav"), 1, ATTN_NORM, 0);
429 ent->pain_debounce_time =
level.
time + 1;
434 if (ent->client->ps.gunframe == FRAME_IDLE_LAST) {
440 for (n = 0; pause_frames[n]; n++) {
441 if (ent->client->ps.gunframe == pause_frames[n]) {
448 ent->client->ps.gunframe++;
454 for (n = 0; fire_frames[n]; n++) {
455 if (ent->client->ps.gunframe == fire_frames[n]) {
457 gi.sound(ent, CHAN_ITEM,
gi.soundindex(
"items/damage3.wav"), 1, ATTN_NORM, 0);
465 ent->client->ps.gunframe++;
Referenced by Weapon_BFG(), Weapon_Blaster(), Weapon_Chaingun(), Weapon_FlareGun(), Weapon_GrenadeLauncher(), Weapon_HyperBlaster(), Weapon_Machinegun(), Weapon_Railgun(), Weapon_RocketLauncher(), Weapon_Shotgun(), and Weapon_SuperShotgun().
◆ 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_grenade_fire()
void weapon_grenade_fire |
( |
edict_t * |
ent, |
|
|
qboolean |
held |
|
) |
| |
Definition at line 485 of file p_weapon.c.
495 radius = damage + 40;
499 VectorSet(offset, 8, 8, ent->viewheight - 8);
503 timer = ent->client->grenade_time -
level.
time;
507 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
508 ent->client->pers.inventory[ent->client->ammo_index]--;
510 ent->client->grenade_time =
level.
time + 1.0;
512 if (ent->deadflag || ent->s.modelindex != 255) {
516 if (ent->health <= 0)
519 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
Referenced by ChangeWeapon(), and Weapon_Grenade().
◆ 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_grenadelauncher_fire()
void weapon_grenadelauncher_fire |
( |
edict_t * |
ent | ) |
|
Definition at line 625 of file p_weapon.c.
633 radius = damage + 40;
637 VectorSet(offset, 8, 8, ent->viewheight - 8);
641 VectorScale(
forward, -2, ent->client->kick_origin);
642 ent->client->kick_angles[0] = -1;
649 gi.multicast(ent->s.origin, MULTICAST_PVS);
651 ent->client->ps.gunframe++;
655 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
656 ent->client->pers.inventory[ent->client->ammo_index]--;
Referenced by Weapon_GrenadeLauncher().
◆ 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_HyperBlaster_Fire()
void Weapon_HyperBlaster_Fire |
( |
edict_t * |
ent | ) |
|
Definition at line 783 of file p_weapon.c.
790 ent->client->weapon_sound =
gi.soundindex(
"weapons/hyprbl1a.wav");
792 if (!(ent->client->buttons & BUTTON_ATTACK)) {
793 ent->client->ps.gunframe++;
795 if (! ent->client->pers.inventory[ent->client->ammo_index]) {
796 if (
level.
time >= ent->pain_debounce_time) {
797 gi.sound(ent, CHAN_VOICE,
gi.soundindex(
"weapons/noammo.wav"), 1, ATTN_NORM, 0);
798 ent->pain_debounce_time =
level.
time + 1;
802 rotation = (ent->client->ps.gunframe - 5) * 2 * M_PI / 6;
803 offset[0] = -4 * sin(rotation);
805 offset[2] = 4 * cos(rotation);
807 if ((ent->client->ps.gunframe == 6) || (ent->client->ps.gunframe == 9))
808 effect = EF_HYPERBLASTER;
816 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
817 ent->client->pers.inventory[ent->client->ammo_index]--;
820 if (ent->client->ps.pmove.pm_flags & PMF_DUCKED) {
829 ent->client->ps.gunframe++;
830 if (ent->client->ps.gunframe == 12 && ent->client->pers.inventory[ent->client->ammo_index])
831 ent->client->ps.gunframe = 6;
834 if (ent->client->ps.gunframe == 12) {
835 gi.sound(ent, CHAN_AUTO,
gi.soundindex(
"weapons/hyprbd1a.wav"), 1, ATTN_NORM, 0);
836 ent->client->weapon_sound = 0;
Referenced by Weapon_HyperBlaster().
◆ 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_railgun_fire()
void weapon_railgun_fire |
( |
edict_t * |
ent | ) |
|
Definition at line 1176 of file p_weapon.c.
1200 VectorScale(
forward, -3, ent->client->kick_origin);
1201 ent->client->kick_angles[0] = -3;
1203 VectorSet(offset, 0, 7, ent->viewheight - 8);
1211 gi.multicast(ent->s.origin, MULTICAST_PVS);
1213 ent->client->ps.gunframe++;
1216 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
1217 ent->client->pers.inventory[ent->client->ammo_index]--;
Referenced by Weapon_Railgun().
◆ 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_RocketLauncher_Fire()
void Weapon_RocketLauncher_Fire |
( |
edict_t * |
ent | ) |
|
Definition at line 675 of file p_weapon.c.
677 vec3_t offset, start;
693 VectorScale(
forward, -2, ent->client->kick_origin);
694 ent->client->kick_angles[0] = -1;
696 VectorSet(offset, 8, 8, ent->viewheight - 8);
704 gi.multicast(ent->s.origin, MULTICAST_PVS);
706 ent->client->ps.gunframe++;
710 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
711 ent->client->pers.inventory[ent->client->ammo_index]--;
Referenced by Weapon_RocketLauncher().
◆ 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_shotgun_fire()
void weapon_shotgun_fire |
( |
edict_t * |
ent | ) |
|
Definition at line 1061 of file p_weapon.c.
1069 if (ent->client->ps.gunframe == 9) {
1070 ent->client->ps.gunframe++;
1076 VectorScale(
forward, -2, ent->client->kick_origin);
1077 ent->client->kick_angles[0] = -2;
1079 VectorSet(offset, 0, 8, ent->viewheight - 8);
1096 gi.multicast(ent->s.origin, MULTICAST_PVS);
1098 ent->client->ps.gunframe++;
1101 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
1102 ent->client->pers.inventory[ent->client->ammo_index]--;
Referenced by Weapon_Shotgun().
◆ 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};
◆ weapon_supershotgun_fire()
void weapon_supershotgun_fire |
( |
edict_t * |
ent | ) |
|
Definition at line 1114 of file p_weapon.c.
1125 VectorScale(
forward, -2, ent->client->kick_origin);
1126 ent->client->kick_angles[0] = -2;
1128 VectorSet(offset, 0, 8, ent->viewheight - 8);
1136 v[PITCH] = ent->client->v_angle[PITCH];
1137 v[YAW] = ent->client->v_angle[YAW] - 5;
1138 v[ROLL] = ent->client->v_angle[ROLL];
1141 v[YAW] = ent->client->v_angle[YAW] + 5;
1149 gi.multicast(ent->s.origin, MULTICAST_PVS);
1151 ent->client->ps.gunframe++;
1154 if (!((
int)
dmflags->value & DF_INFINITE_AMMO))
1155 ent->client->pers.inventory[ent->client->ammo_index] -= 2;
Referenced by Weapon_SuperShotgun().
◆ is_quad
Definition at line 24 of file p_weapon.c.
Referenced by Blaster_Fire(), Chaingun_Fire(), Machinegun_Fire(), Think_Weapon(), weapon_bfg_fire(), weapon_grenade_fire(), weapon_grenadelauncher_fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), and weapon_supershotgun_fire().
◆ is_silenced
Definition at line 25 of file p_weapon.c.
Referenced by Blaster_Fire(), Chaingun_Fire(), Machinegun_Fire(), Think_Weapon(), weapon_bfg_fire(), weapon_flaregun_fire(), weapon_grenadelauncher_fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), and weapon_supershotgun_fire().
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)
void flare_touch(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
#define DEFAULT_BULLET_HSPREAD
static void P_ProjectSource(gclient_t *client, vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t result)
void fire_flaregun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
void weapon_supershotgun_fire(edict_t *ent)
qboolean Add_Ammo(edict_t *ent, gitem_t *item, int count)
void weapon_flaregun_fire(edict_t *ent)
void fire_rail(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick)
void fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
void Blaster_Fire(edict_t *ent, vec3_t g_offset, int damage, qboolean hyper, int effect)
void weapon_grenade_fire(edict_t *ent, qboolean held)
void NoAmmoWeaponChange(edict_t *ent)
void fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius)
#define DEFAULT_SHOTGUN_COUNT
void fire_grenade(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius)
void Weapon_HyperBlaster_Fire(edict_t *ent)
void fire_grenade2(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, float timer, float damage_radius, qboolean held)
void weapon_railgun_fire(edict_t *ent)
void vectoangles(vec3_t vec, vec3_t angles)
#define DEFAULT_BULLET_VSPREAD
void Chaingun_Fire(edict_t *ent)
#define DROPPED_PLAYER_ITEM
void PlayerNoise(edict_t *who, vec3_t where, int type)
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void weapon_shotgun_fire(edict_t *ent)
void SetRespawn(edict_t *ent, float delay)
#define FRAME_DEACTIVATE_FIRST
void Weapon_RocketLauncher_Fire(edict_t *ent)
void fire_bullet(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int mod)
#define DEFAULT_DEATHMATCH_SHOTGUN_COUNT
int sound_entity_framenum
#define DEFAULT_SHOTGUN_HSPREAD
void ChangeWeapon(edict_t *ent)
edict_t * Drop_Item(edict_t *ent, gitem_t *item)
void weapon_grenadelauncher_fire(edict_t *ent)
void Weapon_Blaster_Fire(edict_t *ent)
#define DEFAULT_SHOTGUN_VSPREAD
void flare_think(edict_t *self)
void fire_blaster(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int effect, qboolean hyper)
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))
CONST PIXELFORMATDESCRIPTOR int
void weapon_bfg_fire(edict_t *ent)
void fire_shotgun(edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int mod)
int sound2_entity_framenum
#define DEFAULT_SSHOTGUN_COUNT
void Machinegun_Fire(edict_t *ent)