First step in the attack mechanism's refactor.
Enabled firing multiple armaments at a target simultaneously. Each armament defines own cursor for targeting. The force attack modifier influences armament choice for target. Autotargeting modified to handle firing multiple armaments simultaneously. As a consequence, healers (medics) no longer require separate Heal activity and AttackMedic and AutoHeal traits.
This commit is contained in:
@@ -27,6 +27,14 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
[Desc("Damage percentage versus each armortype.")]
|
||||
public readonly Dictionary<string, int> Versus;
|
||||
|
||||
public override bool IsValidAgainst(Actor victim, Actor firedBy)
|
||||
{
|
||||
if (Damage < 0 && victim.GetDamageState() == DamageState.Undamaged)
|
||||
return false;
|
||||
|
||||
return base.IsValidAgainst(victim, firedBy);
|
||||
}
|
||||
|
||||
public static object LoadVersus(MiniYaml yaml)
|
||||
{
|
||||
var nd = yaml.ToDictionary();
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
public abstract void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers);
|
||||
|
||||
/// <summary>Checks if the warhead is valid against (can do something to) the actor.</summary>
|
||||
public bool IsValidAgainst(Actor victim, Actor firedBy)
|
||||
public virtual bool IsValidAgainst(Actor victim, Actor firedBy)
|
||||
{
|
||||
if (!AffectsParent && victim == firedBy)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user