91 vehic.angles.x = -vehic.angles.x;
93 vehic.angles.x = -vehic.angles.x;
94 if (gun == vehic.gun1)
113 if (gun.lock_time <
time ||
IS_DEAD(gun.enemy) ||
STAT(FROZEN, gun.enemy))
126 gun.lock_time =
time + 2.5;
132 gun.lock_time =
time + 0.5;
140 float distance, impact_time;
143 vector _vel = gun.enemy.velocity;
150 ad = vf + _vel * impact_time;
166 &&
time > gun.attack_finished_single[0]
186 UpdateAuxiliaryXhair(vehic.owner,
trace_endpos, (
'1 0 0' *
this.vehicle_reload1) + (
'0 1 0' * (1 -
this.vehicle_reload1)), (
this == vehic.gunner1 ? 1 : 2));
196 tracebox(gunner.origin +
'0 0 32',
STAT(PL_MIN, player),
STAT(PL_MAX, player), prefer_spot,
MOVE_NORMAL, player);
200 float mysize = 1.5 *
vlen(
STAT(PL_MAX, player) -
STAT(PL_MIN, player));
202 vector v2 = 0.5 * (gunner.absmin + gunner.absmax);
203 for (
int i = 0; i < 100; ++i)
220 entity vehic = gunner.owner;
243 player.view_ofs =
STAT(PL_VIEW_OFS, player);
250 player.(weaponentity).
m_switchweapon = gunner.(weaponentity).m_switchweapon;
251 delete(gunner.(weaponentity));
253 player.vehicle_enter_delay =
time + 2;
254 setsize(player,
STAT(PL_MIN, player),
STAT(PL_MAX, player));
258 if (player == vehic.gunner1)
259 vehic.gunner1 =
NULL;
260 if (player == vehic.gunner2)
262 vehic.gunner2 =
NULL;
272 player.velocity = 0.75 * vehic.velocity +
normalize(spot - vehic.origin) * 200;
273 player.velocity.z += 10;
275 gunner.phase =
time + 5;
276 gunner.vehicle_hudmodel.viewmodelforclient = gunner;
280 player.vehicle =
NULL;
288 if (!vehic.gunner1 && !vehic.gunner2
289 &&
time >= vehic.gun1.phase &&
time >= vehic.gun2.phase)
294 if (
vlen2(player.origin - v1) <
vlen2(player.origin - v2))
297 vehic.gunner1 = player;
302 vehic.gunner2 = player;
305 else if (!vehic.gunner1 &&
time >= vehic.gun1.phase)
308 vehic.gunner1 = player;
310 else if (!vehic.gunner2 &&
time >= vehic.gun2.phase)
313 vehic.gunner2 = player;
321 player.vehicle = gunner;
322 player.angles = vehic.angles;
328 player.view_ofs =
'0 0 0';
329 STAT(HUD, player) =
STAT(HUD, gunner);
330 player.teleportable =
false;
331 player.PlayerPhysplug = gunner.PlayerPhysplug;
332 player.vehicle_ammo1 = vehic.vehicle_ammo1;
333 player.vehicle_ammo2 = vehic.vehicle_ammo2;
334 player.vehicle_reload1 = vehic.vehicle_reload1;
335 player.vehicle_reload2 = vehic.vehicle_reload2;
336 player.vehicle_energy = vehic.vehicle_energy;
344 gunner.(weaponentity) =
new(temp_wepent);
345 gunner.(weaponentity).
m_switchweapon = player.(weaponentity).m_switchweapon;
348 gunner.vehicle_hudmodel.viewmodelforclient = player;
386 if (autocvar_g_vehicles_enter)
399 if (
time >=
toucher.vehicle_enter_delay && phase_time
452 vector vang = vehic.angles;
455 newvel.x = -newvel.x;
456 if (newvel.x > 180) newvel.x -= 360;
457 if (newvel.x < -180) newvel.x += 360;
458 if (newvel.y > 180) newvel.y -= 360;
459 if (newvel.y < -180) newvel.y += 360;
462 if (ftmp > 180) ftmp -= 360;
463 if (ftmp < -180) ftmp += 360;
477 vehic.angles.x =
anglemods(vehic.angles.x);
478 vehic.angles.y =
anglemods(vehic.angles.y);
479 vehic.angles.z =
anglemods(vehic.angles.z);
500 vehic.angles.z =
bound(-15, vehic.angles.z + ftmp, 15);
504 vehic.angles.z *= 0.95;
505 if (vehic.angles.z >= -1 && vehic.angles.z <= -1)
514 vehic.velocity += newvel * dt;
515 this.
velocity =
CS(
this).movement = vehic.velocity;
520 if (vehic.tur_head.lock_time <
time ||
IS_DEAD(vehic.tur_head.enemy) ||
STAT(FROZEN, vehic.tur_head.enemy))
521 vehic.tur_head.enemy =
NULL;
543 if (vehic.tur_head.enemy)
558 vehic.gun3.enemy.realowner =
this;
608 vehic.gun3.enemy.SendFlags |=
BRG_END;
610 vehic.wait =
time + 1;
631 vehic.angles.x = -vehic.angles.x;
633 vehic.angles.x = -vehic.angles.x;
657 if (this.
owner.vehicleid == VEH_BUMBLEBEE.vehicleid)
686 if (this.
gun3.enemy || !wasfreed(this.
gun3.enemy))
690 this.
owner.velocity.z += 10;
691 setorigin(this.
owner, spot);
706 DEATH_VH_BUMB_DEATH.m_id,
757 instance.nextthink = 0;
762 if (!instance.gunner1
763 &&
time >= instance.gun1.phase
764 && instance.gun1.vehicle_enter
765 && instance.gun1.vehicle_enter(instance, actor))
768 if (!instance.gunner2
769 &&
time >= instance.gun2.phase
770 && instance.gun2.vehicle_enter
771 && instance.gun2.vehicle_enter(instance, actor))
776 instance.angles.z *= 0.8;
777 instance.angles.x *= 0.8;
779 instance.nextthink =
time;
783 if (instance.gunner1)
785 instance.gun1.vehicle_exit(instance.gun1,
VHEF_EJECT);
787 gettouch(instance)(instance, instance.gunner1);
791 if (instance.gunner2)
793 instance.gun2.vehicle_exit(instance.gun2,
VHEF_EJECT);
795 gettouch(instance)(instance, instance.gunner2);
805 if (instance.gun3.enemy || !wasfreed(instance.gun3.enemy))
806 instance.gun3.enemy.effects |=
EF_NODRAW;
808 if (instance.gunner1)
809 instance.gun1.vehicle_exit(instance.gun1,
VHEF_EJECT);
810 if (instance.gunner2)
811 instance.gun2.vehicle_exit(instance.gun2,
VHEF_EJECT);
828 _body.nextthink =
time;
830 _body.owner = instance;
831 _body.enemy = instance.enemy;
833 _body.angles = instance.angles;
844 instance.colormod =
'0 0 0';
845 instance.avelocity =
'0 0 0';
846 instance.velocity =
'0 0 0';
848 instance.nextthink = 0;
850 setorigin(instance, instance.pos1);
859 setmodel(instance.vehicle_shieldent, MDL_VEH_BUMBLEBEE_SHIELD);
860 setattachment(instance.vehicle_shieldent, instance,
"");
861 setorigin(instance.vehicle_shieldent,
real_origin(instance) - instance.origin);
862 instance.vehicle_shieldent.scale = 512 /
vlen(instance.maxs - instance.mins);
864 instance.vehicle_shieldent.alpha = -1;
867 instance.gun1 =
new(vehicle_playerslot);
868 instance.gun2 =
new(vehicle_playerslot);
869 instance.gun3 =
new(bumblebee_raygun);
873 instance.gun1.owner = instance;
874 instance.gun2.owner = instance;
875 instance.gun3.owner = instance;
877 setmodel(instance.gun1, MDL_VEH_BUMBLEBEE_CANNON_RIGHT);
878 setmodel(instance.gun2, MDL_VEH_BUMBLEBEE_CANNON_LEFT);
879 setmodel(instance.gun3, MDL_VEH_BUMBLEBEE_CANNON_CENTER);
881 setattachment(instance.gun1, instance,
"cannon_right");
882 setattachment(instance.gun2, instance,
"cannon_left");
885 instance.gun3.pos1 = instance.angles;
886 instance.angles =
'0 0 0';
888 ofs -= instance.origin;
889 setattachment(instance.gun3, instance,
"");
890 setorigin(instance.gun3, ofs);
891 instance.angles = instance.gun3.pos1;
896 setorigin(instance.vehicle_hudmodel,
'50 0 -5');
897 setorigin(instance.vehicle_viewport,
'5 0 2');
900 setorigin(instance.gun1.vehicle_hudmodel,
'90 -27 -23');
901 setorigin(instance.gun1.vehicle_viewport,
'-85 0 50');
903 setorigin(instance.gun2.vehicle_hudmodel,
'90 27 -23');
904 setorigin(instance.gun2.vehicle_viewport,
'-85 0 50');
906 instance.scale = 1.5;
909 if (instance.gun3.enemy ==
NULL)
911 instance.gun3.enemy =
new(bumble_raygun);
913 instance.gun3.enemy.SendFlags =
BRG_SETUP;
926 instance.damageforcescale = 0.025;
930 setorigin(instance, instance.origin +
'0 0 25');
950 instance.max_health =
GetResource(instance, RES_HEALTH);
966 Vehicles_drawHUD(VEH_BUMBLEBEE.m_icon,
"vehicle_bumble_weapon1",
"vehicle_bumble_weapon2",
971 float blinkValue = 0.55 +
sin(
time * 7) * 0.45;
1008 PAR(_(
"The %s vehicle seats up to three passengers, who are given different roles based on the order they enter."),
COLORED_NAME(
this));
1009 PAR(_(
"The first player to enter will be the pilot, flying the vehicle up into the skies. "
1010 "The first player can also shoot a green healing wave to heal other teammates on the ground."));
1011 PAR(_(
"The second player to enter is the right gunner and the third player to enter is the left gunner."));
1012 PAR(_(
"When the pilot exits the vehicle, the players switch roles by moving up in position."));
ERASEABLE float anglemods(float v)
Return a angle within +/- 360.
ERASEABLE float shortangle_f(float ang1, float ang2)
Return the short angle.
void antilag_clear(entity e, entity store)
#define MUTATOR_CALLHOOK(name,...)
bool autocvar_g_vehicle_bumblebee_raygun
float autocvar_g_vehicle_bumblebee_cannon_lock
float autocvar_g_vehicle_bumblebee_health_regen
float autocvar_g_vehicle_bumblebee_raygun_turnspeed
float autocvar_g_vehicle_bumblebee_respawntime
bool bumblebee_gunner_enter(entity this, entity player)
float autocvar_g_vehicle_bumblebee_healgun_locktime
float autocvar_g_vehicle_bumblebee_shield_regen
float autocvar_g_vehicle_bumblebee_energy_regen
float autocvar_g_vehicle_bumblebee_pitchspeed
float autocvar_g_vehicle_bumblebee_healgun_sps
float autocvar_g_vehicle_bumblebee_healgun_hmax
void bumblebee_exit(entity this, int eject)
float autocvar_g_vehicle_bumblebee_blowup_forceintensity
float autocvar_g_vehicle_bumblebee_cannon_ammo_regen
float autocvar_g_vehicle_bumblebee_cannon_turnlimit_out
void bumblebee_diethink(entity this)
float autocvar_g_vehicle_bumblebee_raygun_aps
void bumblebee_blowup(entity this)
bool vehicles_valid_pilot(entity this, entity toucher)
float autocvar_g_vehicle_bumblebee_cannon_ammo
bool bumblebee_gunner_frame(entity this, float dt)
float autocvar_g_vehicle_bumblebee_turnspeed
float autocvar_g_vehicle_bumblebee_blowup_edgedamage
bool bumblebee_pilot_frame(entity this, float dt)
float autocvar_g_vehicle_bumblebee_raygun_pitchlimit_down
float autocvar_g_vehicle_bumblebee_healgun_aps
float autocvar_g_vehicle_bumblebee_speed_strafe
float autocvar_g_vehicle_bumblebee_healgun_hps
float autocvar_g_vehicle_bumblebee_speed_forward
float autocvar_g_vehicle_bumblebee_raygun_range
float autocvar_g_vehicle_bumblebee_blowup_coredamage
float autocvar_g_vehicle_bumblebee_blowup_radius
float autocvar_g_vehicle_bumblebee_energy_regen_pause
float autocvar_g_vehicle_bumblebee_cannon_ammo_regen_pause
void bumblebee_regen(entity this, float dt)
bool autocvar_g_vehicle_bumblebee
float autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides
vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity player)
vector autocvar_g_vehicle_bumblebee_bouncepain
float autocvar_g_vehicle_bumblebee_healgun_amax
float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up
float autocvar_g_vehicle_bumblebee_raygun_fps
float autocvar_g_vehicle_bumblebee_health
void bumblebee_land(entity this)
void bumblebee_gunner_exit(entity this, int _exitflag)
float autocvar_g_vehicle_bumblebee_shield
float autocvar_g_vehicle_bumblebee_cannon_turnlimit_in
float autocvar_g_vehicle_bumblebee_pitchlimit
void bumblebee_dead_touch(entity this, entity toucher)
float autocvar_g_vehicle_bumblebee_shield_regen_pause
float autocvar_g_vehicle_bumblebee_raygun_dps
bool autocvar_g_vehicle_bumblebee_swim
float autocvar_g_vehicle_bumblebee_raygun_pitchlimit_up
float autocvar_g_vehicle_bumblebee_friction
float autocvar_g_vehicle_bumblebee_cannon_turnspeed
void CSQC_BUMBLE_GUN_HUD()
float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down
float autocvar_g_vehicle_bumblebee_health_regen_pause
float autocvar_g_vehicle_bumblebee_energy
float autocvar_g_vehicle_bumblebee_speed_down
void bumblebee_touch(entity this, entity toucher)
float autocvar_g_vehicle_bumblebee_speed_up
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.
void Vehicles_drawCrosshair(string crosshair)
void Vehicles_drawHUD(string vehicle, string vehicleWeapon1, string vehicleWeapon2, string iconAmmo1, vector colorAmmo1, string iconAmmo2, vector colorAmmo2)
vector autocvar_hud_progressbar_vehicles_ammo1_color
const string vCROSS_BURST
entity AuxiliaryXhair[MAX_AXH]
#define drawstring(position, text, scale, rgb, alpha, flag)
#define COLORED_NAME(this)
#define setmodel(this, m)
#define PHYS_INPUT_BUTTON_CROUCH(s)
#define PHYS_INPUT_BUTTON_JUMP(s)
#define PHYS_INPUT_FRAMETIME
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
vector real_origin(entity ent)
vector findbetterlocation(vector org, float mindist)
const int HUD_BUMBLEBEE_GUN
const float DRAWFLAG_NORMAL
const float SOLID_SLIDEBOX
float DPCONTENTS_LIQUIDSMASK
#define CSQCMODEL_AUTOUPDATE(e)
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
bool Heal(entity targ, entity inflictor, float amount, float limit)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
WriteByte(chan, ent.angles.y/DEC_FACTOR)
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
float autocvar_hud_panel_fg_alpha
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCEMISSILE
#define UNSET_ONGROUND(s)
const int MOVETYPE_NOCLIP
#define METHOD(cname, name, prototype)
float health
Legacy fields for the resources. To be removed.
void RemoveGrapplingHooks(entity pl)
void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
#define sound(e, c, s, v, a)
ClientState CS(Client this)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
void CSQCModel_UnlinkEntity(entity e)
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 shield left on vehicle. If ent is vehicle,...
const float vehicle_ammo1
If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already st...
const float SVC_SETVIEWANGLES
const float vehicle_health
If ent is player this is 0..100 indicating precentage of health left on vehicle. Vehicle's value is t...
const float vehicle_energy
If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehicle,...
const float SVC_SETVIEWPORT
const int VHEF_EJECT
User pressed exit key 3 times fast (not implemented) or vehicle is dying.
#define VEHICLE_UPDATE_PLAYER(ply, vehi, fld, vhname)
#define VEHICLE_UPDATE_PLAYER_RESOURCE(ply, vehi, fld, vhname, res)
float autocvar_g_vehicles_allow_bots
entity vehicle_shieldent
Entity to disply the shild effect on damage.
const float vehicle_ammo2
If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehicle,...
const float vehicle_reload1
If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehicle,...
const int TELEPORT_NORMAL
void crosshair_trace(entity pl)
#define IS_REAL_CLIENT(v)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
const int VHF_HASSHIELD
Vehicle has shileding.
const int VHF_MULTISLOT
Vehicle has multiple player slots.
const int VHF_HEALTHREGEN
Vehicles health regenerates.
const int VHF_ENERGYREGEN
Vehicles energy regenerates.
const int VHF_SHIELDREGEN
Vehicles shield regenerates.
float vehicle_altitude(entity this, float amax)
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
bool weaponUseForbidden(entity player)
bool weaponLocked(entity player)