mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Path of Ancestry - fixed duplicated triggers on unused mana (#7191);
This commit is contained in:
parent
aeb2d31d47
commit
fef30de3f0
1 changed files with 17 additions and 1 deletions
|
@ -30,7 +30,7 @@ public final class PathOfAncestry extends CardImpl {
|
|||
// Path of Ancestry enters the battlefield tapped.
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
||||
// T: Add one mana of any color in your commander's color identity. When that mana is spent to cast a creature spell that shares a creature type with your commander, scry 1.
|
||||
// {T}: Add one mana of any color in your commander's color identity. When that mana is spent to cast a creature spell that shares a creature type with your commander, scry 1.
|
||||
Ability ability = new CommanderColorIdentityManaAbility();
|
||||
ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new PathOfAncestryTriggeredAbility()));
|
||||
this.addAbility(ability);
|
||||
|
@ -105,6 +105,22 @@ class PathOfAncestryTriggeredAbility extends DelayedTriggeredAbility {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInactive(Game game) {
|
||||
if (super.isInactive(game)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// must remove effect on empty mana pool to fix accumulate bug
|
||||
Player player = game.getPlayer(this.getControllerId());
|
||||
if (player == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// if no mana in pool then it can be discarded
|
||||
return player.getManaPool().getManaItems().stream().noneMatch(m -> m.getSourceId().equals(getSourceId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When that mana is spent to cast a creature spell that shares a creature type with your commander, scry 1.";
|
||||
|
|
Loading…
Reference in a new issue