From ff9b1b5b130ee88fee083b97f92bf635211ff53b Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Tue, 31 Dec 2019 10:03:34 -0600 Subject: [PATCH] - Fixed #5315 --- .../src/mage/cards/c/CarpetOfFlowers.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java b/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java index bcb4bc99bc8..cc0513321cf 100644 --- a/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java +++ b/Mage.Sets/src/mage/cards/c/CarpetOfFlowers.java @@ -30,7 +30,9 @@ public final class CarpetOfFlowers extends CardImpl { public CarpetOfFlowers(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}"); - // At the beginning of each of your main phases, if you haven't added mana with this ability this turn, you may add up to X mana of any one color, where X is the number of Islands target opponent controls. + // At the beginning of each of your main phases, if you haven't added mana + // with this ability this turn, you may add up to X mana of any one color, + // where X is the number of Islands target opponent controls. this.addAbility(new CarpetOfFlowersTriggeredAbility()); } @@ -73,26 +75,36 @@ class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkInterveningIfClause(Game game) { - return !Boolean.TRUE.equals(game.getState().getValue(this.originalId.toString() + "addMana")); + return !Boolean.TRUE.equals(game.getState().getValue(this.originalId.toString() + + "addMana" + + game.getState().getZoneChangeCounter(sourceId))); } @Override public boolean resolve(Game game) { boolean value = super.resolve(game); if (value == true) { - game.getState().setValue(this.originalId.toString() + "addMana", Boolean.TRUE); + game.getState().setValue(this.originalId.toString() + + "addMana" + + game.getState().getZoneChangeCounter(sourceId), + Boolean.TRUE); } return value; } @Override public void reset(Game game) { - game.getState().setValue(this.originalId.toString() + "addMana", Boolean.FALSE); + game.getState().setValue(this.originalId.toString() + + "addMana" + + game.getState().getZoneChangeCounter(sourceId), + Boolean.FALSE); } @Override public String getRule() { - return "At the beginning of each of your main phases, if you haven't added mana with this ability this turn, " + super.getRule(); + return "At the beginning of each of your main phases, if " + + "you haven't added mana with this ability this turn, " + + super.getRule(); } }