mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
- Fixed #5315
This commit is contained in:
parent
2649435071
commit
ff9b1b5b13
1 changed files with 17 additions and 5 deletions
|
@ -30,7 +30,9 @@ public final class CarpetOfFlowers extends CardImpl {
|
||||||
public CarpetOfFlowers(UUID ownerId, CardSetInfo setInfo) {
|
public CarpetOfFlowers(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
|
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());
|
this.addAbility(new CarpetOfFlowersTriggeredAbility());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,26 +75,36 @@ class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkInterveningIfClause(Game game) {
|
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
|
@Override
|
||||||
public boolean resolve(Game game) {
|
public boolean resolve(Game game) {
|
||||||
boolean value = super.resolve(game);
|
boolean value = super.resolve(game);
|
||||||
if (value == true) {
|
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;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset(Game game) {
|
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
|
@Override
|
||||||
public String getRule() {
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue