Go to the documentation of this file.
62 v[2] = 200.0 + 100.0 *
random();
97 if (self->s.frame == 10)
108 if (!self->groundentity)
193 self->s.modelindex2 = 0;
196 self->s.effects |=
EF_GIB;
217 VectorMA (self->velocity, vscale, vd, self->velocity);
236 gibname =
"models/objects/gibs/head2/tris.md2";
241 gibname =
"models/objects/gibs/skull/tris.md2";
245 self->s.origin[2] += 32;
259 VectorAdd (self->velocity, vd, self->velocity);
264 self->client->anim_end =
self->s.frame;
353 if (self->pathtarget)
357 savetarget =
self->
target;
358 self->target =
self->pathtarget;
360 self->target = savetarget;
371 v[2] += next->
mins[2];
372 v[2] -= other->
mins[2];
401 if (!self->targetname)
403 gi.
dprintf (
"path_corner with no targetname at %s\n",
vtos(self->s.origin));
431 other->
target =
self->target;
435 gi.
dprintf(
"%s at %s target %s does not exist\n", self->classname,
vtos(self->s.origin), self->target);
455 if (self->pathtarget)
459 savetarget =
self->target;
460 self->target =
self->pathtarget;
462 activator = other->
enemy;
470 self->target = savetarget;
568 if (self->style >= 32)
608 if (!(self->spawnflags & 2))
617 if (self->spawnflags & 8)
619 if (self->spawnflags & 16)
623 if ((self->spawnflags & 7) == 0)
631 if (!(self->spawnflags & 1))
634 self->spawnflags |= 1;
638 if (self->spawnflags & 4)
640 if (!(self->spawnflags & 2))
642 gi.
dprintf(
"func_wall START_ON without TOGGLE\n");
643 self->spawnflags |= 2;
648 if (self->spawnflags & 4)
670 if (plane->
normal[2] < 1.0)
706 if (self->spawnflags == 0)
721 if (self->spawnflags & 2)
723 if (self->spawnflags & 4)
782 chunkorigin[0] = origin[0] +
crandom() * size[0];
783 chunkorigin[1] = origin[1] +
crandom() * size[1];
784 chunkorigin[2] = origin[2] +
crandom() * size[2];
785 ThrowDebris (
self,
"models/objects/debris1/tris.md2", 1, chunkorigin);
795 chunkorigin[0] = origin[0] +
crandom() * size[0];
796 chunkorigin[1] = origin[1] +
crandom() * size[1];
797 chunkorigin[2] = origin[2] +
crandom() * size[2];
798 ThrowDebris (
self,
"models/objects/debris2/tris.md2", 2, chunkorigin);
838 if (self->spawnflags & 1)
847 if (self->targetname)
851 if (self->spawnflags & 2)
853 if (self->spawnflags & 4)
882 ratio = (float)other->
mass / (
float)
self->mass;
896 VectorMA (self->absmin, 0.5, self->size, self->s.origin);
899 spd = 1.5 * (float)self->dmg / 200.0;
900 org[0] = self->s.origin[0] +
crandom() *
self->size[0];
901 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
902 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
903 ThrowDebris (
self,
"models/objects/debris1/tris.md2", spd, org);
904 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
905 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
906 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
907 ThrowDebris (
self,
"models/objects/debris1/tris.md2", spd, org);
910 spd = 1.75 * (float)self->dmg / 200.0;
912 ThrowDebris (
self,
"models/objects/debris3/tris.md2", spd, org);
914 org[0] +=
self->size[0];
915 ThrowDebris (
self,
"models/objects/debris3/tris.md2", spd, org);
917 org[1] +=
self->size[1];
918 ThrowDebris (
self,
"models/objects/debris3/tris.md2", spd, org);
920 org[0] +=
self->size[0];
921 org[1] +=
self->size[1];
922 ThrowDebris (
self,
"models/objects/debris3/tris.md2", spd, org);
925 spd = 2 *
self->dmg / 200;
926 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
927 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
928 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
929 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
930 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
931 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
932 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
933 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
934 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
935 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
936 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
937 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
938 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
939 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
940 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
941 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
942 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
943 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
944 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
945 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
946 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
947 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
948 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
949 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
950 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
951 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
952 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
953 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
954 org[0] =
self->s.origin[0] +
crandom() *
self->size[0];
955 org[1] =
self->s.origin[1] +
crandom() *
self->size[1];
956 org[2] =
self->s.origin[2] +
crandom() *
self->size[2];
957 ThrowDebris (
self,
"models/objects/debris2/tris.md2", spd, org);
960 if (self->groundentity)
971 self->activator = attacker;
989 self->model =
"models/objects/barrels/tris.md2";
1034 if (++self->s.frame < 19)
1062 if (++self->s.frame < 293)
1066 self->s.frame = 254;
1090 if (++self->s.frame < 247)
1094 self->s.frame = 208;
1118 if (++self->s.frame < 287)
1122 self->s.frame = 248;
1148 if (++self->s.frame < 24)
1151 self->nextthink = 0;
1153 if (self->s.frame == 22)
1167 self->s.origin[2] += 2;
1174 self->model =
"models/monsters/commandr/tris.md2";
1207 ent->
s.
frame = rand() % 16;
1221 if (self->health > -80)
1225 for (n= 0; n < 4; n++)
1334 self->s.origin[2] =
self->absmin[2] + 1;
1344 self->groundentity =
NULL;
1346 diff =
self->timestamp -
level.time;
1353 diff =
self->s.angles[2];
1355 self->s.angles[2] = diff + 10;
1369 self->activator = activator;
1374 self->timestamp =
level.time;
1385 self->s.modelindex =
gi.
modelindex (
"models/objects/bomb/tris.md2");
1448 if (self->s.frame < 38)
1498 gi.
setmodel (ent,
"models/objects/gibs/arm/tris.md2");
1519 gi.
setmodel (ent,
"models/objects/gibs/leg/tris.md2");
1540 gi.
setmodel (ent,
"models/objects/gibs/head/tris.md2");
1583 l = (
int)strlen(self->message);
1595 c =
self->message[n];
1596 if (c >=
'0' && c <=
'9')
1628 #define CLOCK_MESSAGE_SIZE 16
1635 self->activator =
NULL;
1636 if (self->spawnflags & 1)
1639 self->wait =
self->count;
1641 else if (self->spawnflags & 2)
1643 self->health =
self->count;
1650 if (self->style == 0)
1656 if (self->style == 1)
1659 if (self->message[3] ==
' ')
1660 self->message[3] =
'0';
1664 if (self->style == 2)
1666 Com_sprintf(self->message,
CLOCK_MESSAGE_SIZE,
"%2i:%2i:%2i", self->health / 3600, (self->health - (self->health / 3600) * 3600) / 60, self->health % 60);
1667 if (self->message[3] ==
' ')
1668 self->message[3] =
'0';
1669 if (self->message[6] ==
' ')
1670 self->message[6] =
'0';
1684 if (self->spawnflags & 1)
1689 else if (self->spawnflags & 2)
1700 ltime = localtime(&gmtime);
1702 if (self->message[3] ==
' ')
1703 self->message[3] =
'0';
1704 if (self->message[6] ==
' ')
1705 self->message[6] =
'0';
1708 self->enemy->message =
self->message;
1709 self->enemy->use (self->enemy,
self,
self);
1711 if (((self->spawnflags & 1) && (self->health > self->wait)) ||
1712 ((self->spawnflags & 2) && (self->health < self->wait)))
1714 if (self->pathtarget)
1719 savetarget =
self->target;
1720 savemessage =
self->message;
1721 self->target =
self->pathtarget;
1722 self->message =
NULL;
1724 self->target = savetarget;
1725 self->message = savemessage;
1728 if (!(self->spawnflags & 8))
1733 if (self->spawnflags & 4)
1737 self->nextthink =
level.time + 1;
1742 if (!(self->spawnflags & 8))
1744 if (self->activator)
1746 self->activator = activator;
1754 gi.
dprintf(
"%s with no target at %s\n", self->classname,
vtos(self->s.origin));
1759 if ((self->spawnflags & 2) && (!self->count))
1761 gi.
dprintf(
"%s with no count at %s\n", self->classname,
vtos(self->s.origin));
1766 if ((self->spawnflags & 1) && (!self->count))
1767 self->count = 60*60;;
1775 if (self->spawnflags & 4)
1778 self->nextthink =
level.time + 1;
1793 gi.
dprintf (
"Couldn't find destination\n");
1814 for (
i=0 ;
i<3 ;
i++)
1838 gi.
dprintf (
"teleporter without a target.\n");
1843 gi.
setmodel (ent,
"models/objects/dmspot/tris.md2");
1870 gi.
setmodel (ent,
"models/objects/dmspot/tris.md2");
void ThrowHead(edict_t *self, char *gibname, int damage, int type)
void misc_strogg_ship_use(edict_t *self, edict_t *other, edict_t *activator)
void SP_viewthing(edict_t *ent)
void misc_deadsoldier_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void(* dprintf)(char *fmt,...)
void SP_light(edict_t *self)
void ThrowClientHead(edict_t *self, int damage)
void SP_misc_viper(edict_t *ent)
void SP_misc_satellite_dish(edict_t *ent)
void misc_viper_bomb_use(edict_t *self, edict_t *other, edict_t *activator)
void SP_misc_teleporter_dest(edict_t *ent)
#define MASK_MONSTERSOLID
void SP_misc_strogg_ship(edict_t *ent)
void barrel_delay(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void func_object_use(edict_t *self, edict_t *other, edict_t *activator)
CONST PIXELFORMATDESCRIPTOR int
#define VectorSubtract(a, b, c)
static void light_use(edict_t *self, edict_t *other, edict_t *activator)
void(* WritePosition)(vec3_t pos)
void(* multicast)(vec3_t origin, multicast_t to)
void barrel_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void TH_viewthing(edict_t *ent)
void misc_viper_use(edict_t *self, edict_t *other, edict_t *activator)
void SP_light_mine1(edict_t *ent)
void SP_misc_deadsoldier(edict_t *ent)
void path_corner_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
qboolean M_walkmove(edict_t *ent, float yaw, float dist)
void func_clock_think(edict_t *self)
void SP_point_combat(edict_t *self)
void SP_misc_bigviper(edict_t *ent)
void SP_misc_gib_arm(edict_t *ent)
void misc_banner_think(edict_t *ent)
void target_string_use(edict_t *self, edict_t *other, edict_t *activator)
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
void SP_misc_easterchick(edict_t *ent)
void(* stand)(edict_t *self)
void func_train_find(edict_t *self)
void SP_misc_blackhole(edict_t *ent)
edict_t * G_Find(edict_t *from, int fieldofs, char *match)
struct gclient_s * client
void(* sound)(edict_t *ent, int channel, int soundindex, float volume, float attenuation, float timeofs)
void SP_monster_commander_body(edict_t *self)
void M_droptofloor(edict_t *ent)
float vectoyaw(vec3_t vec)
void commander_body_use(edict_t *self, edict_t *other, edict_t *activator)
void misc_easterchick2_think(edict_t *self)
void SP_target_string(edict_t *self)
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 BecomeExplosion2(edict_t *self)
void barrel_explode(edict_t *self)
void commander_body_drop(edict_t *self)
void func_object_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void teleporter_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void func_wall_use(edict_t *self, edict_t *other, edict_t *activator)
void debris_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void commander_body_think(edict_t *self)
#define PMF_TIME_TELEPORT
void SP_misc_banner(edict_t *ent)
void vectoangles(vec3_t vec, vec3_t angles)
void gib_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void SP_func_areaportal(edict_t *ent)
void G_FreeEdict(edict_t *e)
void SP_info_notnull(edict_t *self)
void point_combat_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void(* configstring)(int num, char *string)
void func_object_release(edict_t *self)
void(* SetAreaPortalState)(int portalnum, qboolean open)
int(* soundindex)(char *name)
void SP_misc_viper_bomb(edict_t *self)
int(* modelindex)(char *name)
void misc_eastertank_think(edict_t *self)
void SP_info_null(edict_t *self)
void Use_Areaportal(edict_t *ent, edict_t *other, edict_t *activator)
void SP_func_explosive(edict_t *self)
void(* think)(edict_t *self)
void func_clock_use(edict_t *self, edict_t *other, edict_t *activator)
vec_t VectorNormalize(vec3_t v)
void *(* TagMalloc)(int size, int tag)
void SP_func_wall(edict_t *self)
void BecomeExplosion1(edict_t *self)
void SP_misc_eastertank(edict_t *ent)
void SP_misc_easterchick2(edict_t *ent)
static void func_clock_reset(edict_t *self)
void SP_func_object(edict_t *self)
void misc_blackhole_use(edict_t *ent, edict_t *other, edict_t *activator)
void misc_blackhole_think(edict_t *self)
void SP_misc_teleporter(edict_t *ent)
void misc_viper_bomb_prethink(edict_t *self)
void(* setmodel)(edict_t *ent, char *name)
#define VectorAdd(a, b, c)
void(* unlinkentity)(edict_t *ent)
void SP_misc_explobox(edict_t *self)
void ClipGibVelocity(edict_t *ent)
void func_explosive_use(edict_t *self, edict_t *other, edict_t *activator)
void ThrowGib(edict_t *self, char *gibname, int damage, int type)
void func_explosive_spawn(edict_t *self, edict_t *other, edict_t *activator)
void(* use)(edict_t *self, edict_t *other, edict_t *activator)
monsterinfo_t monsterinfo
void gib_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void SP_target_character(edict_t *self)
void SP_misc_gib_leg(edict_t *ent)
void misc_viper_bomb_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void G_UseTargets(edict_t *ent, edict_t *activator)
#define CLOCK_MESSAGE_SIZE
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
void SP_path_corner(edict_t *self)
qboolean KillBox(edict_t *ent)
void(* touch)(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
void misc_easterchick_think(edict_t *self)
void SP_misc_gib_head(edict_t *ent)
void gib_think(edict_t *self)
static void func_clock_format_countdown(edict_t *self)
void func_explosive_explode(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
#define VectorSet(v, x, y, z)
void SP_func_clock(edict_t *self)
void misc_satellite_dish_think(edict_t *self)
void SP_light_mine2(edict_t *ent)
void VelocityForDamage(int damage, vec3_t v)
edict_t * G_PickTarget(char *targetname)
void(* linkentity)(edict_t *ent)
void train_use(edict_t *self, edict_t *other, edict_t *activator)
void misc_satellite_dish_use(edict_t *self, edict_t *other, edict_t *activator)
void(* die)(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
void Com_sprintf(char *dest, int size, char *fmt,...)
void ThrowDebris(edict_t *self, char *modelname, float speed, vec3_t origin)
void T_RadiusDamage(edict_t *inflictor, edict_t *attacker, float damage, edict_t *ignore, float radius, int mod)