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"));
42
44void M_Mage_Attack_Push(entity this);
45METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weaponentity, int fire))
46{
47 TC(MageSpike, thiswep);
48 if (fire & 1)
49 if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2))
50 {
51 if (!actor.target_range)
52 actor.target_range = autocvar_g_monsters_target_range;
53 actor.enemy = Monster_FindTarget(actor);
54 monster_makevectors(actor, actor.enemy);
55 W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_MageSpike_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_MAGE.m_id);
56 if (!IS_PLAYER(actor))
57 w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
59 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
60 }
61 if (fire & 2)
62 if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, true, 0.5))
63 {
64 M_Mage_Attack_Push(actor);
65 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, 0, w_ready);
66 }
67}
68
69void M_Mage_Attack_Teleport(entity this, entity targ);
70
73 METHOD(OffhandMageTeleport, offhand_think, void(OffhandMageTeleport this, entity player, bool key_pressed))
74 {
76 if (key_pressed && !player.OffhandMageTeleport_key_pressed)
77 M_Mage_Attack_Teleport(player, player.enemy);
78 player.OffhandMageTeleport_key_pressed = key_pressed;
79 }
81
87
88void M_Mage_Defend_Heal(entity this);
90
91.entity mage_spike;
93
95{
96 // TODO: mutator hook to choose valid healing targets?
97 if (!targ)
98 return false;
99 if (DIFF_TEAM(targ, this) && targ != this.monster_follow)
100 return false;
101 if (GetResource(targ, RES_HEALTH) <= 0 || STAT(FROZEN, targ))
102 return false;
103 if (!IS_PLAYER(targ))
104 return IS_MONSTER(targ) && GetResource(targ, RES_HEALTH) < targ.max_health;
105 if (StatusEffects_active(STATUSEFFECT_Shield, targ))
106 return false;
107
108 switch (this.skin)
109 {
110 case 0:
111 return GetResource(targ, RES_HEALTH) < autocvar_g_balance_health_regenstable;
112 case 1:
113 return ((GetResource(targ, RES_CELLS) && GetResource(targ, RES_CELLS) < autocvar_g_pickup_cells_max)
114 || (GetResource(targ, RES_ROCKETS) && GetResource(targ, RES_ROCKETS) < autocvar_g_pickup_rockets_max)
115 || (GetResource(targ, RES_BULLETS) && GetResource(targ, RES_BULLETS) < autocvar_g_pickup_nails_max)
116 || (GetResource(targ, RES_SHELLS) && GetResource(targ, RES_SHELLS) < autocvar_g_pickup_shells_max)
117 );
118 case 2:
120 }
121
122 return false;
123}
124
125void M_Mage_Attack_Spike_Explode(entity this, entity directhitentity)
126{
127 this.event_damage = func_null;
128
129 sound(this, CH_SHOTS, SND_MageSpike_IMPACT, VOL_BASE, ATTEN_NORM);
130
131 this.realowner.mage_spike = NULL;
132
133 Send_Effect(EFFECT_EXPLOSION_SMALL, this.origin, '0 0 0', 1);
134 RadiusDamage(this, this.realowner,
138 NULL,
139 NULL,
140 0,
141 DEATH_MONSTER_MAGE.m_id,
142 DMG_NOWEP,
143 directhitentity
144 );
145
146 delete(this);
147}
148
155
156.float wait;
157
158// copied from W_Seeker_Think
160{
161 if (time > this.ltime
162 || (this.enemy && GetResource(this.enemy, RES_HEALTH) <= 0)
163 || !this.owner || GetResource(this.owner, RES_HEALTH) <= 0)
164 {
167 }
168
169 float spd = vlen(this.velocity);
170 spd = bound(
174 );
175
176 if (this.enemy != NULL
177 && this.enemy.takedamage != DAMAGE_AIM || IS_DEAD(this.enemy))
178 this.enemy = NULL;
179
180 if (this.enemy != NULL)
181 {
182 entity e = this.enemy;
183 vector eorg = 0.5 * (e.absmin + e.absmax);
184 float turnrate = autocvar_g_monster_mage_attack_spike_turnrate; // how fast to turn
185 vector desireddir = normalize(eorg - this.origin);
186 vector olddir = normalize(this.velocity); // get my current direction
187
188 // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
190 {
191 // Is it a better idea (shorter distance) to trace to the target itself?
192 if (vlen2(this.origin + olddir * this.wait) < vlen2(eorg - this.origin))
193 traceline(this.origin, this.origin + olddir * this.wait, false, this);
194 else
195 traceline(this.origin, eorg, false, this);
196
197 // Setup adaptive tracelength
199
200 // Calc how important it is that we turn and add this to the desierd (enemy) dir.
201 desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
202 }
203
204 vector newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
205 this.velocity = newdir * spd; // make me fly in the new direction at my flight speed
206 }
207
209
210 //this.angles = vectoangles(this.velocity); // turn model in the new flight direction
211 this.nextthink = time;// + 0.05; // csqc projectiles
213}
214
216{
217 makevectors(this.angles);
218
219 entity missile = new(M_Mage_Attack_Spike);
220 missile.owner = missile.realowner = this;
222 missile.ltime = time + 7;
223 missile.nextthink = time;
224 missile.solid = SOLID_BBOX;
226 missile.flags = FL_PROJECTILE;
227 IL_PUSH(g_projectiles, missile);
228 IL_PUSH(g_bot_dodge, missile);
229 setorigin(missile, this.origin + v_forward * 14 + '0 0 30' + v_right * -14);
230 setsize(missile, '0 0 0', '0 0 0');
231 missile.velocity = dir * 400;
232 missile.avelocity = '300 300 300';
233 missile.enemy = this.enemy;
235
236 this.mage_spike = missile;
237
238 CSQCProjectile(missile, true, PROJECTILE_MAGE_SPIKE, true);
239}
240
242{
243 bool washealed = false;
244
246 {
247 washealed = true;
248 entity fx = EFFECT_Null;
249 if (IS_PLAYER(it))
250 {
251 switch (this.skin)
252 {
253 case 0:
255 fx = EFFECT_HEALING;
256 break;
257 case 1:
258 if (GetResource(it, RES_CELLS)) GiveResourceWithLimit(it, RES_CELLS, 1, autocvar_g_pickup_cells_max);
259 if (GetResource(it, RES_ROCKETS)) GiveResourceWithLimit(it, RES_ROCKETS, 1, autocvar_g_pickup_rockets_max);
260 if (GetResource(it, RES_SHELLS)) GiveResourceWithLimit(it, RES_SHELLS, 2, autocvar_g_pickup_shells_max);
261 if (GetResource(it, RES_BULLETS)) GiveResourceWithLimit(it, RES_BULLETS, 5, autocvar_g_pickup_nails_max);
262 // TODO: fuel?
263 fx = EFFECT_AMMO_REGEN;
264 break;
265 case 2:
267 {
269 fx = EFFECT_ARMOR_REPAIR;
270 }
271 break;
272 }
273
274 Send_Effect(fx, it.origin, vec2(it.velocity), 5);
275 }
276 else
277 {
278 Send_Effect(EFFECT_HEALING, it.origin, vec2(it.velocity), 5);
280 if (!(it.spawnflags & MONSTERFLAG_INVINCIBLE) && it.sprite)
281 WaypointSprite_UpdateHealth(it.sprite, GetResource(it, RES_HEALTH));
282 }
283 });
284
285 if (washealed)
286 {
287 setanim(this, this.anim_melee, true, true, true);
290 this.anim_finished = time + 1.5;
291 }
292}
293
295{
296 sound(this, CH_SHOTS, SND_MageSpike_PUSH, 1, ATTEN_NORM);
297 RadiusDamage(this, this,
301 NULL,
302 NULL,
304 DEATH_MONSTER_MAGE.m_id,
305 DMG_NOWEP,
306 this.enemy
307 );
308 Send_Effect(EFFECT_TE_EXPLOSION, this.origin, '0 0 0', 1);
309
310 setanim(this, this.anim_duckjump, true, true, true);
312 this.anim_finished = time + 1;
313 this.state = MONSTER_ATTACK_MELEE; // prevent moving while firing spike
314}
315
317{
318 if (!targ || vdist(targ.origin - this.origin, >, autocvar_g_monster_mage_attack_teleport_random_range))
319 return;
320
321 vector a;
323 {
324 vector oldpos = this.origin;
326 if (MoveToRandomLocationWithinBounds(this, this.absmin - extrasize, this.absmax + extrasize,
328 Q3SURFACEFLAG_SKY, 10, 64, 256, true))
329 {
330 a = vectoangles(targ.origin - this.origin);
331 this.angles = '0 1 0' * a.y;
332 this.fixangle = true;
333 Send_Effect(EFFECT_SPAWN, oldpos, '0 0 0', 1);
334 Send_Effect(EFFECT_SPAWN, this.origin, '0 0 0', 1);
336 return;
337 }
338 }
339
340 if (!IS_ONGROUND(targ))
341 return;
342
343 makevectors(targ.angles);
344 tracebox(CENTER_OR_VIEWOFS(targ), this.mins, this.maxs, CENTER_OR_VIEWOFS(targ) + (v_forward * -200), MOVE_NOMONSTERS, this);
345
346 if (trace_fraction < 1)
347 return;
348
349 vector newpos = trace_endpos;
350
351 Send_Effect(EFFECT_SPAWN, this.origin, '0 0 0', 1);
352 Send_Effect(EFFECT_SPAWN, newpos, '0 0 0', 1);
353
354 setorigin(this, newpos);
355
356 a = vectoangles(targ.origin - this.origin);
357 a.x = -a.x;
358 this.angles.x = a.x;
359 this.angles.y = a.y;
360 this.fixangle = true;
361 this.velocity *= 0.5;
362
364}
365
367{
368 StatusEffects_apply(STATUSEFFECT_Shield, this, time + autocvar_g_monster_mage_shield_time, 0);
371 setanim(this, this.anim_shoot, true, true, true);
372 this.attack_finished_single[0] = this.anim_finished = time + 1; // give just a short cooldown on attacking
373}
374
375bool M_Mage_Attack(int attack_type, entity actor, entity targ, .entity weaponentity)
376{
377 switch (attack_type)
378 {
380 {
382 {
383 Weapon wep = WEP_MAGE_SPIKE;
384
385 wep.wr_think(wep, actor, weaponentity, 2);
386 return true;
387 }
388 return false;
389 }
391 {
393 {
395 actor.OffhandMageTeleport_key_pressed = 0;
396 off.offhand_think(off, actor, 1);
397 return true;
398 }
399 else if (!actor.mage_spike && random() <= autocvar_g_monster_mage_attack_spike_chance)
400 {
401 setanim(actor, actor.anim_shoot, true, true, true);
402 actor.attack_finished_single[0] = time + autocvar_g_monster_mage_attack_spike_delay;
403 actor.anim_finished = time + 1;
404 actor.state = MONSTER_ATTACK_MELEE; // prevent moving while firing spike
405 Weapon wep = WEP_MAGE_SPIKE;
406 wep.wr_think(wep, actor, weaponentity, 1);
407 return true;
408 }
409 return false;
410 }
411 }
412
413 return false;
414}
415
416spawnfunc(monster_mage)
417{
418 Monster_Spawn(this, true, MON_MAGE);
419}
420
421METHOD(Mage, mr_think, bool(Mage thismon, entity actor))
422{
423 TC(Mage, thismon);
424 bool need_help = false;
425
426 FOREACH_CLIENT(IS_PLAYER(it) && it != actor,
427 {
428 if (vdist(it.origin - actor.origin, <=, autocvar_g_monster_mage_heal_range)
429 && M_Mage_Defend_Heal_Check(actor, it))
430 {
431 need_help = true;
432 break;
433 }
434 });
435
436 if (!need_help)
437 IL_EACH(g_monsters, it != actor,
438 {
439 if (vdist(it.origin - actor.origin, <=, autocvar_g_monster_mage_heal_range)
440 && M_Mage_Defend_Heal_Check(actor, it))
441 {
442 need_help = true;
443 break;
444 }
445 });
446
447 if (random() < 0.5
448 && time >= actor.attack_finished_single[0]
449 && (GetResource(actor, RES_HEALTH) < autocvar_g_monster_mage_heal_minhealth || need_help))
450 M_Mage_Defend_Heal(actor);
451
452 if (random() < 0.5
453 && actor.enemy && time >= actor.mage_shield_delay
454 && GetResource(actor, RES_HEALTH) < actor.max_health && !StatusEffects_active(STATUSEFFECT_Shield, actor))
456
457 return true;
458}
459
460METHOD(Mage, mr_pain, float(Mage this, entity actor, float damage_take, entity attacker, float deathtype))
461{
462 TC(Mage, this);
463 return damage_take;
464}
465
466METHOD(Mage, mr_death, bool(Mage this, entity actor))
467{
468 TC(Mage, this);
469 setanim(actor, ((random() > 0.5) ? actor.anim_die2 : actor.anim_die1), false, true, true);
470 return true;
471}
472#endif // SVQC
473#ifdef GAMEQC
474METHOD(Mage, mr_anim, bool(Mage this, entity actor))
475{
476 TC(Mage, this);
477 vector none = '0 0 0';
478 actor.anim_idle = animfixfps(actor, '0 1 1', none);
479 actor.anim_walk = animfixfps(actor, '1 1 1', none);
480 actor.anim_run = animfixfps(actor, '1 1 1', none);
481 actor.anim_shoot = animfixfps(actor, '2 1 5', none); // analyze models and set framerate
482 actor.anim_duckjump = animfixfps(actor, '4 1 5', none); // analyze models and set framerate
483 actor.anim_melee = animfixfps(actor, '5 1 5', none); // analyze models and set framerate
484 //actor.anim_fire1 = animfixfps(actor, '3 1 5', none); // analyze models and set framerate
485 //actor.anim_fire2 = animfixfps(actor, '4 1 5', none); // analyze models and set framerate
486 //actor.anim_fire3 = animfixfps(actor, '5 1 5', none); // analyze models and set framerate
487 actor.anim_pain1 = animfixfps(actor, '6 1 2', none); // 0.5 seconds
488 actor.anim_pain2 = animfixfps(actor, '7 1 2', none); // 0.5 seconds
489 //actor.anim_pain3 = animfixfps(actor, '8 1 2', none); // 0.5 seconds
490 actor.anim_die1 = animfixfps(actor, '9 1 0.5', none); // 2 seconds
491 actor.anim_die2 = animfixfps(actor, '10 1 0.5', none); // 2 seconds
492 //actor.anim_dead1 = animfixfps(actor, '11 1 0.5', none); // 2 seconds
493 //actor.anim_dead2 = animfixfps(actor, '12 1 0.5', none); // 2 seconds
494 return true;
495}
496#endif // GAMEQC
497#ifdef SVQC
498METHOD(Mage, mr_setup, bool(Mage this, entity actor))
499{
500 TC(Mage, this);
501 if (!GetResource(this, RES_HEALTH))
503 if (!actor.speed) actor.speed = autocvar_g_monster_mage_speed_walk;
504 if (!actor.speed2) actor.speed2 = autocvar_g_monster_mage_speed_run;
505 if (!actor.stopspeed) actor.stopspeed = autocvar_g_monster_mage_speed_stop;
506 if (!actor.damageforcescale) actor.damageforcescale = autocvar_g_monster_mage_damageforcescale;
507
508 actor.monster_loot = autocvar_g_monster_mage_loot;
509 actor.monster_attackfunc = M_Mage_Attack;
510
511 return true;
512}
513#endif // SVQC
514#ifdef MENUQC
515METHOD(Mage, describe, string(Mage this))
516{
517 TC(Mage, this);
519 PAR(_("Wielding nanotechnology as if it were sorcery, the Mage employs a range of unique abilities of its own creation in combat."));
520 PAR(_("As a primary attack, the Mage throws a homing electric sphere towards the player. "
521 "This sphere will track its target at high speed, exploding on impact or if it does not reach its target in time."));
522 PAR(_("When threatened, the Mage may deploy an energy shield to protect itself from damage briefly. "
523 "Enemies approaching too closely during this time may be pushed away with explosive force!"));
524 PAR(_("Defensively the Mage is capable of healing itself and nearby allies, with some variants also providing armor and ammunition."));
525 PAR(_("The Mage may sometimes appear to blink out of existence as it teleports behind its target for a sneak attack."));
526 return PAGE_TEXT;
527}
528#endif // MENUQC
#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:72
virtual void offhand_think()
Definition mage.qc:73
virtual void offhand_think()
Definition weapon.qh:238
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:42
virtual void wr_think()
(SERVER) logic to run every frame
Definition weapon.qh:98
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
float ltime
Definition net.qh:10
#define IS_DEAD(s)
Definition player.qh:244
#define IS_PLAYER(s)
Definition player.qh:242
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:957
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:943
#define DMG_NOWEP
Definition damage.qh:104
int state
const int HITTYPE_SPLASH
Definition all.qh:30
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:120
RES_ARMOR
Definition ent_cs.qc:130
ent angles
Definition ent_cs.qc:121
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:366
void M_Mage_Defend_Heal(entity this)
Definition mage.qc:241
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:159
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:125
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:316
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:294
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:82
bool M_Mage_Attack(int attack_type, entity actor, entity targ,.entity weaponentity)
Definition mage.qc:375
entity mage_spike
Definition mage.qc:91
bool M_Mage_Defend_Heal_Check(entity this, entity targ)
Definition mage.qc:94
void M_Mage_Attack_Spike(entity this, vector dir)
Definition mage.qc:215
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:149
float mage_shield_delay
Definition mage.qc:92
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:1905
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
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:226
#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:642
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:648
#define PAGE_TEXT_INIT()
Definition string.qh:641
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)
Setup the basic required properties for a monster.
entity Monster_FindTarget(entity this)
void monster_makevectors(entity this, entity targ)
float anim_finished
will be phased out when we have proper animations system
entity monster_follow
monster follow target
float autocvar_g_monsters_target_range
const int MONSTER_ATTACK_MELEE
const int MONSTERFLAG_INVINCIBLE
monster doesn't take damage (may be used for map objects & temporary monsters)
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:23
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:52
#define CENTER_OR_VIEWOFS(ent)
Definition utils.qh:31
#define vlen2(v)
Definition vector.qh:4
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
#define vec2(...)
Definition vector.qh:90
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:1118