1 const vector SPIDERBOT_MIN = '-75 -75 10';
2 const vector SPIDERBOT_MAX = '75 75 125';
5 float autocvar_g_vehicle_spiderbot_respawntime;
7 float autocvar_g_vehicle_spiderbot_speed_stop;
8 float autocvar_g_vehicle_spiderbot_speed_strafe;
9 float autocvar_g_vehicle_spiderbot_speed_walk;
10 float autocvar_g_vehicle_spiderbot_turnspeed;
11 float autocvar_g_vehicle_spiderbot_movement_inertia;
13 float autocvar_g_vehicle_spiderbot_springlength;
14 float autocvar_g_vehicle_spiderbot_springup;
15 float autocvar_g_vehicle_spiderbot_springblend;
17 float autocvar_g_vehicle_spiderbot_head_pitchlimit_down;
18 float autocvar_g_vehicle_spiderbot_head_pitchlimit_up;
19 float autocvar_g_vehicle_spiderbot_head_pitchspeed;
20 float autocvar_g_vehicle_spiderbot_head_turnlimit;
21 float autocvar_g_vehicle_spiderbot_head_turnspeed;
23 //float autocvar_g_vehicle_spiderbot_energy;
24 //float autocvar_g_vehicle_spiderbot_energy_regen;
25 //float autocvar_g_vehicle_spiderbot_energy_regen_pause;
27 float autocvar_g_vehicle_spiderbot_health;
28 float autocvar_g_vehicle_spiderbot_health_regen;
29 float autocvar_g_vehicle_spiderbot_health_regen_pause;
31 float autocvar_g_vehicle_spiderbot_shield;
32 float autocvar_g_vehicle_spiderbot_shield_regen;
33 float autocvar_g_vehicle_spiderbot_shield_regen_pause;
35 float autocvar_g_vehicle_spiderbot_minigun_damage;
36 float autocvar_g_vehicle_spiderbot_minigun_refire;
37 float autocvar_g_vehicle_spiderbot_minigun_spread;
38 float autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
39 float autocvar_g_vehicle_spiderbot_minigun_ammo_max;
40 float autocvar_g_vehicle_spiderbot_minigun_ammo_regen;
41 float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause;
43 float autocvar_g_vehicle_spiderbot_rocket_damage;
44 float autocvar_g_vehicle_spiderbot_rocket_force;
45 float autocvar_g_vehicle_spiderbot_rocket_radius;
46 float autocvar_g_vehicle_spiderbot_rocket_speed;
47 float autocvar_g_vehicle_spiderbot_rocket_refire;
48 float autocvar_g_vehicle_spiderbot_rocket_reload;
49 float autocvar_g_vehicle_spiderbot_rocket_health;
50 float autocvar_g_vehicle_spiderbot_rocket_noise;
51 float autocvar_g_vehicle_spiderbot_rocket_turnrate;
52 float autocvar_g_vehicle_spiderbot_rocket_lifetime;
54 void spiderbot_exit(float eject);
55 void spiderbot_enter();
56 void spiderbot_spawn();
58 void spiderbot_rocket_unguided()
60 vector newdir, olddir;
62 self.nextthink = time;
64 olddir = normalize(self.velocity);
65 newdir = normalize(self.pos1 - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
66 self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
68 UpdateCSQCProjectile(self);
70 if (self.owner.deadflag != DEAD_NO || self.cnt < time || vlen(self.pos1 - self.origin) < 16)
74 void spiderbot_rocket_guided()
76 vector newdir, olddir;
78 self.nextthink = time;
80 if not (self.realowner.vehicle)
81 self.think = spiderbot_rocket_unguided;
83 crosshair_trace(self.realowner);
84 olddir = normalize(self.velocity);
85 newdir = normalize(trace_endpos - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
86 self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
88 UpdateCSQCProjectile(self);
90 if (self.owner.deadflag != DEAD_NO || self.cnt < time)
94 void spiderbot_guide_release()
97 rkt = findchainentity(realowner, self.owner);
101 crosshair_trace(self.owner);
104 if(rkt.think == spiderbot_rocket_guided)
106 rkt.pos1 = trace_endpos;
107 rkt.think = spiderbot_rocket_unguided;
113 void spiderbot_rocket_do()
119 if (self.owner.BUTTON_ATCK2)
122 if (self.tur_head.frame == 9 || self.tur_head.frame == 1)
124 if(self.gun2.cnt < time && self.tur_head.frame == 9)
125 self.tur_head.frame = 1;
134 spiderbot_guide_release();
139 if(self.gun2.cnt > time)
142 if (self.tur_head.frame >= 9)
143 self.tur_head.frame = 1;
145 if not (self.owner.BUTTON_ATCK2)
148 crosshair_trace(self.owner);
150 v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
151 rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
152 v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
153 autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
154 DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, FALSE);
156 rocket.cnt = time + 15;
157 rocket.classname = "spiderbot_rocket";
158 rocket.pos1 = trace_endpos;
159 rocket.think = spiderbot_rocket_guided;
160 rocket.nextthink = time;
161 rocket.cnt = time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
163 self.tur_head.frame += 1;
164 if (self.tur_head.frame == 9)
165 self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_reload;
167 self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_refire;
169 self.gun2.cnt = time + self.attack_finished_single;
172 float spiderbot_frame()
175 entity player, spider;
178 if(intermission_running)
182 spider = self.vehicle;
185 vehicles_painframe();
187 player.BUTTON_ZOOM = 0;
188 player.BUTTON_CROUCH = 0;
189 player.switchweapon = 0;
191 crosshair_trace(player);
192 //UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
194 player.v_angle_x *= -1;
195 gettaginfo(spider.tur_head, 0);
196 ad = player.v_angle - vectoangles2(v_forward, v_up);
197 //ad = player.v_angle - (spider.tur_head.angles + spider.angles);
198 player.v_angle_x *= -1;
199 if(ad_x > 180) ad_x -= 360;
200 if(ad_x < -180) ad_x += 360;
201 if(ad_y > 180) ad_y -= 360;
202 if(ad_y < -180) ad_y += 360;
205 ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
206 ad_y = bound(-ftmp, ad_y, ftmp);
207 spider.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, spider.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit);
210 #if 0 // Enable to pich by cross-trace (more precise in chase, but less predictable)
211 ad = vectoangles(normalize(trace_endpos - gettaginfo(spider.tur_head,gettagindex(spider.tur_head,"tag_hud")))) - (spider.tur_head.angles + spider.angles);
212 if(ad_x > 180) ad_x -= 360;
213 if(ad_x < -180) ad_x += 360;
215 ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
216 ad_x = bound(ftmp * -1, ad_x, ftmp);
217 spider.tur_head.angles_x = bound(autocvar_g_vehicle_spiderbot_head_pitchlimit_down, spider.tur_head.angles_x + ad_x, autocvar_g_vehicle_spiderbot_head_pitchlimit_up);
220 ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
221 ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
223 makevectors(spider.angles + '-2 0 0' * spider.angles_x);
227 ofs = self.origin + v_up * 128;
228 te_lightning1(world, ofs, ofs + v_up * 32);
229 te_lightning1(world, ofs, ofs + v_right * 128);
230 te_lightning1(world, ofs, ofs + v_forward * 256);
233 movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend);
235 if(spider.flags & FL_ONGROUND)
237 if(spider.frame == 4 && self.tur_head.wait != 0)
239 sound (self, CHAN_TRIGGER, "vehicles/spiderbot_land.wav", VOL_VEHICLEENGINE, ATTN_NORM);
243 if(player.BUTTON_JUMP && self.tur_head.wait < time)
245 sound (self, CHAN_TRIGGER, "vehicles/spiderbot_jump.wav", VOL_VEHICLEENGINE, ATTN_NORM);
246 //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
249 self.tur_head.wait = time + 2;
250 player.BUTTON_JUMP = 0;
251 spider.velocity = v_forward * 700 + v_up * 600;
256 if(vlen(player.movement) == 0)
258 if(self.sound_nexttime < time || self.delay != 3)
261 self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav");
262 //dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n");
263 sound (self, CHAN_TRIGGER, "vehicles/spiderbot_idle.wav", VOL_VEHICLEENGINE, ATTN_NORM);
265 movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
270 spider.angles_y = anglemods(spider.angles_y + ftmp);
271 spider.tur_head.angles_y -= ftmp;
273 if(player.movement_x != 0)
275 if(player.movement_x > 0)
277 player.movement_x = 1;
280 else if(player.movement_x < 0)
282 player.movement_x = -1;
285 player.movement_y = 0;
286 movelib_move_simple(normalize(v_forward * player.movement_x),autocvar_g_vehicle_spiderbot_speed_walk,autocvar_g_vehicle_spiderbot_movement_inertia);
288 if(self.sound_nexttime < time || self.delay != 1)
291 self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav");
292 sound (self, CHAN_TRIGGER, "vehicles/spiderbot_walk.wav", VOL_VEHICLEENGINE, ATTN_NORM);
293 //dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n");
296 else if(player.movement_y != 0)
298 if(player.movement_y < 0)
300 player.movement_y = -1;
303 else if(player.movement_y > 0)
305 player.movement_y = 1;
308 movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
309 if(self.sound_nexttime < time || self.delay != 2)
312 self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav");
313 sound (self, CHAN_TRIGGER, "vehicles/spiderbot_strafe.wav", VOL_VEHICLEENGINE, ATTN_NORM);
314 //dprint("spiderbot_strafe:", ftos(soundlength("vehicles/spiderbot_strafe.wav")), "\n");
321 self.angles_x = bound(-45, self.angles_x, 45);
322 self.angles_z = bound(-45, self.angles_z, 45);
324 if(player.BUTTON_ATCK)
327 if(spider.vehicle_ammo1 >= autocvar_g_vehicle_spiderbot_minigun_ammo_cost && spider.tur_head.attack_finished_single <= time)
331 spider.misc_bulletcounter += 1;
335 mod(spider.misc_bulletcounter, 2) ? gun = spider.gun1 : gun = spider.gun2;
336 v = gettaginfo(gun, gettagindex(gun, "barrels"));
337 v_forward = normalize(v_forward);
340 fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
341 autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
343 sound (gun, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
344 trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
345 pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), v, v_forward * 2500, 1);
349 spider.vehicle_ammo1 -= autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
350 spider.tur_head.attack_finished_single = time + autocvar_g_vehicle_spiderbot_minigun_refire;
351 player.vehicle_ammo1 = (spider.vehicle_ammo1 / autocvar_g_vehicle_spiderbot_minigun_ammo_max) * 100;
355 vehicles_regen(cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max,
356 autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause,
357 autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime);
359 spiderbot_rocket_do();
361 if(self.vehicle_flags & VHF_SHIELDREGEN)
362 vehicles_regen(dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime);
364 if(self.vehicle_flags & VHF_HEALTHREGEN)
365 vehicles_regen(dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime);
367 player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
368 player.vehicle_ammo2 = spider.tur_head.frame;
370 if(spider.gun2.cnt <= time)
371 player.vehicle_reload2 = 100;
373 player.vehicle_reload2 = 100 - ((spider.gun2.cnt - time) / spider.attack_finished_single) * 100;
375 setorigin(player, spider.origin + '0 0 1' * SPIDERBOT_MAX_z);
376 player.velocity = spider.velocity;
378 VEHICLE_UPDATE_PLAYER(health, spiderbot);
380 if(self.vehicle_flags & VHF_HASSHIELD)
381 VEHICLE_UPDATE_PLAYER(shield, spiderbot);
383 #if 1 // 0 to enable per-gun impact aux crosshairs
384 // Avarage gun impact point's -> aux cross
386 ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
388 ad += gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
391 v_forward = vf * 0.5;
392 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
393 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
396 ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
397 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
398 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
400 ad = gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
401 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
402 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 1);
409 void spiderbot_think()
411 if(self.flags & FL_ONGROUND)
412 movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
414 self.nextthink = time;
417 void spiderbot_enter()
419 self.movetype = MOVETYPE_WALK;
421 self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_spiderbot_health);
422 self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_spiderbot_shield);
424 if(self.owner.flagcarried)
426 setattachment(self.owner.flagcarried, self.tur_head, "");
427 setorigin(self.owner.flagcarried, '-20 0 120');
431 void spiderbot_exit(float eject)
436 e = findchain(classname,"spiderbot_rocket");
439 if(e.owner == self.owner)
441 e.realowner = self.owner;
447 self.velocity = '0 0 0';
448 self.think = spiderbot_think;
449 self.nextthink = time;
451 self.movetype = MOVETYPE_WALK;
456 makevectors(self.angles);
459 spot = self.origin + v_forward * 100 + '0 0 64';
460 spot = vehicles_findgoodexit(spot);
461 setorigin(self.owner , spot);
462 self.owner.velocity = (v_up + v_forward * 0.25) * 750;
466 spot = self.origin - v_forward * 200 + '0 0 64';
467 spot = vehicles_findgoodexit(spot);
468 setorigin(self.owner , spot);
474 void spiderbot_spawn()
477 self.tur_head.frame = 1;
478 self.think = spiderbot_think;
479 self.nextthink = time;
480 self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
481 self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
482 self.movetype = MOVETYPE_WALK;
483 self.solid = SOLID_SLIDEBOX;
484 self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
485 self.tur_head.angles = '0 0 0';
487 setorigin(self, self.pos1 + '0 0 128');
488 self.angles = self.pos2;
491 void spiderbot_headfade()
493 self.think = spiderbot_headfade;
494 self.nextthink = self.fade_time;
495 self.alpha = 1 - (time - self.fade_time) * self.fade_rate;
497 if(self.cnt < time || self.alpha < 0.1)
501 sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
502 pointparticles(particleeffectnum("explosion_big"), self.origin + '0 0 100', '0 0 0', 1);
508 void spiderbot_blowup()
514 sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
515 pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
517 self.nextthink = time + 0.1;
527 setmodel(b, "models/vehicles/spiderbot.dpm");
528 setmodel(h, "models/vehicles/spiderbot_top.dpm");
529 setmodel(g1, "models/vehicles/spiderbot_barrels.dpm");
530 setmodel(g2, "models/vehicles/spiderbot_barrels.dpm");
532 setorigin(b, self.origin);
534 b.angles = self.angles;
535 setsize(b, self.mins, self.maxs);
537 setorigin(h, gettaginfo(self, gettagindex(self, "tag_head")));
538 h.movetype = MOVETYPE_BOUNCE;
539 h.solid = SOLID_BBOX;
540 h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
541 h.modelflags = MF_ROCKET;
542 h.effects = EF_FLAME | EF_LOWPRECISION;
543 h.avelocity = randomvec() * 360;
546 h.cnt = time + (3.5 * random());
547 h.fade_rate = 1 / min(autocvar_g_vehicle_spiderbot_respawntime, 10);
549 h.think = spiderbot_headfade;
552 setorigin(g1, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint01")));
553 g1.movetype = MOVETYPE_TOSS;
554 g1.solid = SOLID_CORPSE;
555 g1.velocity = v_forward * 700 + (randomvec() * 32);
556 g1.avelocity = randomvec() * 180;
558 setorigin(g2, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint02")));
559 g2.movetype = MOVETYPE_TOSS;
560 g2.solid = SOLID_CORPSE;
561 g2.velocity = v_forward * 700 + (randomvec() * 32);
562 g2.avelocity = randomvec() * 180;
564 h.colormod = b.colormod = g1.colormod = g2.colormod = '-2 -2 -2';
566 SUB_SetFade(b, time + 5, min(autocvar_g_vehicle_spiderbot_respawntime, 1));
567 //SUB_SetFade(h, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
568 SUB_SetFade(g1, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
569 SUB_SetFade(g2, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
571 RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world);
573 self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
574 self.movetype = MOVETYPE_NONE;
575 self.deadflag = DEAD_DEAD;
576 self.solid = SOLID_NOT;
577 self.tur_head.effects &~= EF_FLAME;
578 self.vehicle_hudmodel.viewmodelforclient = self;
583 sound (self, CHAN_TRIGGER, "vehicles/spiderbot_die.wav", VOL_BASE, ATTN_NORM);
584 pointparticles(particleeffectnum("explosion_medium"), self.origin + '0 0 100', '0 0 0', 1);
587 self.event_damage = SUB_Null;
588 self.takedamage = DAMAGE_NO;
589 self.touch = SUB_Null;
590 self.cnt = 3.4 + time + random() * 2;
591 self.think = spiderbot_blowup;
592 self.nextthink = time;
593 self.deadflag = DEAD_DYING;
595 self.tur_head.effects |= EF_FLAME;
596 self.colormod = self.tur_head.colormod = '-1 -1 -1';
598 self.movetype = MOVETYPE_TOSS;
601 void vewhicle_spiderbot_dinit()
603 if not (vehicle_initialize(
605 "models/vehicles/spiderbot.dpm",
606 "models/vehicles/spiderbot_top.dpm",
607 "models/vehicles/spiderbot_cockpit.dpm",
608 "tag_head", "tag_hud", "",
610 SPIDERBOT_MIN, SPIDERBOT_MAX,
612 spiderbot_spawn, autocvar_g_vehicle_spiderbot_respawntime,
614 spiderbot_enter, spiderbot_exit,
615 spiderbot_die, spiderbot_think,
626 setmodel(self.gun1, "models/vehicles/spiderbot_barrels.dpm");
627 setmodel(self.gun2, "models/vehicles/spiderbot_barrels.dpm");
629 setattachment(self.gun1, self.tur_head, "tag_hardpoint01");
630 setattachment(self.gun2, self.tur_head, "tag_hardpoint02");
636 void spawnfunc_vehicle_spiderbot()
638 self.vehicle_flags |= VHF_DMGSHAKE;
639 //self.vehicle_flags |= VHF_DMGROLL;
640 //self.vehicle_flags |= VHF_DMGHEADROLL;
642 precache_model ( "models/vhshield.md3");
643 precache_model ( "models/vehicles/spiderbot.dpm");
644 precache_model ( "models/vehicles/spiderbot_top.dpm");
645 precache_model ( "models/vehicles/spiderbot_barrels.dpm");
646 precache_model ( "models/vehicles/spiderbot_cockpit.dpm");
647 precache_model ( "models/uziflash.md3");
649 precache_sound ( "weapons/rocket_impact.wav" );
650 precache_sound ( "weapons/uzi_fire.wav" );
651 precache_sound ( "weapons/rocket_impact.wav");
653 precache_sound ( "vehicles/spiderbot_die.wav");
654 precache_sound ( "vehicles/spiderbot_idle.wav");
655 precache_sound ( "vehicles/spiderbot_jump.wav");
656 precache_sound ( "vehicles/spiderbot_strafe.wav");
657 precache_sound ( "vehicles/spiderbot_walk.wav");
658 precache_sound ( "vehicles/spiderbot_land.wav");
660 vehicles_configcheck("vehicle_spiderbot.cfg", autocvar_g_vehicle_spiderbot_health);
661 if(autocvar_g_vehicle_spiderbot_shield)
662 self.vehicle_flags |= VHF_HASSHIELD;
664 if(autocvar_g_vehicle_spiderbot_shield_regen)
665 self.vehicle_flags |= VHF_SHIELDREGEN;
667 if(autocvar_g_vehicle_spiderbot_health_regen)
668 self.vehicle_flags |= VHF_HEALTHREGEN;
670 self.think = vewhicle_spiderbot_dinit;
671 self.nextthink = time + (autocvar_g_vehicles_delayspawn ? autocvar_g_vehicle_spiderbot_respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter) : 0.5);