// Generic aiming
vector turret_aim_generic(entity this)
{
-
vector pre_pos, prep;
float distance, impact_time = 0, i, mintime;
return pre_pos;
}
-float turret_targetscore_support(entity _turret,entity _target)
+float turret_targetscore_support(entity _turret, entity _target)
{
float score; // Total score
float s_score = 0, d_score;
this.deadflag = DEAD_DEAD;
this.tur_head.deadflag = this.deadflag;
-// Unsolidify and hide real parts
+ // Unsolidify and hide real parts
this.solid = SOLID_NOT;
this.tur_head.solid = this.solid;
SetResourceExplicit(this, RES_HEALTH, 0);
-// Go boom
+ // Go boom
//RadiusDamage (this,this, min(this.ammo,50),min(this.ammo,50) * 0.25,250,NULL,min(this.ammo,50)*5,DEATH_TURRET,NULL);
Turret tur = get_turretinfo(this.m_id);
this.anim_start_time = time;
}
- if(client_only)
+ if(client_only)
this.clientframe = _frame;
else
this.frame = _frame;
void turret_projectile_explode(entity this)
{
-
this.takedamage = DAMAGE_NO;
this.event_damage = func_null;
#ifdef TURRET_DEBUG
switch(this.track_type)
{
case TFL_TRACKTYPE_STEPMOTOR:
- f_tmp = this.aim_speed * frametime; // dgr/sec -> dgr/tic
+ f_tmp = this.aim_speed * frametime;
if (this.track_flags & TFL_TRACK_PITCH)
{
- this.tur_head.angles_x += bound(-f_tmp,move_angle_x, f_tmp);
+ this.tur_head.angles_x += bound(-f_tmp, move_angle_x, f_tmp);
if(this.tur_head.angles_x > this.aim_maxpitch)
this.tur_head.angles_x = this.aim_maxpitch;
return;
case TFL_TRACKTYPE_FLUIDINERTIA:
- f_tmp = this.aim_speed * frametime; // dgr/sec -> dgr/tic
+ f_tmp = this.aim_speed * frametime;
move_angle_x = bound(-this.aim_speed, move_angle_x * this.track_accel_pitch * f_tmp, this.aim_speed);
move_angle_y = bound(-this.aim_speed, move_angle_y * this.track_accel_rot * f_tmp, this.aim_speed);
move_angle = (this.tur_head.avelocity * this.track_blendrate) + (move_angle * (1 - this.track_blendrate));
*/
void turret_use(entity this, entity actor, entity trigger)
{
- LOG_TRACE("Turret ",this.netname, " used by ", actor.classname);
+ LOG_TRACE("Turret ", this.netname, " used by ", actor.classname);
this.team = actor.team;
this.active = ACTIVE_NOT;
else
this.active = ACTIVE_ACTIVE;
-
}
void turret_link(entity this)
}
else if (this.tur_head.spawnshieldtime < 2)
{
-
newframe = ewheel_anim_fwd_slow;
movelib_move_simple(this, v_forward, (autocvar_g_turrets_unit_ewheel_speed_slow), 0.4);
- }
+ }
else
{
newframe = ewheel_anim_fwd_slow;
it.frame = it.tur_head.frame = 1;
it.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE;
- // Convert from dgr / sec to dgr / tic
- it.tur_head.aim_speed = (autocvar_g_turrets_unit_ewheel_turnrate);
- it.tur_head.aim_speed = it.tur_head.aim_speed / (1 / frametime);
+ it.tur_head.aim_speed = autocvar_g_turrets_unit_ewheel_turnrate * frametime;
}
#endif // SVQC