]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/turrets/turret/walker.qc
Cleanse the touch functions of the other evil
[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     remove (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     rocket.movetype                = 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     rocket.solid                          = SOLID_BBOX;
264     rocket.max_health            = time + 9;
265     rocket.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT;
266
267     CSQCProjectile(rocket, false, PROJECTILE_ROCKET, false); // no culling, has fly sound
268 }
269
270 .vector enemy_last_loc;
271 .float enemy_last_time;
272 void walker_move_to(entity this, vector _target, float _dist)
273 {
274     switch (this.waterlevel)
275     {
276         case WATERLEVEL_NONE:
277             if (_dist > 500)
278                 this.animflag = ANIM_RUN;
279             else
280                 this.animflag = ANIM_WALK;
281         case WATERLEVEL_WETFEET:
282         case WATERLEVEL_SWIMMING:
283             if (this.animflag != ANIM_SWIM)
284                 this.animflag = ANIM_WALK;
285             else
286                 this.animflag = ANIM_SWIM;
287             break;
288         case WATERLEVEL_SUBMERGED:
289             this.animflag = ANIM_SWIM;
290     }
291
292     this.moveto = _target;
293     this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
294
295     if(this.enemy)
296     {
297         this.enemy_last_loc = _target;
298         this.enemy_last_time = time;
299     }
300 }
301
302 void walker_move_path(entity this)
303 {
304 #ifdef WALKER_FANCYPATHING
305     // Are we close enougth to a path node to switch to the next?
306     if(vdist(this.origin - this.pathcurrent.origin, <, 64))
307         if (this.pathcurrent.path_next == NULL)
308         {
309             // Path endpoint reached
310             pathlib_deletepath(this.pathcurrent.owner);
311             this.pathcurrent = NULL;
312
313             if (this.pathgoal)
314             {
315                 if (this.pathgoal.use)
316                     this.pathgoal.use(this, NULL, NULL);
317
318                 if (this.pathgoal.enemy)
319                 {
320                     this.pathcurrent = WALKER_PATH(this, this.pathgoal.origin, this.pathgoal.enemy.origin);
321                     this.pathgoal = this.pathgoal.enemy;
322                 }
323             }
324             else
325                 this.pathgoal = NULL;
326         }
327         else
328             this.pathcurrent = this.pathcurrent.path_next;
329
330     this.moveto = this.pathcurrent.origin;
331     this.steerto = steerlib_attract2(this, this.moveto,0.5,500,0.95);
332     walker_move_to(this, this.moveto, 0);
333
334 #else
335     if(vdist(this.origin - this.pathcurrent.origin, <, 64))
336         this.pathcurrent = this.pathcurrent.enemy;
337
338     if(!this.pathcurrent)
339         return;
340
341     this.moveto = this.pathcurrent.origin;
342     this.steerto = steerlib_attract2(this, this.moveto, 0.5, 500, 0.95);
343     walker_move_to(this, this.moveto, 0);
344 #endif
345 }
346
347 spawnfunc(turret_walker) { if(!turret_initialize(this, TUR_WALKER)) remove(this); }
348
349 METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
350 {
351     fixedmakevectors(it.angles);
352
353     if (it.spawnflags & TSF_NO_PATHBREAK && it.pathcurrent)
354         walker_move_path(it);
355     else if (it.enemy == NULL)
356     {
357         if(it.pathcurrent)
358             walker_move_path(it);
359         else
360         {
361             if(it.enemy_last_time != 0)
362             {
363                 if(vdist(it.origin - it.enemy_last_loc, <, 128) || time - it.enemy_last_time > 10)
364                     it.enemy_last_time = 0;
365                 else
366                     walker_move_to(it, it.enemy_last_loc, 0);
367             }
368             else
369             {
370                 if(it.animflag != ANIM_NO)
371                 {
372                     traceline(it.origin + '0 0 64', it.origin + '0 0 64' + v_forward * 128, MOVE_NORMAL, it);
373
374                     if(trace_fraction != 1.0)
375                         it.tur_head.idletime = -1337;
376                     else
377                     {
378                         traceline(trace_endpos, trace_endpos - '0 0 256', MOVE_NORMAL, it);
379                         if(trace_fraction == 1.0)
380                             it.tur_head.idletime = -1337;
381                     }
382
383                     if(it.tur_head.idletime == -1337)
384                     {
385                         it.moveto = it.origin + randomvec() * 256;
386                         it.tur_head.idletime = 0;
387                     }
388
389                     it.moveto = it.moveto * 0.9 + ((it.origin + v_forward * 500) + randomvec() * 400) * 0.1;
390                     it.moveto_z = it.origin_z + 64;
391                     walker_move_to(it, it.moveto, 0);
392                 }
393
394                 if(it.idletime < time)
395                 {
396                     if(random() < 0.5 || !(it.spawnflags & TSL_ROAM))
397                     {
398                         it.idletime = time + 1 + random() * 5;
399                         it.moveto = it.origin;
400                         it.animflag = ANIM_NO;
401                     }
402                     else
403                     {
404                         it.animflag = ANIM_WALK;
405                         it.idletime = time + 4 + random() * 2;
406                         it.moveto = it.origin + randomvec() * 256;
407                         it.tur_head.moveto = it.moveto;
408                         it.tur_head.idletime = 0;
409                     }
410                 }
411             }
412         }
413     }
414     else
415     {
416         if (it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_melee_range) && it.animflag != ANIM_MELEE)
417         {
418             vector wish_angle;
419
420             wish_angle = angleofs(it, it.enemy);
421             if (it.animflag != ANIM_SWIM)
422             if (fabs(wish_angle_y) < 15)
423             {
424                 it.moveto   = it.enemy.origin;
425                 it.steerto  = steerlib_attract2(it, it.moveto, 0.5, 500, 0.95);
426                 it.animflag = ANIM_MELEE;
427             }
428         }
429         else if (it.tur_head.attack_finished_single[0] < time)
430         {
431             if(it.tur_head.shot_volly)
432             {
433                 it.animflag = ANIM_NO;
434
435                 it.tur_head.shot_volly = it.tur_head.shot_volly -1;
436                 if(it.tur_head.shot_volly == 0)
437                     it.tur_head.attack_finished_single[0] = time + (autocvar_g_turrets_unit_walker_rocket_refire);
438                 else
439                     it.tur_head.attack_finished_single[0] = time + 0.2;
440
441                 if(it.tur_head.shot_volly > 1)
442                     walker_fire_rocket(it, gettaginfo(it, gettagindex(it, "tag_rocket01")));
443                 else
444                     walker_fire_rocket(it, gettaginfo(it, gettagindex(it, "tag_rocket02")));
445             }
446             else
447             {
448                 if (it.tur_dist_enemy > (autocvar_g_turrets_unit_walker_rocket_range_min))
449                 if (it.tur_dist_enemy < (autocvar_g_turrets_unit_walker_rocket_range))
450                     it.tur_head.shot_volly = 4;
451             }
452         }
453         else
454         {
455             if (it.animflag != ANIM_MELEE)
456                 walker_move_to(it, it.enemy.origin, it.tur_dist_enemy);
457         }
458     }
459
460     {
461         vector real_angle;
462         float turny = 0, turnx = 0;
463         float vz;
464
465         real_angle = vectoangles(it.steerto) - it.angles;
466         vz = it.velocity_z;
467
468         switch (it.animflag)
469         {
470             case ANIM_NO:
471                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
472                 break;
473
474             case ANIM_TURN:
475                 turny = (autocvar_g_turrets_unit_walker_turn);
476                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
477                 break;
478
479             case ANIM_WALK:
480                 turny = (autocvar_g_turrets_unit_walker_turn_walk);
481                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_walk), 0.6);
482                 break;
483
484             case ANIM_RUN:
485                 turny = (autocvar_g_turrets_unit_walker_turn_run);
486                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_run), 0.6);
487                 break;
488
489             case ANIM_STRAFE_L:
490                 turny = (autocvar_g_turrets_unit_walker_turn_strafe);
491                 movelib_move_simple(it, v_right * -1, (autocvar_g_turrets_unit_walker_speed_walk), 0.8);
492                 break;
493
494             case ANIM_STRAFE_R:
495                 turny = (autocvar_g_turrets_unit_walker_turn_strafe);
496                 movelib_move_simple(it, v_right, (autocvar_g_turrets_unit_walker_speed_walk), 0.8);
497                 break;
498
499             case ANIM_JUMP:
500                 it.velocity += '0 0 1' * (autocvar_g_turrets_unit_walker_speed_jump);
501                 break;
502
503             case ANIM_LAND:
504                 break;
505
506             case ANIM_PAIN:
507                 if(it.frame != ANIM_PAIN)
508                     defer(it, 0.25, walker_setnoanim);
509
510                 break;
511
512             case ANIM_MELEE:
513                 if(it.frame != ANIM_MELEE)
514                 {
515                     defer(it, 0.41, walker_setnoanim);
516                     defer(it, 0.21, walker_melee_do_dmg);
517                 }
518
519                 movelib_brake_simple(it, (autocvar_g_turrets_unit_walker_speed_stop));
520                 break;
521
522             case ANIM_SWIM:
523                 turny = (autocvar_g_turrets_unit_walker_turn_swim);
524                 turnx = (autocvar_g_turrets_unit_walker_turn_swim);
525
526                 it.angles_x += bound(-10, shortangle_f(real_angle_x, it.angles_x), 10);
527                 movelib_move_simple(it, v_forward, (autocvar_g_turrets_unit_walker_speed_swim), 0.3);
528                 vz = it.velocity_z + sin(time * 4) * 8;
529                 break;
530
531             case ANIM_ROAM:
532                 turny = (autocvar_g_turrets_unit_walker_turn_walk);
533                 movelib_move_simple(it, v_forward ,(autocvar_g_turrets_unit_walker_speed_roam), 0.5);
534                 break;
535         }
536
537         if(turny)
538         {
539             turny = bound( turny * -1, shortangle_f(real_angle_y, it.angles_y), turny );
540             it.angles_y += turny;
541         }
542
543         if(turnx)
544         {
545             turnx = bound( turnx * -1, shortangle_f(real_angle_x, it.angles_x), turnx );
546             it.angles_x += turnx;
547         }
548
549         it.velocity_z = vz;
550     }
551
552
553     if(it.origin != it.oldorigin)
554         it.SendFlags |= TNSF_MOVE;
555
556     it.oldorigin = it.origin;
557     turrets_setframe(it, it.animflag, false);
558 }
559 METHOD(WalkerTurret, tr_death, void(WalkerTurret this, entity it))
560 {
561 #ifdef WALKER_FANCYPATHING
562     if (it.pathcurrent)
563         pathlib_deletepath(it.pathcurrent.owner);
564 #endif
565     it.pathcurrent = NULL;
566 }
567 METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))
568 {
569     it.ticrate = 0.05;
570
571     entity e;
572
573     // Respawn is called & first spawn to, to set team. need to make sure we do not move the initial spawn.
574     if(it.movetype == MOVETYPE_WALK)
575     {
576         if(it.pos1)
577             setorigin(it, it.pos1);
578         if(it.pos2)
579             it.angles = it.pos2;
580     }
581
582     it.ammo_flags = TFL_AMMO_BULLETS | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
583     it.aim_flags = TFL_AIM_LEAD;
584     it.turret_flags |= TUR_FLAG_HITSCAN;
585
586     it.target_select_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
587     it.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
588     it.iscreature = true;
589     it.teleportable = TELEPORT_NORMAL;
590     it.damagedbycontents = true;
591     it.solid = SOLID_SLIDEBOX;
592     it.takedamage = DAMAGE_AIM;
593     if(it.movetype != MOVETYPE_WALK)
594     {
595         setorigin(it, it.origin);
596         tracebox(it.origin + '0 0 128', it.mins, it.maxs, it.origin - '0 0 10000', MOVE_NORMAL, it);
597         setorigin(it, trace_endpos + '0 0 4');
598         it.pos1 = it.origin;
599         it.pos2 = it.angles;
600     }
601     it.movetype = MOVETYPE_WALK;
602     it.idle_aim = '0 0 0';
603     it.turret_firecheckfunc = walker_firecheck;
604
605     if (it.target != "")
606     {
607         e = find(NULL, targetname, it.target);
608         if (!e)
609         {
610             LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n");
611             it.target = "";
612         }
613
614         if (e.classname != "turret_checkpoint")
615             LOG_TRACE("Warning: not a turrret path\n");
616         else
617         {
618 #ifdef WALKER_FANCYPATHING
619             it.pathcurrent = WALKER_PATH(it, it.origin, e.origin);
620             it.pathgoal = e;
621 #else
622             it.pathcurrent = e;
623 #endif
624         }
625     }
626 }
627
628 #endif // SVQC
629 #ifdef CSQC
630
631 #include <common/physics/movelib.qh>
632
633 void walker_draw(entity this)
634 {
635     float dt;
636
637     dt = time - this.move_time;
638     this.move_time = time;
639     if(dt <= 0)
640         return;
641
642     fixedmakevectors(this.angles);
643     movelib_groundalign4point(this, 300, 100, 0.25, 45);
644     setorigin(this, this.origin + this.velocity * dt);
645     this.tur_head.angles += dt * this.tur_head.move_avelocity;
646     this.angles_y = this.move_angles_y;
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             it.movetype         = MOVETYPE_BOUNCE;
657             it.move_movetype    = MOVETYPE_BOUNCE;
658             it.move_origin      = it.origin;
659             it.move_time                = time;
660             it.draw                     = walker_draw;
661         }
662
663 #endif // CSQC
664 #endif