From: Mario Date: Thu, 30 May 2013 19:04:16 +0000 (+1000) Subject: Fusion Reactor now heals monsters instead of turrets, idea by hutty X-Git-Tag: xonotic-v0.8.0~241^2^2~216 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3859bb9b68cddefaffa781d9941998c8c05a2158;p=xonotic%2Fxonotic-data.pk3dir.git Fusion Reactor now heals monsters instead of turrets, idea by hutty --- diff --git a/qcsrc/server/mutators/gamemode_towerdefense.qc b/qcsrc/server/mutators/gamemode_towerdefense.qc index 9a588bfd2..f4519da4c 100644 --- a/qcsrc/server/mutators/gamemode_towerdefense.qc +++ b/qcsrc/server/mutators/gamemode_towerdefense.qc @@ -606,6 +606,9 @@ MUTATOR_HOOKFUNCTION(td_TurretSpawn) if(self.realowner == world) return TRUE; + if(self.turrcaps_flags & TFL_TURRCAPS_SUPPORT) + self.target_range = 500; + self.bot_attack = FALSE; buffturret(self, 0.7); @@ -878,9 +881,7 @@ MUTATOR_HOOKFUNCTION(td_TurretValidateTarget) if(turret_target.flags & FL_PROJECTILE) if(turret_target.owner.flags & FL_MONSTER) return TRUE; // flac support - - if(turret.turrcaps_flags & TFL_TURRCAPS_SUPPORT && turret_target.turrcaps_flags & TFL_TURRCAPS_ISTURRET) - return TRUE; + if not(turret_target.flags & FL_MONSTER) turret_target = world; diff --git a/qcsrc/server/tturrets/units/unit_fusionreactor.qc b/qcsrc/server/tturrets/units/unit_fusionreactor.qc index e9db03fff..d1bf08931 100644 --- a/qcsrc/server/tturrets/units/unit_fusionreactor.qc +++ b/qcsrc/server/tturrets/units/unit_fusionreactor.qc @@ -7,11 +7,10 @@ void turret_fusionreactor_fire() vector fl_org; self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max); - if(g_td) // auto repair? + if(g_td) // auto heal monsters in tower defense { self.enemy.health = min(self.enemy.health + self.shot_dmg,self.enemy.max_health); - self.enemy.tur_health = min(self.enemy.tur_health + self.shot_dmg,self.enemy.max_health); - self.enemy.SendFlags |= TNSF_STATUS; + self.enemy.SendFlags |= MSF_STATUS; } fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax); te_smallflash(fl_org); @@ -51,14 +50,14 @@ float turret_fusionreactor_firecheck() if(g_td) { - if(self.realowner != self.enemy.realowner) + if(self.enemy.health >= self.enemy.max_health) return 0; - - if(self.enemy.turrcaps_flags & TFL_TURRCAPS_AMMOSOURCE) + + if(IsDifferentTeam(self.enemy, self)) return 0; - if(self.enemy.health >= self.enemy.max_health) - return 0; + if(self.enemy.flags & FL_MONSTER) + return 1; // the following checks are for turrets only } if (self.enemy.ammo >= self.enemy.ammo_max)