diff --git a/Mage.Common/src/mage/view/CardsView.java b/Mage.Common/src/mage/view/CardsView.java index e9b772161b2..ff83aa18eef 100644 --- a/Mage.Common/src/mage/view/CardsView.java +++ b/Mage.Common/src/mage/view/CardsView.java @@ -112,7 +112,7 @@ public class CardsView extends LinkedHashMap { } } if (!names.isEmpty()) { - abilityView.getRules().add("Targets: " + names.toString() + ""); + abilityView.getRules().add("Related to: " + names.toString() + ""); } } } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java index 33097f406ab..d7c6652c72d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java @@ -31,14 +31,21 @@ import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.costs.common.ExileSourceFromGraveCost; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ExileSourceEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; +import mage.constants.Outcome; +import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; /** @@ -63,7 +70,7 @@ public class InameLifeAspect extends CardImpl { this.toughness = new MageInt(4); // When Iname, Life Aspect dies, you may exile it. If you do, return any number of target Spirit cards from your graveyard to your hand. - Ability ability = new DiesTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new ExileSourceFromGraveCost(), "Exile to return Spirit cards?"), false); + Ability ability = new DiesTriggeredAbility(new InameLifeAspectEffect(), false); ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, filter)); this.addAbility(ability); } @@ -77,3 +84,34 @@ public class InameLifeAspect extends CardImpl { return new InameLifeAspect(this); } } + +class InameLifeAspectEffect extends OneShotEffect { + + public InameLifeAspectEffect() { + super(Outcome.Benefit); + this.staticText = "you may exile it. If you do, return any number of target Spirit cards from your graveyard to your hand"; + } + + public InameLifeAspectEffect(final InameLifeAspectEffect effect) { + super(effect); + } + + @Override + public InameLifeAspectEffect copy() { + return new InameLifeAspectEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit cards?", game)) { + new ExileSourceEffect(Zone.GRAVEYARD).apply(game, source); + return new ReturnToHandTargetEffect().apply(game, source); + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/magic2014/OgreBattledriver.java b/Mage.Sets/src/mage/sets/magic2014/OgreBattledriver.java index e3a82275869..674a35e7f80 100644 --- a/Mage.Sets/src/mage/sets/magic2014/OgreBattledriver.java +++ b/Mage.Sets/src/mage/sets/magic2014/OgreBattledriver.java @@ -58,7 +58,7 @@ public class OgreBattledriver extends CardImpl { filter.add(new AnotherPredicate()); } - private String rule = "Whenever another creature enters the battlefield under your control, that creature gets +2/+0 and gains haste until end of turn."; + private final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +2/+0 and gains haste until end of turn."; public OgreBattledriver(UUID ownerId) { super(ownerId, 148, "Ogre Battledriver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); diff --git a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java index 8c097f1eb0a..23fb2a8ac83 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/KnightOfTheWhiteOrchid.java @@ -35,7 +35,6 @@ import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.OpponentControllsMoreCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java b/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java index 01c3fecd2e8..232f7be4a9c 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/AcademyRector.java @@ -29,12 +29,13 @@ package mage.sets.urzasdestiny; import java.util.UUID; import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; -import mage.abilities.costs.common.ExileSourceCost; import mage.abilities.costs.common.ExileSourceFromGraveCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ExileSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -88,7 +89,7 @@ class AcademyRectorEffect extends OneShotEffect { public AcademyRectorEffect() { super(Outcome.Benefit); - staticText = "search your library for an enchantment card and put it onto the battlefield. Then shuffle your library"; + staticText = "you may exile it. If you do, search your library for an enchantment card and put it onto the battlefield. Then shuffle your library"; } public AcademyRectorEffect(final AcademyRectorEffect effect) { @@ -98,15 +99,19 @@ class AcademyRectorEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - TargetCardInLibrary target = new TargetCardInLibrary(filter); - target.setNotTarget(true); - controller.searchLibrary(target, game); - Card targetCard = game.getCard(target.getFirstTarget()); - if (targetCard != null) { - controller.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId()); + MageObject sourceObject = game.getObject(source.getSourceId()); + if (controller != null && sourceObject != null) { + if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit card?", game)) { + new ExileSourceEffect(Zone.GRAVEYARD).apply(game, source); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + target.setNotTarget(true); + controller.searchLibrary(target, game); + Card targetCard = game.getCard(target.getFirstTarget()); + if (targetCard != null) { + controller.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId()); + } + controller.shuffleLibrary(game); } - controller.shuffleLibrary(game); return true; } return false; diff --git a/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java b/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java index 42345c1f5b3..27811130bdc 100644 --- a/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java +++ b/Mage/src/mage/abilities/condition/common/CastFromHandCondition.java @@ -23,4 +23,11 @@ public class CastFromHandCondition implements Condition { } return false; } + + @Override + public String toString() { + return "you cast it from your hand"; + } + + } diff --git a/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java b/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java index 5e250f06c67..3345455f5e0 100644 --- a/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java +++ b/Mage/src/mage/abilities/decorator/ConditionalOneShotEffect.java @@ -93,7 +93,7 @@ public class ConditionalOneShotEffect extends OneShotEffect { return staticText; } if (otherwiseEffect == null) { - return "If " + condition.toString() + ", " + effect.getText(mode); + return "if " + condition.toString() + ", " + effect.getText(mode); } return effect.getText(mode) + ". If " + condition.toString() + ", " + otherwiseEffect.getText(mode); } diff --git a/Mage/src/mage/abilities/keyword/BushidoAbility.java b/Mage/src/mage/abilities/keyword/BushidoAbility.java index 6ca43bec550..efb692849c6 100644 --- a/Mage/src/mage/abilities/keyword/BushidoAbility.java +++ b/Mage/src/mage/abilities/keyword/BushidoAbility.java @@ -43,18 +43,21 @@ public class BushidoAbility extends BlocksOrBecomesBlockedTriggeredAbility { public BushidoAbility(int value) { this(new StaticValue(value)); - rule = new StringBuilder("Bushido ").append(value).toString(); + rule = "Bushido " + value + getReminder(Integer.toString(value)); } public BushidoAbility(DynamicValue value) { super(new BoostSourceEffect(value, value, Duration.EndOfTurn, true), false); - if (rule == null) { - rule = new StringBuilder("{this} has bushido X, where X is ").append(value.getMessage()).toString(); + if (!(value instanceof StaticValue)) { + rule = "{this} has bushido X, where X is " + value.getMessage() + getReminder(value.toString()); } - rule = new StringBuilder(rule).append(" (When this blocks or becomes blocked, it gets +").append(value.toString()).append("/+").append(value.toString()).append(" until end of turn.)").toString(); this.value = value; } + static String getReminder(String xValue) { + return " (When this blocks or becomes blocked, it gets +" + xValue+ "/+" + xValue + " until end of turn.)"; + } + public BushidoAbility(final BushidoAbility ability) { super(ability); this.value = ability.value; diff --git a/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java b/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java index 9b68a2649c4..92d7ee0474c 100644 --- a/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java +++ b/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java @@ -201,7 +201,11 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl { // check if spell can be activated (protection problem not solved because effect will be used from the base spell?) Card card = game.getCard(source.getSourceId()); if (card != null) { - return card.getSpellAbility().canActivate(source.getControllerId(), game); + if (card.getManaCost().isEmpty()) { // e.g. Evermind + return card.getSpellAbility().spellCanBeActivatedRegularlyNow(source.getControllerId(), game); + } else { + return card.getSpellAbility().canActivate(source.getControllerId(), game); + } } return false; }