1 #ifndef VEHICLE_SPIDERBOT
2 #define VEHICLE_SPIDERBOT
4 #include "spiderbot_weapons.qc"
6 CLASS(Spiderbot, Vehicle)
7 /* spawnflags */ ATTRIB(Spiderbot, spawnflags, int, VHF_DMGSHAKE);
8 /* mins */ ATTRIB(Spiderbot, mins, vector, '-75 -75 10');
9 /* maxs */ ATTRIB(Spiderbot, maxs, vector, '75 75 125');
10 /* model */ ATTRIB(Spiderbot, mdl, string, "models/vehicles/spiderbot.dpm");
11 /* model */ ATTRIB(Spiderbot, model, string, "models/vehicles/spiderbot.dpm");
12 /* head_model */ ATTRIB(Spiderbot, head_model, string, "models/vehicles/spiderbot_top.dpm");
13 /* hud_model */ ATTRIB(Spiderbot, hud_model, string, "models/vehicles/spiderbot_cockpit.dpm");
14 /* tags */ ATTRIB(Spiderbot, tag_head, string, "tag_head");
15 /* tags */ ATTRIB(Spiderbot, tag_hud, string, "tag_hud");
16 /* tags */ ATTRIB(Spiderbot, tag_view, string, "");
17 /* netname */ ATTRIB(Spiderbot, netname, string, "spiderbot");
18 /* fullname */ ATTRIB(Spiderbot, vehicle_name, string, _("Spiderbot"));
19 /* icon */ ATTRIB(Spiderbot, m_icon, string, "vehicle_spider");
22 REGISTER_VEHICLE(SPIDERBOT, NEW(Spiderbot));
28 const int SBRM_FIRST = 1;
29 const int SBRM_VOLLY = 1;
30 const int SBRM_GUIDE = 2;
31 const int SBRM_ARTILLERY = 3;
32 const int SBRM_LAST = 3;
34 #include "spiderbot_weapons.qc"
37 bool autocvar_g_vehicle_spiderbot;
39 float autocvar_g_vehicle_spiderbot_respawntime;
41 float autocvar_g_vehicle_spiderbot_speed_stop;
42 float autocvar_g_vehicle_spiderbot_speed_strafe;
43 float autocvar_g_vehicle_spiderbot_speed_walk;
44 float autocvar_g_vehicle_spiderbot_speed_run = 700;
45 float autocvar_g_vehicle_spiderbot_turnspeed;
46 float autocvar_g_vehicle_spiderbot_turnspeed_strafe;
47 float autocvar_g_vehicle_spiderbot_movement_inertia;
49 float autocvar_g_vehicle_spiderbot_springlength;
50 float autocvar_g_vehicle_spiderbot_springup;
51 float autocvar_g_vehicle_spiderbot_springblend;
52 float autocvar_g_vehicle_spiderbot_tiltlimit;
54 float autocvar_g_vehicle_spiderbot_head_pitchlimit_down;
55 float autocvar_g_vehicle_spiderbot_head_pitchlimit_up;
56 float autocvar_g_vehicle_spiderbot_head_turnlimit;
57 float autocvar_g_vehicle_spiderbot_head_turnspeed;
59 int autocvar_g_vehicle_spiderbot_health;
60 float autocvar_g_vehicle_spiderbot_health_regen;
61 float autocvar_g_vehicle_spiderbot_health_regen_pause;
63 int autocvar_g_vehicle_spiderbot_shield;
64 float autocvar_g_vehicle_spiderbot_shield_regen;
65 float autocvar_g_vehicle_spiderbot_shield_regen_pause;
67 vector autocvar_g_vehicle_spiderbot_bouncepain;
70 float spiderbot_frame()
73 entity player, spider;
76 if(intermission_running)
78 self.vehicle.velocity = '0 0 0';
79 self.vehicle.avelocity = '0 0 0';
84 spider = self.vehicle;
89 player.BUTTON_ZOOM = 0;
90 player.BUTTON_CROUCH = 0;
91 player.switchweapon = 0;
92 player.vehicle_weapon2mode = spider.vehicle_weapon2mode;
95 #if 1 // 0 to enable per-gun impact aux crosshairs
96 // Avarage gun impact point's -> aux cross
97 ad = gettaginfo(spider.tur_head, gettagindex(spider.tur_head, "tag_hardpoint01"));
99 ad += gettaginfo(spider.tur_head, gettagindex(spider.tur_head, "tag_hardpoint02"));
102 v_forward = vf * 0.5;
103 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
104 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
106 ad = gettaginfo(spider.gun1, gettagindex(spider.gun1, "barrels"));
107 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
108 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 0);
110 ad = gettaginfo(spider.gun2, gettagindex(spider.gun2, "barrels"));
111 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, spider);
112 UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload1) + ('0 1 0' * (1 - player.vehicle_reload1)), 1);
113 ad = 0.5 * (ad + vf);
116 crosshair_trace(player);
117 ad = vectoangles(normalize(trace_endpos - ad));
118 ad = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(spider.angles), AnglesTransform_FromAngles(ad))) - spider.tur_head.angles;
119 ad = AnglesTransform_Normalize(ad, true);
120 //UpdateAuxiliaryXhair(player, trace_endpos, ('1 0 0' * player.vehicle_reload2) + ('0 1 0' * (1 - player.vehicle_reload2)), 2);
123 ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * sys_frametime;
124 ad_y = bound(-ftmp, ad_y, ftmp);
125 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);
128 ad_x = bound(ftmp * -1, ad_x, ftmp);
129 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);
132 //fixedmakevectors(spider.angles);
133 makevectors(spider.angles + '-2 0 0' * spider.angles_x);
135 movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit);
137 if(spider.flags & FL_ONGROUND)
138 spider.jump_delay = time; // reset now so movement can begin
140 //if(spider.flags & FL_ONGROUND)
142 if(spider.flags & FL_ONGROUND)
143 if(spider.frame == 4 && self.tur_head.wait != 0)
145 sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_LAND, VOL_VEHICLEENGINE, ATTEN_NORM);
149 if(!player.BUTTON_JUMP)
150 spider.BUTTON_JUMP = 0;
152 if((spider.flags & FL_ONGROUND) && player.BUTTON_JUMP && !spider.BUTTON_JUMP && self.tur_head.wait < time)
154 sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_JUMP, VOL_VEHICLEENGINE, ATTEN_NORM);
155 //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
158 self.tur_head.wait = time + 2;
159 spider.jump_delay = time + 2;
160 spider.BUTTON_JUMP = 1; // set spider's jump
161 //player.BUTTON_JUMP = 0;
163 vector movefix = '0 0 0';
164 if(player.movement_x > 0) movefix_x = 1;
165 if(player.movement_x < 0) movefix_x = -1;
166 if(player.movement_y > 0) movefix_y = 1;
167 if(player.movement_y < 0) movefix_y = -1;
169 vector rt = movefix_y * v_right;
170 vector sd = movefix_x * v_forward;
171 if(movefix_y == 0 && movefix_x == 0)
172 sd = v_forward; // always do forward
174 spider.flags &= ~FL_ONGROUND;
176 spider.velocity = sd * 700 + rt * 600 + v_up * 600;
179 else if(time >= spider.jump_delay)
181 if(vlen(player.movement) == 0)
183 if(spider.flags & FL_ONGROUND)
185 if(self.sound_nexttime < time || self.delay != 3)
188 self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav");
189 //dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n");
190 sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_IDLE, VOL_VEHICLEENGINE, ATTEN_NORM);
192 movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
199 if(player.movement_x == 0 && player.movement_y != 0)
200 ftmp = autocvar_g_vehicle_spiderbot_turnspeed_strafe * sys_frametime;
202 ftmp = autocvar_g_vehicle_spiderbot_turnspeed * sys_frametime;
204 ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
205 spider.angles_y = anglemods(spider.angles_y + ftmp);
206 spider.tur_head.angles_y -= ftmp;
208 if(player.movement_x != 0)
210 if(player.movement_x > 0)
212 player.movement_x = 1;
213 if(spider.flags & FL_ONGROUND)
216 else if(player.movement_x < 0)
218 player.movement_x = -1;
219 if(spider.flags & FL_ONGROUND)
222 player.movement_y = 0;
223 float oldvelz = spider.velocity_z;
224 movelib_move_simple(normalize(v_forward * player.movement_x),((player.BUTTON_JUMP) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
225 spider.velocity_z = oldvelz;
226 float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
227 if(spider.velocity_z <= 20) // not while jumping
228 spider.velocity_z -= g * sys_frametime * autocvar_sv_gravity;
229 if(spider.flags & FL_ONGROUND)
230 if(self.sound_nexttime < time || self.delay != 1)
233 self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav");
234 sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_WALK, VOL_VEHICLEENGINE, ATTEN_NORM);
235 //dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n");
238 else if(player.movement_y != 0)
240 if(player.movement_y < 0)
242 player.movement_y = -1;
243 if(spider.flags & FL_ONGROUND)
246 else if(player.movement_y > 0)
248 player.movement_y = 1;
249 if(spider.flags & FL_ONGROUND)
253 float oldvelz = spider.velocity_z;
254 movelib_move_simple(normalize(v_right * player.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
255 spider.velocity_z = oldvelz;
256 float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
257 if(spider.velocity_z <= 20) // not while jumping
258 spider.velocity_z -= g * sys_frametime * autocvar_sv_gravity;
259 if(spider.flags & FL_ONGROUND)
260 if(self.sound_nexttime < time || self.delay != 2)
263 self.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav");
264 sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_STRAFE, VOL_VEHICLEENGINE, ATTEN_NORM);
265 //dprint("spiderbot_strafe:", ftos(soundlength("vehicles/spiderbot_strafe.wav")), "\n");
272 self.angles_x = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, self.angles_x, autocvar_g_vehicle_spiderbot_tiltlimit);
273 self.angles_z = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, self.angles_z, autocvar_g_vehicle_spiderbot_tiltlimit);
275 if(!forbidWeaponUse(player))
276 if(player.BUTTON_ATCK)
279 if(spider.vehicle_ammo1 >= autocvar_g_vehicle_spiderbot_minigun_ammo_cost && spider.tur_head.attack_finished_single <= time)
283 spider.misc_bulletcounter += 1;
287 gun = (spider.misc_bulletcounter % 2) ? spider.gun1 : spider.gun2;
289 v = gettaginfo(gun, gettagindex(gun, "barrels"));
290 v_forward = normalize(v_forward);
293 fireBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
294 autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0);
296 sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
297 //trailparticles(self, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
298 pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH), v, v_forward * 2500, 1);
302 spider.vehicle_ammo1 -= autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
303 spider.tur_head.attack_finished_single = time + autocvar_g_vehicle_spiderbot_minigun_refire;
304 player.vehicle_ammo1 = (spider.vehicle_ammo1 / autocvar_g_vehicle_spiderbot_minigun_ammo_max) * 100;
305 spider.gun1.angles_z += 45;
306 spider.gun2.angles_z -= 45;
307 if(spider.gun1.angles_z >= 360)
309 spider.gun1.angles_z = 0;
310 spider.gun2.angles_z = 0;
315 vehicles_regen(spider.cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max,
316 autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause,
317 autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime, false);
320 spiderbot_rocket_do();
322 if(self.vehicle_flags & VHF_SHIELDREGEN)
323 vehicles_regen(spider.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, frametime, true);
325 if(self.vehicle_flags & VHF_HEALTHREGEN)
326 vehicles_regen(spider.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime, false);
328 player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
329 //player.vehicle_ammo2 = spider.tur_head.frame;
330 player.vehicle_ammo2 = (9 - spider.tur_head.frame) / 8 * 100; // Percentage, like ammo1
332 if(spider.gun2.cnt <= time)
333 player.vehicle_reload2 = 100;
335 player.vehicle_reload2 = 100 - ((spider.gun2.cnt - time) / spider.attack_finished_single) * 100;
337 setorigin(player, spider.origin + '0 0 1' * spider.maxs_z);
338 player.velocity = spider.velocity;
340 VEHICLE_UPDATE_PLAYER(player, health, spiderbot);
342 if(self.vehicle_flags & VHF_HASSHIELD)
343 VEHICLE_UPDATE_PLAYER(player, shield, spiderbot);
349 void spiderbot_exit(float eject)
354 e = findchain(classname,"spiderbot_rocket");
357 if(e.owner == self.owner)
359 e.realowner = self.owner;
365 self.think = vehicles_think;
366 self.nextthink = time;
368 self.movetype = MOVETYPE_WALK;
373 makevectors(self.angles);
376 spot = self.origin + v_forward * 100 + '0 0 64';
377 spot = vehicles_findgoodexit(spot);
378 setorigin(self.owner , spot);
379 self.owner.velocity = (v_up + v_forward * 0.25) * 750;
380 self.owner.oldvelocity = self.owner.velocity;
384 if(vlen(self.velocity) > autocvar_g_vehicle_spiderbot_speed_strafe)
386 self.owner.velocity = normalize(self.velocity) * vlen(self.velocity);
387 self.owner.velocity_z += 200;
388 spot = self.origin + v_forward * 128 + '0 0 64';
389 spot = vehicles_findgoodexit(spot);
393 self.owner.velocity = self.velocity * 0.5;
394 self.owner.velocity_z += 10;
395 spot = self.origin + v_forward * 256 + '0 0 64';
396 spot = vehicles_findgoodexit(spot);
398 self.owner.oldvelocity = self.owner.velocity;
399 setorigin(self.owner , spot);
402 antilag_clear(self.owner);
406 void spiderbot_headfade()
408 self.think = spiderbot_headfade;
409 self.nextthink = self.fade_time;
410 self.alpha = 1 - (time - self.fade_time) * self.fade_rate;
412 if(self.cnt < time || self.alpha < 0.1)
416 sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
417 Send_Effect(EFFECT_EXPLOSION_BIG, self.origin + '0 0 100', '0 0 0', 1);
423 void spiderbot_blowup()
429 sound (self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
430 Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
432 self.nextthink = time + 0.1;
442 setmodel(b, MDL_VEH_SPIDERBOT_BODY);
443 setmodel(h, MDL_VEH_SPIDERBOT_TOP);
444 setmodel(g1, MDL_VEH_SPIDERBOT_GUN);
445 setmodel(g2, MDL_VEH_SPIDERBOT_GUN);
447 setorigin(b, self.origin);
449 b.angles = self.angles;
450 setsize(b, self.mins, self.maxs);
452 setorigin(h, gettaginfo(self, gettagindex(self, "tag_head")));
453 h.movetype = MOVETYPE_BOUNCE;
454 h.solid = SOLID_BBOX;
455 h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
456 h.modelflags = MF_ROCKET;
457 h.effects = EF_FLAME | EF_LOWPRECISION;
458 h.avelocity = randomvec() * 360;
461 h.cnt = time + (3.5 * random());
462 h.fade_rate = 1 / min(self.respawntime, 10);
464 h.think = spiderbot_headfade;
467 setorigin(g1, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint01")));
468 g1.movetype = MOVETYPE_TOSS;
469 g1.solid = SOLID_CORPSE;
470 g1.velocity = v_forward * 700 + (randomvec() * 32);
471 g1.avelocity = randomvec() * 180;
473 setorigin(g2, gettaginfo(self.tur_head, gettagindex(self.tur_head, "tag_hardpoint02")));
474 g2.movetype = MOVETYPE_TOSS;
475 g2.solid = SOLID_CORPSE;
476 g2.velocity = v_forward * 700 + (randomvec() * 32);
477 g2.avelocity = randomvec() * 180;
479 h.colormod = b.colormod = g1.colormod = g2.colormod = '-2 -2 -2';
481 SUB_SetFade(b, time + 5, min(self.respawntime, 1));
482 //SUB_SetFade(h, time, min(self.respawntime, 10));
483 SUB_SetFade(g1, time, min(self.respawntime, 10));
484 SUB_SetFade(g2, time, min(self.respawntime, 10));
486 RadiusDamage (self, self.enemy, 250, 15, 250, world, world, 250, DEATH_VH_SPID_DEATH, world);
488 self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
489 self.movetype = MOVETYPE_NONE;
490 self.deadflag = DEAD_DEAD;
491 self.solid = SOLID_NOT;
492 self.tur_head.effects &= ~EF_FLAME;
493 self.vehicle_hudmodel.viewmodelforclient = self;
496 bool spiderbot_impulse(int _imp)
502 self.vehicle.vehicle_weapon2mode = SBRM_VOLLY;
503 CSQCVehicleSetup(self, 0);
507 self.vehicle.vehicle_weapon2mode = SBRM_GUIDE;
508 CSQCVehicleSetup(self, 0);
513 self.vehicle.vehicle_weapon2mode = SBRM_ARTILLERY;
514 CSQCVehicleSetup(self, 0);
520 self.vehicle.vehicle_weapon2mode += 1;
521 if(self.vehicle.vehicle_weapon2mode > SBRM_LAST)
522 self.vehicle.vehicle_weapon2mode = SBRM_FIRST;
524 //centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode)));
525 CSQCVehicleSetup(self, 0);
531 self.vehicle.vehicle_weapon2mode -= 1;
532 if(self.vehicle.vehicle_weapon2mode < SBRM_FIRST)
533 self.vehicle.vehicle_weapon2mode = SBRM_LAST;
535 //centerprint(self, strcat("Rocket mode is ", ftos(self.vehicle.vehicle_weapon2mode)));
536 CSQCVehicleSetup(self, 0);
540 case 17: // toss gun, could be used to exit?
542 case 20: // Manual minigun reload?
549 void spawnfunc_vehicle_spiderbot()
551 if(!autocvar_g_vehicle_spiderbot) { remove(self); return; }
552 if(!vehicle_initialize(VEH_SPIDERBOT, false)) { remove(self); return; }
555 METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh))
557 if(autocvar_g_vehicle_spiderbot_bouncepain)
558 vehicles_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
560 METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh))
562 self.vehicle_weapon2mode = SBRM_GUIDE;
563 self.movetype = MOVETYPE_WALK;
564 CSQCVehicleSetup(self.owner, 0);
565 self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_spiderbot_health) * 100;
566 self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_spiderbot_shield) * 100;
568 if(self.owner.flagcarried)
570 setattachment(self.owner.flagcarried, self.tur_head, "");
571 setorigin(self.owner.flagcarried, '-20 0 120');
574 METHOD(Spiderbot, vr_think, void(Spiderbot thisveh))
576 if(self.flags & FL_ONGROUND)
577 movelib_beak_simple(autocvar_g_vehicle_spiderbot_speed_stop);
579 METHOD(Spiderbot, vr_death, void(Spiderbot thisveh))
582 self.event_damage = func_null;
583 self.takedamage = DAMAGE_NO;
584 self.touch = func_null;
585 self.cnt = 3.4 + time + random() * 2;
586 self.think = spiderbot_blowup;
587 self.nextthink = time;
588 self.deadflag = DEAD_DYING;
590 self.tur_head.effects |= EF_FLAME;
591 self.colormod = self.tur_head.colormod = '-1 -1 -1';
593 self.movetype = MOVETYPE_TOSS;
595 CSQCModel_UnlinkEntity(); // networking the death scene would be a nightmare
597 METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh))
601 self.vehicles_impulse = spiderbot_impulse;
604 setmodel(self.gun1, MDL_VEH_SPIDERBOT_GUN);
605 setmodel(self.gun2, MDL_VEH_SPIDERBOT_GUN);
606 setattachment(self.gun1, self.tur_head, "tag_hardpoint01");
607 setattachment(self.gun2, self.tur_head, "tag_hardpoint02");
613 self.tur_head.frame = 1;
614 self.movetype = MOVETYPE_WALK;
615 self.solid = SOLID_SLIDEBOX;
616 self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = 1;
617 self.tur_head.angles = '0 0 0';
618 self.vehicle_exit = spiderbot_exit;
620 setorigin(self, self.pos1 + '0 0 128');
621 self.angles = self.pos2;
622 self.damageforcescale = 0.03;
623 self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
624 self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
626 self.PlayerPhysplug = spiderbot_frame;
628 METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh))
630 if(autocvar_g_vehicle_spiderbot_shield)
631 self.vehicle_flags |= VHF_HASSHIELD;
633 if(autocvar_g_vehicle_spiderbot_shield_regen)
634 self.vehicle_flags |= VHF_SHIELDREGEN;
636 if(autocvar_g_vehicle_spiderbot_health_regen)
637 self.vehicle_flags |= VHF_HEALTHREGEN;
639 self.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
640 self.vehicle_health = autocvar_g_vehicle_spiderbot_health;
641 self.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
642 self.max_health = self.vehicle_health;
643 self.pushable = true; // spiderbot can use jumppads
648 float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
649 float autocvar_cl_vehicle_spiderbot_cross_size = 1;
651 METHOD(Spiderbot, vr_hud, void(Spiderbot thisveh))
657 case SBRM_VOLLY: crosshair = vCROSS_BURST; break;
658 case SBRM_GUIDE: crosshair = vCROSS_GUIDE; break;
659 case SBRM_ARTILLERY: crosshair = vCROSS_RAIN; break;
660 default: crosshair = vCROSS_BURST;
663 Vehicles_drawHUD(VEH_SPIDERBOT.m_icon, "vehicle_spider_weapon1", "vehicle_spider_weapon2",
664 "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
665 "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
668 METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh))
670 AuxiliaryXhair[0].axh_image = vCROSS_HINT; // Minigun1
671 AuxiliaryXhair[1].axh_image = vCROSS_HINT; // Minigun2