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