1 #include "spiderbot.qh"
5 const int SBRM_FIRST = 1;
6 const int SBRM_VOLLY = 1;
7 const int SBRM_GUIDE = 2;
8 const int SBRM_ARTILLERY = 3;
9 const int SBRM_LAST = 3;
12 bool autocvar_g_vehicle_spiderbot = true;
14 float autocvar_g_vehicle_spiderbot_respawntime = 45;
16 float autocvar_g_vehicle_spiderbot_speed_stop = 50;
17 float autocvar_g_vehicle_spiderbot_speed_strafe = 400;
18 float autocvar_g_vehicle_spiderbot_speed_walk = 500;
19 float autocvar_g_vehicle_spiderbot_speed_run = 700;
20 float autocvar_g_vehicle_spiderbot_turnspeed = 90;
21 float autocvar_g_vehicle_spiderbot_turnspeed_strafe = 300;
22 float autocvar_g_vehicle_spiderbot_movement_inertia = 0.15;
24 float autocvar_g_vehicle_spiderbot_springlength = 150;
25 float autocvar_g_vehicle_spiderbot_springup = 20;
26 float autocvar_g_vehicle_spiderbot_springblend = 0.1;
27 float autocvar_g_vehicle_spiderbot_tiltlimit = 90;
29 float autocvar_g_vehicle_spiderbot_head_pitchlimit_down = -20;
30 float autocvar_g_vehicle_spiderbot_head_pitchlimit_up = 30;
31 float autocvar_g_vehicle_spiderbot_head_turnlimit = 90;
32 float autocvar_g_vehicle_spiderbot_head_turnspeed = 110;
34 int autocvar_g_vehicle_spiderbot_health = 800;
35 float autocvar_g_vehicle_spiderbot_health_regen = 10;
36 float autocvar_g_vehicle_spiderbot_health_regen_pause = 5;
38 int autocvar_g_vehicle_spiderbot_shield = 200;
39 float autocvar_g_vehicle_spiderbot_shield_regen = 25;
40 float autocvar_g_vehicle_spiderbot_shield_regen_pause = 0.35;
42 // 'minspeed_for_pain speedchange_to_pain_factor max_damage'
43 vector autocvar_g_vehicle_spiderbot_bouncepain = '0 0 0';
46 bool spiderbot_frame(entity this, float dt)
48 entity vehic = this.vehicle;
53 vehic.solid = SOLID_NOT;
54 vehic.takedamage = DAMAGE_NO;
55 set_movetype(vehic, MOVETYPE_NONE);
59 vehicles_frame(vehic, this);
61 PHYS_INPUT_BUTTON_ZOOM(this) = false;
62 PHYS_INPUT_BUTTON_CROUCH(this) = false;
63 PS(this).m_switchweapon = WEP_Null;
64 this.vehicle_weapon2mode = vehic.vehicle_weapon2mode;
67 #if 1 // 0 to enable per-gun impact aux crosshairs
68 // Avarage gun impact point's -> aux cross
69 vector ad = gettaginfo(vehic.tur_head, gettagindex(vehic.tur_head, "tag_hardpoint01"));
70 vector vf = v_forward;
71 ad += gettaginfo(vehic.tur_head, gettagindex(vehic.tur_head, "tag_hardpoint02"));
75 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, vehic);
76 UpdateAuxiliaryXhair(this, trace_endpos, ('1 0 0' * this.vehicle_reload1) + ('0 1 0' * (1 - this.vehicle_reload1)), 0);
78 vector ad = gettaginfo(vehic.gun1, gettagindex(vehic.gun1, "barrels"));
79 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, vehic);
80 UpdateAuxiliaryXhair(this, trace_endpos, ('1 0 0' * this.vehicle_reload1) + ('0 1 0' * (1 - this.vehicle_reload1)), 0);
82 ad = gettaginfo(vehic.gun2, gettagindex(vehic.gun2, "barrels"));
83 traceline(ad, ad + v_forward * MAX_SHOT_DISTANCE, MOVE_NORMAL, vehic);
84 UpdateAuxiliaryXhair(this, trace_endpos, ('1 0 0' * this.vehicle_reload1) + ('0 1 0' * (1 - this.vehicle_reload1)), 1);
88 crosshair_trace(this);
89 ad = vectoangles(normalize(trace_endpos - ad));
90 ad = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(vehic.angles), AnglesTransform_FromAngles(ad))) - vehic.tur_head.angles;
91 ad = AnglesTransform_Normalize(ad, true);
92 //UpdateAuxiliaryXhair(this, trace_endpos, ('1 0 0' * this.vehicle_reload2) + ('0 1 0' * (1 - this.vehicle_reload2)), 2);
95 float ftmp = autocvar_g_vehicle_spiderbot_head_turnspeed * PHYS_INPUT_FRAMETIME;
96 ad_y = bound(-ftmp, ad_y, ftmp);
97 vehic.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, vehic.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit);
100 ad_x = bound(ftmp * -1, ad_x, ftmp);
101 vehic.tur_head.angles_x = bound(autocvar_g_vehicle_spiderbot_head_pitchlimit_down, vehic.tur_head.angles_x + ad_x, autocvar_g_vehicle_spiderbot_head_pitchlimit_up);
104 //fixedmakevectors(vehic.angles);
105 makevectors(vehic.angles + '-2 0 0' * vehic.angles_x);
107 movelib_groundalign4point(vehic, autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend, autocvar_g_vehicle_spiderbot_tiltlimit);
109 if(IS_ONGROUND(vehic))
110 vehic.jump_delay = time; // reset now so movement can begin
112 //if(IS_ONGROUND(vehic))
114 if(IS_ONGROUND(vehic))
115 if(vehic.frame == 4 && vehic.tur_head.wait != 0)
117 sound (vehic, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_LAND, VOL_VEHICLEENGINE, ATTEN_NORM);
121 if (!PHYS_INPUT_BUTTON_JUMP(this))
122 PHYS_INPUT_BUTTON_JUMP(vehic) = false;
124 if((IS_ONGROUND(vehic)) && PHYS_INPUT_BUTTON_JUMP(this) && !PHYS_INPUT_BUTTON_JUMP(vehic) && vehic.tur_head.wait < time)
126 sound (vehic, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_JUMP, VOL_VEHICLEENGINE, ATTEN_NORM);
127 //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
130 vehic.tur_head.wait = time + 2;
131 vehic.jump_delay = time + 2;
132 PHYS_INPUT_BUTTON_JUMP(vehic) = true; // set spider's jump
133 //PHYS_INPUT_BUTTON_JUMP(this) = false;
135 vector movefix = '0 0 0';
136 if(this.movement_x > 0) movefix_x = 1;
137 if(this.movement_x < 0) movefix_x = -1;
138 if(this.movement_y > 0) movefix_y = 1;
139 if(this.movement_y < 0) movefix_y = -1;
141 vector rt = movefix_y * v_right;
142 vector sd = movefix_x * v_forward;
143 if(movefix_y == 0 && movefix_x == 0)
144 sd = v_forward; // always do forward
146 UNSET_ONGROUND(vehic);
148 vehic.velocity = sd * 700 + rt * 600 + v_up * 600;
151 else if(time >= vehic.jump_delay)
155 if(IS_ONGROUND(vehic))
157 if(vehic.sound_nexttime < time || vehic.delay != 3)
160 vehic.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_idle.wav");
161 //dprint("spiderbot_idle:", ftos(soundlength("vehicles/spiderbot_idle.wav")), "\n");
162 sound (vehic, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_IDLE, VOL_VEHICLEENGINE, ATTEN_NORM);
164 movelib_brake_simple(vehic, autocvar_g_vehicle_spiderbot_speed_stop);
171 if(this.movement_x == 0 && this.movement_y != 0)
172 ftmp = autocvar_g_vehicle_spiderbot_turnspeed_strafe * PHYS_INPUT_FRAMETIME;
174 ftmp = autocvar_g_vehicle_spiderbot_turnspeed * PHYS_INPUT_FRAMETIME;
176 ftmp = bound(-ftmp, vehic.tur_head.angles_y, ftmp);
177 vehic.angles_y = anglemods(vehic.angles_y + ftmp);
178 vehic.tur_head.angles_y -= ftmp;
180 if(this.movement_x != 0)
182 if(this.movement_x > 0)
185 if(IS_ONGROUND(vehic))
188 else if(this.movement_x < 0)
190 this.movement_x = -1;
191 if(IS_ONGROUND(vehic))
195 float oldvelz = vehic.velocity_z;
196 movelib_move_simple(vehic, normalize(v_forward * this.movement_x),((PHYS_INPUT_BUTTON_JUMP(this)) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
197 vehic.velocity_z = oldvelz;
198 float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
199 if(vehic.velocity_z <= 20) // not while jumping
200 vehic.velocity_z -= g * PHYS_INPUT_FRAMETIME * autocvar_sv_gravity;
201 if(IS_ONGROUND(vehic))
202 if(vehic.sound_nexttime < time || vehic.delay != 1)
205 vehic.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_walk.wav");
206 sound (vehic, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_WALK, VOL_VEHICLEENGINE, ATTEN_NORM);
207 //dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n");
210 else if(this.movement_y != 0)
212 if(this.movement_y < 0)
214 this.movement_y = -1;
215 if(IS_ONGROUND(vehic))
218 else if(this.movement_y > 0)
221 if(IS_ONGROUND(vehic))
225 float oldvelz = vehic.velocity_z;
226 movelib_move_simple(vehic, normalize(v_right * this.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
227 vehic.velocity_z = oldvelz;
228 float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
229 if(vehic.velocity_z <= 20) // not while jumping
230 vehic.velocity_z -= g * PHYS_INPUT_FRAMETIME * autocvar_sv_gravity;
231 if(IS_ONGROUND(vehic))
232 if(vehic.sound_nexttime < time || vehic.delay != 2)
235 vehic.sound_nexttime = time + 6.486500; //soundlength("vehicles/spiderbot_strafe.wav");
236 sound (vehic, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_STRAFE, VOL_VEHICLEENGINE, ATTEN_NORM);
237 //dprint("spiderbot_strafe:", ftos(soundlength("vehicles/spiderbot_strafe.wav")), "\n");
244 vehic.angles_x = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, vehic.angles_x, autocvar_g_vehicle_spiderbot_tiltlimit);
245 vehic.angles_z = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, vehic.angles_z, autocvar_g_vehicle_spiderbot_tiltlimit);
247 if(!forbidWeaponUse(this))
248 if(PHYS_INPUT_BUTTON_ATCK(this))
251 if(vehic.vehicle_ammo1 >= autocvar_g_vehicle_spiderbot_minigun_ammo_cost && vehic.tur_head.attack_finished_single[0] <= time)
255 vehic.misc_bulletcounter += 1;
257 gun = (vehic.misc_bulletcounter % 2) ? vehic.gun1 : vehic.gun2;
259 v = gettaginfo(gun, gettagindex(gun, "barrels"));
260 v_forward = normalize(v_forward);
263 fireBullet(this, v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
264 autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN.m_id, 0);
266 sound (gun, CH_WEAPON_A, SND_UZI_FIRE, VOL_BASE, ATTEN_NORM);
267 //trailparticles(this, _particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
268 Send_Effect(EFFECT_SPIDERBOT_MINIGUN_MUZZLEFLASH, v, v_forward * 2500, 1);
270 vehic.vehicle_ammo1 -= autocvar_g_vehicle_spiderbot_minigun_ammo_cost;
271 vehic.tur_head.attack_finished_single[0] = time + autocvar_g_vehicle_spiderbot_minigun_refire;
272 this.vehicle_ammo1 = (vehic.vehicle_ammo1 / autocvar_g_vehicle_spiderbot_minigun_ammo_max) * 100;
273 vehic.gun1.angles_z += 45;
274 vehic.gun2.angles_z -= 45;
275 if(vehic.gun1.angles_z >= 360)
277 vehic.gun1.angles_z = 0;
278 vehic.gun2.angles_z = 0;
283 vehicles_regen(vehic, vehic.cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max,
284 autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause,
285 autocvar_g_vehicle_spiderbot_minigun_ammo_regen, dt, false);
288 spiderbot_rocket_do(vehic);
290 if(vehic.vehicle_flags & VHF_SHIELDREGEN)
291 vehicles_regen(vehic, vehic.dmg_time, vehicle_shield, autocvar_g_vehicle_spiderbot_shield, autocvar_g_vehicle_spiderbot_shield_regen_pause, autocvar_g_vehicle_spiderbot_shield_regen, dt, true);
293 if(vehic.vehicle_flags & VHF_HEALTHREGEN)
294 vehicles_regen(vehic, vehic.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, dt, false);
296 PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
297 //this.vehicle_ammo2 = vehic.tur_head.frame;
298 this.vehicle_ammo2 = (9 - vehic.tur_head.frame) / 8 * 100; // Percentage, like ammo1
300 if(vehic.gun2.cnt <= time)
301 this.vehicle_reload2 = 100;
303 this.vehicle_reload2 = 100 - ((vehic.gun2.cnt - time) / vehic.attack_finished_single[0]) * 100;
305 setorigin(this, vehic.origin + '0 0 1' * vehic.maxs_z);
306 this.velocity = vehic.velocity;
308 VEHICLE_UPDATE_PLAYER(this, vehic, health, spiderbot);
310 if(vehic.vehicle_flags & VHF_HASSHIELD)
311 VEHICLE_UPDATE_PLAYER(this, vehic, shield, spiderbot);
314 void spiderbot_exit(entity this, int eject)
318 IL_EACH(g_projectiles, it.owner == this.owner && it.classname == "spiderbot_rocket",
320 it.realowner = this.owner;
324 setthink(this, vehicles_think);
325 this.nextthink = time;
327 set_movetype(this, MOVETYPE_WALK);
332 makevectors(this.angles);
335 spot = this.origin + v_forward * 100 + '0 0 64';
336 spot = vehicles_findgoodexit(this, spot);
337 setorigin(this.owner , spot);
338 this.owner.velocity = (v_up + v_forward * 0.25) * 750;
339 this.owner.oldvelocity = this.owner.velocity;
343 if(vdist(this.velocity, >, autocvar_g_vehicle_spiderbot_speed_strafe))
345 this.owner.velocity = normalize(this.velocity) * vlen(this.velocity);
346 this.owner.velocity_z += 200;
347 spot = this.origin + v_forward * 128 + '0 0 64';
348 spot = vehicles_findgoodexit(this, spot);
352 this.owner.velocity = this.velocity * 0.5;
353 this.owner.velocity_z += 10;
354 spot = this.origin + v_forward * 256 + '0 0 64';
355 spot = vehicles_findgoodexit(this, spot);
357 this.owner.oldvelocity = this.owner.velocity;
358 setorigin(this.owner , spot);
361 antilag_clear(this.owner, CS(this.owner));
365 void spiderbot_headfade(entity this)
367 setthink(this, spiderbot_headfade);
368 this.nextthink = this.fade_time;
369 this.alpha = 1 - (time - this.fade_time) * this.fade_rate;
371 if(this.cnt < time || this.alpha < 0.1)
375 sound (this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
376 Send_Effect(EFFECT_EXPLOSION_BIG, this.origin + '0 0 100', '0 0 0', 1);
382 void spiderbot_blowup(entity this)
388 sound (this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
389 Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (this.origin + '0 0 100'), '0 0 0', 1);
391 this.nextthink = time + 0.1;
401 setmodel(b, MDL_VEH_SPIDERBOT_BODY);
402 setmodel(h, MDL_VEH_SPIDERBOT_TOP);
403 setmodel(g1, MDL_VEH_SPIDERBOT_GUN);
404 setmodel(g2, MDL_VEH_SPIDERBOT_GUN);
406 setorigin(b, this.origin);
408 b.angles = this.angles;
409 setsize(b, this.mins, this.maxs);
411 vector org = gettaginfo(this, gettagindex(this, "tag_head"));
413 set_movetype(h, MOVETYPE_BOUNCE);
414 h.solid = SOLID_BBOX;
415 h.velocity = v_up * (500 + random() * 500) + randomvec() * 128;
416 h.modelflags = MF_ROCKET;
417 h.effects = EF_FLAME | EF_LOWPRECISION;
418 h.avelocity = randomvec() * 360;
421 h.cnt = time + (3.5 * random());
422 h.fade_rate = 1 / min(this.respawntime, 10);
424 setthink(h, spiderbot_headfade);
427 org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint01"));
429 set_movetype(g1, MOVETYPE_TOSS);
430 g1.solid = SOLID_CORPSE;
431 g1.velocity = v_forward * 700 + (randomvec() * 32);
432 g1.avelocity = randomvec() * 180;
434 org = gettaginfo(this.tur_head, gettagindex(this.tur_head, "tag_hardpoint02"));
436 set_movetype(g2, MOVETYPE_TOSS);
437 g2.solid = SOLID_CORPSE;
438 g2.velocity = v_forward * 700 + (randomvec() * 32);
439 g2.avelocity = randomvec() * 180;
441 h.colormod = b.colormod = g1.colormod = g2.colormod = '-2 -2 -2';
443 SUB_SetFade(b, time + 5, min(this.respawntime, 1));
444 //SUB_SetFade(h, time, min(this.respawntime, 10));
445 SUB_SetFade(g1, time, min(this.respawntime, 10));
446 SUB_SetFade(g2, time, min(this.respawntime, 10));
448 RadiusDamage (this, this.enemy, 250, 15, 250, NULL, NULL, 250, DEATH_VH_SPID_DEATH.m_id, NULL);
450 this.alpha = this.tur_head.alpha = this.gun1.alpha = this.gun2.alpha = -1;
451 set_movetype(this, MOVETYPE_NONE);
452 this.deadflag = DEAD_DEAD;
453 this.solid = SOLID_NOT;
454 this.tur_head.effects &= ~EF_FLAME;
455 this.vehicle_hudmodel.viewmodelforclient = this;
458 bool spiderbot_impulse(entity this, int _imp)
462 case IMP_weapon_group_1.impulse:
463 this.vehicle.vehicle_weapon2mode = SBRM_VOLLY;
464 CSQCVehicleSetup(this, 0);
466 case IMP_weapon_group_2.impulse:
467 this.vehicle.vehicle_weapon2mode = SBRM_GUIDE;
468 CSQCVehicleSetup(this, 0);
470 case IMP_weapon_group_3.impulse:
471 this.vehicle.vehicle_weapon2mode = SBRM_ARTILLERY;
472 CSQCVehicleSetup(this, 0);
475 case IMP_weapon_next_byid.impulse:
476 case IMP_weapon_next_bypriority.impulse:
477 case IMP_weapon_next_bygroup.impulse:
478 this.vehicle.vehicle_weapon2mode += 1;
479 if(this.vehicle.vehicle_weapon2mode > SBRM_LAST)
480 this.vehicle.vehicle_weapon2mode = SBRM_FIRST;
482 //centerprint(this, strcat("Rocket mode is ", ftos(this.vehicle.vehicle_weapon2mode)));
483 CSQCVehicleSetup(this, 0);
485 case IMP_weapon_last.impulse:
486 case IMP_weapon_prev_byid.impulse:
487 case IMP_weapon_prev_bypriority.impulse:
488 case IMP_weapon_prev_bygroup.impulse:
489 this.vehicle.vehicle_weapon2mode -= 1;
490 if(this.vehicle.vehicle_weapon2mode < SBRM_FIRST)
491 this.vehicle.vehicle_weapon2mode = SBRM_LAST;
493 //centerprint(this, strcat("Rocket mode is ", ftos(this.vehicle.vehicle_weapon2mode)));
494 CSQCVehicleSetup(this, 0);
498 case IMP_weapon_drop.impulse: // toss gun, could be used to exit?
500 case IMP_weapon_reload.impulse: // Manual minigun reload?
507 spawnfunc(vehicle_spiderbot)
509 if(!autocvar_g_vehicle_spiderbot) { delete(this); return; }
510 if(!vehicle_initialize(this, VEH_SPIDERBOT, false)) { delete(this); return; }
513 METHOD(Spiderbot, vr_impact, void(Spiderbot thisveh, entity instance))
515 if(autocvar_g_vehicle_spiderbot_bouncepain)
516 vehicles_impact(instance, autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
518 METHOD(Spiderbot, vr_enter, void(Spiderbot thisveh, entity instance))
520 instance.vehicle_weapon2mode = SBRM_GUIDE;
521 set_movetype(instance, MOVETYPE_WALK);
522 CSQCVehicleSetup(instance.owner, 0);
523 instance.owner.vehicle_health = (instance.vehicle_health / autocvar_g_vehicle_spiderbot_health) * 100;
524 instance.owner.vehicle_shield = (instance.vehicle_shield / autocvar_g_vehicle_spiderbot_shield) * 100;
526 if(instance.owner.flagcarried)
528 setattachment(instance.owner.flagcarried, instance.tur_head, "");
529 setorigin(instance.owner.flagcarried, '-20 0 120');
532 METHOD(Spiderbot, vr_think, void(Spiderbot thisveh, entity instance))
534 if(IS_ONGROUND(instance))
535 movelib_brake_simple(instance, autocvar_g_vehicle_spiderbot_speed_stop);
537 METHOD(Spiderbot, vr_death, void(Spiderbot thisveh, entity instance))
540 instance.event_damage = func_null;
541 instance.takedamage = DAMAGE_NO;
542 settouch(instance, func_null);
543 instance.cnt = 3.4 + time + random() * 2;
544 setthink(instance, spiderbot_blowup);
545 instance.nextthink = time;
546 instance.deadflag = DEAD_DYING;
548 instance.tur_head.effects |= EF_FLAME;
549 instance.colormod = instance.tur_head.colormod = '-1 -1 -1';
551 set_movetype(instance, MOVETYPE_TOSS);
553 CSQCModel_UnlinkEntity(instance); // networking the death scene would be a nightmare
555 METHOD(Spiderbot, vr_spawn, void(Spiderbot thisveh, entity instance))
559 instance.vehicles_impulse = spiderbot_impulse;
560 instance.gun1 = spawn();
561 instance.gun2 = spawn();
562 setmodel(instance.gun1, MDL_VEH_SPIDERBOT_GUN);
563 setmodel(instance.gun2, MDL_VEH_SPIDERBOT_GUN);
564 setattachment(instance.gun1, instance.tur_head, "tag_hardpoint01");
565 setattachment(instance.gun2, instance.tur_head, "tag_hardpoint02");
566 instance.gravity = 2;
567 instance.mass = 5000;
571 instance.tur_head.frame = 1;
572 set_movetype(instance, MOVETYPE_WALK);
573 instance.solid = SOLID_SLIDEBOX;
574 instance.alpha = instance.tur_head.alpha = instance.gun1.alpha = instance.gun2.alpha = 1;
575 instance.tur_head.angles = '0 0 0';
576 instance.vehicle_exit = spiderbot_exit;
578 setorigin(instance, instance.pos1 + '0 0 128');
579 instance.angles = instance.pos2;
580 instance.damageforcescale = 0.03;
581 instance.vehicle_health = autocvar_g_vehicle_spiderbot_health;
582 instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
584 instance.PlayerPhysplug = spiderbot_frame;
586 METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance))
588 if(autocvar_g_vehicle_spiderbot_shield)
589 instance.vehicle_flags |= VHF_HASSHIELD;
591 if(autocvar_g_vehicle_spiderbot_shield_regen)
592 instance.vehicle_flags |= VHF_SHIELDREGEN;
594 if(autocvar_g_vehicle_spiderbot_health_regen)
595 instance.vehicle_flags |= VHF_HEALTHREGEN;
597 instance.respawntime = autocvar_g_vehicle_spiderbot_respawntime;
598 instance.vehicle_health = autocvar_g_vehicle_spiderbot_health;
599 instance.vehicle_shield = autocvar_g_vehicle_spiderbot_shield;
600 instance.max_health = instance.vehicle_health;
601 instance.pushable = true; // spiderbot can use jumppads
606 //float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
607 //float autocvar_cl_vehicle_spiderbot_cross_size = 1;
609 METHOD(Spiderbot, vr_hud, void(Spiderbot thisveh))
611 Vehicles_drawHUD(VEH_SPIDERBOT.m_icon, "vehicle_spider_weapon1", "vehicle_spider_weapon2",
612 "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
613 "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color);
615 METHOD(Spiderbot, vr_crosshair, void(Spiderbot thisveh, entity player))
621 case SBRM_VOLLY: crosshair = vCROSS_BURST; break;
622 case SBRM_GUIDE: crosshair = vCROSS_GUIDE; break;
623 case SBRM_ARTILLERY: crosshair = vCROSS_RAIN; break;
624 default: crosshair = vCROSS_BURST;
627 Vehicles_drawCrosshair(crosshair);
629 METHOD(Spiderbot, vr_setup, void(Spiderbot thisveh, entity instance))
631 AuxiliaryXhair[0].axh_image = vCROSS_HINT; // Minigun1
632 AuxiliaryXhair[1].axh_image = vCROSS_HINT; // Minigun2