Xonotic
sv_monsters.qh File Reference
#include "all.qh"
+ Include dependency graph for sv_monsters.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _MSOUND(m)   .string monstersound_##m;
 
#define ALLMONSTERSOUNDS
 
#define MONSTER_SKILLMOD(mon)   (0.5 + mon.monster_skill * ((1.2 - 0.3) / 10))
 

Functions

bool Monster_Attack_Leap (entity this, vector anm, void(entity this, entity toucher) touchfunc, vector vel, float animtime)
 
float Monster_Attack_Melee (entity this, entity targ, float damg, vector anim, float er, float animtime, int deathtype, float dostop)
 
void Monster_Delay (entity this, int repeat_count, float defer_amnt, void(entity) func)
 
entity Monster_FindTarget (entity this)
 
void monster_makevectors (entity this, entity targ)
 
void Monster_Move_2D (entity this, float mspeed, float allow_jumpoff)
 
void Monster_Remove (entity this)
 
void monster_setupcolors (entity this)
 
void Monster_Sound (entity this,.string samplefield, float sound_delay, float delaytoo, float chan)
 
bool Monster_Spawn (entity this, bool check_appear, Monster mon)
 
void Monster_Touch (entity this, entity toucher)
 
void monsters_setstatus (entity this)
 
 STATIC_INIT (g_monsters)
 
 STATIC_INIT (g_monster_targets)
 

Variables

float anim_finished
 
float attack_range
 
float autocvar_g_monsters
 
float autocvar_g_monsters_armor_blockpercent
 
float autocvar_g_monsters_attack_range
 
float autocvar_g_monsters_damageforcescale = 0.8
 
float autocvar_g_monsters_drop_time
 
bool autocvar_g_monsters_edit
 
float autocvar_g_monsters_healthbars
 
bool autocvar_g_monsters_lineofsight = true
 
int autocvar_g_monsters_max
 
int autocvar_g_monsters_max_perplayer
 
float autocvar_g_monsters_miniboss_chance
 
float autocvar_g_monsters_miniboss_healthboost
 
bool autocvar_g_monsters_owners
 
bool autocvar_g_monsters_quake_resize = true
 
bool autocvar_g_monsters_respawn
 
float autocvar_g_monsters_respawn_delay
 
int autocvar_g_monsters_score_kill
 
int autocvar_g_monsters_score_spawned
 
bool autocvar_g_monsters_sounds
 
float autocvar_g_monsters_spawnshieldtime
 
bool autocvar_g_monsters_target_infront
 
float autocvar_g_monsters_target_infront_range = 0.3
 
float autocvar_g_monsters_target_range
 
bool autocvar_g_monsters_teams
 
float autocvar_g_monsters_think_delay
 
bool autocvar_g_monsters_typefrag
 
bool candrop
 
IntrusiveList g_monster_targets
 
IntrusiveList g_monsters
 
ALLMONSTERSOUNDS float GetMonsterSoundSampleField_notFound
 
float last_enemycheck
 
float last_trace
 
string mdl_dead
 
bool monster_attack
 
const int MONSTER_ATTACK_MELEE = 6
 
const int MONSTER_ATTACK_RANGED = 7
 
vector monster_face
 
entity monster_follow
 
float monster_lifetime
 
const int MONSTER_MOVE_ENEMY = 5
 
const int MONSTER_MOVE_FOLLOW = 1
 
const int MONSTER_MOVE_NOMOVE = 4
 
const int MONSTER_MOVE_SPAWNLOC = 3
 
const int MONSTER_MOVE_WANDER = 2
 
int monster_moveflags
 
int monster_movestate
 
vector monster_moveto
 
int monster_skill
 
const int MONSTER_SKILL_EASY = 1
 
const int MONSTER_SKILL_HARD = 5
 
const int MONSTER_SKILL_INSANE = 7
 
const int MONSTER_SKILL_MEDIUM = 3
 
const int MONSTER_SKILL_NIGHTMARE = 10
 
const int MONSTERFLAG_APPEAR = 2
 
const int MONSTERFLAG_FLY_VERTICAL = 8
 
const int MONSTERFLAG_INFRONT = 32
 
const int MONSTERFLAG_INVINCIBLE = 128
 
const int MONSTERFLAG_MINIBOSS = 64
 
const int MONSTERFLAG_NORESPAWN = 4
 
const int MONSTERFLAG_RESPAWNED = 32768
 
const int MONSTERFLAG_SPAWNED = 16384
 
int monsters_killed
 
int monsters_total
 
const int MONSTERSKILL_NOTEASY = 256
 
const int MONSTERSKILL_NOTHARD = 1024
 
const int MONSTERSKILL_NOTMEDIUM = 512
 
float msound_delay
 
int oldskin
 
string oldtarget2
 
float spawn_time
 
float speed2
 
float stopspeed
 
int totalspawned
 number of monsters spawned with mobspawn command More...
 
float wander_delay
 
float wander_distance
 

Macro Definition Documentation

◆ _MSOUND

#define _MSOUND (   m)    .string monstersound_##m;

Definition at line 138 of file sv_monsters.qh.

◆ ALLMONSTERSOUNDS

#define ALLMONSTERSOUNDS
Value:
_MSOUND(death) \
_MSOUND(sight) \
_MSOUND(ranged) \
_MSOUND(melee) \
_MSOUND(pain) \
_MSOUND(spawn) \
_MSOUND(idle) \
_MSOUND(attack)
#define _MSOUND(m)
Definition: sv_monsters.qh:138

Definition at line 128 of file sv_monsters.qh.

Referenced by Monster_Sound_SampleField(), and Monster_Sounds_Clear().

◆ MONSTER_SKILLMOD

#define MONSTER_SKILLMOD (   mon)    (0.5 + mon.monster_skill * ((1.2 - 0.3) / 10))

Definition at line 59 of file sv_monsters.qh.

Referenced by Monster_Attack_Melee(), Monster_Move(), and Monster_Spawn_Setup().

Function Documentation

◆ Monster_Attack_Leap()

bool Monster_Attack_Leap ( entity  this,
vector  anm,
void(entity this, entity toucher)  touchfunc,
vector  vel,
float  animtime 
)

Definition at line 403 of file sv_monsters.qc.

References anim_finished, animstate_endtime, attack_finished_single, IS_MONSTER, Monster_Attack_Leap_Check(), MONSTER_ATTACK_RANGED, setanim, state, time, UNSET_ONGROUND, and velocity.

404 {
405  if(!Monster_Attack_Leap_Check(this, vel))
406  return false;
407 
408  setanim(this, anm, false, true, false);
409 
410  if(this.animstate_endtime > time && IS_MONSTER(this))
412  else
413  this.attack_finished_single[0] = this.anim_finished = time + animtime;
414 
415  if(IS_MONSTER(this))
417  settouch(this, touchfunc);
418  this.origin_z += 1;
419  this.velocity = vel;
420  UNSET_ONGROUND(this);
421 
422  return true;
423 }
float state
Definition: subs.qh:32
float anim_finished
Definition: sv_monsters.qh:51
float animstate_endtime
Definition: anim.qh:38
#define setanim(...)
Definition: anim.qh:45
#define IS_MONSTER(v)
Definition: utils.qh:21
bool Monster_Attack_Leap_Check(entity this, vector vel)
Definition: sv_monsters.qc:381
#define UNSET_ONGROUND(s)
Definition: movetypes.qh:18
const int MONSTER_ATTACK_RANGED
Definition: sv_monsters.qh:71
float time
Definition: csprogsdefs.qc:16
vector velocity
Definition: csprogsdefs.qc:103
float attack_finished_single[MAX_WEAPONSLOTS]
Definition: weaponsystem.qh:36
+ Here is the call graph for this function:

◆ Monster_Attack_Melee()

float Monster_Attack_Melee ( entity  this,
entity  targ,
float  damg,
vector  anim,
float  er,
float  animtime,
int  deathtype,
float  dostop 
)

◆ Monster_Delay()

void Monster_Delay ( entity  this,
int  repeat_count,
float  defer_amnt,
void(entity func 
)

Definition at line 218 of file sv_monsters.qc.

References entity(), Monster_Delay(), Monster_Delay_Action(), new_pure, setthink, and time.

Referenced by Monster_Delay().

219 {
220  // deferred attacking, checks if monster is still alive and target is still valid before attacking
222 
224  e.nextthink = time + defer_amnt;
225  e.count = defer_amnt;
226  e.owner = this;
227  e.monster_delayedfunc = func;
228  e.cnt = repeat_count;
229 }
entity() spawn
void Monster_Delay(entity this, int repeat_count, float defer_amnt, void(entity) func)
Definition: sv_monsters.qc:218
#define new_pure(class)
purely logical entities (.origin doesn't work)
Definition: oo.qh:62
#define setthink(e, f)
float time
Definition: csprogsdefs.qc:16
void Monster_Delay_Action(entity this)
Definition: sv_monsters.qc:197
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Monster_FindTarget()

entity Monster_FindTarget ( entity  this)

Definition at line 126 of file sv_monsters.qc.

References CENTER_OR_VIEWOFS, enemy, entity(), g_monster_targets, IL_EACH, MUTATOR_CALLHOOK, NULL, vdist, and vector().

Referenced by Monster_Enemy_Check().

127 {
128  if(MUTATOR_CALLHOOK(MonsterFindTarget)) { return this.enemy; } // Handled by a mutator
129 
130  entity closest_target = NULL;
131  vector my_center = CENTER_OR_VIEWOFS(this);
132 
133  // find the closest acceptable target to pass to
134  IL_EACH(g_monster_targets, it.monster_attack && vdist(it.origin - this.origin, <, this.target_range),
135  {
136  if(Monster_ValidTarget(this, it))
137  {
138  // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in damage.qc)
139  vector targ_center = CENTER_OR_VIEWOFS(it);
140 
141  if(closest_target)
142  {
143  vector closest_target_center = CENTER_OR_VIEWOFS(closest_target);
144  if(vlen2(my_center - targ_center) < vlen2(my_center - closest_target_center))
145  { closest_target = it; }
146  }
147  else { closest_target = it; }
148  }
149  });
150 
151  return closest_target;
152 }
#define IL_EACH(this, cond, body)
IntrusiveList g_monster_targets
Definition: sv_monsters.qh:147
entity() spawn
entity enemy
Definition: sv_ctf.qh:143
#define NULL
Definition: post.qh:17
#define CENTER_OR_VIEWOFS(ent)
Definition: utils.qh:28
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition: vector.qh:8
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monster_makevectors()

void monster_makevectors ( entity  this,
entity  targ 
)

Definition at line 66 of file sv_monsters.qc.

References IS_MONSTER, makevectors, origin, v, v_angle, vectoangles(), vector(), and view_ofs.

Referenced by Monster_Attack_Check(), and Monster_Delay_Action().

67 {
68  if(IS_MONSTER(this))
69  {
70  vector v = targ.origin + (targ.mins + targ.maxs) * 0.5;
71  this.v_angle = vectoangles(v - (this.origin + this.view_ofs));
72  this.v_angle_x = -this.v_angle_x;
73  }
74 
75  makevectors(this.v_angle);
76 }
vector view_ofs
Definition: progsdefs.qc:151
vector v_angle
Definition: progsdefs.qc:161
#define IS_MONSTER(v)
Definition: utils.qh:21
origin
Definition: ent_cs.qc:114
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector v
Definition: ent_cs.qc:116
#define makevectors
Definition: post.qh:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Monster_Move_2D()

void Monster_Move_2D ( entity  this,
float  mspeed,
float  allow_jumpoff 
)

◆ Monster_Remove()

void Monster_Remove ( entity  this)

Definition at line 852 of file sv_monsters.qc.

References iceblock, IS_CLIENT, MAX_WEAPONSLOTS, MUTATOR_CALLHOOK, origin, sprite, and weaponentities.

Referenced by CommonCommand_editmob(), Invasion_CheckWinner(), and Monster_Spawn().

853 {
854  if(IS_CLIENT(this))
855  return; // don't remove it?
856 
857  if(!this) { return; }
858 
859  if(!MUTATOR_CALLHOOK(MonsterRemove, this))
860  Send_Effect(EFFECT_ITEM_PICKUP, this.origin, '0 0 0', 1);
861 
862  for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
863  {
864  .entity weaponentity = weaponentities[slot];
865  if(this.(weaponentity))
866  delete(this.(weaponentity));
867  }
868  if(this.iceblock) { delete(this.iceblock); }
869  WaypointSprite_Kill(this.sprite);
870  delete(this);
871 }
entity sprite
Definition: sv_assault.qc:11
#define IS_CLIENT(v)
Definition: utils.qh:13
entity iceblock
Definition: damage.qh:116
origin
Definition: ent_cs.qc:114
const int MAX_WEAPONSLOTS
Definition: weapon.qh:13
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
entity weaponentities[MAX_WEAPONSLOTS]
Definition: weapon.qh:14
+ Here is the caller graph for this function:

◆ monster_setupcolors()

void monster_setupcolors ( entity  this)

Definition at line 154 of file sv_monsters.qc.

References colormap, IS_PLAYER, monster_skill, MONSTER_SKILL_EASY, MONSTER_SKILL_HARD, MONSTER_SKILL_INSANE, MONSTER_SKILL_MEDIUM, MONSTER_SKILL_NIGHTMARE, realowner, team, and teamplay.

Referenced by invasion_SpawnChosenMonster(), monster_changeteam(), and Monster_Spawn().

155 {
156  if(IS_PLAYER(this.realowner))
157  this.colormap = this.realowner.colormap;
158  else if(teamplay && this.team)
159  this.colormap = 1024 + (this.team - 1) * 17;
160  else
161  {
163  this.colormap = 1029;
164  else if(this.monster_skill <= MONSTER_SKILL_MEDIUM)
165  this.colormap = 1027;
166  else if(this.monster_skill <= MONSTER_SKILL_HARD)
167  this.colormap = 1038;
168  else if(this.monster_skill <= MONSTER_SKILL_INSANE)
169  this.colormap = 1028;
170  else if(this.monster_skill <= MONSTER_SKILL_NIGHTMARE)
171  this.colormap = 1032;
172  else
173  this.colormap = 1024;
174  }
175 }
float colormap
Definition: csprogsdefs.qc:131
const int MONSTER_SKILL_MEDIUM
Definition: sv_monsters.qh:75
int team
Definition: main.qh:157
const int MONSTER_SKILL_EASY
Definition: sv_monsters.qh:74
int monster_skill
Definition: sv_monsters.qh:96
const int MONSTER_SKILL_INSANE
Definition: sv_monsters.qh:77
const int MONSTER_SKILL_HARD
Definition: sv_monsters.qh:76
const int MONSTER_SKILL_NIGHTMARE
Definition: sv_monsters.qh:78
float teamplay
Definition: progsdefs.qc:31
entity realowner
Definition: common.qh:25
#define IS_PLAYER(v)
Definition: utils.qh:9
+ Here is the caller graph for this function:

◆ Monster_Sound()

void Monster_Sound ( entity  this,
.string  samplefield,
float  sound_delay,
float  delaytoo,
float  chan 
)

◆ Monster_Spawn()

bool Monster_Spawn ( entity  this,
bool  check_appear,
Monster  mon 
)

Definition at line 1325 of file sv_monsters.qc.

References angles, autocvar_g_fullbrightplayers, autocvar_g_monsters, autocvar_g_monsters_edit, autocvar_g_monsters_quake_resize, autocvar_g_monsters_spawnshieldtime, autocvar_g_monsters_think_delay, autocvar_g_nodepthtestplayers, autocvar_g_playerclip_collisions, bot_attack, bound(), candrop, classname, cvar(), DAMAGE_AIM, damagedbycontents, DEAD_NO, deadflag, DPCONTENTS_BODY, DPCONTENTS_BOTCLIP, DPCONTENTS_MONSTERCLIP, DPCONTENTS_PLAYERCLIP, DPCONTENTS_SOLID, dphitcontentsmask, EF_FULLBRIGHT, EF_NODEPTHTEST, effects, enemy, FL_FLY, FL_MONSTER, FL_SWIM, flags, g_bot_targets, g_damagedbycontents, g_monsters, grab, gravity, IL_PUSH(), iscreature, Monster::m_maxs, Monster::m_mins, maxs, mdl_dead, mins, Monster_Appear_Check(), Monster_Damage(), monster_face, Monster_Heal(), monster_moveto, Monster::monster_name, Monster_Remove(), Monster_Reset(), monster_setupcolors(), MONSTER_SIZE_BROKEN, MONSTER_SIZE_QUAKE, monster_skill, MONSTER_SKILL_EASY, MONSTER_SKILL_HARD, MONSTER_SKILL_MEDIUM, Monster_Spawn_Setup(), Monster_Touch(), MONSTER_TYPE_FLY, MONSTER_TYPE_SWIM, Monster_UpdateModel(), Monster_Use(), monsterdef, MONSTERFLAG_RESPAWNED, MONSTERFLAG_SPAWNED, monsters_total, MONSTERSKILL_NOTEASY, MONSTERSKILL_NOTHARD, MONSTERSKILL_NOTMEDIUM, MOVE_WORLDONLY, MOVETYPE_FLY, MOVETYPE_WALK, netname, Monster::netname, noalign, NULL, oldtarget2, origin, pos1, scale, set_movetype(), setmodel, setorigin(), solid, SOLID_BBOX, spawn_time, Monster::spawnflags, spawnflags, sys_frametime, takedamage, target2, team, teamplay, teleportable, ticrate, time, trace_endpos, use, velocity, and view_ofs.

Referenced by Monster_Appear(), Monster_Respawn(), and spawnmonster().

1326 {
1327  // setup the basic required properties for a monster
1328 
1329  if(!mon || mon == MON_Null) { return false; } // invalid monster
1330  if(!autocvar_g_monsters) { Monster_Remove(this); return false; }
1331 
1332  if(!(this.spawnflags & MONSTERFLAG_RESPAWNED) && !(this.flags & FL_MONSTER))
1333  {
1334  IL_PUSH(g_monsters, this);
1335  if(this.mdl && this.mdl != "")
1336  precache_model(this.mdl);
1337  if(this.mdl_dead && this.mdl_dead != "")
1338  precache_model(this.mdl_dead);
1339  }
1340 
1341  if(check_appear && Monster_Appear_Check(this, mon)) { return true; } // return true so the monster isn't removed
1342 
1343  if(!this.monster_skill)
1344  this.monster_skill = cvar("g_monsters_skill");
1345 
1346  // support for quake style removing monsters based on skill
1347  if(this.monster_skill == MONSTER_SKILL_EASY) if(this.spawnflags & MONSTERSKILL_NOTEASY) { Monster_Remove(this); return false; }
1348  if(this.monster_skill == MONSTER_SKILL_MEDIUM) if(this.spawnflags & MONSTERSKILL_NOTMEDIUM) { Monster_Remove(this); return false; }
1349  if(this.monster_skill == MONSTER_SKILL_HARD) if(this.spawnflags & MONSTERSKILL_NOTHARD) { Monster_Remove(this); return false; }
1350 
1351  if(this.team && !teamplay)
1352  this.team = 0;
1353 
1354  if(!(this.spawnflags & MONSTERFLAG_SPAWNED)) // naturally spawned monster
1355  if(!(this.spawnflags & MONSTERFLAG_RESPAWNED)) // don't count re-spawning monsters either
1356  monsters_total += 1;
1357 
1358  if(this.mdl && this.mdl != "")
1359  _setmodel(this, this.mdl);
1360  else
1361  setmodel(this, mon.m_model);
1362 
1363  if(this.statuseffects && this.statuseffects.owner == this)
1364  {
1365  StatusEffects_clearall(this.statuseffects);
1366  StatusEffects_update(this);
1367  }
1368  else
1369  this.statuseffects = NULL;
1370 
1371  this.flags = FL_MONSTER;
1372  this.classname = "monster";
1373  this.takedamage = DAMAGE_AIM;
1374  if(!this.bot_attack)
1375  IL_PUSH(g_bot_targets, this);
1376  this.bot_attack = true;
1377  this.iscreature = true;
1378  this.teleportable = true;
1379  if(!this.damagedbycontents)
1381  this.damagedbycontents = true;
1382  this.monsterdef = mon;
1383  this.event_damage = Monster_Damage;
1384  this.event_heal = Monster_Heal;
1385  settouch(this, Monster_Touch);
1386  this.use = Monster_Use;
1387  this.solid = SOLID_BBOX;
1388  set_movetype(this, MOVETYPE_WALK);
1389  StatusEffects_apply(STATUSEFFECT_SpawnShield, this, time + autocvar_g_monsters_spawnshieldtime, 0);
1390  this.enemy = NULL;
1391  this.velocity = '0 0 0';
1392  this.moveto = this.origin;
1393  this.pos1 = this.origin;
1394  this.pos2 = this.angles;
1395  this.reset = Monster_Reset;
1396  this.netname = mon.netname;
1397  this.monster_attackfunc = mon.monster_attackfunc;
1398  this.monster_name = mon.monster_name;
1399  this.candrop = true;
1400  this.view_ofs = '0 0 0.7' * (this.maxs_z * 0.5);
1401  this.oldtarget2 = this.target2;
1402  //this.pass_distance = 0;
1403  this.deadflag = DEAD_NO;
1404  this.spawn_time = time;
1405  this.gravity = 1;
1406  this.monster_moveto = '0 0 0';
1407  this.monster_face = '0 0 0';
1409 
1410  if(!this.noalign) { this.noalign = ((mon.spawnflags & MONSTER_TYPE_FLY) || (mon.spawnflags & MONSTER_TYPE_SWIM)); }
1411  if(!this.scale) { this.scale = 1; }
1412  if(autocvar_g_monsters_edit) { this.grab = 1; }
1415  if(mon.spawnflags & MONSTER_TYPE_SWIM) { this.flags |= FL_SWIM; }
1416 
1419 
1420  if(mon.spawnflags & MONSTER_TYPE_FLY)
1421  {
1422  this.flags |= FL_FLY;
1423  set_movetype(this, MOVETYPE_FLY);
1424  }
1425 
1426  if(!(this.spawnflags & MONSTERFLAG_RESPAWNED))
1427  {
1429  this.scale *= 1.3;
1430 
1431  if(mon.spawnflags & MONSTER_SIZE_QUAKE)
1433  this.scale *= 1.3;
1434  }
1435 
1436  setsize(this, mon.m_mins * this.scale, mon.m_maxs * this.scale);
1437 
1439 
1440  Monster_UpdateModel(this);
1441 
1442  if(!Monster_Spawn_Setup(this))
1443  {
1444  Monster_Remove(this);
1445  return false;
1446  }
1447 
1448  if(!this.noalign)
1449  {
1450  setorigin(this, this.origin + '0 0 20');
1451  tracebox(this.origin + '0 0 64', this.mins, this.maxs, this.origin - '0 0 10000', MOVE_WORLDONLY, this);
1452  setorigin(this, trace_endpos);
1453  }
1454 
1455  if(!(this.spawnflags & MONSTERFLAG_RESPAWNED))
1456  monster_setupcolors(this);
1457 
1458  CSQCMODEL_AUTOINIT(this);
1459 
1460  return true;
1461 }
bool autocvar_g_monsters_edit
Definition: sv_monsters.qh:6
const int MONSTERFLAG_RESPAWNED
Definition: sv_monsters.qh:92
const int MONSTERSKILL_NOTEASY
Definition: sv_monsters.qh:80
int monsters_total
Definition: sv_monsters.qh:34
float MOVETYPE_WALK
Definition: progsdefs.qc:249
bool Monster_Spawn_Setup(entity this)
const int MONSTER_SIZE_QUAKE
Definition: monster.qh:13
bool autocvar_g_nodepthtestplayers
Definition: client.qh:33
string monster_name
human readable name
Definition: monster.qh:36
vector view_ofs
Definition: progsdefs.qc:151
void Monster_UpdateModel(entity this)
Definition: sv_monsters.qc:460
const int MONSTER_SKILL_MEDIUM
Definition: sv_monsters.qh:75
bool iscreature
Definition: main.qh:42
bool autocvar_g_monsters_quake_resize
Definition: sv_monsters.qh:24
vector monster_face
Definition: sv_monsters.qh:53
vector m_mins
hitbox size
Definition: monster.qh:42
int team
Definition: main.qh:157
float DPCONTENTS_MONSTERCLIP
string netname
short name
Definition: monster.qh:38
void Monster_Reset(entity this)
Definition: sv_monsters.qc:905
const int MONSTER_SKILL_EASY
Definition: sv_monsters.qh:74
IntrusiveList g_damagedbycontents
Definition: damage.qh:155
float DAMAGE_AIM
Definition: progsdefs.qc:284
float bot_attack
Definition: api.qh:38
int spawnflags
attributes
Definition: monster.qh:34
float autocvar_g_monsters_think_delay
Definition: sv_monsters.qh:8
vector maxs
Definition: csprogsdefs.qc:113
bool Monster_Heal(entity targ, entity inflictor, float amount, float limit)
float DPCONTENTS_BOTCLIP
string netname
Definition: powerups.qc:20
float DPCONTENTS_PLAYERCLIP
const int MONSTER_SIZE_BROKEN
Definition: monster.qh:7
origin
Definition: ent_cs.qc:114
float autocvar_g_monsters_spawnshieldtime
Definition: sv_monsters.qh:23
string classname
Definition: csprogsdefs.qc:107
const float EF_NODEPTHTEST
Definition: csprogsdefs.qc:304
float noalign
Definition: items.qh:42
float FL_FLY
Definition: progsdefs.qc:232
const int MONSTER_TYPE_FLY
Definition: monster.qh:5
string mdl_dead
Definition: sv_monsters.qh:57
float effects
Definition: csprogsdefs.qc:111
void Monster_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition: sv_monsters.qc:997
float spawnflags
Definition: progsdefs.qc:191
int monster_skill
Definition: sv_monsters.qh:96
IntrusiveList g_bot_targets
Definition: api.qh:149
bool candrop
Definition: sv_monsters.qh:45
#define setmodel(this, m)
Definition: model.qh:26
void monster_setupcolors(entity this)
Definition: sv_monsters.qc:154
const float EF_FULLBRIGHT
Definition: csprogsdefs.qc:303
const int MONSTER_SKILL_HARD
Definition: sv_monsters.qh:76
float sys_frametime
Definition: common.qh:57
entity enemy
Definition: sv_ctf.qh:143
vector mins
Definition: csprogsdefs.qc:113
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
float damagedbycontents
Definition: damage.qh:48
float autocvar_g_monsters
Definition: sv_monsters.qh:5
bool Monster_Appear_Check(entity this, Monster monster_id)
Definition: sv_monsters.qc:891
vector monster_moveto
Definition: sv_monsters.qh:52
#define NULL
Definition: post.qh:17
vector m_maxs
hitbox size
Definition: monster.qh:44
float DPCONTENTS_SOLID
void Monster_Remove(entity this)
Definition: sv_monsters.qc:852
vector trace_endpos
Definition: csprogsdefs.qc:37
float takedamage
Definition: progsdefs.qc:147
entity monsterdef
Definition: monster.qh:20
float teamplay
Definition: progsdefs.qc:31
const int MONSTERSKILL_NOTHARD
Definition: sv_monsters.qh:82
float scale
Definition: projectile.qc:14
string target2
Definition: sv_onslaught.qh:45
void Monster_Touch(entity this, entity toucher)
Definition: sv_monsters.qc:479
float gravity
Definition: items.qh:16
bool autocvar_g_fullbrightplayers
Definition: client.qh:16
float deadflag
Definition: progsdefs.qc:149
float DPCONTENTS_BODY
float flags
Definition: csprogsdefs.qc:129
vector pos2
Definition: sv_monsters.qc:524
const int MONSTER_TYPE_SWIM
Definition: monster.qh:6
const float SOLID_BBOX
Definition: csprogsdefs.qc:246
const int MONSTERSKILL_NOTMEDIUM
Definition: sv_monsters.qh:81
float teleportable
Definition: teleporters.qh:24
setorigin(ent, v)
float dphitcontentsmask
float DEAD_NO
Definition: progsdefs.qc:274
float FL_SWIM
Definition: progsdefs.qc:233
vector angles
Definition: csprogsdefs.qc:104
float spawn_time
Definition: sv_monsters.qh:44
#define use
Definition: csprogsdefs.qh:50
float FL_MONSTER
Definition: progsdefs.qc:236
void Monster_Use(entity this, entity actor, entity trigger)
Definition: sv_monsters.qc:557
float MOVE_WORLDONLY
bool autocvar_g_playerclip_collisions
Definition: client.qh:17
IntrusiveList g_monsters
Definition: sv_monsters.qh:144
float time
Definition: csprogsdefs.qc:16
vector velocity
Definition: csprogsdefs.qc:103
vector pos1
Definition: sv_monsters.qc:524
void set_movetype(entity this, int mt)
float MOVETYPE_FLY
Definition: progsdefs.qc:251
string oldtarget2
Definition: sv_monsters.qh:48
float ticrate
Definition: main.qh:182
int grab
Definition: cheats.qh:25
const int MONSTERFLAG_SPAWNED
Definition: sv_monsters.qh:91
float solid
Definition: csprogsdefs.qc:99
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Monster_Touch()

void Monster_Touch ( entity  this,
entity  toucher 
)

Definition at line 479 of file sv_monsters.qc.

References enemy, IS_MONSTER, Monster_ValidTarget(), and NULL.

Referenced by Monster_Dead(), Monster_Move(), and Monster_Spawn().

480 {
481  if(toucher == NULL) { return; }
482 
483  if(toucher.monster_attack)
484  if(this.enemy != toucher)
485  if(!IS_MONSTER(toucher))
486  if(Monster_ValidTarget(this, toucher))
487  this.enemy = toucher;
488 }
bool Monster_ValidTarget(entity this, entity targ)
Definition: sv_monsters.qc:82
#define IS_MONSTER(v)
Definition: utils.qh:21
entity enemy
Definition: sv_ctf.qh:143
#define NULL
Definition: post.qh:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monsters_setstatus()

void monsters_setstatus ( entity  this)

Definition at line 33 of file sv_monsters.qc.

References monsters_killed, and monsters_total.

Referenced by PlayerThink().

34 {
35  STAT(MONSTERS_TOTAL, this) = monsters_total;
36  STAT(MONSTERS_KILLED, this) = monsters_killed;
37 }
int monsters_total
Definition: sv_monsters.qh:34
int monsters_killed
Definition: sv_monsters.qh:35
+ Here is the caller graph for this function:

◆ STATIC_INIT() [1/2]

STATIC_INIT ( g_monsters  )

Definition at line 145 of file sv_monsters.qh.

References IL_NEW.

145 { g_monsters = IL_NEW(); }
#define IL_NEW()
IntrusiveList g_monsters
Definition: sv_monsters.qh:144

◆ STATIC_INIT() [2/2]

STATIC_INIT ( g_monster_targets  )

Definition at line 148 of file sv_monsters.qh.

References IL_NEW.

148 { g_monster_targets = IL_NEW(); }
IntrusiveList g_monster_targets
Definition: sv_monsters.qh:147
#define IL_NEW()

Variable Documentation

◆ anim_finished

float anim_finished

Definition at line 51 of file sv_monsters.qh.

Referenced by Monster_Attack_Leap(), Monster_Attack_Melee(), and Monster_Move().

◆ attack_range

float attack_range

Definition at line 43 of file sv_monsters.qh.

Referenced by Monster_Spawn_Setup().

◆ autocvar_g_monsters

float autocvar_g_monsters

Definition at line 5 of file sv_monsters.qh.

Referenced by CommonCommand_editmob(), Monster_Spawn(), and spawnfunc().

◆ autocvar_g_monsters_armor_blockpercent

float autocvar_g_monsters_armor_blockpercent

Definition at line 28 of file sv_monsters.qh.

◆ autocvar_g_monsters_attack_range

float autocvar_g_monsters_attack_range

Definition at line 15 of file sv_monsters.qh.

Referenced by Monster_Spawn_Setup().

◆ autocvar_g_monsters_damageforcescale

float autocvar_g_monsters_damageforcescale = 0.8

Definition at line 11 of file sv_monsters.qh.

Referenced by Monster_Spawn_Setup().

◆ autocvar_g_monsters_drop_time

float autocvar_g_monsters_drop_time

Definition at line 22 of file sv_monsters.qh.

Referenced by monster_dropitem().

◆ autocvar_g_monsters_edit

bool autocvar_g_monsters_edit

Definition at line 6 of file sv_monsters.qh.

Referenced by CommonCommand_editmob(), and Monster_Spawn().

◆ autocvar_g_monsters_healthbars

float autocvar_g_monsters_healthbars

Definition at line 29 of file sv_monsters.qh.

Referenced by Monster_Spawn_Setup().

◆ autocvar_g_monsters_lineofsight

bool autocvar_g_monsters_lineofsight = true

Definition at line 30 of file sv_monsters.qh.

Referenced by Monster_ValidTarget().

◆ autocvar_g_monsters_max

int autocvar_g_monsters_max

Definition at line 9 of file sv_monsters.qh.

Referenced by CommonCommand_editmob().

◆ autocvar_g_monsters_max_perplayer

int autocvar_g_monsters_max_perplayer

Definition at line 10 of file sv_monsters.qh.

Referenced by CommonCommand_editmob().

◆ autocvar_g_monsters_miniboss_chance

float autocvar_g_monsters_miniboss_chance

Definition at line 20 of file sv_monsters.qh.

Referenced by Monster_Miniboss_Check().

◆ autocvar_g_monsters_miniboss_healthboost

float autocvar_g_monsters_miniboss_healthboost

Definition at line 21 of file sv_monsters.qh.

Referenced by Monster_Miniboss_Check().

◆ autocvar_g_monsters_owners

bool autocvar_g_monsters_owners

Definition at line 19 of file sv_monsters.qh.

Referenced by spawnmonster().

◆ autocvar_g_monsters_quake_resize

bool autocvar_g_monsters_quake_resize = true

Definition at line 24 of file sv_monsters.qh.

Referenced by Monster_Spawn().

◆ autocvar_g_monsters_respawn

bool autocvar_g_monsters_respawn

Definition at line 27 of file sv_monsters.qh.

Referenced by Monster_Respawn_Check().

◆ autocvar_g_monsters_respawn_delay

float autocvar_g_monsters_respawn_delay

Definition at line 26 of file sv_monsters.qh.

Referenced by Monster_Spawn_Setup().

◆ autocvar_g_monsters_score_kill

int autocvar_g_monsters_score_kill

Definition at line 16 of file sv_monsters.qh.

Referenced by Monster_Dead().

◆ autocvar_g_monsters_score_spawned

int autocvar_g_monsters_score_spawned

Definition at line 17 of file sv_monsters.qh.

Referenced by Monster_Dead().

◆ autocvar_g_monsters_sounds

bool autocvar_g_monsters_sounds

Definition at line 7 of file sv_monsters.qh.

Referenced by Monster_Sound().

◆ autocvar_g_monsters_spawnshieldtime

float autocvar_g_monsters_spawnshieldtime

Definition at line 23 of file sv_monsters.qh.

Referenced by Monster_Spawn().

◆ autocvar_g_monsters_target_infront

bool autocvar_g_monsters_target_infront

Definition at line 13 of file sv_monsters.qh.

Referenced by Monster_ValidTarget().

◆ autocvar_g_monsters_target_infront_range

float autocvar_g_monsters_target_infront_range = 0.3

Definition at line 14 of file sv_monsters.qh.

Referenced by Monster_ValidTarget().

◆ autocvar_g_monsters_target_range

float autocvar_g_monsters_target_range

Definition at line 12 of file sv_monsters.qh.

Referenced by Monster_Spawn_Setup().

◆ autocvar_g_monsters_teams

bool autocvar_g_monsters_teams

Definition at line 25 of file sv_monsters.qh.

Referenced by Monster_Move(), and spawnmonster().

◆ autocvar_g_monsters_think_delay

float autocvar_g_monsters_think_delay

Definition at line 8 of file sv_monsters.qh.

Referenced by Monster_Spawn().

◆ autocvar_g_monsters_typefrag

bool autocvar_g_monsters_typefrag

Definition at line 18 of file sv_monsters.qh.

Referenced by Monster_ValidTarget().

◆ candrop

bool candrop

Definition at line 45 of file sv_monsters.qh.

Referenced by Monster_Damage(), Monster_Dead(), monster_dropitem(), and Monster_Spawn().

◆ g_monster_targets

◆ g_monsters

◆ GetMonsterSoundSampleField_notFound

ALLMONSTERSOUNDS float GetMonsterSoundSampleField_notFound

Definition at line 142 of file sv_monsters.qh.

Referenced by Monster_Sound_SampleField(), and Monster_Sounds_Load().

◆ last_enemycheck

float last_enemycheck

Definition at line 50 of file sv_monsters.qh.

Referenced by Monster_Think().

◆ last_trace

float last_trace

Definition at line 49 of file sv_monsters.qh.

Referenced by Monster_Move(), and Monster_Move_Target().

◆ mdl_dead

string mdl_dead

Definition at line 57 of file sv_monsters.qh.

Referenced by Monster_Dead(), and Monster_Spawn().

◆ monster_attack

◆ MONSTER_ATTACK_MELEE

const int MONSTER_ATTACK_MELEE = 6

Definition at line 70 of file sv_monsters.qh.

Referenced by Monster_Attack_Check(), Monster_Attack_Melee(), and Monster_Move().

◆ MONSTER_ATTACK_RANGED

const int MONSTER_ATTACK_RANGED = 7

Definition at line 71 of file sv_monsters.qh.

Referenced by Monster_Attack_Check(), Monster_Attack_Leap(), and Monster_Move().

◆ monster_face

vector monster_face

Definition at line 53 of file sv_monsters.qh.

Referenced by Monster_Enemy_Check(), Monster_Move(), and Monster_Spawn().

◆ monster_follow

entity monster_follow

◆ monster_lifetime

float monster_lifetime

Definition at line 42 of file sv_monsters.qh.

Referenced by Monster_Dead(), Monster_Dead_Fade(), Monster_Dead_Think(), and Monster_Think().

◆ MONSTER_MOVE_ENEMY

const int MONSTER_MOVE_ENEMY = 5

Definition at line 69 of file sv_monsters.qh.

Referenced by Monster_Move_Target().

◆ MONSTER_MOVE_FOLLOW

const int MONSTER_MOVE_FOLLOW = 1

Definition at line 65 of file sv_monsters.qh.

Referenced by Monster_Move_Target().

◆ MONSTER_MOVE_NOMOVE

const int MONSTER_MOVE_NOMOVE = 4

Definition at line 68 of file sv_monsters.qh.

Referenced by Monster_Move_Target().

◆ MONSTER_MOVE_SPAWNLOC

const int MONSTER_MOVE_SPAWNLOC = 3

Definition at line 67 of file sv_monsters.qh.

Referenced by Monster_Move_Target().

◆ MONSTER_MOVE_WANDER

const int MONSTER_MOVE_WANDER = 2

Definition at line 66 of file sv_monsters.qh.

Referenced by Monster_Move_Target(), and Monster_Spawn_Setup().

◆ monster_moveflags

int monster_moveflags

Definition at line 47 of file sv_monsters.qh.

Referenced by Monster_Move_Target(), Monster_Spawn_Setup(), and spawner_use().

◆ monster_movestate

int monster_movestate

Definition at line 38 of file sv_monsters.qh.

Referenced by Monster_Move_Target().

◆ monster_moveto

vector monster_moveto

◆ monster_skill

int monster_skill

Definition at line 96 of file sv_monsters.qh.

Referenced by monster_setupcolors(), Monster_Spawn(), and spawner_use().

◆ MONSTER_SKILL_EASY

const int MONSTER_SKILL_EASY = 1

Definition at line 74 of file sv_monsters.qh.

Referenced by monster_setupcolors(), and Monster_Spawn().

◆ MONSTER_SKILL_HARD

const int MONSTER_SKILL_HARD = 5

Definition at line 76 of file sv_monsters.qh.

Referenced by monster_setupcolors(), and Monster_Spawn().

◆ MONSTER_SKILL_INSANE

const int MONSTER_SKILL_INSANE = 7

Definition at line 77 of file sv_monsters.qh.

Referenced by monster_setupcolors().

◆ MONSTER_SKILL_MEDIUM

const int MONSTER_SKILL_MEDIUM = 3

Definition at line 75 of file sv_monsters.qh.

Referenced by monster_setupcolors(), and Monster_Spawn().

◆ MONSTER_SKILL_NIGHTMARE

const int MONSTER_SKILL_NIGHTMARE = 10

Definition at line 78 of file sv_monsters.qh.

Referenced by monster_setupcolors().

◆ MONSTERFLAG_APPEAR

const int MONSTERFLAG_APPEAR = 2

Definition at line 85 of file sv_monsters.qh.

Referenced by Monster_Appear_Check().

◆ MONSTERFLAG_FLY_VERTICAL

const int MONSTERFLAG_FLY_VERTICAL = 8

Definition at line 87 of file sv_monsters.qh.

Referenced by Monster_Move(), and Monster_Move_Target().

◆ MONSTERFLAG_INFRONT

const int MONSTERFLAG_INFRONT = 32

Definition at line 88 of file sv_monsters.qh.

Referenced by Monster_ValidTarget().

◆ MONSTERFLAG_INVINCIBLE

const int MONSTERFLAG_INVINCIBLE = 128

Definition at line 90 of file sv_monsters.qh.

Referenced by Monster_Damage(), Monster_Frozen_Think(), and Monster_Spawn_Setup().

◆ MONSTERFLAG_MINIBOSS

const int MONSTERFLAG_MINIBOSS = 64

Definition at line 89 of file sv_monsters.qh.

Referenced by invasion_SpawnChosenMonster(), and Monster_Miniboss_Check().

◆ MONSTERFLAG_NORESPAWN

const int MONSTERFLAG_NORESPAWN = 4

Definition at line 86 of file sv_monsters.qh.

Referenced by Monster_Respawn_Check(), and spawnmonster().

◆ MONSTERFLAG_RESPAWNED

const int MONSTERFLAG_RESPAWNED = 32768

◆ MONSTERFLAG_SPAWNED

const int MONSTERFLAG_SPAWNED = 16384

Definition at line 91 of file sv_monsters.qh.

Referenced by Monster_Dead(), Monster_Spawn(), MUTATOR_HOOKFUNCTION(), and spawnmonster().

◆ monsters_killed

int monsters_killed

◆ monsters_total

int monsters_total

◆ MONSTERSKILL_NOTEASY

const int MONSTERSKILL_NOTEASY = 256

Definition at line 80 of file sv_monsters.qh.

Referenced by Monster_Spawn().

◆ MONSTERSKILL_NOTHARD

const int MONSTERSKILL_NOTHARD = 1024

Definition at line 82 of file sv_monsters.qh.

Referenced by Monster_Spawn().

◆ MONSTERSKILL_NOTMEDIUM

const int MONSTERSKILL_NOTMEDIUM = 512

Definition at line 81 of file sv_monsters.qh.

Referenced by Monster_Spawn().

◆ msound_delay

float msound_delay

Definition at line 127 of file sv_monsters.qh.

Referenced by Monster_Sound().

◆ oldskin

int oldskin

Definition at line 56 of file sv_monsters.qh.

Referenced by FixPlayermodel().

◆ oldtarget2

string oldtarget2

Definition at line 48 of file sv_monsters.qh.

Referenced by Monster_Damage(), and Monster_Spawn().

◆ spawn_time

float spawn_time

Definition at line 44 of file sv_monsters.qh.

Referenced by Monster_Move(), Monster_Move_2D(), and Monster_Spawn().

◆ speed2

float speed2

Definition at line 54 of file sv_monsters.qh.

Referenced by Monster_Think().

◆ stopspeed

float stopspeed

Definition at line 55 of file sv_monsters.qh.

Referenced by Monster_Think().

◆ totalspawned

int totalspawned

number of monsters spawned with mobspawn command

Definition at line 124 of file sv_monsters.qh.

Referenced by CommonCommand_editmob(), Monster_Dead(), Monster_Dead_Damage(), and Monster_Dead_Fade().

◆ wander_delay

float wander_delay

Definition at line 40 of file sv_monsters.qh.

Referenced by Monster_Move_Target(), and Monster_Spawn_Setup().

◆ wander_distance

float wander_distance

Definition at line 41 of file sv_monsters.qh.

Referenced by Monster_Move_Target(), and Monster_Spawn_Setup().