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