exclusive force fire on husks and bridges

This commit is contained in:
Matthias Mailänder
2014-03-22 10:46:01 +01:00
parent af1db08503
commit c76ebbdc46
9 changed files with 31 additions and 2 deletions

View File

@@ -199,6 +199,9 @@ namespace OpenRA.Mods.RA
if (modifiers.HasModifier(TargetModifiers.ForceMove))
return false;
if (target.RequiresForceFire)
return false;
var targetableRelationship = negativeDamage ? Stance.Ally : Stance.Enemy;
var owner = target.Type == TargetType.FrozenActor ? target.FrozenActor.Owner : target.Actor.Owner;

View File

@@ -18,8 +18,10 @@ namespace OpenRA.Mods.RA
public class TargetableBuildingInfo : ITraitInfo, ITargetableInfo, Requires<BuildingInfo>
{
public readonly string[] TargetTypes = { };
public string[] GetTargetTypes() { return TargetTypes; }
public bool RequiresForceFire = false;
public object Create(ActorInitializer init) { return new TargetableBuilding(init.self, this); }
}
@@ -41,5 +43,7 @@ namespace OpenRA.Mods.RA
{
return building.OccupiedCells().Select(c => c.First.CenterPosition);
}
public bool RequiresForceFire { get { return info.RequiresForceFire; } }
}
}

View File

@@ -16,8 +16,10 @@ namespace OpenRA.Mods.RA
public class TargetableUnitInfo : ITraitInfo, ITargetableInfo
{
public readonly string[] TargetTypes = { };
public string[] GetTargetTypes() { return TargetTypes; }
public bool RequiresForceFire = false;
public virtual object Create(ActorInitializer init) { return new TargetableUnit(init.self, this); }
}
@@ -46,5 +48,7 @@ namespace OpenRA.Mods.RA
{
yield return self.CenterPosition;
}
public bool RequiresForceFire { get { return info.RequiresForceFire; } }
}
}