Skip to content

Commit

Permalink
Add Stance Support to GrantExternalConditionPower.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Jan 1, 2019
1 parent be310ab commit 25ca650
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -34,6 +34,9 @@ class GrantExternalConditionPowerInfo : SupportPowerInfo
[Desc("Sound to instantly play at the targeted area.")]
public readonly string OnFireSound = null;

[Desc("Player stances which condition can be applied to.")]
public readonly Stance ValidStances = Stance.Ally;

[SequenceReference, Desc("Sequence to play for granting actor when activated.",
"This requires the actor to have the WithSpriteBody trait or one of its derivatives.")]
public readonly string Sequence = "active";
Expand Down Expand Up @@ -90,7 +93,7 @@ public IEnumerable<Actor> UnitsInRange(CPos xy)

return units.Distinct().Where(a =>
{
if (!a.Owner.IsAlliedWith(Self.Owner))
if (!info.ValidStances.HasStance(a.Owner.Stances[Self.Owner]))
return false;
return a.TraitsImplementing<ExternalCondition>()
Expand Down

0 comments on commit 25ca650

Please sign in to comment.