Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
bumblebee.qc
Go to the documentation of this file.
1#include "bumblebee.qh"
2
3#ifdef SVQC
5#endif
6
7#ifdef GAMEQC
8
9const float BRG_SETUP = 2;
10const float BRG_START = 4;
11const float BRG_END = 8;
12
13#ifdef SVQC
15
25
29
33
37
41
43
49
50
55
61
68
74
76
77bool bumblebee_gunner_frame(entity this, float dt)
78{
79 entity vehic = this.vehicle.owner;
80 entity gun = this.vehicle;
81 return = true;
82
83 // this isn't technically a vehicle (yet), let's not do frame functions on it (yet)
84 //vehicles_frame(gun, player);
85
86 vehic.solid = SOLID_NOT;
87 //setorigin(this, vehic.origin);
88 this.velocity = vehic.velocity;
89
90 float _in, _out;
91 vehic.angles_x *= -1;
92 makevectors(vehic.angles);
93 vehic.angles_x *= -1;
94 if(gun == vehic.gun1)
95 {
98 setorigin(this, vehic.origin + v_up * -16 + v_forward * -16 + v_right * 128);
99 }
100 else
101 {
104 setorigin(this, vehic.origin + v_up * -16 + v_forward * -16 + v_right * -128);
105 }
106 this.oldorigin = this.origin; // negate fall damage
107
108 crosshair_trace(this);
109 vector _ct = trace_endpos;
110 vector ad;
111
113 {
114 if(gun.lock_time < time || IS_DEAD(gun.enemy) || STAT(FROZEN, gun.enemy))
115 gun.enemy = NULL;
116
117 if(trace_ent)
118 if(trace_ent.move_movetype)
119 if(trace_ent.takedamage)
120 if(!IS_DEAD(trace_ent) && !STAT(FROZEN, trace_ent))
121 {
122 if(teamplay)
123 {
124 if(DIFF_TEAM(trace_ent, this))
125 {
126 gun.enemy = trace_ent;
127 gun.lock_time = time + 2.5;
128 }
129 }
130 else
131 {
132 gun.enemy = trace_ent;
133 gun.lock_time = time + 0.5;
134 }
135 }
136 }
137
138 if(gun.enemy)
139 {
140 float distance, impact_time;
141
142 vector vf = real_origin(gun.enemy);
143 vector _vel = gun.enemy.velocity;
144 if(gun.enemy.move_movetype == MOVETYPE_WALK)
145 _vel.z *= 0.1;
146
147
148 ad = vf;
149 distance = vlen(ad - this.origin);
150 impact_time = distance / autocvar_g_vehicle_bumblebee_cannon_speed;
151 ad = vf + _vel * impact_time;
152 trace_endpos = ad;
153
154
155 UpdateAuxiliaryXhair(this, ad, '1 0 1', 1);
156 vehicle_aimturret(vehic, trace_endpos, gun, "fire",
159
160 }
161 else
162 vehicle_aimturret(vehic, _ct, gun, "fire",
165
166 if(!weaponLocked(this) && !weaponUseForbidden(this))
167 if(PHYS_INPUT_BUTTON_ATCK(this))
168 if(time > gun.attack_finished_single[0])
169 if(gun.vehicle_energy >= autocvar_g_vehicle_bumblebee_cannon_cost)
170 {
171 gun.vehicle_energy -= autocvar_g_vehicle_bumblebee_cannon_cost;
172 bumblebee_fire_cannon(vehic, gun, "fire", this);
173 gun.delay = time;
174 gun.attack_finished_single[0] = time + autocvar_g_vehicle_bumblebee_cannon_refire;
175 }
176
177 VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, bumblebee, RES_HEALTH);
178
179 if(vehic.vehicle_flags & VHF_HASSHIELD)
180 VEHICLE_UPDATE_PLAYER(this, vehic, shield, bumblebee);
181
182 ad = gettaginfo(gun, gettagindex(gun, "fire"));
183 traceline(ad, ad + v_forward * max_shot_distance, MOVE_NORMAL, gun);
184
185 UpdateAuxiliaryXhair(this, trace_endpos, ('1 0 0' * this.vehicle_reload1) + ('0 1 0' *(1 - this.vehicle_reload1)), 0);
186
187 if(vehic.owner)
188 UpdateAuxiliaryXhair(vehic.owner, trace_endpos, ('1 0 0' * this.vehicle_reload1) + ('0 1 0' *(1 - this.vehicle_reload1)), ((this == vehic.gunner1) ? 1 : 2));
189
190 vehic.solid = SOLID_BBOX;
192 this.vehicle_energy = (gun.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
193}
194
196{
197 //vector exitspot;
198 float mysize;
199
200 tracebox(gunner.origin + '0 0 32', STAT(PL_MIN, player), STAT(PL_MAX, player), prefer_spot, MOVE_NORMAL, player);
202 return prefer_spot;
203
204 mysize = 1.5 * vlen(STAT(PL_MAX, player) - STAT(PL_MIN, player)); // can't use gunner's size, as they don't have a size
205 float i;
206 vector v, v2;
207 v2 = 0.5 * (gunner.absmin + gunner.absmax);
208 for(i = 0; i < 100; ++i)
209 {
210 v = randomvec();
211 v_z = 0;
212 v = v2 + normalize(v) * mysize;
213 tracebox(v2, STAT(PL_MIN, player), STAT(PL_MAX, player), v, MOVE_NORMAL, player);
215 return v;
216 }
217
218 return prefer_spot; // this should be considered a fallback?!
219}
220
221void bumblebee_gunner_exit(entity this, int _exitflag)
222{
223 entity player = ((this.owner.gun1 == this) ? this.owner.gunner1 : this.owner.gunner2);
224 entity gunner = this;
225 entity vehic = gunner.owner;
226
227 if(IS_REAL_CLIENT(player))
228 {
229 msg_entity = player;
231 WriteEntity(MSG_ONE, player);
232
233 // NOTE: engine networked
236 WriteAngle(MSG_ONE, vehic.angles.y);
238 }
239
241
242 player.takedamage = DAMAGE_AIM;
243 player.solid = SOLID_SLIDEBOX;
245 player.effects &= ~EF_NODRAW;
246 player.alpha = 1;
247 player.PlayerPhysplug = func_null;
248 player.view_ofs = STAT(PL_VIEW_OFS, player);
249 player.event_damage = PlayerDamage;
250 STAT(HUD, player) = HUD_NORMAL;
251 player.teleportable = TELEPORT_NORMAL;
252 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
253 {
254 .entity weaponentity = weaponentities[slot];
255 player.(weaponentity).m_switchweapon = gunner.(weaponentity).m_switchweapon;
256 delete(gunner.(weaponentity));
257 }
258 player.vehicle_enter_delay = time + 2;
259 setsize(player, STAT(PL_MIN, player), STAT(PL_MAX, player));
260
261 fixedmakevectors(vehic.angles);
262
263 if(player == vehic.gunner1) { vehic.gunner1 = NULL; }
264 if(player == vehic.gunner2) { vehic.gunner2 = NULL; v_right *= -1; }
265
266 vector spot = real_origin(gunner);
267 spot = spot + v_up * 128 + v_forward * 300 + v_right * 150;
268 spot = bumblebee_gunner_findgoodexit(spot, gunner, player);
269
270 // TODO: figure a way to move player out of the gunner
271
272 player.velocity = 0.75 * vehic.velocity + normalize(spot - vehic.origin) * 200;
273 player.velocity_z += 10;
274
275 gunner.phase = time + 5;
276 gunner.vehicle_hudmodel.viewmodelforclient = gunner;
277
278 MUTATOR_CALLHOOK(VehicleExit, player, gunner);
279
280 player.vehicle = NULL;
281}
282
284{
285 entity vehic = this;
286 entity gunner = NULL;
287
288 if(!vehic.gunner1 && !vehic.gunner2 && ((time >= vehic.gun1.phase) + (time >= vehic.gun2.phase)) == 2)
289 {
290 // we can have some fun
291 vector v1 = gettaginfo(vehic, gettagindex(vehic, "cannon_right"));
292 vector v2 = gettaginfo(vehic, gettagindex(vehic, "cannon_left"));
293 if(vlen2(player.origin - v1) < vlen2(player.origin - v2))
294 {
295 gunner = vehic.gun1;
296 vehic.gunner1 = player;
297 }
298 else
299 {
300 gunner = vehic.gun2;
301 vehic.gunner2 = player;
302 }
303 }
304 else if(!vehic.gunner1 && time >= vehic.gun1.phase) { gunner = vehic.gun1; vehic.gunner1 = player; }
305 else if(!vehic.gunner2 && time >= vehic.gun2.phase) { gunner = vehic.gun2; vehic.gunner2 = player; }
306 else { LOG_TRACE("Vehicle is full, fail"); return false; }
307
308 player.vehicle = gunner;
309 player.angles = vehic.angles;
310 player.takedamage = DAMAGE_NO;
311 player.solid = SOLID_NOT;
312 player.alpha = -1;
314 player.event_damage = func_null;
315 player.view_ofs = '0 0 0';
316 STAT(HUD, player) = STAT(HUD, gunner);
317 player.teleportable = false;
318 player.PlayerPhysplug = gunner.PlayerPhysplug;
319 player.vehicle_ammo1 = vehic.vehicle_ammo1;
320 player.vehicle_ammo2 = vehic.vehicle_ammo2;
321 player.vehicle_reload1 = vehic.vehicle_reload1;
322 player.vehicle_reload2 = vehic.vehicle_reload2;
323 player.vehicle_energy = vehic.vehicle_energy;
324 UNSET_ONGROUND(player);
325
326 RemoveGrapplingHooks(player);
327
328 for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
329 {
330 .entity weaponentity = weaponentities[slot];
331
332 gunner.(weaponentity) = new(temp_wepent);
333 gunner.(weaponentity).m_switchweapon = player.(weaponentity).m_switchweapon;
334 }
335 gunner.vehicle_exit = bumblebee_gunner_exit;
336 gunner.vehicle_hudmodel.viewmodelforclient = player;
337
338 if(IS_REAL_CLIENT(player))
339 {
340 msg_entity = player;
342 WriteEntity(MSG_ONE, gunner.vehicle_viewport);
343
344 // NOTE: engine networked
346 WriteAngle(MSG_ONE, gunner.angles_x + vehic.angles_x); // tilt
347 WriteAngle(MSG_ONE, gunner.angles_y + vehic.angles_y); // yaw
348 WriteAngle(MSG_ONE, 0); // roll
349 }
350
351 CSQCVehicleSetup(player, STAT(HUD, player));
352
353 MUTATOR_CALLHOOK(VehicleEnter, player, gunner);
354
355 return true;
356}
357
359{
361 return false;
362
363 if((!IS_PLAYER(toucher))
364 || (IS_DEAD(toucher))
365 || (toucher.vehicle)
366 || (DIFF_TEAM(toucher, this))
367 ) { return false; }
368
369 return true;
370}
371
373{
374 if(autocvar_g_vehicles_enter) { return; }
375
376 if(this.gunner1 != NULL && this.gunner2 != NULL)
377 {
378 vehicles_touch(this, toucher);
379 return;
380 }
381
383 {
384 float phase_time = (time >= this.gun1.phase) + (time >= this.gun2.phase);
385
386 if(time >= toucher.vehicle_enter_delay && phase_time)
388 return;
389 }
390
391 vehicles_touch(this, toucher);
392}
393
414
415bool bumblebee_pilot_frame(entity this, float dt)
416{
417 entity vehic = this.vehicle;
418 return = true;
419
420 if(game_stopped)
421 {
422 vehic.solid = SOLID_NOT;
423 vehic.takedamage = DAMAGE_NO;
425 return;
426 }
427
428 vehicles_frame(vehic, this);
429
430 if(IS_DEAD(vehic))
431 {
433 return;
434 }
435
436 bumblebee_regen(vehic, dt);
437
438 crosshair_trace(this);
439
440 vector vang = vehic.angles;
441 vector newvel = vectoangles(normalize(trace_endpos - vehic.origin + '0 0 32'));
442 vang.x *= -1;
443 newvel.x *= -1;
444 if(newvel.x > 180) newvel.x -= 360;
445 if(newvel.x < -180) newvel.x += 360;
446 if(newvel.y > 180) newvel.y -= 360;
447 if(newvel.y < -180) newvel.y += 360;
448
449 float ftmp = shortangle_f(this.v_angle.y - vang.y, vang.y);
450 if(ftmp > 180) ftmp -= 360;
451 if(ftmp < -180) ftmp += 360;
452 vehic.avelocity_y = bound(-autocvar_g_vehicle_bumblebee_turnspeed, ftmp + vehic.avelocity.y * 0.9, autocvar_g_vehicle_bumblebee_turnspeed);
453
454 // Pitch
455 ftmp = 0;
456 if(CS(this).movement.x > 0 && vang.x < autocvar_g_vehicle_bumblebee_pitchlimit)
457 ftmp = 4;
458 else if(CS(this).movement.x < 0 && vang.x > -autocvar_g_vehicle_bumblebee_pitchlimit)
459 ftmp = -8;
460
463 vehic.avelocity_x = bound(-autocvar_g_vehicle_bumblebee_pitchspeed, ftmp + vehic.avelocity.x * 0.9, autocvar_g_vehicle_bumblebee_pitchspeed);
464
465 vehic.angles_x = anglemods(vehic.angles.x);
466 vehic.angles_y = anglemods(vehic.angles.y);
467 vehic.angles_z = anglemods(vehic.angles.z);
468
469 makevectors('0 1 0' * vehic.angles.y);
470 newvel = vehic.velocity * -autocvar_g_vehicle_bumblebee_friction;
471
472 if(CS(this).movement.x != 0)
473 {
474 if(CS(this).movement.x > 0)
476 else if(CS(this).movement.x < 0)
478 }
479
480 if(CS(this).movement.y != 0)
481 {
482 if(CS(this).movement.y < 0)
484 else if(CS(this).movement.y > 0)
486 ftmp = newvel * v_right;
487 ftmp *= dt * 0.1;
488 vehic.angles_z = bound(-15, vehic.angles.z + ftmp, 15);
489 }
490 else
491 {
492 vehic.angles_z *= 0.95;
493 if(vehic.angles.z >= -1 && vehic.angles.z <= -1)
494 vehic.angles_z = 0;
495 }
496
499 else if(PHYS_INPUT_BUTTON_JUMP(this))
501
502 vehic.velocity += newvel * dt;
503 this.velocity = CS(this).movement = vehic.velocity;
504
505
507 {
508 if(vehic.tur_head.lock_time < time || IS_DEAD(vehic.tur_head.enemy) || STAT(FROZEN, vehic.tur_head.enemy))
509 vehic.tur_head.enemy = NULL;
510
511 if(trace_ent)
512 if(trace_ent.move_movetype)
513 if(trace_ent.takedamage)
514 if(!IS_DEAD(trace_ent) && !STAT(FROZEN, trace_ent))
515 {
516 if(teamplay)
517 {
518 if(trace_ent.team == this.team)
519 {
520 vehic.tur_head.enemy = trace_ent;
521 vehic.tur_head.lock_time = time + autocvar_g_vehicle_bumblebee_healgun_locktime;
522 }
523 }
524 else
525 {
526 vehic.tur_head.enemy = trace_ent;
527 vehic.tur_head.lock_time = time + autocvar_g_vehicle_bumblebee_healgun_locktime;
528 }
529 }
530
531 if(vehic.tur_head.enemy)
532 {
533 trace_endpos = real_origin(vehic.tur_head.enemy);
534 UpdateAuxiliaryXhair(this, trace_endpos, '0 0.75 0', 0);
535 }
536 }
537
538 vang = vehicle_aimturret(vehic, trace_endpos, vehic.gun3, "fire",
541
542 if(!weaponLocked(this) && !weaponUseForbidden(this))
544 {
545 vehic.gun3.enemy.realowner = this;
546 vehic.gun3.enemy.effects &= ~EF_NODRAW;
547
548 vehic.gun3.enemy.hook_start = gettaginfo(vehic.gun3, gettagindex(vehic.gun3, "fire"));
549 vehic.gun3.enemy.SendFlags |= BRG_START;
550
551 traceline(vehic.gun3.enemy.hook_start, vehic.gun3.enemy.hook_start + v_forward * autocvar_g_vehicle_bumblebee_raygun_range, MOVE_NORMAL, vehic);
552
553 if(trace_ent)
554 {
556 {
559 }
560 else
561 {
562 if(!IS_DEAD(trace_ent))
563 {
564 if((teamplay && trace_ent.team == this.team) || !teamplay)
565 {
567 {
570 }
571
573 {
575 trace_ent.vehicle_shield = min(trace_ent.vehicle_shield + autocvar_g_vehicle_bumblebee_healgun_sps * dt, trace_ent.tur_head.max_health);
576 }
577 else if(IS_CLIENT(trace_ent))
578 {
582 }
583 }
584 }
585 }
586 }
587
588 vehic.gun3.enemy.hook_end = trace_endpos;
589 setorigin(vehic.gun3.enemy, trace_endpos);
590 vehic.gun3.enemy.SendFlags |= BRG_END;
591
592 vehic.wait = time + 1;
593 }
594 else
595 vehic.gun3.enemy.effects |= EF_NODRAW;
596 /*{
597 if(vehic.gun3.enemy)
598 remove(vehic.gun3.enemy);
599
600 vehic.gun3.enemy = NULL;
601 }
602 */
603
604 VEHICLE_UPDATE_PLAYER_RESOURCE(this, vehic, health, bumblebee, RES_HEALTH);
605 VEHICLE_UPDATE_PLAYER(this, vehic, energy, bumblebee);
606
607 this.vehicle_ammo1 = (vehic.gun1.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
608 this.vehicle_ammo2 = (vehic.gun2.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
609
610 if(vehic.vehicle_flags & VHF_HASSHIELD)
611 VEHICLE_UPDATE_PLAYER(this, vehic, shield, bumblebee);
612
613 vehic.angles_x *= -1;
614 makevectors(vehic.angles);
615 vehic.angles_x *= -1;
616 setorigin(this, vehic.origin + v_up * 48 + v_forward * 160);
617 this.oldorigin = this.origin; // negate fall damage
618
620}
621
623{
624 float hgt;
625
626 hgt = vehicle_altitude(this, 512);
627 this.velocity = (this.velocity * 0.9) + ('0 0 -1800' * (hgt / 256) * PHYS_INPUT_FRAMETIME);
628 this.angles_x *= 0.95;
629 this.angles_z *= 0.95;
630
631 if(hgt < 16)
633
634 this.nextthink = time;
635
637}
638
639void bumblebee_exit(entity this, int eject)
640{
641 if(this.owner.vehicleid == VEH_BUMBLEBEE.vehicleid)
642 {
643 bumblebee_gunner_exit(this, eject);
644 return;
645 }
646
648
649 if(!IS_DEAD(this))
650 {
652 this.nextthink = time;
653 }
654
656
657 if(!this.owner)
658 return;
659
661 vector spot;
663 spot = this.origin + v_up * 128 + v_forward * 300;
664 else
665 spot = this.origin + v_up * 128 - v_forward * 300;
666
667 spot = vehicles_findgoodexit(this, this.owner, spot);
668
669 // Hide beam
670 if(this.gun3.enemy || !wasfreed(this.gun3.enemy))
671 this.gun3.enemy.effects |= EF_NODRAW;
672
673 this.owner.velocity = 0.75 * this.vehicle.velocity + normalize(spot - this.vehicle.origin) * 200;
674 this.owner.velocity_z += 10;
675 setorigin(this.owner, spot);
676
677 antilag_clear(this.owner, CS(this.owner));
678 this.owner = NULL;
679}
680
682{
687 DEATH_VH_BUMB_DEATH.m_id, DMG_NOWEP, NULL);
688
689 sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
690 Send_Effect(EFFECT_EXPLOSION_BIG, (this.origin + '0 0 100') + (randomvec() * 80), '0 0 0', 1);
691
692 if(this.owner.deadflag == DEAD_DYING)
693 this.owner.deadflag = DEAD_DEAD;
694
695 delete(this);
696}
697
702
704{
705 if(time >= this.wait)
707
708 if(random() < 0.1)
709 {
710 sound(this, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
711 Send_Effect(EFFECT_EXPLOSION_SMALL, randomvec() * 80 + (this.origin + '0 0 100'), '0 0 0', 1);
712 }
713
714 this.nextthink = time + 0.1;
715}
716
717spawnfunc(vehicle_bumblebee)
718{
719 if(!autocvar_g_vehicle_bumblebee) { delete(this); return; }
720 if(!vehicle_initialize(this, VEH_BUMBLEBEE, false)) { delete(this); return; }
721}
722
723METHOD(Bumblebee, vr_impact, void(Bumblebee thisveh, entity instance))
724{
726 vehicles_impact(instance, autocvar_g_vehicle_bumblebee_bouncepain_x, autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z);
727}
728METHOD(Bumblebee, vr_enter, void(Bumblebee thisveh, entity instance))
729{
730 settouch(instance, bumblebee_touch);
731 instance.nextthink = 0;
733}
734METHOD(Bumblebee, vr_gunner_enter, void(Bumblebee thisveh, entity instance, entity actor))
735{
736 if(!instance.gunner1)
737 if(time >= instance.gun1.phase)
738 if(instance.gun1.vehicle_enter)
739 if(instance.gun1.vehicle_enter(instance, actor))
740 return;
741
742 if(!instance.gunner2)
743 if(time >= instance.gun2.phase)
744 if(instance.gun2.vehicle_enter)
745 if(instance.gun2.vehicle_enter(instance, actor))
746 return;
747}
748METHOD(Bumblebee, vr_think, void(Bumblebee thisveh, entity instance))
749{
750 instance.angles_z *= 0.8;
751 instance.angles_x *= 0.8;
752
753 instance.nextthink = time;
754
755 if(!instance.owner)
756 {
757 if(instance.gunner1)
758 {
759 entity e = instance.gunner1;
760 instance.gun1.vehicle_exit(instance.gun1, VHEF_EJECT);
761 instance.phase = 0;
762 gettouch(instance)(instance, e);
763 return;
764 }
765
766 if(instance.gunner2)
767 {
768 entity e = instance.gunner2;
769 instance.gun2.vehicle_exit(instance.gun2, VHEF_EJECT);
770 instance.phase = 0;
771 gettouch(instance)(instance, e);
772 return;
773 }
774 }
775}
776METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance))
777{
778 CSQCModel_UnlinkEntity(instance);
779
780 // hide beam
781 if(instance.gun3.enemy || !wasfreed(instance.gun3.enemy))
782 instance.gun3.enemy.effects |= EF_NODRAW;
783
784 if(instance.gunner1)
785 instance.gun1.vehicle_exit(instance.gun1, VHEF_EJECT);
786
787 if(instance.gunner2)
788 instance.gun2.vehicle_exit(instance.gun2, VHEF_EJECT);
789
790 instance.vehicle_exit(instance, VHEF_EJECT);
791
792 fixedmakevectors(instance.angles);
793 vehicle_tossgib(instance, instance.gun1, instance.velocity + v_right * 300 + v_up * 100 + randomvec() * 200, "cannon_right", rint(random()), rint(random()), 6, randomvec() * 200);
794 vehicle_tossgib(instance, instance.gun2, instance.velocity + v_right * -300 + v_up * 100 + randomvec() * 200, "cannon_left", rint(random()), rint(random()), 6, randomvec() * 200);
795 vehicle_tossgib(instance, instance.gun3, instance.velocity + v_forward * 300 + v_up * -100 + randomvec() * 200, "raygun", rint(random()), rint(random()), 6, randomvec() * 300);
796
797 entity _body = vehicle_tossgib(instance, instance, instance.velocity + randomvec() * 200, "", rint(random()), rint(random()), 6, randomvec() * 100);
798
799 if(random() > 0.5)
801 else
802 settouch(_body, func_null);
803
805 _body.nextthink = time;
806 _body.wait = time + 2 + (random() * 8);
807 _body.owner = instance;
808 _body.enemy = instance.enemy;
809 _body.scale = 1.5;
810 _body.angles = instance.angles;
811
812 Send_Effect(EFFECT_EXPLOSION_MEDIUM, findbetterlocation(instance.origin, 16), '0 0 0', 1);
813
814 SetResourceExplicit(instance, RES_HEALTH, 0);
815 instance.event_damage = func_null;
816 instance.solid = SOLID_NOT;
817 instance.takedamage = DAMAGE_NO;
818 instance.deadflag = DEAD_DYING;
819 set_movetype(instance, MOVETYPE_NONE);
820 instance.effects = EF_NODRAW;
821 instance.colormod = '0 0 0';
822 instance.avelocity = '0 0 0';
823 instance.velocity = '0 0 0';
824 settouch(instance, func_null);
825 instance.nextthink = 0;
826
827 setorigin(instance, instance.pos1);
828}
829METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance))
830{
831 if(!instance.gun1)
832 {
833 // for some reason, autosizing of the shield entity refuses to work for this one so set it up in advance.
834 instance.vehicle_shieldent = new(vehicle_shieldent);
835 instance.vehicle_shieldent.effects = EF_LOWPRECISION;
836 setmodel(instance.vehicle_shieldent, MDL_VEH_BUMBLEBEE_SHIELD);
837 setattachment(instance.vehicle_shieldent, instance, "");
838 setorigin(instance.vehicle_shieldent, real_origin(instance) - instance.origin);
839 instance.vehicle_shieldent.scale = 512 / vlen(instance.maxs - instance.mins);
840 setthink(instance.vehicle_shieldent, shieldhit_think);
841 instance.vehicle_shieldent.alpha = -1;
842 instance.vehicle_shieldent.effects = EF_LOWPRECISION | EF_NODRAW;
843
844 instance.gun1 = new(vehicle_playerslot);
845 instance.gun2 = new(vehicle_playerslot);
846 instance.gun3 = new(bumblebee_raygun);
847
848 instance.vehicle_flags |= VHF_MULTISLOT;
849
850 instance.gun1.owner = instance;
851 instance.gun2.owner = instance;
852 instance.gun3.owner = instance;
853
854 setmodel(instance.gun1, MDL_VEH_BUMBLEBEE_CANNON_RIGHT);
855 setmodel(instance.gun2, MDL_VEH_BUMBLEBEE_CANNON_LEFT);
856 setmodel(instance.gun3, MDL_VEH_BUMBLEBEE_CANNON_CENTER);
857
858 setattachment(instance.gun1, instance, "cannon_right");
859 setattachment(instance.gun2, instance, "cannon_left");
860
861 // Angled bones are no fun, messes up gun-aim; so work arround it.
862 instance.gun3.pos1 = instance.angles;
863 instance.angles = '0 0 0';
864 vector ofs = gettaginfo(instance, gettagindex(instance, "raygun"));
865 ofs -= instance.origin;
866 setattachment(instance.gun3, instance, "");
867 setorigin(instance.gun3, ofs);
868 instance.angles = instance.gun3.pos1;
869
870 vehicle_addplayerslot(instance, instance.gun1, HUD_BUMBLEBEE_GUN, MDL_VEH_BUMBLEBEE_GUNCOCKPIT, bumblebee_gunner_frame, bumblebee_gunner_exit, bumblebee_gunner_enter);
871 vehicle_addplayerslot(instance, instance.gun2, HUD_BUMBLEBEE_GUN, MDL_VEH_BUMBLEBEE_GUNCOCKPIT, bumblebee_gunner_frame, bumblebee_gunner_exit, bumblebee_gunner_enter);
872
873 setorigin(instance.vehicle_hudmodel, '50 0 -5'); // Move cockpit forward - down.
874 setorigin(instance.vehicle_viewport, '5 0 2'); // Move camera forward up
875
876 //fixme-model-bones
877 setorigin(instance.gun1.vehicle_hudmodel, '90 -27 -23');
878 setorigin(instance.gun1.vehicle_viewport, '-85 0 50');
879 //fixme-model-bones
880 setorigin(instance.gun2.vehicle_hudmodel, '90 27 -23');
881 setorigin(instance.gun2.vehicle_viewport, '-85 0 50');
882
883 instance.scale = 1.5;
884
885 // Raygun beam
886 if(instance.gun3.enemy == NULL)
887 {
888 instance.gun3.enemy = new(bumble_raygun);
889 Net_LinkEntity(instance.gun3.enemy, true, 0, bumble_raygun_send);
890 instance.gun3.enemy.SendFlags = BRG_SETUP;
891 instance.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
892 instance.gun3.enemy.effects = EF_NODRAW | EF_LOWPRECISION;
893 }
894 }
895
897 instance.dphitcontentsmask |= DPCONTENTS_LIQUIDSMASK;
898
900 instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
901 instance.solid = SOLID_BBOX;
902 set_movetype(instance, MOVETYPE_TOSS);
903 instance.damageforcescale = 0.025;
904
905 instance.PlayerPhysplug = bumblebee_pilot_frame;
906
907 setorigin(instance, instance.origin + '0 0 25');
908}
909METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh, entity instance))
910{
913 instance.vehicle_flags |= VHF_ENERGYREGEN;
914
916 instance.vehicle_flags |= VHF_HASSHIELD;
917
919 instance.vehicle_flags |= VHF_SHIELDREGEN;
920
922 instance.vehicle_flags |= VHF_HEALTHREGEN;
923
924 instance.vehicle_exit = bumblebee_exit;
925 instance.respawntime = autocvar_g_vehicle_bumblebee_respawntime;
927 instance.max_health = GetResource(instance, RES_HEALTH);
928 instance.vehicle_shield = autocvar_g_vehicle_bumblebee_shield;
929}
930
931#endif // SVQC
932#ifdef CSQC
933
935{
936 Vehicles_drawHUD("vehicle_gunner", "vehicle_gunner_weapon1", string_null,
938 string_null, '0 0 0');
939}
940
941METHOD(Bumblebee, vr_hud, void(Bumblebee thisveh))
942{
943 Vehicles_drawHUD(VEH_BUMBLEBEE.m_icon, "vehicle_bumble_weapon1", "vehicle_bumble_weapon2",
946
947 float hudAlpha = autocvar_hud_panel_fg_alpha;
948 float blinkValue = 0.55 + sin(time * 7) * 0.45;
949 vector tmpPos = '0 0 0';
950 vector tmpSize = hud_fontsize;
951 tmpPos.x = vehicleHud_Pos.x + vehicleHud_Size.x * (520/768);
952
953 if(!AuxiliaryXhair[1].draw2d)
954 {
955 tmpPos.y = vehicleHud_Pos.y + vehicleHud_Size.y * (96/256) - tmpSize.y;
956 drawstring(tmpPos, _("No right gunner!"), tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL);
957 }
958
959 if(!AuxiliaryXhair[2].draw2d)
960 {
961 tmpPos.y = vehicleHud_Pos.y + vehicleHud_Size.y * (160/256);
962 drawstring(tmpPos, _("No left gunner!"), tmpSize, '1 1 1', hudAlpha * blinkValue, DRAWFLAG_NORMAL);
963 }
964}
965METHOD(Bumblebee, vr_crosshair, void(Bumblebee thisveh, entity player))
966{
968}
969METHOD(Bumblebee, vr_setup, void(Bumblebee thisveh, entity instance))
970{
971 AuxiliaryXhair[0].axh_image = vCROSS_LOCK; // Raygun-locked
972 AuxiliaryXhair[1].axh_image = vCROSS_BURST; // Gunner1
973 AuxiliaryXhair[2].axh_image = vCROSS_BURST; // Gunner2
974}
975
976#endif
977
978#endif
979#ifdef MENUQC
980
981METHOD(Bumblebee, describe, string(Bumblebee this))
982{
983 TC(Bumblebee, this);
985 PAR(_("The %s vehicle seats up to three passengers, who are given different roles based on the order they enter."), COLORED_NAME(this));
986 PAR(_("The first player to enter will be the pilot, flying the vehicle up into the skies. "
987 "The first player can also shoot a green healing wave to heal other teammates on the ground."));
988 PAR(_("The second player to enter is the right gunner and the third player to enter is the left gunner."));
989 PAR(_("When the pilot exits the vehicle, the players switch roles by moving up in position."));
990 return PAGE_TEXT;
991}
992
993#endif
ERASEABLE float anglemods(float v)
Definition angle.qc:13
ERASEABLE float shortangle_f(float ang1, float ang2)
Definition angle.qc:29
void fixedmakevectors(vector a)
void antilag_clear(entity e, entity store)
Definition antilag.qc:114
#define MUTATOR_CALLHOOK(id,...)
Definition base.qh:143
#define MUTATOR_IS_ENABLED(this)
Definition base.qh:193
bool autocvar_g_vehicle_bumblebee_raygun
Definition bumblebee.qc:56
float autocvar_g_vehicle_bumblebee_cannon_lock
Definition bumblebee.qc:42
float autocvar_g_vehicle_bumblebee_health_regen
Definition bumblebee.qc:31
float autocvar_g_vehicle_bumblebee_raygun_turnspeed
Definition bumblebee.qc:51
float autocvar_g_vehicle_bumblebee_respawntime
Definition bumblebee.qc:14
bool bumblebee_gunner_enter(entity this, entity player)
Definition bumblebee.qc:283
float autocvar_g_vehicle_bumblebee_healgun_locktime
Definition bumblebee.qc:67
float autocvar_g_vehicle_bumblebee_shield_regen
Definition bumblebee.qc:35
float autocvar_g_vehicle_bumblebee_energy_regen
Definition bumblebee.qc:27
float autocvar_g_vehicle_bumblebee_pitchspeed
Definition bumblebee.qc:21
float autocvar_g_vehicle_bumblebee_healgun_sps
Definition bumblebee.qc:66
float autocvar_g_vehicle_bumblebee_healgun_hmax
Definition bumblebee.qc:63
void bumblebee_exit(entity this, int eject)
Definition bumblebee.qc:639
float autocvar_g_vehicle_bumblebee_blowup_forceintensity
Definition bumblebee.qc:72
float autocvar_g_vehicle_bumblebee_cannon_ammo_regen
Definition bumblebee.qc:39
float autocvar_g_vehicle_bumblebee_cannon_turnlimit_out
Definition bumblebee.qc:48
void bumblebee_diethink(entity this)
Definition bumblebee.qc:703
float autocvar_g_vehicle_bumblebee_raygun_aps
Definition bumblebee.qc:59
void bumblebee_blowup(entity this)
Definition bumblebee.qc:681
bool vehicles_valid_pilot(entity this, entity toucher)
Definition bumblebee.qc:358
float autocvar_g_vehicle_bumblebee_cannon_ammo
Definition bumblebee.qc:38
bool bumblebee_gunner_frame(entity this, float dt)
Definition bumblebee.qc:77
float autocvar_g_vehicle_bumblebee_turnspeed
Definition bumblebee.qc:20
float autocvar_g_vehicle_bumblebee_blowup_edgedamage
Definition bumblebee.qc:71
bool bumblebee_pilot_frame(entity this, float dt)
Definition bumblebee.qc:415
float autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down
Definition bumblebee.qc:52
float autocvar_g_vehicle_bumblebee_healgun_aps
Definition bumblebee.qc:64
float autocvar_g_vehicle_bumblebee_speed_strafe
Definition bumblebee.qc:17
float autocvar_g_vehicle_bumblebee_healgun_hps
Definition bumblebee.qc:62
float autocvar_g_vehicle_bumblebee_speed_forward
Definition bumblebee.qc:16
float autocvar_g_vehicle_bumblebee_raygun_range
Definition bumblebee.qc:57
float autocvar_g_vehicle_bumblebee_blowup_coredamage
Definition bumblebee.qc:70
float autocvar_g_vehicle_bumblebee_blowup_radius
Definition bumblebee.qc:69
float autocvar_g_vehicle_bumblebee_energy_regen_pause
Definition bumblebee.qc:28
float autocvar_g_vehicle_bumblebee_cannon_ammo_regen_pause
Definition bumblebee.qc:40
void bumblebee_regen(entity this, float dt)
Definition bumblebee.qc:394
bool autocvar_g_vehicle_bumblebee
Definition bumblebee.qc:75
float autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides
Definition bumblebee.qc:54
vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity player)
Definition bumblebee.qc:195
vector autocvar_g_vehicle_bumblebee_bouncepain
Definition bumblebee.qc:73
float autocvar_g_vehicle_bumblebee_healgun_amax
Definition bumblebee.qc:65
float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up
Definition bumblebee.qc:46
float autocvar_g_vehicle_bumblebee_raygun_fps
Definition bumblebee.qc:60
float autocvar_g_vehicle_bumblebee_health
Definition bumblebee.qc:30
void bumblebee_land(entity this)
Definition bumblebee.qc:622
void bumblebee_gunner_exit(entity this, int _exitflag)
Definition bumblebee.qc:221
float autocvar_g_vehicle_bumblebee_shield
Definition bumblebee.qc:34
const float BRG_SETUP
Definition bumblebee.qc:9
float autocvar_g_vehicle_bumblebee_cannon_turnlimit_in
Definition bumblebee.qc:47
float autocvar_g_vehicle_bumblebee_pitchlimit
Definition bumblebee.qc:22
void bumblebee_dead_touch(entity this, entity toucher)
Definition bumblebee.qc:698
float autocvar_g_vehicle_bumblebee_shield_regen_pause
Definition bumblebee.qc:36
float autocvar_g_vehicle_bumblebee_raygun_dps
Definition bumblebee.qc:58
const float BRG_START
Definition bumblebee.qc:10
const float BRG_END
Definition bumblebee.qc:11
bool autocvar_g_vehicle_bumblebee_swim
Definition bumblebee.qc:24
float autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up
Definition bumblebee.qc:53
float autocvar_g_vehicle_bumblebee_friction
Definition bumblebee.qc:23
float autocvar_g_vehicle_bumblebee_cannon_turnspeed
Definition bumblebee.qc:44
void CSQC_BUMBLE_GUN_HUD()
Definition bumblebee.qc:934
float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down
Definition bumblebee.qc:45
float autocvar_g_vehicle_bumblebee_health_regen_pause
Definition bumblebee.qc:32
float autocvar_g_vehicle_bumblebee_energy
Definition bumblebee.qc:26
float autocvar_g_vehicle_bumblebee_speed_down
Definition bumblebee.qc:19
void bumblebee_touch(entity this, entity toucher)
Definition bumblebee.qc:372
float autocvar_g_vehicle_bumblebee_speed_up
Definition bumblebee.qc:18
void bumblebee_fire_cannon(entity this, entity _gun, string _tagname, entity _owner)
bool bumble_raygun_send(entity this, entity to, float sf)
float autocvar_g_vehicle_bumblebee_cannon_speed
float autocvar_g_vehicle_bumblebee_cannon_refire
float autocvar_g_vehicle_bumblebee_cannon_cost
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
void Vehicles_drawCrosshair(string crosshair)
void Vehicles_drawHUD(string vehicle, string vehicleWeapon1, string vehicleWeapon2, string iconAmmo1, vector colorAmmo1, string iconAmmo2, vector colorAmmo2)
vector vehicleHud_Pos
const string vCROSS_LOCK
vector vehicleHud_Size
const string vCROSS_HEAL
vector autocvar_hud_progressbar_vehicles_ammo1_color
const string vCROSS_BURST
entity AuxiliaryXhair[MAX_AXH]
#define drawstring(position, text, scale, rgb, alpha, flag)
Definition draw.qh:27
float wait
Definition items.qc:17
vector hud_fontsize
Definition main.qh:77
entity owner
Definition main.qh:87
#define COLORED_NAME(this)
Definition color.qh:195
#define setmodel(this, m)
Definition model.qh:26
#define PHYS_INPUT_BUTTON_CROUCH(s)
Definition player.qh:154
vector movement
Definition player.qh:229
#define IS_CLIENT(s)
Definition player.qh:242
#define IS_DEAD(s)
Definition player.qh:245
#define PHYS_INPUT_BUTTON_JUMP(s)
Definition player.qh:151
#define PHYS_INPUT_FRAMETIME
Definition player.qh:255
vector v_angle
Definition player.qh:237
#define IS_PLAYER(s)
Definition player.qh:243
#define PHYS_INPUT_BUTTON_ATCK(s)
Definition player.qh:150
#define PHYS_INPUT_BUTTON_ATCK2(s)
Definition player.qh:152
float game_stopped
Definition stats.qh:81
vector real_origin(entity ent)
Definition util.qc:148
vector findbetterlocation(vector org, float mindist)
Definition util.qc:117
const int HUD_BUMBLEBEE_GUN
Definition constants.qh:48
const int HUD_NORMAL
Definition constants.qh:47
vector v_up
const float DRAWFLAG_NORMAL
const float SOLID_SLIDEBOX
entity trace_ent
const float MOVE_NORMAL
float DPCONTENTS_LIQUIDSMASK
vector velocity
const float SOLID_BBOX
const float SOLID_NOT
float time
vector v_right
vector trace_endpos
float trace_startsolid
float nextthink
vector v_forward
vector origin
float trace_fraction
vector oldorigin
float trace_allsolid
const float EF_NODRAW
#define CSQCMODEL_AUTOUPDATE(e)
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:503
bool Heal(entity targ, entity inflictor, float amount, float limit)
Definition damage.qc:987
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
Definition damage.qc:981
#define DMG_NOWEP
Definition damage.qh:104
float EF_LOWPRECISION
#define gettagindex
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:124
RES_ARMOR
Definition ent_cs.qc:130
ent angles
Definition ent_cs.qc:121
float autocvar_hud_panel_fg_alpha
Definition hud.qh:202
#define TC(T, sym)
Definition _all.inc:82
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:123
#define STAT(...)
Definition stats.qh:82
#define LOG_TRACE(...)
Definition log.qh:76
float MSG_ONE
Definition menudefs.qc:56
float bound(float min, float value, float max)
float random(void)
float vlen(vector v)
vector vectoangles(vector v)
void WriteEntity(entity data, float dest, float desto)
vector randomvec(void)
float sin(float f)
float min(float f,...)
float rint(float f)
vector normalize(vector v)
void WriteByte(float data, float dest, float desto)
void WriteAngle(float data, float dest, float desto)
void set_movetype(entity this, int mt)
Definition movetypes.qc:4
const int MOVETYPE_WALK
Definition movetypes.qh:132
const int MOVETYPE_NONE
Definition movetypes.qh:129
const int MOVETYPE_BOUNCEMISSILE
Definition movetypes.qh:140
#define UNSET_ONGROUND(s)
Definition movetypes.qh:18
const int MOVETYPE_NOCLIP
Definition movetypes.qh:137
const int MOVETYPE_TOSS
Definition movetypes.qh:135
var void func_null()
string string_null
Definition nil.qh:9
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define NULL
Definition post.qh:14
#define makevectors
Definition post.qh:21
#define gettaginfo
Definition post.qh:32
float DEAD_DYING
Definition progsdefs.qc:275
entity msg_entity
Definition progsdefs.qc:63
float DEAD_DEAD
Definition progsdefs.qc:276
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
const int RES_LIMIT_NONE
Definition resources.qh:60
#define gettouch(e)
Definition self.qh:74
#define setthink(e, f)
vector
Definition self.qh:92
entity entity toucher
Definition self.qh:72
#define settouch(e, f)
Definition self.qh:73
void RemoveGrapplingHooks(entity pl)
Definition hook.qc:30
void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition player.qc:234
const float VOL_BASE
Definition sound.qh:36
const int CH_SHOTS
Definition sound.qh:14
const float ATTEN_NORM
Definition sound.qh:30
#define sound(e, c, s, v, a)
Definition sound.qh:52
#define spawnfunc(id)
Definition spawnfunc.qh:96
ClientState CS(Client this)
Definition state.qh:47
#define PAGE_TEXT
Definition string.qh:643
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
Definition string.qh:649
#define PAGE_TEXT_INIT()
Definition string.qh:642
const int DAMAGE_NO
Definition subs.qh:79
const int DAMAGE_AIM
Definition subs.qh:81
entity enemy
Definition sv_ctf.qh:153
int autocvar_g_instagib_extralives
void CSQCModel_UnlinkEntity(entity e)
Definition sv_model.qc:129
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
void vehicles_impact(entity this, float _minspeed, float _speedfac, float _maxpain)
bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
void vehicles_touch(entity this, entity toucher)
void vehicles_regen(entity this, float timer,.float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
vector vehicles_findgoodexit(entity this, entity player, vector prefer_spot)
void shieldhit_think(entity this)
bool vehicle_addplayerslot(entity _owner, entity _slot, int _hud, Model _hud_model, bool(entity, float) _framefunc, void(entity, bool) _exitfunc, float(entity, entity) _enterfunc)
void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id)
void vehicles_think(entity this)
void vehicles_regen_resource(entity this, float timer,.float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale, Resource resource)
void CSQCVehicleSetup(entity own, int vehicle_id)
vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname, float _pichlimit_min, float _pichlimit_max, float _rotlimit_min, float _rotlimit_max, float _aimspeed, float dt)
void vehicles_frame(entity this, entity actor)
entity vehicle_tossgib(entity this, entity _template, vector _vel, string _tag, bool _burn, bool _explode, float _maxtime, vector _rot)
const float vehicle_shield
If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehicle,...
const float vehicle_ammo1
If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehicle,...
float dmg_time
const float SVC_SETVIEWANGLES
const float vehicle_health
const float vehicle_energy
If ent is player this is 0..100 indicating precentage of health left on vehicle. Vehicle's value is t...
const float SVC_SETVIEWPORT
const int VHEF_EJECT
User pressed exit key.
#define VEHICLE_UPDATE_PLAYER(ply, vehi, fld, vhname)
#define VEHICLE_UPDATE_PLAYER_RESOURCE(ply, vehi, fld, vhname, res)
entity gun1
entity vehicle
Entity to disply the shild effect on damage.
float autocvar_g_vehicles_allow_bots
int vehicle_flags
entity gunner1
entity gunner2
entity gun3
entity gun2
entity vehicle_shieldent
const float vehicle_ammo2
If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehicle,...
const float vehicle_reload1
If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already st...
bool teamplay
Definition teams.qh:59
#define DIFF_TEAM(a, b)
Definition teams.qh:242
const int TELEPORT_NORMAL
void crosshair_trace(entity pl)
Definition tracing.qc:549
#define IS_REAL_CLIENT(v)
Definition utils.qh:17
#define IS_VEHICLE(v)
Definition utils.qh:22
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
Definition utils.qh:15
#define vlen2(v)
Definition vector.qh:4
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
const int VHF_HASSHIELD
Indicates vehicle.
Definition vehicle.qh:85
const int VHF_MULTISLOT
Add random head angles each frame if health < 50%.
Definition vehicle.qh:96
const int VHF_HEALTHREGEN
Vehicles shield regenerates.
Definition vehicle.qh:87
const int VHF_ENERGYREGEN
Vehicles health regenerates.
Definition vehicle.qh:88
const int VHF_SHIELDREGEN
Vehicle has shileding.
Definition vehicle.qh:86
float vehicle_altitude(entity this, float amax)
Definition vehicles.qc:4
const int MAX_WEAPONSLOTS
Definition weapon.qh:16
int max_shot_distance
Definition weapon.qh:203
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17
bool weaponUseForbidden(entity player)
bool weaponLocked(entity player)
Weapon m_switchweapon
Definition wepent.qh:25