Change WeaponInfo.EffectivenessAgainst to take ActorInfo.

This commit is contained in:
Paul Chote
2013-08-08 19:57:21 +12:00
parent ff98fb0cdf
commit fa517b8787
2 changed files with 11 additions and 8 deletions

View File

@@ -118,7 +118,7 @@ namespace OpenRA.Mods.RA
foreach (var t in world.FindTilesInCircle(targetTile, warhead.Size[0]))
foreach (var unit in world.FindActorsInBox(t, t))
unit.InflictDamage(firedBy,
(int)(warhead.Damage * warhead.EffectivenessAgainst(unit)), warhead);
(int)(warhead.Damage * warhead.EffectivenessAgainst(unit.Info)), warhead);
} break;
}
}
@@ -173,7 +173,7 @@ namespace OpenRA.Mods.RA
var distance = (int)Math.Max(0, (target.CenterPosition - pos).Length * Game.CellSize / 1024 - health.Radius);
var falloff = (float)GetDamageFalloff(distance / warhead.Spread);
var rawDamage = (float)(warhead.Damage * modifier * falloff);
var multiplier = (float)warhead.EffectivenessAgainst(target);
var multiplier = (float)warhead.EffectivenessAgainst(target.Info);
return (float)(rawDamage * multiplier);
}