if(self.dmg)
RadiusDamage(self, activator, self.dmg, self.dmg_edge, self.dmg_radius, self, world, self.dmg_force, DEATH_HURTTRIGGER, world);
- if(self.cnt)
- Send_Effect((effects_ent[self.cnt - 1]).eent_eff_name, self.absmin * 0.5 + self.absmax * 0.5, '0 0 0', self.count);
+ if(self.cnt) // TODO
+ pointparticles(self.cnt, self.absmin * 0.5 + self.absmax * 0.5, '0 0 0', self.count);
if(self.respawntime)
{
return 1;
}
+bool turret_checkfire()
+{
+ bool ret = false; // dummy
+ if(MUTATOR_CALLHOOK(Turret_CheckFire, ret))
+ return ret_bool;
+
+ return self.turret_firecheckfunc();
+}
+
void turret_fire()
{
if (autocvar_g_turrets_nofire != 0)
return;
+ if(MUTATOR_CALLHOOK(TurretFire, self))
+ return;
+
TUR_ACTION(self.turretid, TR_ATTACK);
self.attack_finished_single = time + self.shot_refire;
turret_do_updates(self);
- if (self.turret_firecheckfunc())
+ if (turret_checkfire())
turret_fire();
}
}
turret_do_updates(self);
// Fire?
- if (self.turret_firecheckfunc())
+ if (turret_checkfire())
turret_fire();
}
else
turret_do_updates(self);
// Fire!
- if (self.turret_firecheckfunc() != 0)
+ if (turret_checkfire())
turret_fire();
TUR_ACTION(self.turretid, TR_THINK);
turret_do_updates(self);
// Fire?
- if (self.turret_firecheckfunc())
+ if (turret_checkfire())
turret_fire();
}
);
#else
#ifdef SVQC
-float turret_fusionreactor_firecheck()
+bool turret_fusionreactor_firecheck()
{
if (self.attack_finished_single > time)
- return 0;
+ return false;
if (self.enemy.deadflag != DEAD_NO)
- return 0;
+ return false;
if (self.enemy == world)
- return 0;
+ return false;
if (self.ammo < self.shot_dmg)
- return 0;
+ return false;
if (self.enemy.ammo >= self.enemy.ammo_max)
- return 0;
+ return false;
if (vlen(self.enemy.origin - self.origin) > self.target_range)
- return 0;
+ return false;
if(self.team != self.enemy.team)
- return 0;
+ return false;
if(!(self.enemy.ammo_flags & TFL_AMMO_ENERGY))
- return 0;
+ return false;
- return 1;
+ return true;
}
void spawnfunc_turret_fusionreactor() { if(!turret_initialize(TUR_FUSIONREACTOR)) remove(self); }
/**/
MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn);
+/** return error to not attack */
+#define EV_TurretFire(i, o) \
+ /** turret */ i(entity, self) \
+ /**/
+MUTATOR_HOOKABLE(TurretFire, EV_TurretFire);
+
+/** return error to not attack */
+#define EV_Turret_CheckFire(i, o) \
+ /**/ i(bool, ret_bool) \
+ /**/ o(bool, ret_bool) \
+ /**/
+bool ret_bool;
+MUTATOR_HOOKABLE(Turret_CheckFire, EV_Turret_CheckFire);
+
/** return error to prevent entity spawn, or modify the entity */
MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_NO_ARGS);