73 STAT(VEHICLESTAT_W2MODE,
this) =
STAT(VEHICLESTAT_W2MODE, vehic);
105 ad_y =
bound(-ftmp, ad_y, ftmp);
109 ad_x =
bound(ftmp * -1, ad_x, ftmp);
114 makevectors(vehic.angles +
'-2 0 0' * vehic.angles_x);
119 vehic.jump_delay =
time;
124 if(vehic.frame == 4 && vehic.tur_head.wait != 0)
131 vehic.button2 =
false;
139 vehic.tur_head.wait =
time + 2;
140 vehic.jump_delay =
time + 2;
141 vehic.button2 =
true;
145 if(
CS(
this).movement_x > 0) movefix_x = 1;
146 if(
CS(
this).movement_x < 0) movefix_x = -1;
147 if(
CS(
this).movement_y > 0) movefix_y = 1;
148 if(
CS(
this).movement_y < 0) movefix_y = -1;
152 if(movefix_y == 0 && movefix_x == 0)
157 vehic.velocity = sd * 700 + rt * 600 +
v_up * 600;
160 else if(
time >= vehic.jump_delay)
166 if(vehic.sound_nexttime <
time || vehic.delay != 3)
169 vehic.sound_nexttime =
time + 6.486500;
180 if(
CS(
this).movement_x == 0 &&
CS(
this).movement_y != 0)
185 ftmp =
bound(-ftmp, vehic.tur_head.angles_y, ftmp);
186 vehic.angles_y =
anglemods(vehic.angles_y + ftmp);
187 vehic.tur_head.angles_y -= ftmp;
189 if(
CS(
this).movement_x != 0)
191 if(
CS(
this).movement_x > 0)
193 CS(
this).movement_x = 1;
197 else if(
CS(
this).movement_x < 0)
199 CS(
this).movement_x = -1;
203 CS(
this).movement_y = 0;
204 float oldvelz = vehic.velocity_z;
206 vehic.velocity_z = oldvelz;
208 if(vehic.velocity_z <= 20)
211 if(vehic.sound_nexttime <
time || vehic.delay != 1)
214 vehic.sound_nexttime =
time + 6.486500;
219 else if(
CS(
this).movement_y != 0)
221 if(
CS(
this).movement_y < 0)
223 CS(
this).movement_y = -1;
227 else if(
CS(
this).movement_y > 0)
229 CS(
this).movement_y = 1;
234 float oldvelz = vehic.velocity_z;
236 vehic.velocity_z = oldvelz;
238 if(vehic.velocity_z <= 20)
241 if(vehic.sound_nexttime <
time || vehic.delay != 2)
244 vehic.sound_nexttime =
time + 6.486500;
264 vehic.misc_bulletcounter += 1;
266 gun = (vehic.misc_bulletcounter % 2) ? vehic.gun1 : vehic.gun2;
283 vehic.gun1.angles_z += 45;
284 vehic.gun2.angles_z -= 45;
285 if(vehic.gun1.angles_z >= 360)
287 vehic.gun1.angles_z = 0;
288 vehic.gun2.angles_z = 0;
310 if(vehic.gun2.cnt <=
time)
313 this.
vehicle_reload2 = 100 - ((vehic.gun2.cnt -
time) / vehic.attack_finished_single[0]) * 100;
315 setorigin(
this, vehic.origin +
'0 0 1' * vehic.maxs_z);
331 it.realowner = player;
352 setorigin(player, spot);
354 player.oldvelocity = player.velocity;
361 player.velocity_z += 200;
367 player.velocity = this.
velocity * 0.5;
368 player.velocity_z += 10;
372 player.oldvelocity = player.velocity;
373 setorigin(player, spot);
410 entity h =
new(spiderbot_top), g1 =
new(spiderbot_gun), g2 =
new(spiderbot_gun), b =
new(spiderbot_body);
412 setmodel(b, MDL_VEH_SPIDERBOT_BODY);
414 setmodel(g1, MDL_VEH_SPIDERBOT_GUN);
415 setmodel(g2, MDL_VEH_SPIDERBOT_GUN);
417 setorigin(b, this.
origin);
452 h.colormod = b.colormod = g1.colormod = g2.colormod =
'-2 -2 -2';
459 RadiusDamage (
this, this.
enemy, 250, 15, 250,
NULL,
NULL, 250, DEATH_VH_SPID_DEATH.m_id,
DMG_NOWEP,
NULL);
473 case IMP_weapon_group_1.impulse:
477 case IMP_weapon_group_2.impulse:
481 case IMP_weapon_group_3.impulse:
486 case IMP_weapon_next_byid.impulse:
487 case IMP_weapon_next_bypriority.impulse:
488 case IMP_weapon_next_bygroup.impulse:
496 case IMP_weapon_last.impulse:
497 case IMP_weapon_prev_byid.impulse:
498 case IMP_weapon_prev_bypriority.impulse:
499 case IMP_weapon_prev_bygroup.impulse:
527 vehicles_impact(instance, autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
537 if(instance.owner.flagcarried)
539 setattachment(instance.owner.flagcarried, instance.tur_head,
"");
540 setorigin(instance.owner.flagcarried,
'-20 0 120');
556 instance.nextthink =
time;
559 instance.tur_head.effects |=
EF_FLAME;
560 instance.colormod = instance.tur_head.colormod =
'-1 -1 -1';
571 instance.gun1 =
new(spiderbot_gun);
572 instance.gun2 =
new(spiderbot_gun);
573 setmodel(instance.gun1, MDL_VEH_SPIDERBOT_GUN);
574 setmodel(instance.gun2, MDL_VEH_SPIDERBOT_GUN);
575 setattachment(instance.gun1, instance.tur_head,
"tag_hardpoint01");
576 setattachment(instance.gun2, instance.tur_head,
"tag_hardpoint02");
577 instance.gravity = 2;
578 instance.mass = 5000;
582 instance.tur_head.frame = 1;
585 instance.alpha = instance.tur_head.alpha = instance.gun1.alpha = instance.gun2.alpha = 1;
586 instance.tur_head.angles =
'0 0 0';
589 setorigin(instance, instance.pos1 +
'0 0 128');
590 instance.angles = instance.pos2;
591 instance.damageforcescale = 0.03;
611 instance.max_health =
GetResource(instance, RES_HEALTH);
612 instance.pushable =
true;
622 Vehicles_drawHUD(VEH_SPIDERBOT.m_icon,
"vehicle_spider_weapon1",
"vehicle_spider_weapon2",
655 PAR(_(
"The %s vehicle walks and jumps around, and takes only one rider."),
COLORED_NAME(
this));
656 PAR(_(
"It can jump from very high altitudes while protecting the rider."));
657 PAR(_(
"It has two weapons the rider can control, which have different reticles for them similar to the %s. "
658 "The primary weapon is a machine gun, and is shot toward the green reticle. "
659 "The secondary weapon shoots rockets towards the white reticle. "
660 "The white reticle points to the front of the vehicle, while the green reticle also points to the front but with a bit of delay when the %s rotates."),
COLORED_NAME(VEH_RAPTOR),
COLORED_NAME(
this));
ERASEABLE float anglemods(float v)
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
const string vCROSS_GUIDE
vector autocvar_hud_progressbar_vehicles_ammo1_color
const string vCROSS_BURST
entity AuxiliaryXhair[MAX_AXH]
#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_ZOOM(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
#define autocvar_sv_gravity
bool autocvar_sv_gameplayfix_gravityunaffectedbyticrate
const float SOLID_SLIDEBOX
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)
void movelib_groundalign4point(entity this, float spring_length, float spring_up, float blendrate, float _max)
Pitches and rolls the entity to match the gound.
void movelib_brake_simple(entity this, float force)
#define movelib_move_simple(e, newdir, velo, blendrate)
void set_movetype(entity this, int mt)
#define UNSET_ONGROUND(s)
const int MOVETYPE_BOUNCE
#define METHOD(cname, name, prototype)
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)
float autocvar_g_vehicle_spiderbot_springblend
bool autocvar_g_vehicle_spiderbot
float autocvar_g_vehicle_spiderbot_shield_regen
float autocvar_g_vehicle_spiderbot_turnspeed_strafe
void spiderbot_headfade(entity this)
bool spiderbot_impulse(entity this, int _imp)
float autocvar_g_vehicle_spiderbot_health_regen
int autocvar_g_vehicle_spiderbot_shield
void spiderbot_exit(entity this, int eject)
float autocvar_g_vehicle_spiderbot_speed_stop
float autocvar_g_vehicle_spiderbot_turnspeed
vector autocvar_g_vehicle_spiderbot_bouncepain
float autocvar_g_vehicle_spiderbot_head_turnlimit
int autocvar_g_vehicle_spiderbot_health
void spiderbot_blowup(entity this)
float autocvar_g_vehicle_spiderbot_head_turnspeed
float autocvar_g_vehicle_spiderbot_health_regen_pause
float autocvar_g_vehicle_spiderbot_speed_walk
float autocvar_g_vehicle_spiderbot_movement_inertia
float autocvar_g_vehicle_spiderbot_respawntime
float autocvar_g_vehicle_spiderbot_shield_regen_pause
float autocvar_g_vehicle_spiderbot_head_pitchlimit_down
float autocvar_g_vehicle_spiderbot_springlength
float autocvar_g_vehicle_spiderbot_head_pitchlimit_up
bool spiderbot_frame(entity this, float dt)
float autocvar_g_vehicle_spiderbot_tiltlimit
float autocvar_g_vehicle_spiderbot_springup
float autocvar_g_vehicle_spiderbot_speed_strafe
void spiderbot_rocket_do(entity this)
float autocvar_g_vehicle_spiderbot_minigun_solidpenetration
float autocvar_g_vehicle_spiderbot_minigun_damage
float autocvar_g_vehicle_spiderbot_minigun_refire
int autocvar_g_vehicle_spiderbot_minigun_ammo_max
int autocvar_g_vehicle_spiderbot_minigun_ammo_regen
float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause
int autocvar_g_vehicle_spiderbot_minigun_ammo_cost
float autocvar_g_vehicle_spiderbot_minigun_force
float autocvar_g_vehicle_spiderbot_minigun_spread
ClientState CS(Client this)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
void SUB_SetFade(entity ent, float vanish_time, float fading_time)
void CSQCModel_UnlinkEntity(entity e)
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)
void vehicles_frame(entity this, entity actor)
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_ammo1
If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehicle,...
const float vehicle_health
#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,...
const float vehicle_reload1
If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already st...
void fireBullet(entity this,.entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float headshot_multiplier, float force, float dtype, entity tracer_effect)
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_SHIELDREGEN
Vehicle has shileding.
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
bool weaponUseForbidden(entity player)
bool weaponLocked(entity player)