Merge pull request #3243 from ScottNZ/balance

RA Balance (destructible mines; badr and mamooth and cruiser buff)
This commit is contained in:
Matthias Mailänder
2013-05-10 02:55:17 -07:00
5 changed files with 34 additions and 26 deletions

View File

@@ -20,7 +20,6 @@ namespace OpenRA.Mods.RA
class MineInfo : ITraitInfo
{
public readonly string[] CrushClasses = { };
[WeaponReference] public readonly string Weapon = "ATMine";
public readonly bool AvoidFriendly = true;
public readonly string[] DetonateClasses = { };
@@ -44,15 +43,14 @@ namespace OpenRA.Mods.RA
public void OnCrush(Actor crusher)
{
if (crusher.HasTrait<MineImmune>() || self.Owner.Stances[crusher.Owner] == Stance.Ally)
if (crusher.HasTrait<MineImmune>() || (self.Owner.Stances[crusher.Owner] == Stance.Ally && info.AvoidFriendly))
return;
var mobile = crusher.TraitOrDefault<Mobile>();
if (mobile != null && !info.DetonateClasses.Intersect(mobile.Info.Crushes).Any())
return;
Combat.DoExplosion(self, info.Weapon, crusher.CenterLocation, 0);
self.QueueActivity(new RemoveSelf());
self.Kill(crusher);
}
public bool CrushableBy(string[] crushClasses, Player owner)