69 this.angles_x *= 0.95;
70 this.angles_z *= 0.95;
72 if(hgt < 128 && hgt > 0)
73 this.
frame = (hgt / 128) * 25;
75 this.
bomb1.gun1.avelocity_y = 90 + ((this.
frame / 25) * 2000);
76 this.
bomb1.gun2.avelocity_y = -this.
bomb1.gun1.avelocity_y;
111 setorigin(player, spot);
113 player.oldvelocity = player.velocity;
120 player.velocity_z += 200;
126 player.velocity = this.
velocity * 0.5;
127 player.velocity_z += 10;
131 player.oldvelocity = player.velocity;
132 setorigin(player, spot);
162 if(vehic.sound_nexttime <
time)
164 vehic.sound_nexttime =
time + 7.955812;
187 if(vehic.angles_z > 50 || vehic.angles_z < -50)
202 if(df_x > 180) df_x -= 360;
203 if(df_x < -180) df_x += 360;
204 if(df_y > 180) df_y -= 360;
205 if(df_y < -180) df_y += 360;
207 float ftmp =
shortangle_f(this.v_angle_y - vang_y, vang_y);
208 if(ftmp > 180) ftmp -= 360;
if(ftmp < -180) ftmp += 360;
220 vehic.angles_x =
anglemods(vehic.angles_x);
221 vehic.angles_y =
anglemods(vehic.angles_y);
222 vehic.angles_z =
anglemods(vehic.angles_z);
231 if(
CS(
this).movement_x != 0)
233 if(
CS(
this).movement_x > 0)
235 else if(
CS(
this).movement_x < 0)
239 if(
CS(
this).movement_y != 0)
241 if(
CS(
this).movement_y < 0)
243 else if(
CS(
this).movement_y > 0)
250 vehic.angles_z *= 0.95;
251 if(vehic.angles_z >= -1 && vehic.angles_z <= -1)
260 vehic.velocity += df * dt;
261 this.
velocity =
CS(
this).movement = vehic.velocity;
262 setorigin(
this, vehic.origin +
'0 0 32');
265 STAT(VEHICLESTAT_W2MODE,
this) =
STAT(VEHICLESTAT_W2MODE, vehic);
271 if(vehic.gun1.lock_time <
time ||
IS_DEAD(vehic.gun1.enemy) ||
STAT(FROZEN, vehic.gun1.enemy))
272 vehic.gun1.enemy =
NULL;
284 vehic.gun1.lock_time =
time + 5;
290 vehic.gun1.lock_time =
time + 0.5;
296 float distance, impact_time;
300 vector _vel = vehic.gun1.enemy.velocity;
309 ad = vf + _vel * impact_time;
323 if(vehic.lock_target !=
NULL)
325 if(vehic.lock_strength == 1)
327 float i, distance, impact_time;
331 for(i = 0; i < 4; ++i)
333 distance =
vlen(ad - vehic.origin);
335 ad = vf + vehic.lock_target.velocity * impact_time;
340 if(vehic.lock_target)
342 if(vehic.lock_strength == 1)
344 else if(vehic.lock_strength > 0.5)
346 else if(vehic.lock_strength < 0.5)
373 wep1.
wr_think(wep1, vehic, weaponentity, 1);
385 Weapon wep2a = WEP_RAPTOR_BOMB;
393 wep2a.
wr_think(wep2a, vehic, weaponentity, 2);
400 Weapon wep2b = WEP_RAPTOR_FLARE;
405 wep2b.
wr_think(wep2b, vehic, weaponentity, 2);
411 vehic.bomb1.alpha = vehic.bomb2.alpha = (
time - vehic.lip) / (vehic.delay - vehic.lip);
415 if(vehic.bomb1.cnt <
time)
417 bool incoming =
false;
420 if(it.missile_flags & MIF_GUIDED_TRACKING)
421 if(vdist(vehic.origin - it.origin, <, 2 * autocvar_g_vehicle_raptor_flare_range))
434 vehic.bomb1.cnt =
time + 1;
451 vehic.nextthink =
time;
455 if(vehic.sound_nexttime <
time)
457 vehic.sound_nexttime =
time + 7.955812;
465 vehic.velocity_z =
min(vehic.velocity_z * 1.5, 256);
466 vehic.bomb1.gun1.avelocity_y = 90 + ((vehic.frame / 25) * 25000);
467 vehic.bomb1.gun2.avelocity_y = -vehic.bomb1.gun1.avelocity_y;
470 setorigin(
this, vehic.origin +
'0 0 32');
476 STAT(VEHICLESTAT_W2MODE,
this) =
STAT(VEHICLESTAT_W2MODE, vehic);
488 vehic.bomb1.alpha = vehic.bomb2.alpha = (
time - vehic.lip) / (vehic.delay - vehic.lip);
504 RadiusDamage (
this, this.
enemy, 250, 15, 250,
NULL,
NULL, 250, DEATH_VH_RAPT_DEATH.m_id,
DMG_NOWEP,
NULL);
513 setorigin(
this, this.
pos1);
549 case IMP_weapon_group_1.impulse:
553 case IMP_weapon_group_2.impulse:
558 case IMP_weapon_next_byid.impulse:
559 case IMP_weapon_next_bypriority.impulse:
560 case IMP_weapon_next_bygroup.impulse:
567 case IMP_weapon_last.impulse:
568 case IMP_weapon_prev_byid.impulse:
569 case IMP_weapon_prev_bypriority.impulse:
570 case IMP_weapon_prev_bygroup.impulse:
597 vehicles_impact(instance, autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
607 instance.velocity =
'0 0 1';
608 instance.tur_head.exteriormodeltoclient = instance.owner;
613 if(instance.owner.flagcarried)
614 setorigin(instance.owner.flagcarried,
'-20 0 96');
627 instance.nextthink =
time;
632 instance.velocity_z += 600;
634 instance.avelocity =
'0 0.5 1' * (
random() * 400);
635 instance.avelocity -=
'0 0.5 1' * (
random() * 400);
637 instance.colormod =
'-0.5 -0.5 -0.5';
654 instance.bomb1 =
new(raptor_bomb);
655 instance.bomb2 =
new(raptor_bomb);
656 instance.gun1 =
new(raptor_gun);
657 instance.gun2 =
new(raptor_gun);
659 setmodel(instance.bomb1, MDL_VEH_RAPTOR_CB_FOLDED);
660 setmodel(instance.bomb2, MDL_VEH_RAPTOR_CB_FOLDED);
661 setmodel(instance.gun1, MDL_VEH_RAPTOR_GUN);
662 setmodel(instance.gun2, MDL_VEH_RAPTOR_GUN);
663 setmodel(instance.tur_head, MDL_VEH_RAPTOR_TAIL);
665 setattachment(instance.bomb1, instance,
"bombmount_left");
666 setattachment(instance.bomb2, instance,
"bombmount_right");
667 setattachment(instance.tur_head, instance,
"root");
670 instance.bomb1.angles = instance.angles;
671 instance.angles =
'0 0 0';
675 ofs -= instance.origin;
676 setattachment(instance.gun1, instance,
"");
677 setorigin(instance.gun1, ofs);
681 ofs -= instance.origin;
682 setattachment(instance.gun2, instance,
"");
683 setorigin(instance.gun2, ofs);
685 instance.angles = instance.bomb1.angles;
686 instance.bomb1.angles =
'0 0 0';
688 spinner =
new(raptor_spinner);
689 spinner.owner = instance;
690 setmodel(spinner, MDL_VEH_RAPTOR_PROP);
691 setattachment(spinner, instance,
"engine_left");
693 spinner.avelocity =
'0 90 0';
694 instance.bomb1.gun1 = spinner;
696 spinner =
new(raptor_spinner);
697 spinner.owner = instance;
698 setmodel(spinner, MDL_VEH_RAPTOR_PROP);
699 setattachment(spinner, instance,
"engine_right");
701 spinner.avelocity =
'0 -90 0';
702 instance.bomb1.gun2 = spinner;
706 instance.bomb1.nextthink =
time;
716 instance.vehicle_energy = 1;
723 instance.bomb1.gun1.avelocity_y = 90;
724 instance.bomb1.gun2.avelocity_y = -90;
726 instance.delay =
time;
730 instance.damageforcescale = 0.25;
752 instance.max_health =
GetResource(instance, RES_HEALTH);
763 Vehicles_drawHUD(VEH_RAPTOR.m_icon,
"vehicle_raptor_weapon1",
"vehicle_raptor_weapon2",
793 float reload2 =
STAT(VEHICLESTAT_RELOAD2) * 0.01;
807 where.x -= tmpSize.x * 0.5;
808 where.y -= tmpSize.y * 0.5;
824 where.x -= tmpSize.x * 0.5;
825 where.y -= tmpSize.y * 0.5;
850 PAR(_(
"The %s vehicle is a flying vehicle that takes only one pilot, who can operate both of the weapons."),
COLORED_NAME(
this));
851 PAR(_(
"The two weapons have different reticles for them similar to the %s. "
852 "The primary weapon is laser-based, shooting toward the white reticle. "
853 "The secondary weapon drops bombs to the ground, aiming towards the green reticle. "
854 "The white reticle always points to the head of the vehicle, while the green reticle's location is determined by the momentum of the vehicle."),
COLORED_NAME(VEH_SPIDERBOT));
ERASEABLE float anglemods(float v)
ERASEABLE float shortangle_f(float ang1, float ang2)
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
void antilag_clear(entity e, entity store)
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 autocvar_hud_progressbar_vehicles_ammo2_color
vector autocvar_hud_progressbar_vehicles_ammo1_color
float autocvar_cl_vehicles_crosshair_size
const string vCROSS_BURST
entity AuxiliaryXhair[MAX_AXH]
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
virtual void wr_think()
(SERVER) logic to run every frame
virtual void wr_checkammo1()
(SERVER) checks ammo for weapon primary
#define drawpic(position, pic, size, rgb, alpha, flag)
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
#define COLORED_NAME(this)
#define setmodel(this, m)
#define PHYS_INPUT_BUTTON_CROUCH(s)
#define PHYS_INPUT_BUTTON_JUMP(s)
#define PHYS_INPUT_FRAMETIME
float autocvar_sv_maxairspeed
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
vector real_origin(entity ent)
vector findbetterlocation(vector org, float mindist)
float autocvar_crosshair_alpha
const float DRAWFLAG_NORMAL
const float SOLID_SLIDEBOX
const float DRAWFLAG_ADDITIVE
float DPCONTENTS_LIQUIDSMASK
#define CSQCMODEL_AUTOUPDATE(e)
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)
#define IL_EACH(this, cond, body)
noref float vid_conheight
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCEMISSILE
const int MOVETYPE_NOCLIP
const int MOVETYPE_BOUNCE
#define METHOD(cname, name, prototype)
void raptor_land(entity this)
float autocvar_g_vehicle_raptor_shield
float autocvar_g_vehicle_raptor_energy
float autocvar_g_vehicle_raptor_cannon_turnspeed
float autocvar_g_vehicle_raptor_cannon_pitchlimit_down
float autocvar_g_vehicle_raptor_bouncestop
float autocvar_g_vehicle_raptor_health
float autocvar_g_vehicle_raptor_turnspeed
float autocvar_g_vehicle_raptor_cannon_locking_releasetime
float autocvar_g_vehicle_raptor_speed_up
float autocvar_g_vehicle_raptor_cannon_predicttarget
float autocvar_g_vehicle_raptor_energy_regen_pause
float autocvar_g_vehicle_raptor_bouncefactor
void raptor_blowup(entity this, entity toucher)
float autocvar_g_vehicle_raptor_pitchlimit
vector autocvar_g_vehicle_raptor_bouncepain
float autocvar_g_vehicle_raptor_respawntime
bool autocvar_g_vehicle_raptor
bool raptor_takeoff(entity this, float dt)
float autocvar_g_vehicle_raptor_health_regen_pause
int autocvar_g_vehicle_raptor_movestyle
float autocvar_g_vehicle_raptor_cannon_locking_time
bool autocvar_g_vehicle_raptor_swim
float autocvar_g_vehicle_raptor_cannon_turnlimit
float autocvar_g_vehicle_raptor_speed_down
float autocvar_g_vehicle_raptor_shield_regen_pause
void raptor_diethink(entity this)
float autocvar_g_vehicle_raptor_energy_regen
float autocvar_g_vehicle_raptor_shield_regen
float autocvar_g_vehicle_raptor_cannon_locked_time
float autocvar_g_vehicle_raptor_takeofftime
void raptor_rotor_anglefix(entity this)
float autocvar_g_vehicle_raptor_speed_forward
float autocvar_g_vehicle_raptor_cannon_pitchlimit_up
float autocvar_g_vehicle_raptor_friction
float autocvar_g_vehicle_raptor_health_regen
void raptor_exit(entity this, int eject)
bool raptor_impulse(entity this, int _imp)
bool raptor_frame(entity this, float dt)
float autocvar_g_vehicle_raptor_speed_strafe
bool autocvar_g_vehicle_raptor_cannon_locktarget
float autocvar_g_vehicle_raptor_pitchspeed
float autocvar_g_vehicle_raptor_cannon_speed
float autocvar_g_vehicle_raptor_bombs_refire
float autocvar_g_vehicle_raptor_flare_refire
float health
Legacy fields for the resources. To be removed.
IntrusiveList g_projectiles
const int CH_TRIGGER_SINGLE
#define sound(e, c, s, v, a)
void soundto(int _dest, entity e, int chan, string samp, float vol, float _atten, float _pitch)
ClientState CS(Client this)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
void vehicles_impact(entity this, float _minspeed, float _speedfac, float _maxpain)
bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
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 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)
void vehicles_locktarget(entity this, float incr, float decr, float _lock_time)
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_reload2
If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehicle,...
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...
#define VEHICLE_UPDATE_PLAYER(ply, vehi, fld, vhname)
const float VOL_VEHICLEENGINE
#define VEHICLE_UPDATE_PLAYER_RESOURCE(ply, vehi, fld, vhname, res)
entity vehicle
Entity to disply the shild effect on damage.
const float vehicle_ammo2
If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehicle,...
void crosshair_trace(entity pl)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
const int VHF_HASSHIELD
Indicates vehicle.
const int VHF_HEALTHREGEN
Vehicles shield regenerates.
const int VHF_ENERGYREGEN
Vehicles health regenerates.
const int VHF_SHIELDREGEN
Vehicle has shileding.
float vehicle_altitude(entity this, float amax)
vector project_3d_to_2d(vector vec)
entity weaponentities[MAX_WEAPONSLOTS]
bool weaponUseForbidden(entity player)
bool weaponLocked(entity player)