1 const vector SPIDERBOT_MIN = '-75 -75 10';
2 const vector SPIDERBOT_MAX = '75 75 110';
4 float autocvar_g_vehicle_spiderbot_respawntime;
6 //float autocvar_g_vehicle_spiderbot_crush_dmg;
7 //float autocvar_g_vehicle_spiderbot_crush_force;
9 float autocvar_g_vehicle_spiderbot_speed_stop;
10 float autocvar_g_vehicle_spiderbot_speed_strafe;
11 float autocvar_g_vehicle_spiderbot_speed_walk;
12 float autocvar_g_vehicle_spiderbot_turnspeed;
13 float autocvar_g_vehicle_spiderbot_movement_inertia;
15 float autocvar_g_vehicle_spiderbot_springlength;
16 float autocvar_g_vehicle_spiderbot_springup;
17 float autocvar_g_vehicle_spiderbot_springblend;
19 float autocvar_g_vehicle_spiderbot_head_pitchlimit_down;
20 float autocvar_g_vehicle_spiderbot_head_pitchlimit_up;
21 float autocvar_g_vehicle_spiderbot_head_pitchspeed;
22 float autocvar_g_vehicle_spiderbot_head_turnlimit;
23 float autocvar_g_vehicle_spiderbot_head_turnspeed;
25 //float autocvar_g_vehicle_spiderbot_energy;
26 //float autocvar_g_vehicle_spiderbot_energy_regen;
27 //float autocvar_g_vehicle_spiderbot_energy_regen_pause;
29 float autocvar_g_vehicle_spiderbot_health;
30 float autocvar_g_vehicle_spiderbot_health_regen;
31 float autocvar_g_vehicle_spiderbot_health_regen_pause;
33 float autocvar_g_vehicle_spiderbot_shield;
34 float autocvar_g_vehicle_spiderbot_shield_regen;
35 float autocvar_g_vehicle_spiderbot_shield_regen_pause;
37 float autocvar_g_vehicle_spiderbot_minigun_damage;
38 float autocvar_g_vehicle_spiderbot_minigun_refire;
39 float autocvar_g_vehicle_spiderbot_minigun_spread;
40 float autocvar_g_vehicle_spiderbot_minigun_cooldown;
41 float autocvar_g_vehicle_spiderbot_minigun_heat;
43 float autocvar_g_vehicle_spiderbot_rocket_damage;
44 float autocvar_g_vehicle_spiderbot_rocket_edgedamage;
45 float autocvar_g_vehicle_spiderbot_rocket_force;
46 float autocvar_g_vehicle_spiderbot_rocket_health;
47 float autocvar_g_vehicle_spiderbot_rocket_lifetime;
48 float autocvar_g_vehicle_spiderbot_rocket_noise;
49 float autocvar_g_vehicle_spiderbot_rocket_radius;
50 float autocvar_g_vehicle_spiderbot_rocket_refire;
51 float autocvar_g_vehicle_spiderbot_rocket_reload;
52 float autocvar_g_vehicle_spiderbot_rocket_speed;
53 float autocvar_g_vehicle_spiderbot_rocket_turnrate;
56 void spiderbot_exit(float eject);
57 void spiderbot_enter();
58 void spiderbot_spawn();
60 void spiderbot_rocket_unguided()
62 vector newdir, olddir;
64 self.nextthink = time;
66 olddir = normalize(self.velocity);
67 newdir = normalize(self.pos1 - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
68 self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
70 UpdateCSQCProjectile(self);
72 if (self.owner.deadflag != DEAD_NO || self.cnt < time)
76 void spiderbot_rocket_guided()
78 vector newdir, olddir;
80 self.nextthink = time;
82 if not (self.realowner.vehicle)
83 self.think = spiderbot_rocket_unguided;
85 crosshair_trace(self.realowner);
86 olddir = normalize(self.velocity);
87 newdir = normalize(trace_endpos - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
88 self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
90 UpdateCSQCProjectile(self);
92 if (self.owner.deadflag != DEAD_NO || self.cnt < time)
96 void spiderbot_guide_release()
99 rkt = findchainentity(realowner, self.owner);
103 crosshair_trace(self.owner);
106 if(rkt.think == spiderbot_rocket_guided)
108 rkt.pos1 = trace_endpos;
109 rkt.think = spiderbot_rocket_unguided;
115 void spiderbot_rocket_do()
121 if (self.owner.BUTTON_ATCK2)
124 if (self.tur_head.frame == 9 || self.tur_head.frame == 1)
126 if(self.gun2.cnt < time && self.tur_head.frame == 9)
127 self.tur_head.frame = 1;
136 spiderbot_guide_release();
141 if(self.gun2.cnt > time)
144 if (self.tur_head.frame >= 9)
145 self.tur_head.frame = 1;
147 if not (self.owner.BUTTON_ATCK2)
150 crosshair_trace(self.owner);
152 v = gettaginfo(self.tur_head,gettagindex(self.tur_head,"tag_fire"));
153 rocket = vehicles_projectile("rocket_explode", "weapons/rocket_impact.wav", "", "weapons/rocket_fire.wav",
154 v, normalize(v_forward + (v_up * 0.5) + randomvec() * 0.25) * autocvar_g_vehicle_spiderbot_rocket_speed,
155 autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
156 DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health);
158 rocket.cnt = time + 15;
159 rocket.classname = "spiderbot_rocket";
160 rocket.pos1 = trace_endpos;
161 rocket.think = spiderbot_rocket_guided;
162 rocket.nextthink = time;
163 rocket.cnt = time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
164 te_explosion (rocket.origin);
166 self.tur_head.frame += 1;
167 if (self.tur_head.frame == 9)
168 self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_reload;
170 self.attack_finished_single = autocvar_g_vehicle_spiderbot_rocket_refire;
172 self.gun2.cnt = time + self.attack_finished_single;
177 void spiderbot_minigun_fire(entity gun, float trail)
181 v = gettaginfo(gun, gettagindex(gun,"barrels"));
182 v_forward = normalize(v_forward);
185 fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
186 autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
190 sound (gun, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
191 trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
192 pointparticles(particleeffectnum("spiderbot_minigun_muzzleflash"), v, v_forward * 2500, 1);
193 pointparticles(particleeffectnum("spiderbot_minigun_impact"), trace_endpos, trace_plane_normal * 2500,1);
197 void spiderbot_miniguns_do()
201 if((self.vehicle_reload1 == 1) || (!self.owner.BUTTON_ATCK))
203 ftmp = 1 / autocvar_g_vehicle_spiderbot_minigun_cooldown * sys_frametime;
204 self.owner.vehicle_reload1 = max(self.owner.vehicle_reload1 - ftmp, 0);
205 if(self.owner.vehicle_reload1 <= 0)
206 self.vehicle_reload1 = 0;
211 if (self.owner.BUTTON_ATCK)
215 self.gun1.angles_z += (1440 * sys_frametime);
216 self.gun2.angles_z -= (1440 * sys_frametime);
217 if(self.gun1.angles_z >= 360)
219 self.gun1.angles_z = 0;
220 self.gun2.angles_z = 360;
223 if (self.tur_head.attack_finished_single < time)
225 // Fire bullets, alternating trails left<->right
227 if(self.misc_bulletcounter == 1)
229 spiderbot_minigun_fire(self.vehicle.gun1, 0);
230 spiderbot_minigun_fire(self.vehicle.gun2, 1);
231 self.misc_bulletcounter = 0;
235 spiderbot_minigun_fire(self.vehicle.gun1, 1);
236 spiderbot_minigun_fire(self.vehicle.gun2, 0);
237 self.misc_bulletcounter += 1;
241 ftmp = autocvar_g_vehicle_spiderbot_minigun_refire / autocvar_g_vehicle_spiderbot_minigun_heat;
242 self.owner.vehicle_reload1 += ftmp;
244 if(self.owner.vehicle_reload1 >= 1)
246 self.vehicle_reload1 = 1;
247 self.owner.vehicle_reload1 = 1;
248 self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_cooldown + time;
251 self.tur_head.attack_finished_single = autocvar_g_vehicle_spiderbot_minigun_refire + time;
257 float spiderbot_frame()
260 entity player, spider;
264 spider = self.vehicle;
266 player.BUTTON_ZOOM = 0;
267 player.BUTTON_CROUCH = 0;
268 player.switchweapon = 0;
270 if(player.BUTTON_USE)
273 vehicles_exit(VHEF_NORMAL);
280 crosshair_trace(player);
281 //UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
283 #if VEHICLES_VIEWROTATE_CROSSHAIR
284 ad = vectoangles(normalize(trace_endpos - gettaginfo(spider.tur_head,gettagindex(spider.tur_head,"tag_hud")))) - (spider.tur_head.angles + spider.angles);
285 if(ad_x > 180) ad_x -= 360;
286 if(ad_x < -180) ad_x += 360;
287 if(ad_y > 180) ad_y -= 360;
288 if(ad_y < -180) ad_y += 360;
291 ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
292 ad_y = bound(-ftmp, ad_y, ftmp);
293 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);
296 ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
297 //ad_x = bound(-ftmp, ad_x, ftmp);
298 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);
301 ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
302 ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
305 player.v_angle_x *= -1;
306 ad = player.v_angle - (spider.tur_head.angles + spider.angles);
307 player.v_angle_x *= -1;
308 if(ad_x > 180) ad_x -= 360;
309 if(ad_x < -180) ad_x += 360;
310 if(ad_y > 180) ad_y -= 360;
311 if(ad_y < -180) ad_y += 360;
314 ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
315 ad_y = bound(-ftmp, ad_y, ftmp);
316 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);
320 ad = vectoangles(normalize(trace_endpos - gettaginfo(spider.tur_head,gettagindex(spider.tur_head,"tag_hud")))) - (spider.tur_head.angles + spider.angles);
321 if(ad_x > 180) ad_x -= 360;
322 if(ad_x < -180) ad_x += 360;
325 ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
326 ad_x = bound(ftmp * -1, ad_x, ftmp);
327 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);
332 ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
333 ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
337 makevectors(spider.angles + '-1 0 0' * spider.angles_x);
341 ofs = self.origin + v_up * 128;
342 te_lightning1(world, ofs, ofs + v_up * 32);
343 te_lightning1(world, ofs, ofs + v_right * 128);
344 te_lightning1(world, ofs, ofs + v_forward * 256);
347 movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend);
349 if(spider.flags & FL_ONGROUND)
351 if(player.BUTTON_JUMP && self.tur_head.wait < time)
353 self.tur_head.wait = time + 2;
354 player.BUTTON_JUMP = 0;
355 spider.velocity = v_forward * 700 + v_up * 600;
360 if(vlen(player.movement) == 0)
362 movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
367 spider.angles_y = anglemods(spider.angles_y + ftmp);
368 spider.tur_head.angles_y -= ftmp;
370 if(player.movement_x != 0)
372 if(player.movement_x > 0)
374 player.movement_x = 1;
377 else if(player.movement_x < 0)
379 player.movement_x = -1;
382 player.movement_y = 0;
383 movelib_move_simple(normalize(v_forward * player.movement_x),autocvar_g_vehicle_spiderbot_speed_walk,autocvar_g_vehicle_spiderbot_movement_inertia);
385 else if(player.movement_y != 0)
387 if(player.movement_y < 0)
389 player.movement_y = -1;
392 else if(player.movement_y > 0)
394 player.movement_y = 1;
397 movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
403 self.angles_x = bound(-45, self.angles_x, 45);
404 self.angles_z = bound(-45, self.angles_z, 45);
406 spiderbot_miniguns_do();
407 spiderbot_rocket_do();
409 if(self.vehicle_flags & VHF_SHIELDREGEN)
410 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);
412 if(self.vehicle_flags & VHF_HEALTHREGEN)
413 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);
415 player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
416 player.vehicle_ammo2 = spider.tur_head.frame;
418 if(spider.gun2.cnt <= time)
419 player.vehicle_reload2 = 1;
421 player.vehicle_reload2 = 1 - ((spider.gun2.cnt - time) / spider.attack_finished_single);
423 setorigin(player, spider.origin + '0 0 1' * SPIDERBOT_MAX_z);
424 player.velocity = spider.velocity;
426 VEHICLE_UPDATE_PLAYER(health, spiderbot);
428 if(self.vehicle_flags & VHF_HASSHIELD)
429 VEHICLE_UPDATE_PLAYER(shield, spiderbot);
431 #if 1 // 0 to enable per-gun impact aux crosshairs
432 // Avarage gun impact point's -> aux cross
434 ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
436 ad += gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
439 v_forward = vf * 0.5;
440 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
441 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
444 ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
445 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
446 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
448 ad = gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
449 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
450 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 1);
457 void spiderbot_think()
459 if(self.flags & FL_ONGROUND)
460 movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
462 self.nextthink = time;
465 void spiderbot_enter()
467 self.movetype = MOVETYPE_WALK;
468 self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_spiderbot_health);
469 self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_spiderbot_shield);
472 void spiderbot_exit(float eject)
476 e = findchain(classname,"spiderbot_rocket");
479 if(e.owner == self.owner)
481 e.realowner = self.owner;
487 self.velocity = '0 0 0';
488 self.think = spiderbot_think;
489 self.nextthink = time;
491 self.movetype = MOVETYPE_WALK;
496 makevectors(self.angles);
499 setorigin(self.owner ,self.origin + v_forward * 100 + '0 0 64');
500 self.owner.velocity = (v_up + v_forward * 0.25) * 750;
503 setorigin(self.owner, self.origin - v_forward * 200 + '0 0 64');
508 // Better way of determening whats crushable needed! (fl_crushable?)
509 float spiderbot_crushable(entity e)
511 if(e.classname == "corpse")
514 if(e.classname == "player")
517 if(e.classname == "monster_zombie")
523 /*void spiderbot_touch(
528 if(vlen(self.velocity) == 0)
531 if not (spiderbot_crushable(other))
534 //todo: add check for velocity/angle here (so we dont cush players runing into us from behind)
536 Damage(other, self, self.owner,autocvar_g_vehicle_spiderbot_crush_dmg,DEATH_SBCRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicle_spiderbot_crush_force);
540 if(other.classname != "player")
543 if(other.deadflag != DEAD_NO)
546 if(other.vehicle != world)
553 void spiderbot_spawn()
556 self.tur_head.frame = 1;
557 self.think = spiderbot_think;
558 self.nextthink = time;
559 self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
560 self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
561 self.movetype = MOVETYPE_WALK;
562 self.solid = SOLID_SLIDEBOX;
563 self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
564 self.tur_head.angles = '0 0 0';
566 setorigin(self, self.pos1 + '0 0 128');
567 self.angles = self.pos2;
570 void spiderbot_headfade()
572 self.think = spiderbot_headfade;
573 self.nextthink = self.fade_time;
574 self.alpha = 1 - (time - self.fade_time) * self.fade_rate;
576 if(self.cnt < time || self.alpha < 0.1)
580 sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
581 pointparticles(particleeffectnum("rocket_explode"), self.origin + '0 0 100', '0 0 0', 1);
587 void spiderbot_blowup()
590 sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
592 for(i = 0; i < 5; ++i)
593 pointparticles(particleeffectnum("rocket_explode"), self.origin + (randomvec() * 100) + '0 0 100', '0 0 0', 1);
601 setmodel(b, "models/vehicles/spiderbot.dpm");
602 setmodel(h, "models/vehicles/spiderbot_top.dpm");
603 setmodel(g1, "models/vehicles/spiderbot_barrels.dpm");
604 setmodel(g2, "models/vehicles/spiderbot_barrels.dpm");
606 setorigin(b, self.origin);
608 b.angles = self.angles;
609 setsize(b, self.mins, self.maxs);
611 setorigin(h, gettaginfo(self, gettagindex(self, "tag_head")));
612 h.movetype = MOVETYPE_BOUNCE;
613 h.solid = SOLID_BBOX;
614 h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
615 h.modelflags = MF_ROCKET;
616 h.effects = EF_FLAME | EF_LOWPRECISION;
617 h.avelocity = randomvec() * 360;
620 h.cnt = time + (3.5 * random());
621 h.fade_rate = 1 / min(autocvar_g_vehicle_spiderbot_respawntime, 10);
623 h.think = spiderbot_headfade;
626 setorigin(g1, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint01")));
627 g1.movetype = MOVETYPE_TOSS;
628 g1.solid = SOLID_CORPSE;
629 g1.velocity = v_forward * 700 + (randomvec() * 32);
630 g1.avelocity = randomvec() * 180;
632 setorigin(g2, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint02")));
633 g2.movetype = MOVETYPE_TOSS;
634 g2.solid = SOLID_CORPSE;
635 g2.velocity = v_forward * 700 + (randomvec() * 32);
636 g2.avelocity = randomvec() * 180;
638 h.colormod = b.colormod = g1.colormod = g2.colormod = '-2 -2 -2';
640 SUB_SetFade(b, time + 5, min(autocvar_g_vehicle_spiderbot_respawntime, 1));
641 //SUB_SetFade(h, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
642 SUB_SetFade(g1, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
643 SUB_SetFade(g2, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
645 RadiusDamage (self, self, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world);
647 self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
648 self.movetype = MOVETYPE_NONE;
649 self.deadflag = DEAD_DEAD;
650 self.solid = SOLID_NOT;
651 self.tur_head.effects &~= EF_FLAME;
652 self.vehicle_hudmodel.viewmodelforclient = self;
654 //self.nextthink = time + autocvar_g_vehicle_spiderbot_respawntime;
655 //self.think = spiderbot_spawn;
657 //setorigin(self, self.tur_aimpos);
662 sound (self, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
663 pointparticles(particleeffectnum("rocket_explode"), self.origin + '0 0 100', '0 0 0', 1);
666 self.event_damage = SUB_Null;
667 self.takedamage = DAMAGE_NO;
668 self.touch = SUB_Null;
669 self.nextthink = 3.4 + time + random() * 2;
670 self.think = spiderbot_blowup;
671 self.deadflag = DEAD_DYING;
673 self.tur_head.effects |= EF_FLAME;
674 self.colormod = self.tur_head.colormod = '-1 -1 -1';
676 self.movetype = MOVETYPE_TOSS;
680 void vewhicle_spiderbot_dinit()
682 if not (vehicle_initialize(
684 "models/vehicles/spiderbot.dpm",
685 "models/vehicles/spiderbot_top.dpm",
686 "models/vehicles/spiderbot_cockpit.dpm",
687 "tag_head", "tag_hud", "",
689 SPIDERBOT_MIN, SPIDERBOT_MAX,
691 spiderbot_spawn, autocvar_g_vehicle_spiderbot_respawntime,
693 spiderbot_enter, spiderbot_exit,
694 spiderbot_die, spiderbot_think))
703 setmodel(self.gun1, "models/vehicles/spiderbot_barrels.dpm");
704 setmodel(self.gun2, "models/vehicles/spiderbot_barrels.dpm");
706 setattachment(self.gun1, self.tur_head, "tag_hardpoint01");
707 setattachment(self.gun2, self.tur_head, "tag_hardpoint02");
713 void spawnfunc_vehicle_spiderbot()
715 precache_model ( "models/vhshield.md3");
716 precache_model ( "models/vehicles/spiderbot.dpm");
717 precache_model ( "models/vehicles/spiderbot_top.dpm");
718 precache_model ( "models/vehicles/spiderbot_barrels.dpm");
719 precache_model ( "models/vehicles/spiderbot_cockpit.dpm");
720 precache_model ( "models/uziflash.md3");
722 precache_sound ( "weapons/rocket_impact.wav" );
723 precache_sound ( "weapons/uzi_fire.wav" );
724 precache_sound ( "weapons/rocket_impact.wav" );
726 vehicles_configcheck("vehicle_spiderbot.cfg", autocvar_g_vehicle_spiderbot_health);
727 if(autocvar_g_vehicle_spiderbot_shield)
728 self.vehicle_flags |= VHF_HASSHIELD;
730 if(autocvar_g_vehicle_spiderbot_shield_regen)
731 self.vehicle_flags |= VHF_SHIELDREGEN;
733 if(autocvar_g_vehicle_spiderbot_health_regen)
734 self.vehicle_flags |= VHF_HEALTHREGEN;
736 self.think = vewhicle_spiderbot_dinit;
737 self.nextthink = time + 0.5;