diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DruidsRepository.java b/Mage.Sets/src/mage/sets/avacynrestored/DruidsRepository.java index e2ced472f5..f95645052e 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DruidsRepository.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DruidsRepository.java @@ -58,8 +58,7 @@ public class DruidsRepository extends CardImpl { this.addAbility(new AttacksCreatureYourControlTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()))); // Remove a charge counter from Druids' Repository: Add one mana of any color to your mana pool. - Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); - ability.addChoice(new ChoiceColor()); + Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/bornofthegods/TokenAndCounters/GoldToken.java b/Mage.Sets/src/mage/sets/bornofthegods/TokenAndCounters/GoldToken.java index 1880d4dd85..353b51e49a 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/TokenAndCounters/GoldToken.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/TokenAndCounters/GoldToken.java @@ -48,8 +48,6 @@ public class GoldToken extends Token { this.setOriginalExpansionSetCode("BNG"); cardType.add(CardType.ARTIFACT); - Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new SacrificeSourceCost()); - ability.addChoice(new ChoiceColor()); - this.addAbility(ability); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new SacrificeSourceCost())); } } diff --git a/Mage.Sets/src/mage/sets/invasion/QuirionSentinel.java b/Mage.Sets/src/mage/sets/invasion/QuirionSentinel.java index 5171f0faa6..cd3286a8e9 100644 --- a/Mage.Sets/src/mage/sets/invasion/QuirionSentinel.java +++ b/Mage.Sets/src/mage/sets/invasion/QuirionSentinel.java @@ -55,9 +55,7 @@ public class QuirionSentinel extends CardImpl { this.toughness = new MageInt(1); // When Quirion Sentinel enters the battlefield, add one mana of any color to your mana pool. - Ability ability = new EntersBattlefieldTriggeredAbility(new AddManaOfAnyColorEffect()); - ability.addChoice(new ChoiceColor()); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldTriggeredAbility(new AddManaOfAnyColorEffect())); } public QuirionSentinel(final QuirionSentinel card) { diff --git a/Mage.Sets/src/mage/sets/limitedalpha/BlackLotus.java b/Mage.Sets/src/mage/sets/limitedalpha/BlackLotus.java index fe523ba26b..f62c6954d6 100644 --- a/Mage.Sets/src/mage/sets/limitedalpha/BlackLotus.java +++ b/Mage.Sets/src/mage/sets/limitedalpha/BlackLotus.java @@ -52,7 +52,6 @@ public class BlackLotus extends CardImpl { // {tap}, Sacrifice Black Lotus: Add three mana of any one color to your mana pool. Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); - ability.addChoice(new ChoiceColor()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/magic2013/GildedLotus.java b/Mage.Sets/src/mage/sets/magic2013/GildedLotus.java index 0d64dd81c2..39c151979e 100644 --- a/Mage.Sets/src/mage/sets/magic2013/GildedLotus.java +++ b/Mage.Sets/src/mage/sets/magic2013/GildedLotus.java @@ -51,7 +51,6 @@ public class GildedLotus extends CardImpl { // {tap}: Add three mana of any one color to your mana pool. Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new TapSourceCost()); - ability.addChoice(new ChoiceColor()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/mirage/LionsEyeDiamond.java b/Mage.Sets/src/mage/sets/mirage/LionsEyeDiamond.java index 373391f266..aff77dcd3a 100644 --- a/Mage.Sets/src/mage/sets/mirage/LionsEyeDiamond.java +++ b/Mage.Sets/src/mage/sets/mirage/LionsEyeDiamond.java @@ -72,8 +72,6 @@ class LionsEyeDiamondAbility extends ManaAbility { public LionsEyeDiamondAbility() { super(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new SacrificeSourceCost()); this.addCost(new DiscardHandCost()); - this.addChoice(new ChoiceColor()); - this.timing = TimingRule.INSTANT; } public LionsEyeDiamondAbility(Zone zone, Mana mana, Cost cost) { diff --git a/Mage.Sets/src/mage/sets/returntoravnica/DeathriteShaman.java b/Mage.Sets/src/mage/sets/returntoravnica/DeathriteShaman.java index c10e52a80e..1fed063669 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/DeathriteShaman.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/DeathriteShaman.java @@ -77,7 +77,6 @@ public class DeathriteShaman extends CardImpl { // {T}: Exile target land card from a graveyard. Add one mana of any color to your mana pool. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new TapSourceCost()); ability.addEffect(new AddManaOfAnyColorEffect()); - ability.addChoice(new ChoiceColor()); ability.addTarget(new TargetCardInGraveyard(new FilterLandCard("land card from a graveyard"))); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java index 79c81101ab..f3d469681b 100644 --- a/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java +++ b/Mage.Sets/src/mage/sets/returntoravnica/ManaBloom.java @@ -73,7 +73,6 @@ public class ManaBloom extends CardImpl { // Remove a charge counter from Mana Bloom: Add one mana of any color to your mana pool. Activate this ability only once each turn. Ability ability = new ActivateOncePerTurnManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance())); - ability.addChoice(new ChoiceColor()); this.addAbility(ability); // At the beginning of your upkeep, if Mana Bloom has no charge counters on it, return it to its owner's hand. diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java index 209119d28e..15a55f0936 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MulDayaChannelers.java @@ -79,7 +79,6 @@ public class MulDayaChannelers extends CardImpl { // As long as the top card of your library is a land card, Mul Daya Channelers has "T: Add two mana of any one color to your mana pool." SimpleManaAbility manaAbility = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(2), new TapSourceCost()); - manaAbility.addChoice(new ChoiceColor()); effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(manaAbility, Duration.WhileOnBattlefield), new TopLibraryCardTypeCondition(TopLibraryCardTypeCondition.CheckType.LAND), "As long as the top card of your library is a land card, Mul Daya Channelers has \"{T}: Add two mana of any one color to your mana pool.\""); diff --git a/Mage.Sets/src/mage/sets/tempest/ReflectingPool.java b/Mage.Sets/src/mage/sets/tempest/ReflectingPool.java index 1ddaf8df4a..21aaddd2a1 100644 --- a/Mage.Sets/src/mage/sets/tempest/ReflectingPool.java +++ b/Mage.Sets/src/mage/sets/tempest/ReflectingPool.java @@ -96,7 +96,7 @@ class ReflectingPoolEffect extends ManaEffect { types.add(ability.getNetMana(game)); } } - Choice choice = new ChoiceImpl(true); + Choice choice = new ChoiceImpl(false); choice.setMessage("Pick a mana color"); if (types.getBlack() > 0) { choice.getChoices().add("Black"); diff --git a/Mage.Sets/src/mage/sets/timespiral/LotusBloom.java b/Mage.Sets/src/mage/sets/timespiral/LotusBloom.java index 0628edf43c..029748fa75 100644 --- a/Mage.Sets/src/mage/sets/timespiral/LotusBloom.java +++ b/Mage.Sets/src/mage/sets/timespiral/LotusBloom.java @@ -58,7 +58,6 @@ public class LotusBloom extends CardImpl { // {tap}, Sacrifice Lotus Bloom: Add three mana of any one color to your mana pool. Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(3), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); - ability.addChoice(new ChoiceColor()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java b/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java index a7f9f31941..b67749c1fc 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java +++ b/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java @@ -83,7 +83,6 @@ class FertileGroundTriggeredAbility extends TriggeredManaAbility { public FertileGroundTriggeredAbility() { super(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect()); - this.addChoice(new ChoiceColor()); } public FertileGroundTriggeredAbility(FertileGroundTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java index f1811437c5..b65a6b9288 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java +++ b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java @@ -67,7 +67,6 @@ public class KhalniGem extends CardImpl { this.addAbility(etbAbility); // {tap}: Add two mana of any one color to your mana pool. SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(2), new TapSourceCost()); - ability.addChoice(new ChoiceColor()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java b/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java index 0dbc6625a9..9b042b1019 100644 --- a/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java +++ b/Mage.Sets/src/mage/sets/zendikar/LotusCobra.java @@ -52,9 +52,7 @@ public class LotusCobra extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - LandfallAbility ability = new LandfallAbility(new AddManaOfAnyColorEffect(), false); - ability.addChoice(new ChoiceColor()); - this.addAbility(ability); + this.addAbility(new LandfallAbility(new AddManaOfAnyColorEffect(), false)); } public LotusCobra(final LotusCobra card) { diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index e873c2c6a3..7aa36238d8 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -155,14 +155,16 @@ public abstract class AbilityImpl implements Ability { boolean effectResult = effect.apply(game, this); result &= effectResult; if (logger.isDebugEnabled()) { - if (!effectResult) { - if (this.getSourceId() != null) { - MageObject mageObject = game.getObject(this.getSourceId()); - if (mageObject != null) { - logger.debug("AbilityImpl.resolve: object: " + mageObject.getName()); + if (!this.getAbilityType().equals(AbilityType.MANA)) { + if (!effectResult) { + if (this.getSourceId() != null) { + MageObject mageObject = game.getObject(this.getSourceId()); + if (mageObject != null) { + logger.debug("AbilityImpl.resolve: object: " + mageObject.getName()); + } } + logger.debug("AbilityImpl.resolve: effect returned false -" + effect.getText(this.getModes().getMode())); } - logger.debug("AbilityImpl.resolve: effect returned false -" + effect.getText(this.getModes().getMode())); } } } diff --git a/Mage/src/mage/abilities/mana/AnyColorManaAbility.java b/Mage/src/mage/abilities/mana/AnyColorManaAbility.java index c8d9d1ed4e..0873324f1c 100644 --- a/Mage/src/mage/abilities/mana/AnyColorManaAbility.java +++ b/Mage/src/mage/abilities/mana/AnyColorManaAbility.java @@ -30,7 +30,6 @@ package mage.abilities.mana; import mage.abilities.costs.Cost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.AddManaOfAnyColorEffect; -import mage.choices.ChoiceColor; import mage.constants.Zone; public class AnyColorManaAbility extends ManaAbility { @@ -40,7 +39,6 @@ public class AnyColorManaAbility extends ManaAbility { public AnyColorManaAbility(Cost cost) { super(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), cost); - this.addChoice(new ChoiceColor()); this.netMana.setAny(1); } diff --git a/Mage/src/mage/choices/ChoiceColor.java b/Mage/src/mage/choices/ChoiceColor.java index 71ffdcc30d..3c686156a4 100644 --- a/Mage/src/mage/choices/ChoiceColor.java +++ b/Mage/src/mage/choices/ChoiceColor.java @@ -37,7 +37,11 @@ import mage.ObjectColor; public class ChoiceColor extends ChoiceImpl { public ChoiceColor() { - super(true); + this(true); + } + + public ChoiceColor(boolean required) { + super(required); this.choices.add("Black"); this.choices.add("Blue"); this.choices.add("Green"); diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 14d96b4f86..241595f7f2 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -853,13 +853,12 @@ public abstract class PlayerImpl implements Player, Serializable { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY, ability.getId(), ability.getSourceId(), playerId))) { int bookmark = game.bookmarkState(); if (ability.activate(game, false)) { - ability.resolve(game); - // #169 - if (storedBookmark == -1 || storedBookmark > bookmark) { // e.g. userfull for undo Nykthos, Shrine to Nyx - setStoredBookmark(bookmark); + if (ability.resolve(game)) { + if (storedBookmark == -1 || storedBookmark > bookmark) { // e.g. usefull for undo Nykthos, Shrine to Nyx + setStoredBookmark(bookmark); + } + return true; } - //game.removeBookmark(bookmark); - return true; } game.restoreState(bookmark); }