Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
|
void | Move_Done (edict_t *ent) |
|
void | Move_Final (edict_t *ent) |
|
void | Move_Begin (edict_t *ent) |
|
void | Think_AccelMove (edict_t *ent) |
|
void | Move_Calc (edict_t *ent, vec3_t dest, void(*func)(edict_t *)) |
|
void | AngleMove_Done (edict_t *ent) |
|
void | AngleMove_Final (edict_t *ent) |
|
void | AngleMove_Begin (edict_t *ent) |
|
void | AngleMove_Calc (edict_t *ent, void(*func)(edict_t *)) |
|
void | plat_CalcAcceleratedMove (moveinfo_t *moveinfo) |
|
void | plat_Accelerate (moveinfo_t *moveinfo) |
|
void | plat_go_down (edict_t *ent) |
|
void | plat_hit_top (edict_t *ent) |
|
void | plat_hit_bottom (edict_t *ent) |
|
void | plat_go_up (edict_t *ent) |
|
void | plat_blocked (edict_t *self, edict_t *other) |
|
void | Use_Plat (edict_t *ent, edict_t *other, edict_t *activator) |
|
void | Touch_Plat_Center (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) |
|
void | plat_spawn_inside_trigger (edict_t *ent) |
|
void | SP_func_plat (edict_t *ent) |
|
void | rotating_blocked (edict_t *self, edict_t *other) |
|
void | rotating_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) |
|
void | rotating_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | SP_func_rotating (edict_t *ent) |
|
void | button_done (edict_t *self) |
|
void | button_return (edict_t *self) |
|
void | button_wait (edict_t *self) |
|
void | button_fire (edict_t *self) |
|
void | button_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | button_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) |
|
void | button_killed (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) |
|
void | SP_func_button (edict_t *ent) |
|
void | door_use_areaportals (edict_t *self, qboolean open) |
|
void | door_go_down (edict_t *self) |
|
void | door_hit_top (edict_t *self) |
|
void | door_hit_bottom (edict_t *self) |
|
void | door_go_up (edict_t *self, edict_t *activator) |
|
void | door_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | Touch_DoorTrigger (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) |
|
void | Think_CalcMoveSpeed (edict_t *self) |
|
void | Think_SpawnDoorTrigger (edict_t *ent) |
|
void | door_blocked (edict_t *self, edict_t *other) |
|
void | door_killed (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) |
|
void | door_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) |
|
void | SP_func_door (edict_t *ent) |
|
void | SP_func_door_rotating (edict_t *ent) |
|
void | SP_func_water (edict_t *self) |
|
void | train_next (edict_t *self) |
|
void | train_blocked (edict_t *self, edict_t *other) |
|
void | train_wait (edict_t *self) |
|
void | train_resume (edict_t *self) |
|
void | func_train_find (edict_t *self) |
|
void | train_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | SP_func_train (edict_t *self) |
|
void | trigger_elevator_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | trigger_elevator_init (edict_t *self) |
|
void | SP_trigger_elevator (edict_t *self) |
|
void | func_timer_think (edict_t *self) |
|
void | func_timer_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | SP_func_timer (edict_t *self) |
|
void | func_conveyor_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | SP_func_conveyor (edict_t *self) |
|
void | door_secret_move1 (edict_t *self) |
|
void | door_secret_move2 (edict_t *self) |
|
void | door_secret_move3 (edict_t *self) |
|
void | door_secret_move4 (edict_t *self) |
|
void | door_secret_move5 (edict_t *self) |
|
void | door_secret_move6 (edict_t *self) |
|
void | door_secret_done (edict_t *self) |
|
void | door_secret_use (edict_t *self, edict_t *other, edict_t *activator) |
|
void | door_secret_blocked (edict_t *self, edict_t *other) |
|
void | door_secret_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) |
|
void | SP_func_door_secret (edict_t *ent) |
|
void | use_killbox (edict_t *self, edict_t *other, edict_t *activator) |
|
void | SP_func_killbox (edict_t *ent) |
|
◆ AccelerationDistance
#define AccelerationDistance |
( |
|
target, |
|
|
|
rate |
|
) |
| (target * ((target / rate) + 1) / 2) |
◆ DOOR_CRUSHER
◆ DOOR_NOMONSTER
◆ DOOR_REVERSE
◆ DOOR_START_OPEN
#define DOOR_START_OPEN 1 |
◆ DOOR_TOGGLE
◆ DOOR_X_AXIS
◆ DOOR_Y_AXIS
◆ PLAT_LOW_TRIGGER
#define PLAT_LOW_TRIGGER 1 |
◆ SECRET_1ST_DOWN
#define SECRET_1ST_DOWN 4 |
◆ SECRET_1ST_LEFT
#define SECRET_1ST_LEFT 2 |
◆ SECRET_ALWAYS_SHOOT
#define SECRET_ALWAYS_SHOOT 1 |
◆ STATE_BOTTOM
◆ STATE_DOWN
◆ STATE_TOP
◆ STATE_UP
◆ TRAIN_BLOCK_STOPS
#define TRAIN_BLOCK_STOPS 4 |
◆ TRAIN_START_ON
◆ TRAIN_TOGGLE
◆ AngleMove_Begin()
void AngleMove_Begin |
( |
edict_t * |
ent | ) |
|
Definition at line 163 of file g_func.c.
171 if (ent->moveinfo.state ==
STATE_UP)
172 VectorSubtract(ent->moveinfo.end_angles, ent->s.angles, destdelta);
174 VectorSubtract(ent->moveinfo.start_angles, ent->s.angles, destdelta);
177 len = VectorLength(destdelta);
180 traveltime = len / ent->moveinfo.speed;
190 VectorScale(destdelta, 1.0 / traveltime, ent->avelocity);
Referenced by AngleMove_Calc().
◆ AngleMove_Calc()
void AngleMove_Calc |
( |
edict_t * |
ent, |
|
|
void(*)(edict_t *) |
func |
|
) |
| |
◆ AngleMove_Done()
void AngleMove_Done |
( |
edict_t * |
ent | ) |
|
◆ AngleMove_Final()
void AngleMove_Final |
( |
edict_t * |
ent | ) |
|
Definition at line 143 of file g_func.c.
147 if (ent->moveinfo.state ==
STATE_UP)
148 VectorSubtract(ent->moveinfo.end_angles, ent->s.angles, move);
150 VectorSubtract(ent->moveinfo.start_angles, ent->s.angles, move);
157 VectorScale(move, 1.0 /
FRAMETIME, ent->avelocity);
Referenced by AngleMove_Begin().
◆ button_done()
void button_done |
( |
edict_t * |
self | ) |
|
Definition at line 656 of file g_func.c.
659 self->s.effects &= ~EF_ANIM23;
660 self->s.effects |= EF_ANIM01;
Referenced by button_return().
◆ button_fire()
void button_fire |
( |
edict_t * |
self | ) |
|
◆ button_killed()
void button_killed |
( |
edict_t * |
self, |
|
|
edict_t * |
inflictor, |
|
|
edict_t * |
attacker, |
|
|
int |
damage, |
|
|
vec3_t |
point |
|
) |
| |
Definition at line 718 of file g_func.c.
720 self->activator = attacker;
721 self->health =
self->max_health;
Referenced by SP_func_button().
◆ button_return()
void button_return |
( |
edict_t * |
self | ) |
|
◆ button_touch()
void button_touch |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
cplane_t * |
plane, |
|
|
csurface_t * |
surf |
|
) |
| |
◆ button_use()
void button_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
◆ button_wait()
void button_wait |
( |
edict_t * |
self | ) |
|
Definition at line 675 of file g_func.c.
678 self->s.effects &= ~EF_ANIM01;
679 self->s.effects |= EF_ANIM23;
683 if (self->moveinfo.wait >= 0) {
684 self->nextthink =
level.
time +
self->moveinfo.wait;
Referenced by button_fire().
◆ door_blocked()
void door_blocked |
( |
edict_t * |
self, |
|
|
edict_t * |
other |
|
) |
| |
Definition at line 1022 of file g_func.c.
1026 if (!(
other->svflags & SVF_MONSTER) && (!
other->client)) {
1043 if (self->moveinfo.wait >= 0) {
1045 for (ent = self->teammaster ; ent ; ent = ent->teamchain)
1048 for (ent = self->teammaster ; ent ; ent = ent->teamchain)
Referenced by SP_func_door(), and SP_func_door_rotating().
◆ door_go_down()
void door_go_down |
( |
edict_t * |
self | ) |
|
Definition at line 856 of file g_func.c.
859 if (self->moveinfo.sound_start)
860 gi.sound(
self, CHAN_NO_PHS_ADD + CHAN_VOICE, self->moveinfo.sound_start, 1, ATTN_STATIC, 0);
861 self->s.sound =
self->moveinfo.sound_middle;
863 if (self->max_health) {
865 self->health =
self->max_health;
869 if (strcmp(self->classname,
"func_door") == 0)
871 else if (strcmp(self->classname,
"func_door_rotating") == 0)
Referenced by door_blocked(), door_hit_top(), and door_use().
◆ door_go_up()
void door_go_up |
( |
edict_t * |
self, |
|
|
edict_t * |
activator |
|
) |
| |
Definition at line 875 of file g_func.c.
877 if (self->moveinfo.state ==
STATE_UP)
882 if (self->moveinfo.wait >= 0)
883 self->nextthink =
level.
time +
self->moveinfo.wait;
888 if (self->moveinfo.sound_start)
889 gi.sound(
self, CHAN_NO_PHS_ADD + CHAN_VOICE, self->moveinfo.sound_start, 1, ATTN_STATIC, 0);
890 self->s.sound =
self->moveinfo.sound_middle;
893 if (strcmp(self->classname,
"func_door") == 0)
895 else if (strcmp(self->classname,
"func_door_rotating") == 0)
Referenced by door_blocked(), and door_use().
◆ door_hit_bottom()
void door_hit_bottom |
( |
edict_t * |
self | ) |
|
Definition at line 845 of file g_func.c.
848 if (self->moveinfo.sound_end)
849 gi.sound(
self, CHAN_NO_PHS_ADD + CHAN_VOICE, self->moveinfo.sound_end, 1, ATTN_STATIC, 0);
Referenced by door_go_down().
◆ door_hit_top()
void door_hit_top |
( |
edict_t * |
self | ) |
|
Definition at line 829 of file g_func.c.
832 if (self->moveinfo.sound_end)
833 gi.sound(
self, CHAN_NO_PHS_ADD + CHAN_VOICE, self->moveinfo.sound_end, 1, ATTN_STATIC, 0);
839 if (self->moveinfo.wait >= 0) {
841 self->nextthink =
level.
time +
self->moveinfo.wait;
Referenced by door_go_up().
◆ door_killed()
void door_killed |
( |
edict_t * |
self, |
|
|
edict_t * |
inflictor, |
|
|
edict_t * |
attacker, |
|
|
int |
damage, |
|
|
vec3_t |
point |
|
) |
| |
◆ door_secret_blocked()
void door_secret_blocked |
( |
edict_t * |
self, |
|
|
edict_t * |
other |
|
) |
| |
◆ door_secret_die()
void door_secret_die |
( |
edict_t * |
self, |
|
|
edict_t * |
inflictor, |
|
|
edict_t * |
attacker, |
|
|
int |
damage, |
|
|
vec3_t |
point |
|
) |
| |
◆ door_secret_done()
void door_secret_done |
( |
edict_t * |
self | ) |
|
◆ door_secret_move1()
void door_secret_move1 |
( |
edict_t * |
self | ) |
|
◆ door_secret_move2()
void door_secret_move2 |
( |
edict_t * |
self | ) |
|
◆ door_secret_move3()
void door_secret_move3 |
( |
edict_t * |
self | ) |
|
◆ door_secret_move4()
void door_secret_move4 |
( |
edict_t * |
self | ) |
|
◆ door_secret_move5()
void door_secret_move5 |
( |
edict_t * |
self | ) |
|
◆ door_secret_move6()
void door_secret_move6 |
( |
edict_t * |
self | ) |
|
◆ door_secret_use()
void door_secret_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
◆ door_touch()
void door_touch |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
cplane_t * |
plane, |
|
|
csurface_t * |
surf |
|
) |
| |
◆ door_use()
void door_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
◆ door_use_areaportals()
void door_use_areaportals |
( |
edict_t * |
self, |
|
|
qboolean |
open |
|
) |
| |
◆ func_conveyor_use()
void func_conveyor_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
Definition at line 1720 of file g_func.c.
1722 if (self->spawnflags & 1) {
1724 self->spawnflags &= ~1;
1726 self->speed =
self->count;
1727 self->spawnflags |= 1;
1730 if (!(self->spawnflags & 2))
Referenced by SP_func_conveyor().
◆ func_timer_think()
void func_timer_think |
( |
edict_t * |
self | ) |
|
◆ func_timer_use()
void func_timer_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
Definition at line 1675 of file g_func.c.
1677 self->activator = activator;
1680 if (self->nextthink) {
1681 self->nextthink = 0;
1687 self->nextthink =
level.
time +
self->delay;
Referenced by SP_func_timer().
◆ func_train_find()
void func_train_find |
( |
edict_t * |
self | ) |
|
Definition at line 1515 of file g_func.c.
1519 if (!self->target) {
1520 gi.dprintf(
"train_find: no target\n");
1525 gi.dprintf(
"train_find: target %s not found\n", self->target);
1528 self->target = ent->target;
1530 VectorSubtract(ent->s.origin, self->mins, self->s.origin);
1531 gi.linkentity(
self);
1534 if (!self->targetname)
1540 self->activator =
self;
Referenced by SP_func_train(), SP_misc_strogg_ship(), and SP_misc_viper().
◆ Move_Begin()
void Move_Begin |
( |
edict_t * |
ent | ) |
|
Definition at line 93 of file g_func.c.
97 if ((ent->moveinfo.speed *
FRAMETIME) >= ent->moveinfo.remaining_distance) {
101 VectorScale(ent->moveinfo.dir, ent->moveinfo.speed, ent->velocity);
102 frames = floor((ent->moveinfo.remaining_distance / ent->moveinfo.speed) /
FRAMETIME);
103 ent->moveinfo.remaining_distance -= frames * ent->moveinfo.speed *
FRAMETIME;
Referenced by Move_Calc().
◆ Move_Calc()
void Move_Calc |
( |
edict_t * |
ent, |
|
|
vec3_t |
dest, |
|
|
void(*)(edict_t *) |
func |
|
) |
| |
Definition at line 110 of file g_func.c.
112 VectorClear(ent->velocity);
113 VectorSubtract(dest, ent->s.origin, ent->moveinfo.dir);
115 ent->moveinfo.endfunc = func;
117 if (ent->moveinfo.speed == ent->moveinfo.accel && ent->moveinfo.speed == ent->moveinfo.decel) {
126 ent->moveinfo.current_speed = 0;
Referenced by button_fire(), button_return(), door_go_down(), door_go_up(), door_secret_move2(), door_secret_move4(), door_secret_move6(), door_secret_use(), plat_go_down(), plat_go_up(), train_next(), and train_resume().
◆ Move_Done()
void Move_Done |
( |
edict_t * |
ent | ) |
|
Definition at line 74 of file g_func.c.
76 VectorClear(ent->velocity);
77 ent->moveinfo.endfunc(ent);
Referenced by Move_Final().
◆ Move_Final()
void Move_Final |
( |
edict_t * |
ent | ) |
|
◆ plat_Accelerate()
Definition at line 246 of file g_func.c.
271 distance = p1_distance + p2_distance;
300 p1_speed = (old_speed + moveinfo->
move_speed) / 2.0;
301 p2_distance = moveinfo->
move_speed * (1.0 - (p1_distance / p1_speed));
302 distance = p1_distance + p2_distance;
303 moveinfo->
current_speed = (p1_speed * (p1_distance / distance)) + (moveinfo->
move_speed * (p2_distance / distance));
Referenced by Think_AccelMove().
◆ plat_blocked()
void plat_blocked |
( |
edict_t * |
self, |
|
|
edict_t * |
other |
|
) |
| |
◆ plat_CalcAcceleratedMove()
◆ plat_go_down()
void plat_go_down |
( |
edict_t * |
ent | ) |
|
Definition at line 358 of file g_func.c.
361 if (ent->moveinfo.sound_start)
362 gi.sound(ent, CHAN_NO_PHS_ADD + CHAN_VOICE, ent->moveinfo.sound_start, 1, ATTN_STATIC, 0);
363 ent->s.sound = ent->moveinfo.sound_middle;
Referenced by plat_blocked(), plat_hit_top(), and Use_Plat().
◆ plat_go_up()
void plat_go_up |
( |
edict_t * |
ent | ) |
|
Definition at line 369 of file g_func.c.
372 if (ent->moveinfo.sound_start)
373 gi.sound(ent, CHAN_NO_PHS_ADD + CHAN_VOICE, ent->moveinfo.sound_start, 1, ATTN_STATIC, 0);
374 ent->s.sound = ent->moveinfo.sound_middle;
Referenced by plat_blocked(), and Touch_Plat_Center().
◆ plat_hit_bottom()
void plat_hit_bottom |
( |
edict_t * |
ent | ) |
|
Definition at line 348 of file g_func.c.
351 if (ent->moveinfo.sound_end)
352 gi.sound(ent, CHAN_NO_PHS_ADD + CHAN_VOICE, ent->moveinfo.sound_end, 1, ATTN_STATIC, 0);
Referenced by plat_go_down().
◆ plat_hit_top()
void plat_hit_top |
( |
edict_t * |
ent | ) |
|
Definition at line 335 of file g_func.c.
338 if (ent->moveinfo.sound_end)
339 gi.sound(ent, CHAN_NO_PHS_ADD + CHAN_VOICE, ent->moveinfo.sound_end, 1, ATTN_STATIC, 0);
Referenced by plat_go_up().
◆ plat_spawn_inside_trigger()
void plat_spawn_inside_trigger |
( |
edict_t * |
ent | ) |
|
Definition at line 423 of file g_func.c.
434 trigger->solid = SOLID_TRIGGER;
435 trigger->enemy = ent;
437 tmin[0] = ent->mins[0] + 25;
438 tmin[1] = ent->mins[1] + 25;
439 tmin[2] = ent->mins[2];
441 tmax[0] = ent->maxs[0] - 25;
442 tmax[1] = ent->maxs[1] - 25;
443 tmax[2] = ent->maxs[2] + 8;
445 tmin[2] = tmax[2] - (ent->pos1[2] - ent->pos2[2] +
st.
lip);
448 tmax[2] = tmin[2] + 8;
450 if (tmax[0] - tmin[0] <= 0) {
451 tmin[0] = (ent->mins[0] + ent->maxs[0]) * 0.5;
452 tmax[0] = tmin[0] + 1;
454 if (tmax[1] - tmin[1] <= 0) {
455 tmin[1] = (ent->mins[1] + ent->maxs[1]) * 0.5;
456 tmax[1] = tmin[1] + 1;
459 VectorCopy(tmin, trigger->mins);
460 VectorCopy(tmax, trigger->maxs);
462 gi.linkentity(trigger);
Referenced by SP_func_plat().
◆ rotating_blocked()
void rotating_blocked |
( |
edict_t * |
self, |
|
|
edict_t * |
other |
|
) |
| |
◆ rotating_touch()
void rotating_touch |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
cplane_t * |
plane, |
|
|
csurface_t * |
surf |
|
) |
| |
Definition at line 567 of file g_func.c.
569 if (self->avelocity[0] || self->avelocity[1] || self->avelocity[2])
Referenced by rotating_use().
◆ rotating_use()
void rotating_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
Definition at line 573 of file g_func.c.
575 if (!VectorCompare(self->avelocity,
vec3_origin)) {
577 VectorClear(self->avelocity);
580 self->s.sound =
self->moveinfo.sound_middle;
581 VectorScale(self->movedir, self->speed, self->avelocity);
582 if (self->spawnflags & 16)
Referenced by SP_func_rotating().
◆ SP_func_button()
void SP_func_button |
( |
edict_t * |
ent | ) |
|
Definition at line 726 of file g_func.c.
733 ent->solid = SOLID_BSP;
734 gi.setmodel(ent, ent->model);
736 if (ent->sounds != 1)
737 ent->moveinfo.sound_start =
gi.soundindex(
"switches/butn2.wav");
742 ent->accel = ent->speed;
744 ent->decel = ent->speed;
751 VectorCopy(ent->s.origin, ent->pos1);
752 abs_movedir[0] = fabs(ent->movedir[0]);
753 abs_movedir[1] = fabs(ent->movedir[1]);
754 abs_movedir[2] = fabs(ent->movedir[2]);
755 dist = abs_movedir[0] * ent->size[0] + abs_movedir[1] * ent->size[1] + abs_movedir[2] * ent->size[2] -
st.
lip;
756 VectorMA(ent->pos1, dist, ent->movedir, ent->pos2);
759 ent->s.effects |= EF_ANIM01;
762 ent->max_health = ent->health;
765 }
else if (! ent->targetname)
770 ent->moveinfo.speed = ent->speed;
771 ent->moveinfo.accel = ent->accel;
772 ent->moveinfo.decel = ent->decel;
773 ent->moveinfo.wait = ent->wait;
774 VectorCopy(ent->pos1, ent->moveinfo.start_origin);
775 VectorCopy(ent->s.angles, ent->moveinfo.start_angles);
776 VectorCopy(ent->pos2, ent->moveinfo.end_origin);
777 VectorCopy(ent->s.angles, ent->moveinfo.end_angles);
◆ SP_func_conveyor()
void SP_func_conveyor |
( |
edict_t * |
self | ) |
|
Definition at line 1734 of file g_func.c.
1739 if (!(self->spawnflags & 1)) {
1740 self->count =
self->speed;
1746 gi.setmodel(
self, self->model);
1747 self->solid = SOLID_BSP;
1748 gi.linkentity(
self);
◆ SP_func_door()
void SP_func_door |
( |
edict_t * |
ent | ) |
|
Definition at line 1078 of file g_func.c.
1082 if (ent->sounds != 1) {
1083 ent->moveinfo.sound_start =
gi.soundindex(
"doors/dr1_strt.wav");
1084 ent->moveinfo.sound_middle =
gi.soundindex(
"doors/dr1_mid.wav");
1085 ent->moveinfo.sound_end =
gi.soundindex(
"doors/dr1_end.wav");
1090 ent->solid = SOLID_BSP;
1091 gi.setmodel(ent, ent->model);
1102 ent->accel = ent->speed;
1104 ent->decel = ent->speed;
1114 VectorCopy(ent->s.origin, ent->pos1);
1115 abs_movedir[0] = fabs(ent->movedir[0]);
1116 abs_movedir[1] = fabs(ent->movedir[1]);
1117 abs_movedir[2] = fabs(ent->movedir[2]);
1118 ent->moveinfo.distance = abs_movedir[0] * ent->size[0] + abs_movedir[1] * ent->size[1] + abs_movedir[2] * ent->size[2] -
st.
lip;
1119 VectorMA(ent->pos1, ent->moveinfo.distance, ent->movedir, ent->pos2);
1123 VectorCopy(ent->pos2, ent->s.origin);
1124 VectorCopy(ent->pos1, ent->pos2);
1125 VectorCopy(ent->s.origin, ent->pos1);
1133 ent->max_health = ent->health;
1134 }
else if (ent->targetname && ent->message) {
1135 gi.soundindex(
"misc/talk.wav");
1139 ent->moveinfo.speed = ent->speed;
1140 ent->moveinfo.accel = ent->accel;
1141 ent->moveinfo.decel = ent->decel;
1142 ent->moveinfo.wait = ent->wait;
1143 VectorCopy(ent->pos1, ent->moveinfo.start_origin);
1144 VectorCopy(ent->s.angles, ent->moveinfo.start_angles);
1145 VectorCopy(ent->pos2, ent->moveinfo.end_origin);
1146 VectorCopy(ent->s.angles, ent->moveinfo.end_angles);
1148 if (ent->spawnflags & 16)
1149 ent->s.effects |= EF_ANIM_ALL;
1150 if (ent->spawnflags & 64)
1151 ent->s.effects |= EF_ANIM_ALLFAST;
1155 ent->teammaster = ent;
1160 if (ent->health || ent->targetname)
◆ SP_func_door_rotating()
void SP_func_door_rotating |
( |
edict_t * |
ent | ) |
|
Definition at line 1196 of file g_func.c.
1198 VectorClear(ent->s.angles);
1201 VectorClear(ent->movedir);
1203 ent->movedir[2] = 1.0;
1205 ent->movedir[0] = 1.0;
1207 ent->movedir[1] = 1.0;
1211 VectorNegate(ent->movedir, ent->movedir);
1214 gi.dprintf(
"%s at %s with no distance set\n", ent->classname,
vtos(ent->s.origin));
1218 VectorCopy(ent->s.angles, ent->pos1);
1219 VectorMA(ent->s.angles,
st.
distance, ent->movedir, ent->pos2);
1223 ent->solid = SOLID_BSP;
1224 gi.setmodel(ent, ent->model);
1232 ent->accel = ent->speed;
1234 ent->decel = ent->speed;
1241 if (ent->sounds != 1) {
1242 ent->moveinfo.sound_start =
gi.soundindex(
"doors/dr1_strt.wav");
1243 ent->moveinfo.sound_middle =
gi.soundindex(
"doors/dr1_mid.wav");
1244 ent->moveinfo.sound_end =
gi.soundindex(
"doors/dr1_end.wav");
1249 VectorCopy(ent->pos2, ent->s.angles);
1250 VectorCopy(ent->pos1, ent->pos2);
1251 VectorCopy(ent->s.angles, ent->pos1);
1252 VectorNegate(ent->movedir, ent->movedir);
1258 ent->max_health = ent->health;
1261 if (ent->targetname && ent->message) {
1262 gi.soundindex(
"misc/talk.wav");
1267 ent->moveinfo.speed = ent->speed;
1268 ent->moveinfo.accel = ent->accel;
1269 ent->moveinfo.decel = ent->decel;
1270 ent->moveinfo.wait = ent->wait;
1271 VectorCopy(ent->s.origin, ent->moveinfo.start_origin);
1272 VectorCopy(ent->pos1, ent->moveinfo.start_angles);
1273 VectorCopy(ent->s.origin, ent->moveinfo.end_origin);
1274 VectorCopy(ent->pos2, ent->moveinfo.end_angles);
1276 if (ent->spawnflags & 16)
1277 ent->s.effects |= EF_ANIM_ALL;
1281 ent->teammaster = ent;
1286 if (ent->health || ent->targetname)
◆ SP_func_door_secret()
void SP_func_door_secret |
( |
edict_t * |
ent | ) |
|
Definition at line 1855 of file g_func.c.
1862 ent->moveinfo.sound_start =
gi.soundindex(
"doors/dr1_strt.wav");
1863 ent->moveinfo.sound_middle =
gi.soundindex(
"doors/dr1_mid.wav");
1864 ent->moveinfo.sound_end =
gi.soundindex(
"doors/dr1_end.wav");
1867 ent->solid = SOLID_BSP;
1868 gi.setmodel(ent, ent->model);
1885 ent->moveinfo.accel =
1886 ent->moveinfo.decel =
1887 ent->moveinfo.speed = 50;
1891 VectorClear(ent->s.angles);
1894 width = fabs(DotProduct(
up, ent->size));
1897 length = fabs(DotProduct(
forward, ent->size));
1899 VectorMA(ent->s.origin, -1 *
width,
up, ent->pos1);
1901 VectorMA(ent->s.origin, side *
width,
right, ent->pos1);
1902 VectorMA(ent->pos1, length,
forward, ent->pos2);
1907 ent->max_health = ent->health;
1908 }
else if (ent->targetname && ent->message) {
1909 gi.soundindex(
"misc/talk.wav");
1913 ent->classname =
"func_door";
◆ SP_func_killbox()
void SP_func_killbox |
( |
edict_t * |
ent | ) |
|
Definition at line 1927 of file g_func.c.
1929 gi.setmodel(ent, ent->model);
1931 ent->svflags = SVF_NOCLIENT;
◆ SP_func_plat()
void SP_func_plat |
( |
edict_t * |
ent | ) |
|
Definition at line 483 of file g_func.c.
485 VectorClear(ent->s.angles);
486 ent->solid = SOLID_BSP;
489 gi.setmodel(ent, ent->model);
515 VectorCopy(ent->s.origin, ent->pos1);
516 VectorCopy(ent->s.origin, ent->pos2);
520 ent->pos2[2] -= (ent->maxs[2] - ent->mins[2]) -
st.
lip;
526 if (ent->targetname) {
529 VectorCopy(ent->pos2, ent->s.origin);
534 ent->moveinfo.speed = ent->speed;
535 ent->moveinfo.accel = ent->accel;
536 ent->moveinfo.decel = ent->decel;
537 ent->moveinfo.wait = ent->wait;
538 VectorCopy(ent->pos1, ent->moveinfo.start_origin);
539 VectorCopy(ent->s.angles, ent->moveinfo.start_angles);
540 VectorCopy(ent->pos2, ent->moveinfo.end_origin);
541 VectorCopy(ent->s.angles, ent->moveinfo.end_angles);
543 ent->moveinfo.sound_start =
gi.soundindex(
"plats/pt1_strt.wav");
544 ent->moveinfo.sound_middle =
gi.soundindex(
"plats/pt1_mid.wav");
545 ent->moveinfo.sound_end =
gi.soundindex(
"plats/pt1_end.wav");
◆ SP_func_rotating()
void SP_func_rotating |
( |
edict_t * |
ent | ) |
|
Definition at line 587 of file g_func.c.
589 ent->solid = SOLID_BSP;
590 if (ent->spawnflags & 32)
596 VectorClear(ent->movedir);
597 if (ent->spawnflags & 4)
598 ent->movedir[2] = 1.0;
599 else if (ent->spawnflags & 8)
600 ent->movedir[0] = 1.0;
602 ent->movedir[1] = 1.0;
605 if (ent->spawnflags & 2)
606 VectorNegate(ent->movedir, ent->movedir);
619 if (ent->spawnflags & 1)
620 ent->use(ent, NULL, NULL);
622 if (ent->spawnflags & 64)
623 ent->s.effects |= EF_ANIM_ALL;
624 if (ent->spawnflags & 128)
625 ent->s.effects |= EF_ANIM_ALLFAST;
627 gi.setmodel(ent, ent->model);
◆ SP_func_timer()
void SP_func_timer |
( |
edict_t * |
self | ) |
|
Definition at line 1692 of file g_func.c.
1700 if (self->random >= self->wait) {
1702 gi.dprintf(
"func_timer at %s has random >= wait\n",
vtos(self->s.origin));
1705 if (self->spawnflags & 1) {
1707 self->activator =
self;
1710 self->svflags = SVF_NOCLIENT;
◆ SP_func_train()
void SP_func_train |
( |
edict_t * |
self | ) |
|
Definition at line 1562 of file g_func.c.
1566 VectorClear(self->s.angles);
1574 self->solid = SOLID_BSP;
1575 gi.setmodel(
self, self->model);
1578 self->moveinfo.sound_middle =
gi.soundindex(
st.
noise);
1583 self->moveinfo.speed =
self->speed;
1584 self->moveinfo.accel =
self->moveinfo.decel =
self->moveinfo.speed;
1588 gi.linkentity(
self);
1596 gi.dprintf(
"func_train without a target at %s\n",
vtos(self->absmin));
◆ SP_func_water()
void SP_func_water |
( |
edict_t * |
self | ) |
|
Definition at line 1308 of file g_func.c.
1314 self->solid = SOLID_BSP;
1315 gi.setmodel(
self, self->model);
1317 switch (self->sounds) {
1322 self->moveinfo.sound_start =
gi.soundindex(
"world/mov_watr.wav");
1323 self->moveinfo.sound_end =
gi.soundindex(
"world/stp_watr.wav");
1327 self->moveinfo.sound_start =
gi.soundindex(
"world/mov_watr.wav");
1328 self->moveinfo.sound_end =
gi.soundindex(
"world/stp_watr.wav");
1333 VectorCopy(self->s.origin, self->pos1);
1334 abs_movedir[0] = fabs(self->movedir[0]);
1335 abs_movedir[1] = fabs(self->movedir[1]);
1336 abs_movedir[2] = fabs(self->movedir[2]);
1337 self->moveinfo.distance = abs_movedir[0] *
self->size[0] + abs_movedir[1] *
self->size[1] + abs_movedir[2] *
self->size[2] -
st.
lip;
1338 VectorMA(self->pos1, self->moveinfo.distance, self->movedir, self->pos2);
1342 VectorCopy(self->pos2, self->s.origin);
1343 VectorCopy(self->pos1, self->pos2);
1344 VectorCopy(self->s.origin, self->pos1);
1347 VectorCopy(self->pos1, self->moveinfo.start_origin);
1348 VectorCopy(self->s.angles, self->moveinfo.start_angles);
1349 VectorCopy(self->pos2, self->moveinfo.end_origin);
1350 VectorCopy(self->s.angles, self->moveinfo.end_angles);
1356 self->moveinfo.accel =
self->moveinfo.decel =
self->moveinfo.speed =
self->speed;
1360 self->moveinfo.wait =
self->wait;
1364 if (self->wait == -1)
1367 self->classname =
"func_door";
1369 gi.linkentity(
self);
◆ SP_trigger_elevator()
void SP_trigger_elevator |
( |
edict_t * |
self | ) |
|
◆ Think_AccelMove()
void Think_AccelMove |
( |
edict_t * |
ent | ) |
|
Definition at line 312 of file g_func.c.
314 ent->moveinfo.remaining_distance -= ent->moveinfo.current_speed;
316 if (ent->moveinfo.current_speed == 0)
322 if (ent->moveinfo.remaining_distance <= ent->moveinfo.current_speed) {
327 VectorScale(ent->moveinfo.dir, ent->moveinfo.current_speed * 10, ent->velocity);
Referenced by Move_Calc().
◆ Think_CalcMoveSpeed()
void Think_CalcMoveSpeed |
( |
edict_t * |
self | ) |
|
Definition at line 947 of file g_func.c.
960 min = fabs(self->moveinfo.distance);
961 for (ent = self->teamchain; ent; ent = ent->teamchain) {
962 dist = fabs(ent->moveinfo.distance);
967 time = min /
self->moveinfo.speed;
970 for (ent =
self; ent; ent = ent->teamchain) {
971 newspeed = fabs(ent->moveinfo.distance) / time;
972 ratio = newspeed / ent->moveinfo.speed;
973 if (ent->moveinfo.accel == ent->moveinfo.speed)
974 ent->moveinfo.accel = newspeed;
976 ent->moveinfo.accel *= ratio;
977 if (ent->moveinfo.decel == ent->moveinfo.speed)
978 ent->moveinfo.decel = newspeed;
980 ent->moveinfo.decel *= ratio;
981 ent->moveinfo.speed = newspeed;
Referenced by SP_func_door(), SP_func_door_rotating(), and Think_SpawnDoorTrigger().
◆ Think_SpawnDoorTrigger()
void Think_SpawnDoorTrigger |
( |
edict_t * |
ent | ) |
|
◆ Touch_DoorTrigger()
void Touch_DoorTrigger |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
cplane_t * |
plane, |
|
|
csurface_t * |
surf |
|
) |
| |
◆ Touch_Plat_Center()
void Touch_Plat_Center |
( |
edict_t * |
ent, |
|
|
edict_t * |
other, |
|
|
cplane_t * |
plane, |
|
|
csurface_t * |
surf |
|
) |
| |
◆ train_blocked()
void train_blocked |
( |
edict_t * |
self, |
|
|
edict_t * |
other |
|
) |
| |
◆ train_next()
void train_next |
( |
edict_t * |
self | ) |
|
Definition at line 1448 of file g_func.c.
1456 if (!self->target) {
1463 gi.dprintf(
"train_next: bad target %s\n", self->target);
1467 self->target = ent->target;
1470 if (ent->spawnflags & 1) {
1472 gi.dprintf(
"connected teleport path_corners, see %s at %s\n", ent->classname,
vtos(ent->s.origin));
1476 VectorSubtract(ent->s.origin, self->mins, self->s.origin);
1477 VectorCopy(self->s.origin, self->s.old_origin);
1478 self->s.event = EV_OTHER_TELEPORT;
1479 gi.linkentity(
self);
1483 self->moveinfo.wait = ent->wait;
1484 self->target_ent = ent;
1487 if (self->moveinfo.sound_start)
1488 gi.sound(
self, CHAN_NO_PHS_ADD + CHAN_VOICE, self->moveinfo.sound_start, 1, ATTN_STATIC, 0);
1489 self->s.sound =
self->moveinfo.sound_middle;
1492 VectorSubtract(ent->s.origin, self->mins, dest);
1494 VectorCopy(self->s.origin, self->moveinfo.start_origin);
1495 VectorCopy(dest, self->moveinfo.end_origin);
Referenced by func_train_find(), train_use(), and train_wait().
◆ train_resume()
void train_resume |
( |
edict_t * |
self | ) |
|
Definition at line 1500 of file g_func.c.
1505 ent =
self->target_ent;
1507 VectorSubtract(ent->s.origin, self->mins, dest);
1509 VectorCopy(self->s.origin, self->moveinfo.start_origin);
1510 VectorCopy(dest, self->moveinfo.end_origin);
Referenced by train_use(), and trigger_elevator_use().
◆ train_use()
void train_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
◆ train_wait()
void train_wait |
( |
edict_t * |
self | ) |
|
Definition at line 1409 of file g_func.c.
1411 if (self->target_ent->pathtarget) {
1415 ent =
self->target_ent;
1416 savetarget = ent->target;
1417 ent->target = ent->pathtarget;
1419 ent->target = savetarget;
1426 if (self->moveinfo.wait) {
1427 if (self->moveinfo.wait > 0) {
1428 self->nextthink =
level.
time +
self->moveinfo.wait;
1433 VectorClear(self->velocity);
1434 self->nextthink = 0;
1438 if (self->moveinfo.sound_end)
1439 gi.sound(
self, CHAN_NO_PHS_ADD + CHAN_VOICE, self->moveinfo.sound_end, 1, ATTN_STATIC, 0);
Referenced by train_next(), and train_resume().
◆ trigger_elevator_init()
void trigger_elevator_init |
( |
edict_t * |
self | ) |
|
Definition at line 1627 of file g_func.c.
1629 if (!self->target) {
1630 gi.dprintf(
"trigger_elevator has no target\n");
1634 if (!self->movetarget) {
1635 gi.dprintf(
"trigger_elevator unable to find target %s\n", self->target);
1638 if (strcmp(self->movetarget->classname,
"func_train") != 0) {
1639 gi.dprintf(
"trigger_elevator target %s is not a train\n", self->target);
1644 self->svflags = SVF_NOCLIENT;
Referenced by SP_trigger_elevator().
◆ trigger_elevator_use()
void trigger_elevator_use |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
Definition at line 1603 of file g_func.c.
1607 if (self->movetarget->nextthink) {
1612 if (!
other->pathtarget) {
1613 gi.dprintf(
"elevator used with no pathtarget\n");
1619 gi.dprintf(
"elevator used with bad pathtarget: %s\n",
other->pathtarget);
1623 self->movetarget->target_ent = target;
Referenced by trigger_elevator_init().
◆ use_killbox()
void use_killbox |
( |
edict_t * |
self, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
◆ Use_Plat()
void Use_Plat |
( |
edict_t * |
ent, |
|
|
edict_t * |
other, |
|
|
edict_t * |
activator |
|
) |
| |
void train_use(edict_t *self, edict_t *other, edict_t *activator)
void func_train_find(edict_t *self)
void Think_AccelMove(edict_t *ent)
void button_use(edict_t *self, edict_t *other, edict_t *activator)
void door_go_up(edict_t *self, edict_t *activator)
void door_secret_move3(edict_t *self)
void func_timer_think(edict_t *self)
void func_conveyor_use(edict_t *self, edict_t *other, edict_t *activator)
void plat_go_down(edict_t *ent)
void button_killed(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void Use_Plat(edict_t *ent, edict_t *other, edict_t *activator)
void door_secret_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void door_secret_move2(edict_t *self)
void plat_Accelerate(moveinfo_t *moveinfo)
void plat_blocked(edict_t *self, edict_t *other)
void plat_CalcAcceleratedMove(moveinfo_t *moveinfo)
void rotating_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
void BecomeExplosion1(edict_t *self)
void train_blocked(edict_t *self, edict_t *other)
void rotating_use(edict_t *self, edict_t *other, edict_t *activator)
void Move_Calc(edict_t *ent, vec3_t dest, void(*func)(edict_t *))
void door_secret_move6(edict_t *self)
void door_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)
void button_return(edict_t *self)
void door_secret_move4(edict_t *self)
#define TRAIN_BLOCK_STOPS
void button_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void train_next(edict_t *self)
void train_wait(edict_t *self)
void button_fire(edict_t *self)
void button_done(edict_t *self)
void plat_hit_bottom(edict_t *ent)
void door_secret_done(edict_t *self)
void button_wait(edict_t *self)
void trigger_elevator_use(edict_t *self, edict_t *other, edict_t *activator)
void AngleMove_Calc(edict_t *ent, void(*func)(edict_t *))
void door_use_areaportals(edict_t *self, qboolean open)
void use_killbox(edict_t *self, edict_t *other, edict_t *activator)
void rotating_blocked(edict_t *self, edict_t *other)
void door_go_down(edict_t *self)
void door_secret_move5(edict_t *self)
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void Touch_DoorTrigger(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void AngleMove_Final(edict_t *ent)
void Move_Begin(edict_t *ent)
void door_secret_blocked(edict_t *self, edict_t *other)
void Think_SpawnDoorTrigger(edict_t *ent)
void door_blocked(edict_t *self, edict_t *other)
void AngleMove_Begin(edict_t *ent)
void door_killed(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void door_hit_top(edict_t *self)
void door_secret_use(edict_t *self, edict_t *other, edict_t *activator)
void plat_go_up(edict_t *ent)
#define SECRET_ALWAYS_SHOOT
#define AccelerationDistance(target, rate)
void Move_Final(edict_t *ent)
void Think_CalcMoveSpeed(edict_t *self)
void G_UseTargets(edict_t *ent, edict_t *activator)
void door_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void G_SetMovedir(vec3_t angles, vec3_t movedir)
qboolean KillBox(edict_t *ent)
void AngleMove_Done(edict_t *ent)
void func_timer_use(edict_t *self, edict_t *other, edict_t *activator)
void plat_spawn_inside_trigger(edict_t *ent)
void Touch_Plat_Center(edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
void train_resume(edict_t *self)
edict_t * G_PickTarget(char *targetname)
vec_t VectorNormalize(vec3_t v)
void AddPointToBounds(const vec3_t v, vec3_t mins, vec3_t maxs)
void door_secret_move1(edict_t *self)
void door_hit_bottom(edict_t *self)
void trigger_elevator_init(edict_t *self)
void Move_Done(edict_t *ent)
void plat_hit_top(edict_t *ent)