much better sub behavior

This commit is contained in:
Chris Forbes
2009-12-13 13:32:19 +13:00
parent 5eb373790b
commit e4c9073884
7 changed files with 21 additions and 4 deletions

View File

@@ -56,9 +56,20 @@ namespace OpenRa.Game
{
var projectile = Rules.ProjectileInfo[weapon.Projectile];
if (projectile.ASW) return false; // we don't support ASW yet. change this when subs can be identified.
if (projectile.ASW && target.traits.Contains<RenderSubmarine>()) return true;
if (projectile.AA && target.traits.Contains<Helicopter>()) return true;
if (projectile.UnderWater && !target.Info.WaterBound) return false;
return projectile.AG;
}
public static bool HasAnyValidWeapons(Actor self, Actor target)
{
if (self.Info.Primary != null &&
WeaponValidForTarget(Rules.WeaponInfo[self.Info.Primary], target)) return true;
if (self.Info.Secondary != null &&
WeaponValidForTarget(Rules.WeaponInfo[self.Info.Secondary], target)) return true;
return false;
}
}
}