this.volly_counter = this.shot_volly;
this.ammo = this.ammo_max;
- this.nextthink = time + this.ticrate;
+ this.nextthink = time;
setthink(this, turret_think);
this.SendFlags = TNSF_FULL_UPDATE;
switch(this.track_type)
{
case TFL_TRACKTYPE_STEPMOTOR:
- f_tmp = this.aim_speed * this.ticrate; // dgr/sec -> dgr/tic
+ f_tmp = this.aim_speed * frametime; // dgr/sec -> dgr/tic
if (this.track_flags & TFL_TRACK_PITCH)
{
this.tur_head.angles_x += bound(-f_tmp,move_angle_x, f_tmp);
return;
case TFL_TRACKTYPE_FLUIDINERTIA:
- f_tmp = this.aim_speed * this.ticrate; // dgr/sec -> dgr/tic
+ f_tmp = this.aim_speed * frametime; // dgr/sec -> dgr/tic
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));
if (this.track_flags & TFL_TRACK_PITCH)
{
this.tur_head.avelocity_x = move_angle_x;
- if((this.tur_head.angles_x + this.tur_head.avelocity_x * this.ticrate) > this.aim_maxpitch)
+ if((this.tur_head.angles_x + this.tur_head.avelocity_x * frametime) > this.aim_maxpitch)
{
this.tur_head.avelocity_x = 0;
this.tur_head.angles_x = this.aim_maxpitch;
this.SendFlags |= TNSF_ANG;
}
- if((this.tur_head.angles_x + this.tur_head.avelocity_x * this.ticrate) < -this.aim_maxpitch)
+ if((this.tur_head.angles_x + this.tur_head.avelocity_x * frametime) < -this.aim_maxpitch)
{
this.tur_head.avelocity_x = 0;
this.tur_head.angles_x = -this.aim_maxpitch;
{
this.tur_head.avelocity_y = move_angle_y;
- if((this.tur_head.angles_y + this.tur_head.avelocity_y * this.ticrate) > this.aim_maxrot)
+ if((this.tur_head.angles_y + this.tur_head.avelocity_y * frametime) > this.aim_maxrot)
{
this.tur_head.avelocity_y = 0;
this.tur_head.angles_y = this.aim_maxrot;
this.SendFlags |= TNSF_ANG;
}
- if((this.tur_head.angles_y + this.tur_head.avelocity_y * this.ticrate) < -this.aim_maxrot)
+ if((this.tur_head.angles_y + this.tur_head.avelocity_y * frametime) < -this.aim_maxrot)
{
this.tur_head.avelocity_y = 0;
this.tur_head.angles_y = -this.aim_maxrot;
void turret_think(entity this)
{
- this.nextthink = time + this.ticrate;
+ this.nextthink = time;
MUTATOR_CALLHOOK(TurretThink, this);
// Handle ammo
if (!(this.spawnflags & TSF_NO_AMMO_REGEN))
if (this.ammo < this.ammo_max)
- this.ammo = min(this.ammo + this.ammo_recharge, this.ammo_max);
+ this.ammo = min(this.ammo + this.ammo_recharge * frametime, this.ammo_max);
// Inactive turrets needs to run the think loop,
// So they can handle animation and wake up if need be.
load_unit_settings(this, 0);
if(!this.team || !teamplay) { this.team = FLOAT_MAX; }
- if(!this.ticrate) { this.ticrate = ((this.turret_flags & TUR_FLAG_SUPPORT) ? 0.2 : 0.1); }
if(!GetResource(this, RES_HEALTH)) { SetResourceExplicit(this, RES_HEALTH, 1000); }
if(!this.shot_refire) { this.shot_refire = 1; }
if(!this.tur_shotorg) { this.tur_shotorg = '50 0 50'; }
this.active = ACTIVE_ACTIVE;
this.effects = EF_NODRAW;
this.netname = tur.turret_name;
- this.ticrate = bound(sys_frametime, this.ticrate, 60);
this.max_health = GetResource(this, RES_HEALTH);
this.target_validate_flags = this.target_select_flags;
this.ammo = this.ammo_max;
- this.ammo_recharge *= this.ticrate;
this.solid = SOLID_BBOX;
this.takedamage = DAMAGE_AIM;
set_movetype(this, MOVETYPE_NOCLIP);
this.event_heal = turret_heal;
this.use = turret_use;
this.bot_attack = true;
- this.nextthink = time + 1 + turret_count * sys_frametime;
+ this.nextthink = time + 1;
this.reset = turret_reset;
this.tur_head = new(turret_head);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
}
entity beam = new(PhaserTurret_beam);
- beam.ticrate = 0.1; //autocvar_sys_ticrate;
setmodel(beam, MDL_TUR_PHASER_BEAM);
beam.effects = EF_LOWPRECISION;
beam.solid = SOLID_NOT;
beam.shot_spread = time + 2;
beam.nextthink = time;
beam.owner = actor;
- beam.shot_dmg = actor.shot_dmg / (actor.shot_speed / beam.ticrate);
+ beam.shot_dmg = actor.shot_dmg / (actor.shot_speed / frametime);
beam.scale = actor.target_range / 256;
set_movetype(beam, MOVETYPE_NONE);
beam.enemy = actor.enemy;
sound (this, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM);
}
- this.nextthink = time + this.ticrate;
+ this.nextthink = time;
actor.attack_finished_single[0] = time + frametime;
FireImoBeam ( actor, actor.tur_shotorg,