9 entity player = isPlayer ? actor : actor.owner;
10 entity veh = player.vehicle;
12 if (
weapon_prepareattack(thiswep, player, weaponentity,
false, autocvar_g_vehicle_racer_cannon_refire)) {
14 veh.vehicle_energy -= autocvar_g_vehicle_racer_cannon_cost;
19 string tagname = (veh.cnt)
20 ? (veh.cnt = 0,
"tag_fire1")
21 : (veh.cnt = 1,
"tag_fire2");
35 autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force, 0,
37 bolt.velocity =
normalize(dir) * autocvar_g_vehicle_racer_cannon_speed;
51 entity player = isPlayer ? actor : actor.owner;
52 entity veh = player.vehicle;
53 return isPlayer || veh.vehicle_energy >= autocvar_g_vehicle_racer_cannon_cost;
56 void racer_rocket_tracker(
entity this);
57 void racer_rocket_groundhugger(
entity this);
62 org, dir * autocvar_g_vehicle_racer_rocket_speed,
63 autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
66 rocket.lip = autocvar_g_vehicle_racer_rocket_accel *
sys_frametime;
67 rocket.wait = autocvar_g_vehicle_racer_rocket_turnrate;
68 rocket.nextthink =
time;
70 rocket.cnt =
time + 15;
73 setthink(rocket, racer_rocket_tracker);
75 setthink(rocket, racer_rocket_groundhugger);
78 void racer_rocket_tracker(
entity this)
99 newvel = oldvel + this.
lip;
103 vector predicted_origin = this.
enemy.origin + this.
enemy.velocity * time_to_impact;
109 float height_diff = predicted_origin_z - this.origin_z;
111 if(
vdist(newdir -
v_forward, >, autocvar_g_vehicle_racer_rocket_locked_maxangle))
115 setthink(
this, racer_rocket_groundhugger);
122 this.
velocity =
normalize(olddir + newdir * autocvar_g_vehicle_racer_rocket_turnrate) * newvel;
124 this.velocity_z +=
max(height_diff, autocvar_g_vehicle_racer_rocket_climbspeed) *
sys_frametime ;
130 void racer_rocket_groundhugger(
entity this)
133 float oldvel, newvel;
151 newvel = oldvel + this.
lip;
174 int cont = pointcontents(this.
origin -
'0 0 32');
176 this.velocity_z += 200;
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define METHOD(cname, name, prototype)
void crosshair_trace(entity pl)
const float CONTENT_SLIME
void UpdateCSQCProjectile(entity e)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
const float CONTENT_WATER
const int PROJECTILE_WAKIROCKET
const int PROJECTILE_WAKICANNON
#define W_SetupShot_Dir(ent, wepent, s_forward, antilag, recoil, snd, chan, maxdamage, deathtype)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
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)