remove (self);
}
-void walker_rocket_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
-{SELFPARAM();
- self.health = self.health - damage;
- self.velocity = self.velocity + vforce;
+void walker_rocket_damage(entity this, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+{
+ this.health = this.health - damage;
+ this.velocity = this.velocity + vforce;
- if (self.health <= 0)
- W_PrepareExplosionByDamage(self.owner, walker_rocket_explode);
+ if (this.health <= 0)
+ WITH(entity, self, this, W_PrepareExplosionByDamage(this.owner, walker_rocket_explode));
}
#define WALKER_ROCKET_MOVE movelib_move_simple(self, newdir, (autocvar_g_turrets_unit_walker_rocket_speed), (autocvar_g_turrets_unit_walker_rocket_turnrate)); UpdateCSQCProjectile(self)
return;
}
- if (vlen(self.origin - self.tur_shotorg) < 100 )
+ if(vdist(self.origin - self.tur_shotorg, <, 100))
{
self.think = walker_rocket_think;
return;
return;
}
- if (vlen(self.origin - self.tur_shotorg) < 100 )
+ if(vdist(self.origin - self.tur_shotorg, <, 100))
{
self.tur_shotorg = self.origin - '0 0 200';
self.think = walker_rocket_loop3;
{SELFPARAM();
#ifdef WALKER_FANCYPATHING
// Are we close enougth to a path node to switch to the next?
- if (vlen(self.origin - self.pathcurrent.origin) < 64)
+ if(vdist(self.origin - self.pathcurrent.origin, <, 64))
if (self.pathcurrent.path_next == world)
{
// Path endpoint reached
walker_move_to(self.moveto, 0);
#else
- if (vlen(self.origin - self.pathcurrent.origin) < 64)
+ if(vdist(self.origin - self.pathcurrent.origin, <, 64))
self.pathcurrent = self.pathcurrent.enemy;
if(!self.pathcurrent)
{
if(self.enemy_last_time != 0)
{
- if(vlen(self.origin - self.enemy_last_loc) < 128 || time - self.enemy_last_time > 10)
+ if(vdist(self.origin - self.enemy_last_loc, <, 128) || time - self.enemy_last_time > 10)
self.enemy_last_time = 0;
else
walker_move_to(self.enemy_last_loc, 0);
{
float dt;
- dt = time - self.move_time;
- self.move_time = time;
+ dt = time - this.move_time;
+ this.move_time = time;
if(dt <= 0)
return;
- fixedmakevectors(self.angles);
+ fixedmakevectors(this.angles);
movelib_groundalign4point(300, 100, 0.25, 45);
- setorigin(self, self.origin + self.velocity * dt);
- self.tur_head.angles += dt * self.tur_head.move_avelocity;
- self.angles_y = self.move_angles_y;
+ setorigin(this, this.origin + this.velocity * dt);
+ this.tur_head.angles += dt * this.tur_head.move_avelocity;
+ this.angles_y = this.move_angles_y;
- if (self.health < 127)
+ if (this.health < 127)
if(random() < 0.15)
- te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
+ te_spark(this.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
}
METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it))