Remove legacy 0% = not targetable assumption

This commit is contained in:
reaperrr
2015-08-09 01:11:10 +02:00
parent 4e101afb6d
commit 277ac04f85
3 changed files with 0 additions and 25 deletions

View File

@@ -47,17 +47,6 @@ namespace OpenRA.Mods.Common.Warheads
return 100;
}
// TODO: This can be removed after the legacy and redundant 0% = not targetable
// assumption has been removed from the yaml definitions
public override bool CanTargetActor(ActorInfo victim, Actor firedBy)
{
var health = victim.Traits.GetOrDefault<HealthInfo>();
if (health == null)
return false;
return DamageVersus(victim) > 0;
}
public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
{
// Used by traits that damage a single actor, rather than a position

View File

@@ -29,10 +29,6 @@ namespace OpenRA.Mods.Common.Warheads
public readonly WDist Range = WDist.FromCells(1);
// TODO: This can be removed after the legacy and redundant 0% = not targetable
// assumption has been removed from the yaml definitions
public override bool CanTargetActor(ActorInfo victim, Actor firedBy) { return true; }
public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
{
var actors = target.Type == TargetType.Actor ? new[] { target.Actor } :

View File

@@ -47,16 +47,9 @@ namespace OpenRA.Mods.Common.Warheads
/// <summary>Applies the warhead's effect against the target.</summary>
public abstract void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers);
// TODO: This can be removed after the legacy and redundant 0% = not targetable
// assumption has been removed from the yaml definitions
public virtual bool CanTargetActor(ActorInfo victim, Actor firedBy) { return false; }
/// <summary>Checks if the warhead is valid against (can do something to) the actor.</summary>
public bool IsValidAgainst(Actor victim, Actor firedBy)
{
if (!CanTargetActor(victim.Info, firedBy))
return false;
if (!AffectsParent && victim == firedBy)
return false;
@@ -75,9 +68,6 @@ namespace OpenRA.Mods.Common.Warheads
/// <summary>Checks if the warhead is valid against (can do something to) the frozen actor.</summary>
public bool IsValidAgainst(FrozenActor victim, Actor firedBy)
{
if (!CanTargetActor(victim.Info, firedBy))
return false;
// AffectsParent checks do not make sense for FrozenActors, so skip to stance checks
var stance = firedBy.Owner.Stances[victim.Owner];
if (!ValidStances.HasStance(stance))