]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/monster/mage.qc
22cb9fef95cbb044a27f7b672a1e8948bef8ae96
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / mage.qc
1 #include "mage.qh"
2
3 #ifdef SVQC
4
5 SOUND(MageSpike_FIRE, W_Sound("electro_fire"));
6 void M_Mage_Attack_Spike(entity this, vector dir);
7 void M_Mage_Attack_Push(entity this);
8 METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weaponentity, int fire))
9 {
10     TC(MageSpike, thiswep);
11     if (fire & 1)
12     if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2)) {
13         if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range;
14         actor.enemy = Monster_FindTarget(actor);
15         monster_makevectors(actor, actor.enemy);
16         W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_MageSpike_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_MAGE.m_id);
17         if (!IS_PLAYER(actor)) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
18         M_Mage_Attack_Spike(actor, w_shotdir);
19         weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready);
20     }
21     if (fire & 2)
22     if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, true, 0.5)) {
23         M_Mage_Attack_Push(actor);
24         weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, 0, w_ready);
25     }
26 }
27
28 void M_Mage_Attack_Teleport(entity this, entity targ);
29
30 CLASS(OffhandMageTeleport, OffhandWeapon)
31     .bool OffhandMageTeleport_key_pressed;
32     METHOD(OffhandMageTeleport, offhand_think, void(OffhandMageTeleport this, entity player, bool key_pressed))
33     {
34         TC(OffhandMageTeleport, this);
35         if (key_pressed && !player.OffhandMageTeleport_key_pressed)
36                 M_Mage_Attack_Teleport(player, player.enemy);
37         player.OffhandMageTeleport_key_pressed = key_pressed;
38     }
39 ENDCLASS(OffhandMageTeleport)
40 OffhandMageTeleport OFFHAND_MAGE_TELEPORT;
41 STATIC_INIT(OFFHAND_MAGE_TELEPORT) { OFFHAND_MAGE_TELEPORT = NEW(OffhandMageTeleport); }
42
43 float autocvar_g_monster_mage_health;
44 float autocvar_g_monster_mage_damageforcescale = 0.5;
45 float autocvar_g_monster_mage_attack_spike_damage;
46 float autocvar_g_monster_mage_attack_spike_radius;
47 float autocvar_g_monster_mage_attack_spike_delay;
48 float autocvar_g_monster_mage_attack_spike_accel;
49 float autocvar_g_monster_mage_attack_spike_decel;
50 float autocvar_g_monster_mage_attack_spike_chance = 0.45;
51 float autocvar_g_monster_mage_attack_spike_turnrate;
52 float autocvar_g_monster_mage_attack_spike_speed_max;
53 float autocvar_g_monster_mage_attack_spike_smart;
54 float autocvar_g_monster_mage_attack_spike_smart_trace_min;
55 float autocvar_g_monster_mage_attack_spike_smart_trace_max;
56 float autocvar_g_monster_mage_attack_spike_smart_mindist;
57 float autocvar_g_monster_mage_attack_push_chance = 0.7;
58 float autocvar_g_monster_mage_attack_push_damage;
59 float autocvar_g_monster_mage_attack_push_radius;
60 float autocvar_g_monster_mage_attack_push_delay;
61 float autocvar_g_monster_mage_attack_push_force;
62 float autocvar_g_monster_mage_attack_teleport_chance = 0.2;
63 float autocvar_g_monster_mage_attack_teleport_delay = 2;
64 float autocvar_g_monster_mage_attack_teleport_random = 0.4;
65 float autocvar_g_monster_mage_attack_teleport_random_range = 1200;
66 float autocvar_g_monster_mage_heal_self;
67 float autocvar_g_monster_mage_heal_allies;
68 float autocvar_g_monster_mage_heal_minhealth;
69 float autocvar_g_monster_mage_heal_range;
70 float autocvar_g_monster_mage_heal_delay;
71 float autocvar_g_monster_mage_shield_time;
72 float autocvar_g_monster_mage_shield_delay;
73 float autocvar_g_monster_mage_shield_blockpercent;
74 float autocvar_g_monster_mage_speed_stop;
75 float autocvar_g_monster_mage_speed_run;
76 float autocvar_g_monster_mage_speed_walk;
77
78 void M_Mage_Defend_Heal(entity this);
79 void M_Mage_Defend_Shield(entity this);
80
81 .entity mage_spike;
82 .float mage_shield_delay;
83
84 bool M_Mage_Defend_Heal_Check(entity this, entity targ)
85 {
86         if(targ == NULL)
87                 return false;
88         if(GetResource(targ, RES_HEALTH) <= 0)
89                 return false;
90         if(DIFF_TEAM(targ, this) && targ != this.monster_follow)
91                 return false;
92         if(STAT(FROZEN, targ))
93                 return false;
94         if(!IS_PLAYER(targ))
95                 return (IS_MONSTER(targ) && GetResource(targ, RES_HEALTH) < targ.max_health);
96         if(StatusEffects_active(STATUSEFFECT_Shield, targ))
97                 return false;
98
99         switch(this.skin)
100         {
101                 case 0: return (GetResource(targ, RES_HEALTH) < autocvar_g_balance_health_regenstable);
102                 case 1:
103                 {
104                         return ((GetResource(targ, RES_CELLS) && GetResource(targ, RES_CELLS) < g_pickup_cells_max)
105                                 ||  (GetResource(targ, RES_PLASMA) && GetResource(targ, RES_PLASMA) < g_pickup_plasma_max)
106                                 ||  (GetResource(targ, RES_ROCKETS) && GetResource(targ, RES_ROCKETS) < g_pickup_rockets_max)
107                                 ||  (GetResource(targ, RES_BULLETS) && GetResource(targ, RES_BULLETS) < g_pickup_nails_max)
108                                 ||  (GetResource(targ, RES_SHELLS) && GetResource(targ, RES_SHELLS) < g_pickup_shells_max)
109                                         );
110                 }
111                 case 2: return (GetResource(targ, RES_ARMOR) < autocvar_g_balance_armor_regenstable);
112                 case 3: return (GetResource(targ, RES_HEALTH) > 0);
113         }
114
115         return false;
116 }
117
118 void M_Mage_Attack_Spike_Explode(entity this, entity directhitentity)
119 {
120         this.event_damage = func_null;
121
122         sound(this, CH_SHOTS, SND_GRENADE_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);
127         RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius),
128                                                 NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, DMG_NOWEP, directhitentity);
129
130         delete(this);
131 }
132
133 void M_Mage_Attack_Spike_Touch(entity this, entity toucher)
134 {
135         PROJECTILE_TOUCH(this, toucher);
136
137         M_Mage_Attack_Spike_Explode(this, toucher);
138 }
139
140 .float wait;
141
142 // copied from W_Seeker_Think
143 void M_Mage_Attack_Spike_Think(entity this)
144 {
145         if (time > this.ltime || (this.enemy && GetResource(this.enemy, RES_HEALTH) <= 0) || !this.owner || GetResource(this.owner, RES_HEALTH) <= 0) {
146                 this.projectiledeathtype |= HITTYPE_SPLASH;
147                 M_Mage_Attack_Spike_Explode(this, NULL);
148         }
149
150         float spd = vlen(this.velocity);
151         spd = bound(
152                 spd - (autocvar_g_monster_mage_attack_spike_decel) * frametime,
153                 (autocvar_g_monster_mage_attack_spike_speed_max),
154                 spd + (autocvar_g_monster_mage_attack_spike_accel) * frametime
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 )
170                 if ((autocvar_g_monster_mage_attack_spike_smart) && vdist(eorg - this.origin, >, autocvar_g_monster_mage_attack_spike_smart_mindist))
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
179                         this.wait = bound((autocvar_g_monster_mage_attack_spike_smart_trace_min), vlen(this.origin - trace_endpos), this.wait = (autocvar_g_monster_mage_attack_spike_smart_trace_max));
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
189         ///////////////
190
191         //this.angles = vectoangles(this.velocity);                     // turn model in the new flight direction
192         this.nextthink = time;// + 0.05; // csqc projectiles
193         UpdateCSQCProjectile(this);
194 }
195
196 void M_Mage_Attack_Spike(entity this, vector dir)
197 {
198         makevectors(this.angles);
199
200         entity missile = new(M_Mage_Attack_Spike);
201         missile.owner = missile.realowner = this;
202         setthink(missile, M_Mage_Attack_Spike_Think);
203         missile.ltime = time + 7;
204         missile.nextthink = time;
205         missile.solid = SOLID_BBOX;
206         set_movetype(missile, MOVETYPE_FLYMISSILE);
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;
215         settouch(missile, M_Mage_Attack_Spike_Touch);
216
217         this.mage_spike = missile;
218
219         CSQCProjectile(missile, true, PROJECTILE_MAGE_SPIKE, true);
220 }
221
222 void M_Mage_Defend_Heal(entity this)
223 {
224         bool washealed = false;
225
226         FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_mage_heal_range, M_Mage_Defend_Heal_Check(this, it),
227         {
228                 washealed = true;
229                 entity fx = EFFECT_Null;
230                 if(IS_PLAYER(it))
231                 {
232                         switch(this.skin)
233                         {
234                                 case 0:
235                                 {
236                                         Heal(it, this, autocvar_g_monster_mage_heal_allies, autocvar_g_balance_health_regenstable);
237                                         fx = EFFECT_HEALING;
238                                         break;
239                                 }
240                                 case 1:
241                                 {
242                                         if(GetResource(it, RES_CELLS)) GiveResourceWithLimit(it, RES_CELLS, 1, g_pickup_cells_max);
243                                         if(GetResource(it, RES_PLASMA)) GiveResourceWithLimit(it, RES_PLASMA, 1, g_pickup_plasma_max);
244                                         if(GetResource(it, RES_ROCKETS)) GiveResourceWithLimit(it, RES_ROCKETS, 1, g_pickup_rockets_max);
245                                         if(GetResource(it, RES_SHELLS)) GiveResourceWithLimit(it, RES_SHELLS, 2, g_pickup_shells_max);
246                                         if(GetResource(it, RES_BULLETS)) GiveResourceWithLimit(it, RES_BULLETS, 5, g_pickup_nails_max);
247                                         // TODO: fuel?
248                                         fx = EFFECT_AMMO_REGEN;
249                                         break;
250                                 }
251                                 case 2:
252                                         if(GetResource(it, RES_ARMOR) < autocvar_g_balance_armor_regenstable)
253                                         {
254                                                 GiveResourceWithLimit(it, RES_ARMOR, autocvar_g_monster_mage_heal_allies, autocvar_g_balance_armor_regenstable);
255                                                 fx = EFFECT_ARMOR_REPAIR;
256                                         }
257                                         break;
258                                 case 3:
259                                         float hp = ((it == this) ? autocvar_g_monster_mage_heal_self : autocvar_g_monster_mage_heal_allies);
260                                         TakeResource(it, RES_HEALTH, hp); // TODO: use regular damage functions? needs a way to bypass friendly fire checks
261                                         fx = EFFECT_RAGE;
262                                         break;
263                         }
264
265                         Send_Effect(fx, it.origin, '0 0 0', 1);
266                 }
267                 else
268                 {
269                         Send_Effect(EFFECT_HEALING, it.origin, '0 0 0', 1);
270                         Heal(it, this, autocvar_g_monster_mage_heal_allies, RES_LIMIT_NONE);
271                         if(!(it.spawnflags & MONSTERFLAG_INVINCIBLE) && it.sprite)
272                                 WaypointSprite_UpdateHealth(it.sprite, GetResource(it, RES_HEALTH));
273                 }
274         });
275
276         if(washealed)
277         {
278                 setanim(this, this.anim_melee, true, true, true);
279                 this.attack_finished_single[0] = time + (autocvar_g_monster_mage_heal_delay);
280                 this.state = MONSTER_ATTACK_MELEE;
281                 this.anim_finished = time + 1.5;
282         }
283 }
284
285 void M_Mage_Attack_Push(entity this)
286 {
287         sound(this, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM);
288         RadiusDamage (this, this, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius),
289                                                 NULL, NULL, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, DMG_NOWEP, this.enemy);
290         Send_Effect(EFFECT_TE_EXPLOSION, this.origin, '0 0 0', 1);
291
292         setanim(this, this.anim_duckjump, true, true, true);
293         this.attack_finished_single[0] = time + (autocvar_g_monster_mage_attack_push_delay);
294         this.anim_finished = time + 1;
295         this.state = MONSTER_ATTACK_MELEE; // prevent moving while firing spike
296 }
297
298 void M_Mage_Attack_Teleport(entity this, entity targ)
299 {
300         if(!targ) return;
301         if(vdist(targ.origin - this.origin, >, autocvar_g_monster_mage_attack_teleport_random_range)) return;
302
303         if(autocvar_g_monster_mage_attack_teleport_random && random() <= autocvar_g_monster_mage_attack_teleport_random)
304         {
305                 vector oldpos = this.origin;
306                 vector extrasize = '1 1 1' * autocvar_g_monster_mage_attack_teleport_random_range;
307                 if(MoveToRandomLocationWithinBounds(this, this.absmin - extrasize, this.absmax + extrasize,
308                                                                                         DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, 
309                                                                                         Q3SURFACEFLAG_SKY, 10, 64, 256, true))
310                 {
311                         vector a = vectoangles(targ.origin - this.origin);
312                         this.angles = '0 1 0' * a.y;
313                         this.fixangle = true;
314                         Send_Effect(EFFECT_SPAWN_NEUTRAL, oldpos, '0 0 0', 1);
315                         Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1);
316                         this.attack_finished_single[0] = time + autocvar_g_monster_mage_attack_teleport_delay;
317                         return;
318                 }
319         }
320
321         if(!IS_ONGROUND(targ)) return;
322
323         makevectors(targ.angles);
324         tracebox(CENTER_OR_VIEWOFS(targ), this.mins, this.maxs, CENTER_OR_VIEWOFS(targ) + ((v_forward * -1) * 200), MOVE_NOMONSTERS, this);
325
326         if(trace_fraction < 1)
327                 return;
328
329         vector newpos = trace_endpos;
330
331         Send_Effect(EFFECT_SPAWN_NEUTRAL, this.origin, '0 0 0', 1);
332         Send_Effect(EFFECT_SPAWN_NEUTRAL, newpos, '0 0 0', 1);
333
334         setorigin(this, newpos);
335
336         vector a = vectoangles(targ.origin - this.origin);
337         a.x = -a.x;
338         this.angles_x = a.x;
339         this.angles_y = a.y;
340         this.fixangle = true;
341         this.velocity *= 0.5;
342
343         this.attack_finished_single[0] = time + autocvar_g_monster_mage_attack_teleport_delay;
344 }
345
346 void M_Mage_Defend_Shield(entity this)
347 {
348         StatusEffects_apply(STATUSEFFECT_Shield, this, time + autocvar_g_monster_mage_shield_time, 0);
349         this.mage_shield_delay = time + (autocvar_g_monster_mage_shield_delay);
350         SetResourceExplicit(this, RES_ARMOR, autocvar_g_monster_mage_shield_blockpercent);
351         setanim(this, this.anim_shoot, true, true, true);
352         this.attack_finished_single[0] = time + 1; // give just a short cooldown on attacking
353         this.anim_finished = time + 1;
354 }
355
356 bool M_Mage_Attack(int attack_type, entity actor, entity targ, .entity weaponentity)
357 {
358         switch(attack_type)
359         {
360                 case MONSTER_ATTACK_MELEE:
361                 {
362                         if(random() <= autocvar_g_monster_mage_attack_push_chance)
363                         {
364                                 Weapon wep = WEP_MAGE_SPIKE;
365
366                                 wep.wr_think(wep, actor, weaponentity, 2);
367                                 return true;
368                         }
369
370                         return false;
371                 }
372                 case MONSTER_ATTACK_RANGED:
373                 {
374                         if(random() <= autocvar_g_monster_mage_attack_teleport_chance)
375                         {
376                                 OffhandWeapon off = OFFHAND_MAGE_TELEPORT;
377                                 actor.OffhandMageTeleport_key_pressed = 0;
378                                 off.offhand_think(off, actor, 1);
379                                 return true;
380                         }
381                         else if(!actor.mage_spike && random() <= autocvar_g_monster_mage_attack_spike_chance)
382                         {
383                                 setanim(actor, actor.anim_shoot, true, true, true);
384                                 actor.attack_finished_single[0] = time + (autocvar_g_monster_mage_attack_spike_delay);
385                                 actor.anim_finished = time + 1;
386                                 actor.state = MONSTER_ATTACK_MELEE; // prevent moving while firing spike
387                                 Weapon wep = WEP_MAGE_SPIKE;
388                                 wep.wr_think(wep, actor, weaponentity, 1);
389                                 return true;
390                         }
391
392                         return false;
393                 }
394         }
395
396         return false;
397 }
398
399 spawnfunc(monster_mage) { Monster_Spawn(this, true, MON_MAGE); }
400
401 #endif // SVQC
402
403 #ifdef SVQC
404 METHOD(Mage, mr_think, bool(Mage thismon, entity actor))
405 {
406     TC(Mage, thismon);
407     bool need_help = false;
408
409     FOREACH_CLIENT(IS_PLAYER(it) && it != actor,
410     {
411         if(vdist(it.origin - actor.origin, <=, autocvar_g_monster_mage_heal_range))
412         if(M_Mage_Defend_Heal_Check(actor, it))
413         {
414             need_help = true;
415             break;
416         }
417     });
418
419     if(!need_help)
420     {
421         IL_EACH(g_monsters, it != actor,
422         {
423                 if(vdist(it.origin - actor.origin, <=, autocvar_g_monster_mage_heal_range))
424                 if(M_Mage_Defend_Heal_Check(actor, it))
425                 {
426                     need_help = true;
427                     break;
428                 }
429         });
430     }
431
432     if(GetResource(actor, RES_HEALTH) < (autocvar_g_monster_mage_heal_minhealth) || need_help)
433     if(time >= actor.attack_finished_single[0])
434     if(random() < 0.5)
435         M_Mage_Defend_Heal(actor);
436
437     if(actor.enemy && time >= actor.mage_shield_delay && random() < 0.5)
438     if(GetResource(actor, RES_HEALTH) < actor.max_health && !StatusEffects_active(STATUSEFFECT_Shield, actor))
439         M_Mage_Defend_Shield(actor);
440
441     return true;
442 }
443
444 METHOD(Mage, mr_pain, float(Mage this, entity actor, float damage_take, entity attacker, float deathtype))
445 {
446     TC(Mage, this);
447     return damage_take;
448 }
449
450 METHOD(Mage, mr_death, bool(Mage this, entity actor))
451 {
452     TC(Mage, this);
453     setanim(actor, ((random() > 0.5) ? actor.anim_die2 : actor.anim_die1), false, true, true);
454     return true;
455 }
456
457 #endif
458 #ifdef GAMEQC
459 METHOD(Mage, mr_anim, bool(Mage this, entity actor))
460 {
461     TC(Mage, this);
462     vector none = '0 0 0';
463     actor.anim_idle = animfixfps(actor, '0 1 1', none);
464     actor.anim_walk = animfixfps(actor, '1 1 1', none);
465     actor.anim_run = animfixfps(actor, '1 1 1', none);
466     actor.anim_shoot = animfixfps(actor, '2 1 5', none); // analyze models and set framerate
467     actor.anim_duckjump = animfixfps(actor, '4 1 5', none); // analyze models and set framerate
468     actor.anim_melee = animfixfps(actor, '5 1 5', none); // analyze models and set framerate
469     //actor.anim_fire1 = animfixfps(actor, '3 1 5', none); // analyze models and set framerate
470     //actor.anim_fire2 = animfixfps(actor, '4 1 5', none); // analyze models and set framerate
471     //actor.anim_fire3 = animfixfps(actor, '5 1 5', none); // analyze models and set framerate
472     actor.anim_pain1 = animfixfps(actor, '6 1 2', none); // 0.5 seconds
473     actor.anim_pain2 = animfixfps(actor, '7 1 2', none); // 0.5 seconds
474     //actor.anim_pain3 = animfixfps(actor, '8 1 2', none); // 0.5 seconds
475     actor.anim_die1 = animfixfps(actor, '9 1 0.5', none); // 2 seconds
476     actor.anim_die2 = animfixfps(actor, '10 1 0.5', none); // 2 seconds
477     //actor.anim_dead1 = animfixfps(actor, '11 1 0.5', none); // 2 seconds
478     //actor.anim_dead2 = animfixfps(actor, '12 1 0.5', none); // 2 seconds
479     return true;
480 }
481 #endif
482 #ifdef SVQC
483 .float speed;
484 METHOD(Mage, mr_setup, bool(Mage this, entity actor))
485 {
486     TC(Mage, this);
487     if(!GetResource(this, RES_HEALTH)) SetResourceExplicit(actor, RES_HEALTH, autocvar_g_monster_mage_health);
488     if(!actor.speed) { actor.speed = (autocvar_g_monster_mage_speed_walk); }
489     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_mage_speed_run); }
490     if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_mage_speed_stop); }
491     if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_mage_damageforcescale); }
492
493     actor.monster_loot = ITEM_HealthBig;
494     actor.monster_attackfunc = M_Mage_Attack;
495
496     return true;
497 }
498 #endif