5 void spiderbot_rocket_artillery(
entity this)
11 void spiderbot_rocket_unguided(
entity this)
19 this.
velocity =
normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
27 void spiderbot_rocket_guided(
entity this)
34 setthink(
this, spiderbot_rocket_unguided);
39 this.
velocity =
normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
47 void spiderbot_guide_release(
entity this)
49 bool donetrace =
false;
59 setthink(it, spiderbot_rocket_unguided);
63 float spiberbot_calcartillery_flighttime;
66 float grav, sdist, zdist, vs, vz, jumpheight;
69 grav = autocvar_sv_gravity;
70 zdist = tgt_z - org_z;
71 sdist =
vlen(tgt - org - zdist *
'0 0 1');
72 sdir =
normalize(tgt - org - zdist *
'0 0 1');
75 jumpheight =
fabs(ht);
77 jumpheight = jumpheight + zdist;
80 vz =
sqrt(2 * grav * jumpheight);
91 solution_y = solution_x;
93 solution_x = solution_y;
103 spiberbot_calcartillery_flighttime = solution_y;
110 spiberbot_calcartillery_flighttime = solution_y;
121 spiberbot_calcartillery_flighttime = solution_x;
128 spiberbot_calcartillery_flighttime = solution_y;
131 vs = sdist / spiberbot_calcartillery_flighttime;
134 return sdir * vs +
'0 0 1' * vz;
137 void spiderbot_rocket_do(
entity this)
142 if (this.
wait != -10)
147 if (this.
tur_head.frame == 9 ||
this.tur_head.frame == 1)
149 if(this.gun2.cnt <
time &&
this.tur_head.frame == 9)
159 spiderbot_guide_release(
this);
165 if(this.gun2.cnt >
time)
183 switch(STAT(VEHICLESTAT_W2MODE,
this))
188 autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
189 DEATH_VH_SPID_ROCKET.m_id,
PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health,
false,
true,
this.owner);
192 _dist -= (
random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
193 rocket.nextthink =
time + (_dist / autocvar_g_vehicle_spiderbot_rocket_speed);
202 autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
203 DEATH_VH_SPID_ROCKET.m_id,
PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health,
false,
false,
this.owner);
206 rocket.nextthink =
time;
207 setthink(rocket, spiderbot_rocket_guided);
214 autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
215 DEATH_VH_SPID_ROCKET.m_id,
PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health,
false,
true,
this.owner);
220 rocket.pos1_z = trace_endpos_z;
222 traceline(v, v +
'0 0 1' * max_shot_distance,
MOVE_WORLDONLY,
this);
226 traceline(v , rocket.pos1 +
'0 0 1' * max_shot_distance,
MOVE_WORLDONLY,
this);
227 float h2 = 0.75 *
vlen(rocket.pos1 - v);
229 rocket.velocity = spiberbot_calcartillery(v, rocket.pos1, ((h1 < h2) ? h1 : h2));
235 rocket.classname =
"spiderbot_rocket";
237 rocket.cnt =
time + autocvar_g_vehicle_spiderbot_rocket_lifetime;
243 this.
attack_finished_single[0] = ((STAT(VEHICLESTAT_W2MODE,
this) == SBRM_VOLLY) ? autocvar_g_vehicle_spiderbot_rocket_refire2 : autocvar_g_vehicle_spiderbot_rocket_refire);
#define PHYS_INPUT_BUTTON_ATCK2(s)
#define IL_EACH(this, cond, body)
ERASEABLE vector solve_quadratic(float a, float b, float c)
ax^2 + bx + c = 0
const int PROJECTILE_SPIDERROCKET
bool weaponUseForbidden(entity player)
void crosshair_trace(entity pl)
void vehicles_projectile_explode_think(entity this)
bool weaponLocked(entity player)
void UpdateCSQCProjectile(entity e)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
IntrusiveList g_projectiles
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
entity vehicles_projectile(entity this, entity _mzlfx, Sound _mzlsound, vector _org, vector _vel, float _dmg, float _radi, float _force, float _size, int _deahtype, float _projtype, float _health, bool _cull, bool _clianim, entity _owner)
void set_movetype(entity this, int mt)
float attack_finished_single[MAX_WEAPONSLOTS]