]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/turret/walker.qc
Merge branch 'Mario/showspecs' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / walker.qc
1 #ifndef TURRET_WALKER_H
2 #define TURRET_WALKER_H
3
4 //#define WALKER_FANCYPATHING
5
6 #include "walker_weapon.qh"
7
8 CLASS(WalkerTurret, Turret)
9 /* spawnflags */ ATTRIB(WalkerTurret, spawnflags, int, TUR_FLAG_PLAYER | TUR_FLAG_MOVE);
10 /* mins       */ ATTRIB(WalkerTurret, mins, vector, '-70 -70 0');
11 /* maxs       */ ATTRIB(WalkerTurret, maxs, vector, '70 70 95');
12 /* modelname  */ ATTRIB(WalkerTurret, mdl, string, "walker_body.md3");
13 /* model      */ ATTRIB_STRZONE(WalkerTurret, model, string, strcat("models/turrets/", this.mdl));
14 /* head_model */ ATTRIB_STRZONE(WalkerTurret, head_model, string, strcat("models/turrets/", "walker_head_minigun.md3"));
15 /* netname    */ ATTRIB(WalkerTurret, netname, string, "walker");
16 /* fullname   */ ATTRIB(WalkerTurret, turret_name, string, _("Walker Turret"));
17     ATTRIB(WalkerTurret, m_weapon, Weapon, WEP_WALKER);
18 ENDCLASS(WalkerTurret)
19 REGISTER_TURRET(WALKER, NEW(WalkerTurret));
20
21 #endif
22
23 #ifdef IMPLEMENTATION
24
25 #ifdef SVQC
26
27 float autocvar_g_turrets_unit_walker_melee_damage;
28 float autocvar_g_turrets_unit_walker_melee_force;
29 float autocvar_g_turrets_unit_walker_melee_range;
30 float autocvar_g_turrets_unit_walker_rocket_damage;
31 float autocvar_g_turrets_unit_walker_rocket_radius;
32 float autocvar_g_turrets_unit_walker_rocket_force;
33 float autocvar_g_turrets_unit_walker_rocket_speed;
34 float autocvar_g_turrets_unit_walker_rocket_range;
35 float autocvar_g_turrets_unit_walker_rocket_range_min;
36 float autocvar_g_turrets_unit_walker_rocket_refire;
37 float autocvar_g_turrets_unit_walker_rocket_turnrate;
38 float autocvar_g_turrets_unit_walker_speed_stop;
39 float autocvar_g_turrets_unit_walker_speed_walk;
40 float autocvar_g_turrets_unit_walker_speed_run;
41 float autocvar_g_turrets_unit_walker_speed_jump;
42 float autocvar_g_turrets_unit_walker_speed_swim;
43 float autocvar_g_turrets_unit_walker_speed_roam;
44 float autocvar_g_turrets_unit_walker_turn;
45 float autocvar_g_turrets_unit_walker_turn_walk;
46 float autocvar_g_turrets_unit_walker_turn_strafe;
47 float autocvar_g_turrets_unit_walker_turn_swim;
48 float autocvar_g_turrets_unit_walker_turn_run;
49
50 const int ANIM_NO         = 0;
51 const int ANIM_TURN       = 1;
52 const int ANIM_WALK       = 2;
53 const int ANIM_RUN        = 3;
54 const int ANIM_STRAFE_L   = 4;
55 const int ANIM_STRAFE_R   = 5;
56 const int ANIM_JUMP       = 6;
57 const int ANIM_LAND       = 7;
58 const int ANIM_PAIN       = 8;
59 const int ANIM_MELEE      = 9;
60 const int ANIM_SWIM       = 10;
61 const int ANIM_ROAM       = 11;
62
63 .float animflag;
64 .float idletime;
65
66 #define WALKER_PATH(this, s, e) pathlib_astar(this, s, e)
67
68 bool walker_firecheck(entity this)
69 {
70     if (this.animflag == ANIM_MELEE)
71         return false;
72
73     return turret_firecheck(this);
74 }
75
76 void walker_melee_do_dmg(entity this)
77 {
78     vector where;
79     entity e;
80
81     makevectors(this.angles);
82     where = this.origin + v_forward * 128;
83
84     e = findradius(where,32);
85     while (e)
86     {
87         if (turret_validate_target(this, e, this.target_validate_flags))
88             if (e != this && e.owner != this)
89                 Damage(e, this, this, (autocvar_g_turrets_unit_walker_melee_damage), DEATH_TURRET_WALK_MELEE.m_id, '0 0 0', v_forward * (autocvar_g_turrets_unit_walker_melee_force));
90
91         e = e.chain;
92     }
93 }
94
95 void walker_setnoanim(entity this)
96 {
97     turrets_setframe(this, ANIM_NO, false);
98     this.animflag = this.frame;
99 }
100 void walker_rocket_explode(entity this)
101 {
102     RadiusDamage (this, this.owner, (autocvar_g_turrets_unit_walker_rocket_damage), 0, (autocvar_g_turrets_unit_walker_rocket_radius), this, NULL, (autocvar_g_turrets_unit_walker_rocket_force), DEATH_TURRET_WALK_ROCKET.m_id, NULL);
103     delete (this);
104 }
105
106 void walker_rocket_touch(entity this, entity toucher)
107 {
108     walker_rocket_explode(this);
109 }
110
111 void walker_rocket_damage(entity this, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
112 {
113     this.health = this.health - damage;
114     this.velocity = this.velocity + vforce;
115
116     if (this.health <= 0)
117         W_PrepareExplosionByDamage(this, this.owner, walker_rocket_explode);
118 }
119
120 #define WALKER_ROCKET_MOVE(s) movelib_move_simple((s), newdir, (autocvar_g_turrets_unit_walker_rocket_speed), (autocvar_g_turrets_unit_walker_rocket_turnrate)); UpdateCSQCProjectile(s)
121 void walker_rocket_loop(entity this);
122 void walker_rocket_think(entity this)
123 {
124     vector newdir;
125     float edist;
126     float itime;
127     float m_speed;
128
129     this.nextthink = time;
130
131     edist = vlen(this.enemy.origin - this.origin);
132
133     // Simulate crude guidance
134     if (this.cnt < time)
135     {
136         if (edist < 1000)
137             this.tur_shotorg = randomvec() * min(edist, 64);
138         else
139             this.tur_shotorg = randomvec() * min(edist, 256);
140
141         this.cnt = time + 0.5;
142     }
143
144     if (edist < 128)
145         this.tur_shotorg = '0 0 0';
146
147     if (this.max_health < time)
148     {
149         setthink(this, walker_rocket_explode);
150         this.nextthink  = time;
151         return;
152     }
153
154     if (this.shot_dmg != 1337 && random() < 0.01)
155     {
156         walker_rocket_loop(this);
157         return;
158     }
159
160     m_speed = vlen(this.velocity);
161
162     // Enemy dead? just keep on the current heading then.
163     if (this.enemy == NULL || IS_DEAD(this.enemy))
164         this.enemy = NULL;
165
166     if (this.enemy)
167     {
168         itime = max(edist / m_speed, 1);
169         newdir = steerlib_pull(this, this.enemy.origin + this.tur_shotorg);
170     }
171     else
172         newdir  = normalize(this.velocity);
173
174     WALKER_ROCKET_MOVE(this);
175 }
176
177 void walker_rocket_loop3(entity this)
178 {
179     this.nextthink = time;
180
181     if (this.max_health < time)
182     {
183         setthink(this, walker_rocket_explode);
184         return;
185     }
186
187     if(vdist(this.origin - this.tur_shotorg, <, 100))
188     {
189         setthink(this, walker_rocket_think);
190         return;
191     }
192
193     vector newdir = steerlib_pull(this, this.tur_shotorg);
194     WALKER_ROCKET_MOVE(this);
195
196     this.angles = vectoangles(this.velocity);
197 }
198
199 void walker_rocket_loop2(entity this)
200 {
201     this.nextthink = time;
202
203     if (this.max_health < time)
204     {
205         setthink(this, walker_rocket_explode);
206         return;
207     }
208
209     if(vdist(this.origin - this.tur_shotorg, <, 100))
210     {
211         this.tur_shotorg = this.origin - '0 0 200';
212         setthink(this, walker_rocket_loop3);
213         return;
214     }
215
216     vector newdir = steerlib_pull(this, this.tur_shotorg);
217     WALKER_ROCKET_MOVE(this);
218 }
219
220 void walker_rocket_loop(entity this)
221 {
222     this.nextthink = time;
223     this.tur_shotorg = this.origin + '0 0 300';
224     setthink(this, walker_rocket_loop2);
225     this.shot_dmg = 1337;
226 }
227
228 void walker_fire_rocket(entity this, vector org)
229 {
230     fixedmakevectors(this.angles);
231
232     te_explosion (org);
233
234     entity rocket = new(walker_rocket);
235     setorigin(rocket, org);
236
237     sound (this, CH_WEAPON_A, SND_HAGAR_FIRE, VOL_BASE, ATTEN_NORM);
238     setsize (rocket, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
239
240     rocket.owner                          = this;
241     rocket.bot_dodge              = true;
242     rocket.bot_dodgerating      = 50;
243     rocket.takedamage            = DAMAGE_YES;
244     rocket.damageforcescale   = 2;
245     rocket.health                        = 25;
246     rocket.tur_shotorg          = randomvec() * 512;
247     rocket.cnt                          = time + 1;
248     rocket.enemy                          = this.enemy;
249
250     if (random() < 0.01)
251         setthink(rocket, walker_rocket_loop);
252     else
253         setthink(rocket, walker_rocket_think);
254
255     rocket.event_damage    = walker_rocket_damage;
256
257     rocket.nextthink              = time;
258     set_movetype(rocket, MOVETYPE_FLY);
259     rocket.velocity                = normalize((v_forward + v_up * 0.5) + (randomvec() * 0.2)) * (autocvar_g_turrets_unit_walker_rocket_speed);
260     rocket.angles                        = vectoangles(rocket.velocity);
261     settouch(rocket, walker_rocket_touch);
262     rocket.flags = FL_PROJECTILE;
263     IL_PUSH(g_projectiles, rocket);
264     rocket.solid                          = SOLID_BBOX;
265     rocket.max_health            = time + 9;
266     rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
267
268     CSQCProjectile(rocket, false, PROJECTILE_ROCKET, false); // no culling, has fly sound
269 }
270
271 .vector enemy_last_loc;
272 .float enemy_last_time;
273 void walker_move_to(entity this, vector _target, float _dist)
274 {
275     switch (this.waterlevel)
276     {
277         case WATERLEVEL_NONE:
278             if (_dist > 500)
279                 this.animflag = ANIM_RUN;
280             else
281                 this.animflag = ANIM_WALK;
282         case WATERLEVEL_WETFEET:
283         case WATERLEVEL_SWIMMING:
284             if (this.animflag != ANIM_SWIM)
285                 this.animflag = ANIM_WALK;
286             else
287                 this.animflag = ANIM_SWIM;
288             break;
289         case WATERLEVEL_SUBMERGED:
290             this.animflag = ANIM_SWIM;
291     }
292
293     this.moveto = _target;
294     this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
295
296     if(this.enemy)
297     {
298         this.enemy_last_loc = _target;
299         this.enemy_last_time = time;
300     }
301 }
302
303 void walker_move_path(entity this)
304 {
305 #ifdef WALKER_FANCYPATHING
306     // Are we close enougth to a path node to switch to the next?
307     if(vdist(this.origin - this.pathcurrent.origin, <, 64))
308         if (this.pathcurrent.path_next == NULL)
309         {
310             // Path endpoint reached
311             pathlib_deletepath(this.pathcurrent.owner);
312             this.pathcurrent = NULL;
313
314             if (this.pathgoal)
315             {
316                 if (this.pathgoal.use)
317                     this.pathgoal.use(this, NULL, NULL);
318
319                 if (this.pathgoal.enemy)
320                 {
321                     this.pathcurrent = WALKER_PATH(this, this.pathgoal.origin, this.pathgoal.enemy.origin);
322                     this.pathgoal = this.pathgoal.enemy;
323                 }
324             }
325             else
326                 this.pathgoal = NULL;
327         }
328         else
329             this.pathcurrent = this.pathcurrent.path_next;
330
331     this.moveto = this.pathcurrent.origin;
332     this.steerto = steerlib_attract2(this, this.moveto,0.5,500,0.95);
333     walker_move_to(this, this.moveto, 0);
334
335 #else
336     if(vdist(this.origin - this.pathcurrent.origin, <, 64))
337         this.pathcurrent = this.pathcurrent.enemy;
338
339     if(!this.pathcurrent)
340         return;
341
342     this.moveto = this.pathcurrent.origin;
343     this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
344     walker_move_to(this, this.moveto, 0);
345 #endif
346 }
347
348 spawnfunc(turret_walker) { if(!turret_initialize(this, TUR_WALKER)) delete(this); }
349
350 METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
351 {
352     fixedmakevectors(it.angles);
353
354     if (it.spawnflags & TSF_NO_PATHBREAK && it.pathcurrent)
355         walker_move_path(it);
356     else if (it.enemy == NULL)
357     {
358         if(it.pathcurrent)
359             walker_move_path(it);
360         else
361         {
362             if(it.enemy_last_time != 0)
363             {
364                 if(vdist(it.origin - it.enemy_last_loc, <, 128) || time - it.enemy_last_time > 10)
365                     it.enemy_last_time = 0;
366                 else
367                     walker_move_to(it, it.enemy_last_loc, 0);
368             }
369             else
370             {
371                 if(it.animflag != ANIM_NO)
372                 {
373                     traceline(it.origin + '0 0 64', it.origin + '0 0 64' + v_forward * 128, MOVE_NORMAL, it);
374
375                     if(trace_fraction != 1.0)
376                         it.tur_head.idletime = -1337;
377                     else
378                     {
379                         traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, it);
380                         if(trace_fraction == 1.0)
381                             it.tur_head.idletime = -1337;
382                     }
383
384                     if(it.tur_head.idletime == -1337)
385                     {
386                         it.moveto = it.origin + randomvec() * 256;
387                         it.tur_head.idletime = 0;
388                     }
389
390                     it.moveto = it.moveto * 0.9 + ((it.origin + v_forward * 500) + randomvec() * 400) * 0.1;
391                     it.moveto_z = it.origin_z + 64;
392                     walker_move_to(it, it.moveto, 0);
393                 }
394
395                 if(it.idletime < time)
396                 {
397                     if(random() < 0.5 || !(it.spawnflags & TSL_ROAM))
398                     {
399                         it.idletime = time + 1 + random() * 5;
400                         it.moveto = it.origin;
401                         it.animflag = ANIM_NO;
402                     }
403                     else
404                     {
405                         it.animflag = ANIM_WALK;
406                         it.idletime = time + 4 + random() * 2;
407                         it.moveto = it.origin + randomvec() * 256;
408                         it.tur_head.moveto = it.moveto;
409                         it.tur_head.idletime = 0;
410                     }
411                 }
412             }
413         }
414     }
415     else
416     {
417         if (it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_melee_range) && it.animflag != ANIM_MELEE)
418         {
419             vector wish_angle;
420
421             wish_angle = angleofs(it, it.enemy);
422             if (it.animflag != ANIM_SWIM)
423             if (fabs(wish_angle_y) < 15)
424             {
425                 it.moveto   = it.enemy.origin;
426                 it.steerto  = steerlib_attract2(it, it.moveto, 0.5, 500, 0.95);
427                 it.animflag = ANIM_MELEE;
428             }
429         }
430         else if (it.tur_head.attack_finished_single[0] < time)
431         {
432             if(it.tur_head.shot_volly)
433             {
434                 it.animflag = ANIM_NO;
435
436                 it.tur_head.shot_volly = it.tur_head.shot_volly -1;
437                 if(it.tur_head.shot_volly == 0)
438                     it.tur_head.attack_finished_single[0] = time + (autocvar_g_turrets_unit_walker_rocket_refire);
439                 else
440                     it.tur_head.attack_finished_single[0] = time + 0.2;
441
442                 if(it.tur_head.shot_volly > 1)
443                     walker_fire_rocket(it, gettaginfo(it, gettagindex(it, "tag_rocket01")));
444                 else
445                     walker_fire_rocket(it, gettaginfo(it, gettagindex(it, "tag_rocket02")));
446             }
447             else
448             {
449                 if (it.tur_dist_enemy > (autocvar_g_turrets_unit_walker_rocket_range_min))
450                 if (it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_rocket_range))
451                     it.tur_head.shot_volly = 4;
452             }
453         }
454         else
455         {
456             if (it.animflag != ANIM_MELEE)
457                 walker_move_to(it, it.enemy.origin, it.tur_dist_enemy);
458         }
459     }
460
461     {
462         vector real_angle;
463         float turny = 0, turnx = 0;
464         float vz;
465
466         real_angle = vectoangles(it.steerto) - it.angles;
467         vz = it.velocity_z;
468
469         switch (it.animflag)
470         {
471             case ANIM_NO:
472                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
473                 break;
474
475             case ANIM_TURN:
476                 turny = (autocvar_g_turrets_unit_walker_turn);
477                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
478                 break;
479
480             case ANIM_WALK:
481                 turny = (autocvar_g_turrets_unit_walker_turn_walk);
482                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_walk), 0.6);
483                 break;
484
485             case ANIM_RUN:
486                 turny = (autocvar_g_turrets_unit_walker_turn_run);
487                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_run), 0.6);
488                 break;
489
490             case ANIM_STRAFE_L:
491                 turny = (autocvar_g_turrets_unit_walker_turn_strafe);
492                 movelib_move_simple(it, v_right * -1, (autocvar_g_turrets_unit_walker_speed_walk), 0.8);
493                 break;
494
495             case ANIM_STRAFE_R:
496                 turny = (autocvar_g_turrets_unit_walker_turn_strafe);
497                 movelib_move_simple(it, v_right, (autocvar_g_turrets_unit_walker_speed_walk), 0.8);
498                 break;
499
500             case ANIM_JUMP:
501                 it.velocity += '0 0 1' * (autocvar_g_turrets_unit_walker_speed_jump);
502                 break;
503
504             case ANIM_LAND:
505                 break;
506
507             case ANIM_PAIN:
508                 if(it.frame != ANIM_PAIN)
509                     defer(it, 0.25, walker_setnoanim);
510
511                 break;
512
513             case ANIM_MELEE:
514                 if(it.frame != ANIM_MELEE)
515                 {
516                     defer(it, 0.41, walker_setnoanim);
517                     defer(it, 0.21, walker_melee_do_dmg);
518                 }
519
520                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
521                 break;
522
523             case ANIM_SWIM:
524                 turny = (autocvar_g_turrets_unit_walker_turn_swim);
525                 turnx = (autocvar_g_turrets_unit_walker_turn_swim);
526
527                 it.angles_x += bound(-10, shortangle_f(real_angle_x, it.angles_x), 10);
528                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_swim), 0.3);
529                 vz = it.velocity_z + sin(time * 4) * 8;
530                 break;
531
532             case ANIM_ROAM:
533                 turny = (autocvar_g_turrets_unit_walker_turn_walk);
534                 movelib_move_simple(it, v_forward ,(autocvar_g_turrets_unit_walker_speed_roam), 0.5);
535                 break;
536         }
537
538         if(turny)
539         {
540             turny = bound( turny * -1, shortangle_f(real_angle_y, it.angles_y), turny );
541             it.angles_y += turny;
542         }
543
544         if(turnx)
545         {
546             turnx = bound( turnx * -1, shortangle_f(real_angle_x, it.angles_x), turnx );
547             it.angles_x += turnx;
548         }
549
550         it.velocity_z = vz;
551     }
552
553
554     if(it.origin != it.oldorigin)
555         it.SendFlags |= TNSF_MOVE;
556
557     it.oldorigin = it.origin;
558     turrets_setframe(it, it.animflag, false);
559 }
560 METHOD(WalkerTurret, tr_death, void(WalkerTurret this, entity it))
561 {
562 #ifdef WALKER_FANCYPATHING
563     if (it.pathcurrent)
564         pathlib_deletepath(it.pathcurrent.owner);
565 #endif
566     it.pathcurrent = NULL;
567 }
568 METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
569 {
570     it.ticrate = 0.05;
571
572     entity e;
573
574     // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
575     if(it.move_movetype == MOVETYPE_WALK)
576     {
577         if(it.pos1)
578             setorigin(it, it.pos1);
579         if(it.pos2)
580             it.angles = it.pos2;
581     }
582
583     it.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
584     it.aim_flags = TFL_AIM_LEAD;
585     it.turret_flags |= TUR_FLAG_HITSCAN;
586
587     it.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
588     it.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
589     it.iscreature = true;
590     it.teleportable = TELEPORT_NORMAL;
591     it.damagedbycontents = true;
592     it.solid = SOLID_SLIDEBOX;
593     it.takedamage = DAMAGE_AIM;
594     if(it.move_movetype != MOVETYPE_WALK)
595     {
596         setorigin(it, it.origin);
597         tracebox(it.origin + '0 0 128', it.mins, it.maxs, it.origin - '0 0 10000', MOVE_NORMAL, it);
598         setorigin(it, trace_endpos + '0 0 4');
599         it.pos1 = it.origin;
600         it.pos2 = it.angles;
601     }
602     set_movetype(it, MOVETYPE_WALK);
603     it.idle_aim = '0 0 0';
604     it.turret_firecheckfunc = walker_firecheck;
605
606     if (it.target != "")
607     {
608         e = find(NULL, targetname, it.target);
609         if (!e)
610         {
611             LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n");
612             it.target = "";
613         }
614
615         if (e.classname != "turret_checkpoint")
616             LOG_TRACE("Warning: not a turrret path\n");
617         else
618         {
619 #ifdef WALKER_FANCYPATHING
620             it.pathcurrent = WALKER_PATH(it, it.origin, e.origin);
621             it.pathgoal = e;
622 #else
623             it.pathcurrent = e;
624 #endif
625         }
626     }
627 }
628
629 #endif // SVQC
630 #ifdef CSQC
631
632 #include <common/physics/movelib.qh>
633
634 void walker_draw(entity this)
635 {
636     float dt;
637
638     dt = time - this.move_time;
639     this.move_time = time;
640     if(dt <= 0)
641         return;
642
643     fixedmakevectors(this.angles);
644     movelib_groundalign4point(this, 300, 100, 0.25, 45);
645     setorigin(this, this.origin + this.velocity * dt);
646     this.tur_head.angles += dt * this.tur_head.avelocity;
647
648     if (this.health < 127)
649     if(random() < 0.15)
650         te_spark(this.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
651 }
652
653         METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
654         {
655             it.gravity          = 1;
656             set_movetype(it, MOVETYPE_BOUNCE);
657             it.move_time                = time;
658             it.draw                     = walker_draw;
659         }
660
661 #endif // CSQC
662 #endif