return;
Turret info = get_turretinfo(self.m_id);
- info.tr_attack(info);
+ info.tr_attack(info, self);
self.attack_finished_single[0] = time + self.shot_refire;
self.ammo -= self.shot_dmg;
turret_fire();
Turret tur = get_turretinfo(self.m_id);
- tur.tr_think(tur);
+ tur.tr_think(tur, self);
return;
}
turret_track();
Turret tur = get_turretinfo(self.m_id);
- tur.tr_think(tur);
+ tur.tr_think(tur, self);
// And bail.
return;
}
Turret tur = get_turretinfo(self.m_id);
- tur.tr_think(tur);
+ tur.tr_think(tur, self);
}
/*
FOREACH_ENTITY(IS_TURRET(it), LAMBDA(
load_unit_settings(it, true);
Turret tur = get_turretinfo(it.m_id);
- tur.tr_think(tur);
+ tur.tr_think(tur, it);
));
cvar_set("g_turrets_reloadcvars", "0");
}
/** turret hitbox size */
ATTRIB(Turret, maxs, vector, '0 0 0')
- METHOD(Turret, display, void(entity this, void(string name, string icon) returns)) {
+ METHOD(Turret, display, void(Turret this, void(string name, string icon) returns)) {
returns(this.turret_name, string_null);
}
/** (BOTH) setup turret data */
}
/** (SERVER) logic to run every frame */
- METHOD(Turret, tr_think, void(Turret this)) {
+ METHOD(Turret, tr_think, void(Turret this, entity it)) {
}
/** (SERVER) called when turret dies */
ATTRIB(Turret, m_weapon, Weapon, WEP_Null)
#ifdef SVQC
/** (SERVER) called when turret attacks */
- METHOD(Turret, tr_attack, void(Turret this)) {
+ METHOD(Turret, tr_attack, void(Turret this, entity it)) {
Weapon w = this.m_weapon;
.entity weaponentity = weaponentities[0];
w.wr_think(w, self, weaponentity, 1);
spawnfunc(turret_ewheel) { if(!turret_initialize(TUR_EWHEEL)) remove(self); }
- METHOD(EWheel, tr_think, void(EWheel thistur))
+ METHOD(EWheel, tr_think, void(EWheel thistur, entity it))
{
SELFPARAM();
float vz;
spawnfunc(turret_fusionreactor) { if (!turret_initialize(TUR_FUSIONREACTOR)) remove(self); }
-METHOD(FusionReactor, tr_attack, void(FusionReactor this))
+METHOD(FusionReactor, tr_attack, void(FusionReactor this, entity it))
{
self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max);
vector fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax);
te_smallflash(fl_org);
}
-METHOD(FusionReactor, tr_think, void(FusionReactor thistur))
+METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it))
{
self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max);
}
spawnfunc(turret_hellion) { if (!turret_initialize(TUR_HELLION)) remove(self); }
-METHOD(Hellion, tr_think, void(Hellion thistur))
+METHOD(Hellion, tr_think, void(Hellion thistur, entity it))
{
if (self.tur_head.frame != 0)
self.tur_head.frame += 1;
spawnfunc(turret_hk) { if(!turret_initialize(TUR_HK)) remove(self); }
-METHOD(HunterKiller, tr_think, void(HunterKiller thistur))
+METHOD(HunterKiller, tr_think, void(HunterKiller thistur, entity it))
{
if (self.tur_head.frame != 0)
self.tur_head.frame = self.tur_head.frame + 1;
spawnfunc(turret_mlrs) { if (!turret_initialize(TUR_MLRS)) remove(self); }
-METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur))
+METHOD(MLRSTurret, tr_think, void(MLRSTurret thistur, entity it))
{
// 0 = full, 6 = empty
self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
spawnfunc(turret_phaser) { if (!turret_initialize(TUR_PHASER)) remove(self); }
-METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur))
+METHOD(PhaserTurret, tr_think, void(PhaserTurret thistur, entity it))
{
if (self.tur_head.frame != 0)
{
spawnfunc(turret_plasma) { if (!turret_initialize(TUR_PLASMA)) remove(self); }
-METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this))
+METHOD(PlasmaTurret, tr_attack, void(PlasmaTurret this, entity it))
{
if(g_instagib)
{
}
else
{
- SUPER(PlasmaTurret).tr_attack(this);
+ SUPER(PlasmaTurret).tr_attack(this, it);
}
if (self.tur_head.frame == 0)
self.tur_head.frame = 1;
}
-METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur))
+METHOD(PlasmaTurret, tr_think, void(PlasmaTurret thistur, entity it))
{
if (self.tur_head.frame != 0)
self.tur_head.frame = self.tur_head.frame + 1;
spawnfunc(turret_plasma_dual) { if (!turret_initialize(TUR_PLASMA_DUAL)) remove(self); }
-METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this))
+METHOD(DualPlasmaTurret, tr_attack, void(DualPlasmaTurret this, entity it))
{
if (g_instagib) {
FireRailgunBullet (self.tur_shotorg, self.tur_shotorg + self.tur_shotdir_updated * MAX_SHOT_DISTANCE, 10000000000,
vector v = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
WarpZone_TrailParticles(world, particleeffectnum(EFFECT_VAPORIZER(self.team)), self.tur_shotorg, v);
} else {
- SUPER(PlasmaTurret).tr_attack(this);
+ SUPER(PlasmaTurret).tr_attack(this, it);
}
self.tur_head.frame += 1;
}
-METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur))
+METHOD(DualPlasmaTurret, tr_think, void(DualPlasmaTurret thistur, entity it))
{
if ((self.tur_head.frame != 0) && (self.tur_head.frame != 3))
self.tur_head.frame = self.tur_head.frame + 1;
spawnfunc(turret_tesla) { if (!turret_initialize(TUR_TESLA)) remove(self); }
-METHOD(TeslaCoil, tr_think, void(TeslaCoil thistur))
+METHOD(TeslaCoil, tr_think, void(TeslaCoil thistur, entity it))
{
if(!self.active)
{
spawnfunc(turret_walker) { if(!turret_initialize(TUR_WALKER)) remove(self); }
- METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur))
+ METHOD(WalkerTurret, tr_think, void(WalkerTurret thistur, entity it))
{
fixedmakevectors(self.angles);