Make HitShape mandatory for damaging actors and refactor warheads.

* Adds support for linking Armor traits to HitShapes.
* Adds spread support to TargetDamageWarhead
* Removes ring-damage support from HealthPercentageDamage
* Removes IsValidAgainst check from DoImpact(Actor victim...) overload
  and instead lets warheads perform the check beforehand
  (to avoid HitShape look-ups on invalid targets).
* Reduces duplication and improves readability of Warhead implementations
This commit is contained in:
reaperrr
2018-10-25 21:15:34 +00:00
committed by reaperrr
parent e2050dfdc9
commit f18ce8cfda
8 changed files with 123 additions and 89 deletions

View File

@@ -12,6 +12,7 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.HitShapes;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
@@ -25,6 +26,10 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Create a targetable position at the center of each occupied cell. Stacks with TargetableOffsets.")]
public readonly bool UseTargetableCellsOffsets = false;
[Desc("Defines which Armor types apply when the actor receives damage to this HitShape.",
"If none specified, all armor types the actor has are valid.")]
public readonly BitSet<ArmorType> ArmorTypes = default(BitSet<ArmorType>);
[FieldLoader.LoadUsing("LoadShape")]
public readonly IHitShape Type;