Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
mage.qc
Go to the documentation of this file.
1#include "mage.qh"
2
3#ifdef SVQC
5string autocvar_g_monster_mage_loot = "health_big";
38
39SOUND(MageSpike_FIRE, W_Sound("electro_fire"));
40SOUND(MageSpike_IMPACT, W_Sound("grenade_impact"));
41SOUND(MageSpike_PUSH, W_Sound("tagexp1"));
43void M_Mage_Attack_Push(entity this);
44METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weaponentity, int fire))
45{
46 TC(MageSpike, thiswep);
47 if (fire & 1)
48 if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2)) {
49 if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range;
50 actor.enemy = Monster_FindTarget(actor);
51 monster_makevectors(actor, actor.enemy);
52 W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_MageSpike_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_MAGE.m_id);
53 if (!IS_PLAYER(actor)) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
55 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
56 }
57 if (fire & 2)
58 if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, true, 0.5)) {
59 M_Mage_Attack_Push(actor);
60 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, 0, w_ready);
61 }
62}
63
64void M_Mage_Attack_Teleport(entity this, entity targ);
65
68 METHOD(OffhandMageTeleport, offhand_think, void(OffhandMageTeleport this, entity player, bool key_pressed))
69 {
71 if (key_pressed && !player.OffhandMageTeleport_key_pressed)
72 M_Mage_Attack_Teleport(player, player.enemy);
73 player.OffhandMageTeleport_key_pressed = key_pressed;
74 }
78
79void M_Mage_Defend_Heal(entity this);
81
82.entity mage_spike;
84
86{
87 // TODO: mutator hook to choose valid healing targets?
88 if(!targ)
89 return false;
90 if(GetResource(targ, RES_HEALTH) <= 0)
91 return false;
92 if(DIFF_TEAM(targ, this) && targ != this.monster_follow)
93 return false;
94 if(STAT(FROZEN, targ))
95 return false;
96 if(!IS_PLAYER(targ))
97 return (IS_MONSTER(targ) && GetResource(targ, RES_HEALTH) < targ.max_health);
98 if(StatusEffects_active(STATUSEFFECT_Shield, targ))
99 return false;
100
101 switch(this.skin)
102 {
103 case 0: return (GetResource(targ, RES_HEALTH) < autocvar_g_balance_health_regenstable);
104 case 1:
105 {
106 return ((GetResource(targ, RES_CELLS) && GetResource(targ, RES_CELLS) < autocvar_g_pickup_cells_max)
107 || (GetResource(targ, RES_ROCKETS) && GetResource(targ, RES_ROCKETS) < autocvar_g_pickup_rockets_max)
108 || (GetResource(targ, RES_BULLETS) && GetResource(targ, RES_BULLETS) < autocvar_g_pickup_nails_max)
109 || (GetResource(targ, RES_SHELLS) && GetResource(targ, RES_SHELLS) < autocvar_g_pickup_shells_max)
110 );
111 }
113 }
114
115 return false;
116}
117
118void M_Mage_Attack_Spike_Explode(entity this, entity directhitentity)
119{
120 this.event_damage = func_null;
121
122 sound(this, CH_SHOTS, SND_MageSpike_IMPACT, VOL_BASE, ATTEN_NORM);
123
124 this.realowner.mage_spike = NULL;
125
126 Send_Effect(EFFECT_EXPLOSION_SMALL, this.origin, '0 0 0', 1);
128 NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, DMG_NOWEP, directhitentity);
129
130 delete(this);
131}
132
139
140.float wait;
141
142// copied from W_Seeker_Think
144{
145 if (time > this.ltime || (this.enemy && GetResource(this.enemy, RES_HEALTH) <= 0) || !this.owner || GetResource(this.owner, RES_HEALTH) <= 0) {
148 }
149
150 float spd = vlen(this.velocity);
151 spd = bound(
155 );
156
157 if (this.enemy != NULL)
158 if (this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
159 this.enemy = NULL;
160
161 if (this.enemy != NULL)
162 {
163 entity e = this.enemy;
164 vector eorg = 0.5 * (e.absmin + e.absmax);
165 float turnrate = (autocvar_g_monster_mage_attack_spike_turnrate); // how fast to turn
166 vector desireddir = normalize(eorg - this.origin);
167 vector olddir = normalize(this.velocity); // get my current direction
168
169 // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
171 {
172 // Is it a better idea (shorter distance) to trace to the target itself?
173 if ( vlen2(this.origin + olddir * this.wait) < vlen2(eorg - this.origin))
174 traceline(this.origin, this.origin + olddir * this.wait, false, this);
175 else
176 traceline(this.origin, eorg, false, this);
177
178 // Setup adaptive tracelength
180
181 // Calc how important it is that we turn and add this to the desierd (enemy) dir.
182 desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
183 }
184
185 vector newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
186 this.velocity = newdir * spd; // make me fly in the new direction at my flight speed
187 }
188
190
191 //this.angles = vectoangles(this.velocity); // turn model in the new flight direction
192 this.nextthink = time;// + 0.05; // csqc projectiles
194}
195
197{
198 makevectors(this.angles);
199
200 entity missile = new(M_Mage_Attack_Spike);
201 missile.owner = missile.realowner = this;
203 missile.ltime = time + 7;
204 missile.nextthink = time;
205 missile.solid = SOLID_BBOX;
207 missile.flags = FL_PROJECTILE;
208 IL_PUSH(g_projectiles, missile);
209 IL_PUSH(g_bot_dodge, missile);
210 setorigin(missile, this.origin + v_forward * 14 + '0 0 30' + v_right * -14);
211 setsize(missile, '0 0 0', '0 0 0');
212 missile.velocity = dir * 400;
213 missile.avelocity = '300 300 300';
214 missile.enemy = this.enemy;
216
217 this.mage_spike = missile;
218
219 CSQCProjectile(missile, true, PROJECTILE_MAGE_SPIKE, true);
220}
221
223{
224 bool washealed = false;
225
227 {
228 washealed = true;
229 entity fx = EFFECT_Null;
230 if(IS_PLAYER(it))
231 {
232 switch(this.skin)
233 {
234 case 0:
235 {
237 fx = EFFECT_HEALING;
238 break;
239 }
240 case 1:
241 {
242 if(GetResource(it, RES_CELLS)) GiveResourceWithLimit(it, RES_CELLS, 1, autocvar_g_pickup_cells_max);
243 if(GetResource(it, RES_ROCKETS)) GiveResourceWithLimit(it, RES_ROCKETS, 1, autocvar_g_pickup_rockets_max);
244 if(GetResource(it, RES_SHELLS)) GiveResourceWithLimit(it, RES_SHELLS, 2, autocvar_g_pickup_shells_max);
245 if(GetResource(it, RES_BULLETS)) GiveResourceWithLimit(it, RES_BULLETS, 5, autocvar_g_pickup_nails_max);
246 // TODO: fuel?
247 fx = EFFECT_AMMO_REGEN;
248 break;
249 }
250 case 2:
252 {
254 fx = EFFECT_ARMOR_REPAIR;
255 }
256 break;
257 }
258
259 Send_Effect(fx, it.origin, '0 0 0', 1);
260 }
261 else
262 {
263 Send_Effect(EFFECT_HEALING, it.origin, '0 0 0', 1);
265 if(!(it.spawnflags & MONSTERFLAG_INVINCIBLE) && it.sprite)
266 WaypointSprite_UpdateHealth(it.sprite, GetResource(it, RES_HEALTH));
267 }
268 });
269
270 if(washealed)
271 {
272 setanim(this, this.anim_melee, true, true, true);
275 this.anim_finished = time + 1.5;
276 }
277}
278
280{
281 sound(this, CH_SHOTS, SND_MageSpike_PUSH, 1, ATTEN_NORM);
283 NULL, NULL, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, DMG_NOWEP, this.enemy);
284 Send_Effect(EFFECT_TE_EXPLOSION, this.origin, '0 0 0', 1);
285
286 setanim(this, this.anim_duckjump, true, true, true);
288 this.anim_finished = time + 1;
289 this.state = MONSTER_ATTACK_MELEE; // prevent moving while firing spike
290}
291
293{
294 if(!targ) return;
295 if(vdist(targ.origin - this.origin, >, autocvar_g_monster_mage_attack_teleport_random_range)) return;
296
298 {
299 vector oldpos = this.origin;
301 if(MoveToRandomLocationWithinBounds(this, this.absmin - extrasize, this.absmax + extrasize,
303 Q3SURFACEFLAG_SKY, 10, 64, 256, true))
304 {
305 vector a = vectoangles(targ.origin - this.origin);
306 this.angles = '0 1 0' * a.y;
307 this.fixangle = true;
308 Send_Effect(EFFECT_SPAWN, oldpos, '0 0 0', 1);
309 Send_Effect(EFFECT_SPAWN, this.origin, '0 0 0', 1);
311 return;
312 }
313 }
314
315 if(!IS_ONGROUND(targ)) return;
316
317 makevectors(targ.angles);
318 tracebox(CENTER_OR_VIEWOFS(targ), this.mins, this.maxs, CENTER_OR_VIEWOFS(targ) + ((v_forward * -1) * 200), MOVE_NOMONSTERS, this);
319
320 if(trace_fraction < 1)
321 return;
322
323 vector newpos = trace_endpos;
324
325 Send_Effect(EFFECT_SPAWN, this.origin, '0 0 0', 1);
326 Send_Effect(EFFECT_SPAWN, newpos, '0 0 0', 1);
327
328 setorigin(this, newpos);
329
330 vector a = vectoangles(targ.origin - this.origin);
331 a.x = -a.x;
332 this.angles_x = a.x;
333 this.angles_y = a.y;
334 this.fixangle = true;
335 this.velocity *= 0.5;
336
338}
339
341{
342 StatusEffects_apply(STATUSEFFECT_Shield, this, time + autocvar_g_monster_mage_shield_time, 0);
345 setanim(this, this.anim_shoot, true, true, true);
346 this.attack_finished_single[0] = time + 1; // give just a short cooldown on attacking
347 this.anim_finished = time + 1;
348}
349
350bool M_Mage_Attack(int attack_type, entity actor, entity targ, .entity weaponentity)
351{
352 switch(attack_type)
353 {
355 {
357 {
358 Weapon wep = WEP_MAGE_SPIKE;
359
360 wep.wr_think(wep, actor, weaponentity, 2);
361 return true;
362 }
363
364 return false;
365 }
367 {
369 {
371 actor.OffhandMageTeleport_key_pressed = 0;
372 off.offhand_think(off, actor, 1);
373 return true;
374 }
375 else if(!actor.mage_spike && random() <= autocvar_g_monster_mage_attack_spike_chance)
376 {
377 setanim(actor, actor.anim_shoot, true, true, true);
378 actor.attack_finished_single[0] = time + (autocvar_g_monster_mage_attack_spike_delay);
379 actor.anim_finished = time + 1;
380 actor.state = MONSTER_ATTACK_MELEE; // prevent moving while firing spike
381 Weapon wep = WEP_MAGE_SPIKE;
382 wep.wr_think(wep, actor, weaponentity, 1);
383 return true;
384 }
385
386 return false;
387 }
388 }
389
390 return false;
391}
392
393spawnfunc(monster_mage) { Monster_Spawn(this, true, MON_MAGE); }
394
395#endif // SVQC
396
397#ifdef SVQC
398METHOD(Mage, mr_think, bool(Mage thismon, entity actor))
399{
400 TC(Mage, thismon);
401 bool need_help = false;
402
403 FOREACH_CLIENT(IS_PLAYER(it) && it != actor,
404 {
405 if(vdist(it.origin - actor.origin, <=, autocvar_g_monster_mage_heal_range))
406 if(M_Mage_Defend_Heal_Check(actor, it))
407 {
408 need_help = true;
409 break;
410 }
411 });
412
413 if(!need_help)
414 {
415 IL_EACH(g_monsters, it != actor,
416 {
417 if(vdist(it.origin - actor.origin, <=, autocvar_g_monster_mage_heal_range))
418 if(M_Mage_Defend_Heal_Check(actor, it))
419 {
420 need_help = true;
421 break;
422 }
423 });
424 }
425
426 if(GetResource(actor, RES_HEALTH) < (autocvar_g_monster_mage_heal_minhealth) || need_help)
427 if(time >= actor.attack_finished_single[0])
428 if(random() < 0.5)
429 M_Mage_Defend_Heal(actor);
430
431 if(actor.enemy && time >= actor.mage_shield_delay && random() < 0.5)
432 if(GetResource(actor, RES_HEALTH) < actor.max_health && !StatusEffects_active(STATUSEFFECT_Shield, actor))
434
435 return true;
436}
437
438METHOD(Mage, mr_pain, float(Mage this, entity actor, float damage_take, entity attacker, float deathtype))
439{
440 TC(Mage, this);
441 return damage_take;
442}
443
444METHOD(Mage, mr_death, bool(Mage this, entity actor))
445{
446 TC(Mage, this);
447 setanim(actor, ((random() > 0.5) ? actor.anim_die2 : actor.anim_die1), false, true, true);
448 return true;
449}
450
451#endif
452#ifdef GAMEQC
453METHOD(Mage, mr_anim, bool(Mage this, entity actor))
454{
455 TC(Mage, this);
456 vector none = '0 0 0';
457 actor.anim_idle = animfixfps(actor, '0 1 1', none);
458 actor.anim_walk = animfixfps(actor, '1 1 1', none);
459 actor.anim_run = animfixfps(actor, '1 1 1', none);
460 actor.anim_shoot = animfixfps(actor, '2 1 5', none); // analyze models and set framerate
461 actor.anim_duckjump = animfixfps(actor, '4 1 5', none); // analyze models and set framerate
462 actor.anim_melee = animfixfps(actor, '5 1 5', none); // analyze models and set framerate
463 //actor.anim_fire1 = animfixfps(actor, '3 1 5', none); // analyze models and set framerate
464 //actor.anim_fire2 = animfixfps(actor, '4 1 5', none); // analyze models and set framerate
465 //actor.anim_fire3 = animfixfps(actor, '5 1 5', none); // analyze models and set framerate
466 actor.anim_pain1 = animfixfps(actor, '6 1 2', none); // 0.5 seconds
467 actor.anim_pain2 = animfixfps(actor, '7 1 2', none); // 0.5 seconds
468 //actor.anim_pain3 = animfixfps(actor, '8 1 2', none); // 0.5 seconds
469 actor.anim_die1 = animfixfps(actor, '9 1 0.5', none); // 2 seconds
470 actor.anim_die2 = animfixfps(actor, '10 1 0.5', none); // 2 seconds
471 //actor.anim_dead1 = animfixfps(actor, '11 1 0.5', none); // 2 seconds
472 //actor.anim_dead2 = animfixfps(actor, '12 1 0.5', none); // 2 seconds
473 return true;
474}
475#endif
476#ifdef SVQC
477.float speed;
478METHOD(Mage, mr_setup, bool(Mage this, entity actor))
479{
480 TC(Mage, this);
481 if(!GetResource(this, RES_HEALTH)) SetResourceExplicit(actor, RES_HEALTH, autocvar_g_monster_mage_health);
482 if(!actor.speed) { actor.speed = (autocvar_g_monster_mage_speed_walk); }
483 if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_mage_speed_run); }
484 if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_mage_speed_stop); }
485 if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_mage_damageforcescale); }
486
487 actor.monster_loot = autocvar_g_monster_mage_loot;
488 actor.monster_attackfunc = M_Mage_Attack;
489
490 return true;
491}
492#endif
493#ifdef MENUQC
494METHOD(Mage, describe, string(Mage this))
495{
496 TC(Mage, this);
498 PAR(_("Wielding nanotechnology as if it were sorcery, the Mage employs a range of unique abilities of its own creation in combat."));
499 PAR(_("As a primary attack, the Mage throws a homing electric sphere towards the player. "
500 "This sphere will track its target at high speed, exploding on impact or if it does not reach its target in time."));
501 PAR(_("When threatened, the Mage may deploy an energy shield to protect itself from damage briefly. "
502 "Enemies approaching too closely during this time may be pushed away with explosive force!"));
503 PAR(_("Defensively the Mage is capable of healing itself and nearby allies, with some variants also providing armor and ammunition."));
504 PAR(_("The Mage may sometimes appear to blink out of existence as it teleports behind its target for a sneak attack."));
505 return PAGE_TEXT;
506}
507#endif
#define setanim(...)
Definition anim.qh:45
IntrusiveList g_bot_dodge
Definition api.qh:150
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
Definition mage.qh:9
bool OffhandMageTeleport_key_pressed
Definition mage.qc:67
virtual void offhand_think()
Definition mage.qc:68
virtual void offhand_think()
Definition weapon.qh:195
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:44
virtual void wr_think()
(SERVER) logic to run every frame
Definition weapon.qh:90
float wait
Definition items.qc:17
entity owner
Definition main.qh:87
int autocvar_g_pickup_rockets_max
Definition ammo.qh:116
int autocvar_g_pickup_shells_max
Definition ammo.qh:44
int autocvar_g_pickup_cells_max
Definition ammo.qh:152
int autocvar_g_pickup_nails_max
Definition ammo.qh:80
#define IS_DEAD(s)
Definition player.qh:245
#define IS_PLAYER(s)
Definition player.qh:243
const int FL_PROJECTILE
Definition constants.qh:85
float Q3SURFACEFLAG_SKY
float DPCONTENTS_SKY
const float MOVE_NOMONSTERS
float DPCONTENTS_DONOTENTER
float DPCONTENTS_SOLID
float frametime
float DPCONTENTS_CORPSE
vector mins
vector velocity
float DPCONTENTS_BODY
const float SOLID_BBOX
float DPCONTENTS_PLAYERCLIP
float DPCONTENTS_SLIME
float skin
float time
vector v_right
vector trace_endpos
vector maxs
float nextthink
vector absmax
vector v_forward
vector origin
float trace_fraction
float DPCONTENTS_LAVA
vector absmin
vector trace_plane_normal
void UpdateCSQCProjectile(entity e)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
bool Heal(entity targ, entity inflictor, float amount, float limit)
Definition damage.qc:987
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
Definition damage.qc:981
#define DMG_NOWEP
Definition damage.qh:104
int state
const int HITTYPE_SPLASH
Definition all.qh:30
float speed
Definition dynlight.qc:9
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:124
RES_ARMOR
Definition ent_cs.qc:130
ent angles
Definition ent_cs.qc:121
angles_y
Definition ent_cs.qc:119
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
#define FOREACH_ENTITY_RADIUS(org, dist, cond, body)
Definition iter.qh:160
#define TC(T, sym)
Definition _all.inc:82
#define STAT(...)
Definition stats.qh:82
void M_Mage_Defend_Shield(entity this)
Definition mage.qc:340
void M_Mage_Defend_Heal(entity this)
Definition mage.qc:222
float autocvar_g_monster_mage_attack_push_force
Definition mage.qc:23
float autocvar_g_monster_mage_shield_time
Definition mage.qc:32
float autocvar_g_monster_mage_attack_spike_chance
Definition mage.qc:12
float autocvar_g_monster_mage_attack_push_radius
Definition mage.qc:21
float autocvar_g_monster_mage_heal_delay
Definition mage.qc:31
float autocvar_g_monster_mage_attack_spike_delay
Definition mage.qc:9
float autocvar_g_monster_mage_attack_teleport_random
Definition mage.qc:26
string autocvar_g_monster_mage_loot
Definition mage.qc:5
float autocvar_g_monster_mage_attack_spike_smart_mindist
Definition mage.qc:18
float autocvar_g_monster_mage_speed_run
Definition mage.qc:36
float autocvar_g_monster_mage_speed_stop
Definition mage.qc:35
float autocvar_g_monster_mage_attack_spike_radius
Definition mage.qc:8
void M_Mage_Attack_Spike_Think(entity this)
Definition mage.qc:143
float autocvar_g_monster_mage_attack_spike_smart_trace_min
Definition mage.qc:16
void M_Mage_Attack_Spike_Explode(entity this, entity directhitentity)
Definition mage.qc:118
float autocvar_g_monster_mage_heal_minhealth
Definition mage.qc:29
float autocvar_g_monster_mage_attack_spike_smart
Definition mage.qc:15
float autocvar_g_monster_mage_attack_spike_accel
Definition mage.qc:10
float autocvar_g_monster_mage_attack_spike_smart_trace_max
Definition mage.qc:17
float autocvar_g_monster_mage_health
Definition mage.qc:4
float autocvar_g_monster_mage_attack_spike_decel
Definition mage.qc:11
float autocvar_g_monster_mage_heal_range
Definition mage.qc:30
float autocvar_g_monster_mage_attack_spike_turnrate
Definition mage.qc:13
float autocvar_g_monster_mage_shield_delay
Definition mage.qc:33
float autocvar_g_monster_mage_attack_spike_damage
Definition mage.qc:7
void M_Mage_Attack_Teleport(entity this, entity targ)
Definition mage.qc:292
float autocvar_g_monster_mage_speed_walk
Definition mage.qc:37
float autocvar_g_monster_mage_attack_spike_speed_max
Definition mage.qc:14
void M_Mage_Attack_Push(entity this)
Definition mage.qc:279
float autocvar_g_monster_mage_attack_push_delay
Definition mage.qc:22
float autocvar_g_monster_mage_attack_push_damage
Definition mage.qc:20
float autocvar_g_monster_mage_shield_blockpercent
Definition mage.qc:34
OffhandMageTeleport OFFHAND_MAGE_TELEPORT
Definition mage.qc:76
bool M_Mage_Attack(int attack_type, entity actor, entity targ,.entity weaponentity)
Definition mage.qc:350
entity mage_spike
Definition mage.qc:82
bool M_Mage_Defend_Heal_Check(entity this, entity targ)
Definition mage.qc:85
void M_Mage_Attack_Spike(entity this, vector dir)
Definition mage.qc:196
float autocvar_g_monster_mage_attack_teleport_random_range
Definition mage.qc:27
float autocvar_g_monster_mage_heal_allies
Definition mage.qc:28
float autocvar_g_monster_mage_attack_teleport_delay
Definition mage.qc:25
float autocvar_g_monster_mage_damageforcescale
Definition mage.qc:6
void M_Mage_Attack_Spike_Touch(entity this, entity toucher)
Definition mage.qc:133
float mage_shield_delay
Definition mage.qc:83
float autocvar_g_monster_mage_attack_teleport_chance
Definition mage.qc:24
float autocvar_g_monster_mage_attack_push_chance
Definition mage.qc:19
float bound(float min, float value, float max)
float random(void)
float vlen(vector v)
vector vectoangles(vector v)
vector normalize(vector v)
vector animfixfps(entity e, vector a, vector b)
Definition util.qc:1808
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_FLYMISSILE
Definition movetypes.qh:138
#define IS_ONGROUND(s)
Definition movetypes.qh:16
float ltime
Definition net.qc:10
var void func_null()
#define NEW(cname,...)
Definition oo.qh:117
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
float fixangle
Definition progsdefs.qc:160
const int PROJECTILE_MAGE_SPIKE
const int RES_LIMIT_NONE
Definition resources.qh:60
#define setthink(e, f)
vector
Definition self.qh:92
entity entity toucher
Definition self.qh:72
#define settouch(e, f)
Definition self.qh:73
int dir
Definition impulse.qc:89
int projectiledeathtype
Definition common.qh:21
#define PROJECTILE_TOUCH(e, t)
Definition common.qh:28
IntrusiveList g_projectiles
Definition common.qh:58
const float VOL_BASE
Definition sound.qh:36
const int CH_SHOTS
Definition sound.qh:14
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
const int CH_WEAPON_B
Definition sound.qh:8
string W_Sound(string w_snd)
Definition all.qc:225
#define SOUND(name, path)
Definition all.qh:30
#define spawnfunc(id)
Definition spawnfunc.qh:96
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32
bool StatusEffects_active(StatusEffect this, entity actor)
void StatusEffects_apply(StatusEffect this, entity actor, float eff_time, int eff_flags)
#define PAGE_TEXT
Definition string.qh:643
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:649
#define PAGE_TEXT_INIT()
Definition string.qh:642
const int DAMAGE_AIM
Definition subs.qh:81
entity enemy
Definition sv_ctf.qh:153
bool Monster_Spawn(entity this, bool check_appear, Monster mon)
entity Monster_FindTarget(entity this)
void monster_makevectors(entity this, entity targ)
float anim_finished
entity monster_follow
float autocvar_g_monsters_target_range
const int MONSTER_ATTACK_MELEE
const int MONSTERFLAG_INVINCIBLE
const int MONSTER_ATTACK_RANGED
IntrusiveList g_monsters
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
float autocvar_g_balance_health_regenstable
int autocvar_g_balance_armor_regenstable
#define DIFF_TEAM(a, b)
Definition teams.qh:242
entity realowner
vector w_shotdir
Definition tracing.qh:20
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
Definition tracing.qh:32
#define IS_MONSTER(v)
Definition utils.qh:21
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:50
#define CENTER_OR_VIEWOFS(ent)
Definition utils.qh:29
#define vlen2(v)
Definition vector.qh:4
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
void WaypointSprite_UpdateHealth(entity e, float f)
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
float attack_finished_single[MAX_WEAPONSLOTS]
bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance, bool frompos)
Definition world.qc:1101