Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
|
void | AnglesNormalize (vec3_t vec) |
|
float | SnapToEights (float x) |
|
void | turret_blocked (edict_t *self, edict_t *other) |
|
void | turret_breach_fire (edict_t *self) |
|
void | turret_breach_think (edict_t *self) |
|
void | turret_breach_finish_init (edict_t *self) |
|
void | SP_turret_breach (edict_t *self) |
|
void | SP_turret_base (edict_t *self) |
|
void | infantry_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage) |
|
void | infantry_stand (edict_t *self) |
|
void | monster_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | turret_driver_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) |
|
qboolean | FindTarget (edict_t *self) |
|
void | turret_driver_think (edict_t *self) |
|
void | turret_driver_link (edict_t *self) |
|
void | SP_turret_driver (edict_t *self) |
|
◆ AnglesNormalize()
void AnglesNormalize |
( |
vec3_t |
vec | ) |
|
◆ FindTarget()
qboolean FindTarget |
( |
edict_t * |
self | ) |
|
Definition at line 385 of file g_ai.c.
392 if (self->goalentity && self->goalentity->inuse && self->goalentity->classname) {
393 if (strcmp(self->goalentity->classname,
"target_actor") == 0)
415 if (client->enemy == self->enemy) {
434 if (client == self->enemy)
437 if (client->client) {
440 }
else if (client->svflags & SVF_MONSTER) {
445 }
else if (heardit) {
452 r =
range(
self, client);
460 if (client->light_level <= 5)
477 self->enemy = client;
479 if (strcmp(self->enemy->classname,
"player_noise") != 0) {
482 if (!self->enemy->client) {
483 self->enemy =
self->enemy->enemy;
484 if (!self->enemy->client) {
493 if (self->spawnflags & 1) {
497 if (!
gi.inPHS(self->s.origin, client->s.origin))
501 VectorSubtract(client->s.origin, self->s.origin, temp);
503 if (VectorLength(temp) > 1000) {
508 if (client->areanum != self->areanum)
509 if (!
gi.AreasConnected(self->areanum, client->areanum))
517 self->enemy = client;
525 if (!(self->monsterinfo.aiflags &
AI_SOUND_TARGET) && (self->monsterinfo.sight))
526 self->monsterinfo.sight(
self, self->enemy);
Referenced by ai_run(), ai_stand(), ai_turn(), ai_walk(), and turret_driver_think().
◆ infantry_die()
void infantry_die |
( |
edict_t * |
self, |
|
|
edict_t * |
inflictor, |
|
|
edict_t * |
attacker, |
|
|
int |
damage |
|
) |
| |
◆ infantry_stand()
void infantry_stand |
( |
edict_t * |
self | ) |
|
◆ monster_use()
void monster_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
◆ SnapToEights()
float SnapToEights |
( |
float |
x | ) |
|
◆ SP_turret_base()
void SP_turret_base |
( |
edict_t * |
self | ) |
|
Definition at line 250 of file g_turret.c.
252 self->solid = SOLID_BSP;
254 gi.setmodel(
self, self->model);
◆ SP_turret_breach()
void SP_turret_breach |
( |
edict_t * |
self | ) |
|
Definition at line 211 of file g_turret.c.
213 self->solid = SOLID_BSP;
215 gi.setmodel(
self, self->model);
234 self->ideal_yaw =
self->s.angles[YAW];
235 self->move_angles[YAW] =
self->ideal_yaw;
◆ SP_turret_driver()
void SP_turret_driver |
( |
edict_t * |
self | ) |
|
Definition at line 371 of file g_turret.c.
379 self->solid = SOLID_BBOX;
380 self->s.modelindex =
gi.modelindex(
"models/monsters/infantry/tris.md2");
381 VectorSet(self->mins, -16, -16, -24);
382 VectorSet(self->maxs, 16, 16, 32);
385 self->gib_health = 0;
387 self->viewheight = 24;
396 self->svflags |= SVF_MONSTER;
397 self->s.renderfx |= RF_FRAMELERP;
400 self->clipmask = MASK_MONSTERSOLID;
401 VectorCopy(self->s.origin, self->s.old_origin);
407 gi.dprintf(
"%s at %s has bad item: %s\n", self->classname,
vtos(self->s.origin),
st.
item);
◆ turret_blocked()
void turret_blocked |
( |
edict_t * |
self, |
|
|
edict_t * |
other |
|
) |
| |
◆ turret_breach_finish_init()
void turret_breach_finish_init |
( |
edict_t * |
self | ) |
|
Definition at line 195 of file g_turret.c.
199 gi.dprintf(
"%s at %s needs a target\n", self->classname,
vtos(self->s.origin));
202 VectorSubtract(self->target_ent->s.origin, self->s.origin, self->move_origin);
206 self->teammaster->dmg =
self->dmg;
Referenced by SP_turret_breach().
◆ turret_breach_fire()
void turret_breach_fire |
( |
edict_t * |
self | ) |
|
Definition at line 75 of file g_turret.c.
83 VectorMA(self->s.origin, self->move_origin[0], f, start);
84 VectorMA(start, self->move_origin[1], r, start);
85 VectorMA(start, self->move_origin[2], u, start);
87 damage = 100 +
random() * 50;
88 speed = 550 + 50 *
skill->value;
89 fire_rocket(self->teammaster->owner, start, f, damage, speed, 150, damage);
90 gi.positioned_sound(start,
self, CHAN_WEAPON,
gi.soundindex(
"weapons/rocklf1a.wav"), 1, ATTN_NORM, 0);
Referenced by turret_breach_think().
◆ turret_breach_think()
void turret_breach_think |
( |
edict_t * |
self | ) |
|
Definition at line 93 of file g_turret.c.
96 vec3_t current_angles;
99 VectorCopy(self->s.angles, current_angles);
103 if (self->move_angles[PITCH] > 180)
104 self->move_angles[PITCH] -= 360;
107 if (self->move_angles[PITCH] > self->pos1[PITCH])
108 self->move_angles[PITCH] =
self->pos1[PITCH];
109 else if (self->move_angles[PITCH] < self->pos2[PITCH])
110 self->move_angles[PITCH] =
self->pos2[PITCH];
112 if ((self->move_angles[YAW] < self->pos1[YAW]) || (self->move_angles[YAW] > self->pos2[YAW])) {
115 dmin = fabs(self->pos1[YAW] - self->move_angles[YAW]);
120 dmax = fabs(self->pos2[YAW] - self->move_angles[YAW]);
125 if (fabs(dmin) < fabs(dmax))
126 self->move_angles[YAW] =
self->pos1[YAW];
128 self->move_angles[YAW] =
self->pos2[YAW];
131 VectorSubtract(self->move_angles, current_angles, delta);
134 else if (delta[0] > 180)
138 else if (delta[1] > 180)
144 if (delta[0] < -1 * self->speed *
FRAMETIME)
148 if (delta[1] < -1 * self->speed *
FRAMETIME)
151 VectorScale(delta, 1.0 /
FRAMETIME, self->avelocity);
155 for (ent = self->teammaster; ent; ent = ent->teamchain)
156 ent->avelocity[1] =
self->avelocity[1];
167 self->owner->avelocity[0] =
self->avelocity[0];
168 self->owner->avelocity[1] =
self->avelocity[1];
171 angle =
self->s.angles[1] +
self->owner->move_origin[1];
172 angle *= (M_PI * 2 / 360);
173 target[0] =
SnapToEights(self->s.origin[0] + cos(angle) * self->owner->move_origin[0]);
174 target[1] =
SnapToEights(self->s.origin[1] + sin(angle) * self->owner->move_origin[0]);
175 target[2] =
self->owner->s.origin[2];
177 VectorSubtract(target, self->owner->s.origin, dir);
178 self->owner->velocity[0] = dir[0] * 1.0 /
FRAMETIME;
179 self->owner->velocity[1] = dir[1] * 1.0 /
FRAMETIME;
182 angle =
self->s.angles[PITCH] * (M_PI * 2 / 360);
183 target_z =
SnapToEights(self->s.origin[2] + self->owner->move_origin[0] * tan(angle) + self->owner->move_origin[2]);
185 diff = target_z -
self->owner->s.origin[2];
188 if (self->spawnflags & 65536) {
190 self->spawnflags &= ~65536;
Referenced by turret_breach_finish_init().
◆ turret_driver_die()
void turret_driver_die |
( |
edict_t * |
self, |
|
|
edict_t * |
inflictor, |
|
|
edict_t * |
attacker, |
|
|
int |
damage, |
|
|
vec3_t |
point |
|
) |
| |
Definition at line 269 of file g_turret.c.
274 self->target_ent->move_angles[0] = 0;
277 for (ent = self->target_ent->teammaster; ent->teamchain !=
self; ent = ent->teamchain)
279 ent->teamchain = NULL;
280 self->teammaster = NULL;
283 self->target_ent->owner = NULL;
284 self->target_ent->teammaster->owner = NULL;
Referenced by SP_turret_driver().
◆ turret_driver_link()
void turret_driver_link |
( |
edict_t * |
self | ) |
|
Definition at line 338 of file g_turret.c.
347 self->target_ent->owner =
self;
348 self->target_ent->teammaster->owner =
self;
349 VectorCopy(self->target_ent->s.angles, self->s.angles);
351 vec[0] =
self->target_ent->s.origin[0] -
self->s.origin[0];
352 vec[1] =
self->target_ent->s.origin[1] -
self->s.origin[1];
354 self->move_origin[0] = VectorLength(vec);
356 VectorSubtract(self->s.origin, self->target_ent->s.origin, vec);
359 self->move_origin[1] = vec[1];
361 self->move_origin[2] =
self->s.origin[2] -
self->target_ent->s.origin[2];
364 for (ent = self->target_ent->teammaster; ent->teamchain; ent = ent->teamchain)
366 ent->teamchain =
self;
367 self->teammaster =
self->target_ent->teammaster;
Referenced by SP_turret_driver().
◆ turret_driver_think()
void turret_driver_think |
( |
edict_t * |
self | ) |
|
Definition at line 291 of file g_turret.c.
299 if (self->enemy && (!self->enemy->inuse || self->enemy->health <= 0))
305 self->monsterinfo.trail_time =
level.
time;
308 if (
visible(
self, self->enemy)) {
310 self->monsterinfo.trail_time =
level.
time;
320 VectorCopy(self->enemy->s.origin, target);
321 target[2] +=
self->enemy->viewheight;
322 VectorSubtract(target, self->target_ent->s.origin, dir);
326 if (
level.
time < self->monsterinfo.attack_finished)
329 reaction_time = (3 -
skill->value) * 1.0;
330 if ((
level.
time - self->monsterinfo.trail_time) < reaction_time)
333 self->monsterinfo.attack_finished =
level.
time + reaction_time + 1.0;
335 self->target_ent->spawnflags |= 65536;
Referenced by turret_driver_link().
void infantry_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage)
void turret_breach_finish_init(edict_t *self)
gitem_t * FindItemByClassname(char *classname)
void turret_breach_think(edict_t *self)
void turret_driver_link(edict_t *self)
mmove_t infantry_move_stand
void fire_rocket(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius, int radius_damage)
void AnglesNormalize(vec3_t vec)
void turret_driver_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
float vectoyaw(vec3_t vec)
void monster_use(edict_t *self, edict_t *other, edict_t *activator)
void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod)
qboolean infront(edict_t *self, edict_t *other)
int sight_entity_framenum
void vectoangles(vec3_t vec, vec3_t angles)
void G_FreeEdict(edict_t *e)
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void FoundTarget(edict_t *self)
void turret_blocked(edict_t *self, edict_t *other)
qboolean visible(edict_t *self, edict_t *other)
int sound_entity_framenum
qboolean FindTarget(edict_t *self)
void turret_driver_think(edict_t *self)
static q_noinline int diff(uint32_t A_u32, uint32_t B_u32)
int range(edict_t *self, edict_t *other)
void M_ChangeYaw(edict_t *ent)
CONST PIXELFORMATDESCRIPTOR int
edict_t * G_PickTarget(char *targetname)
int sound2_entity_framenum
float SnapToEights(float x)
void infantry_stand(edict_t *self)
void turret_breach_fire(edict_t *self)