From de639cc1d60b336f2a65d32f2180d71fc3f2d996 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 11 Sep 2015 23:06:26 +0200 Subject: [PATCH] * Suspend, added the card name to the rule text of the ability triggering, so different suspended cards were not auto put on the stack by the activated same rule text option. --- .../src/mage/player/human/HumanPlayer.java | 12 +++++++----- Mage/src/mage/abilities/AbilityImpl.java | 2 +- Mage/src/mage/abilities/keyword/SuspendAbility.java | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 73fba0f4eae..882a68cfc34 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -383,7 +383,7 @@ public class HumanPlayer extends PlayerImpl { } while (!abort) { Set possibleTargets = target.possibleTargets(source == null ? null : source.getSourceId(), abilityControllerId, game); - boolean required = target.isRequired(source); + boolean required = target.isRequired(source != null ? source.getSourceId() : null, game); if (possibleTargets.isEmpty() || target.getTargets().size() >= target.getNumberOfTargets()) { required = false; } @@ -715,21 +715,23 @@ public class HumanPlayer extends PlayerImpl { if (triggerAutoOrderAbilityFirst.contains(ability.getOriginalId())) { return ability; } - if (triggerAutoOrderNameFirst.contains(ability.getRule())) { + MageObject object = game.getObject(ability.getSourceId()); + String rule = ability.getRule(object != null ? object.getName() : null); + if (triggerAutoOrderNameFirst.contains(rule)) { return ability; } if (triggerAutoOrderAbilityLast.contains(ability.getOriginalId())) { abilityOrderLast = ability; continue; } - if (triggerAutoOrderNameLast.contains(ability.getRule())) { + if (triggerAutoOrderNameLast.contains(rule)) { abilityOrderLast = ability; continue; } if (autoOrderUse) { if (autoOrderRuleText == null) { - autoOrderRuleText = ability.getRule(); - } else if (!ability.getRule().equals(autoOrderRuleText)) { + autoOrderRuleText = rule; + } else if (!rule.equals(autoOrderRuleText)) { autoOrderUse = false; } } diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java index 7006eeebdc2..838204cfa09 100644 --- a/Mage/src/mage/abilities/AbilityImpl.java +++ b/Mage/src/mage/abilities/AbilityImpl.java @@ -335,7 +335,7 @@ public abstract class AbilityImpl implements Ability { if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already in playerImpl.triggerAbility sourceObject.adjustTargets(this, game); } - if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) { + if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, noMana, game) == false) { if ((variableManaCost != null || announceString != null) && !game.isSimulation()) { game.informPlayer(controller, (sourceObject != null ? sourceObject.getIdName() : "") + ": no valid targets with this value of X"); } diff --git a/Mage/src/mage/abilities/keyword/SuspendAbility.java b/Mage/src/mage/abilities/keyword/SuspendAbility.java index 320f11979c4..fbb97482b8f 100644 --- a/Mage/src/mage/abilities/keyword/SuspendAbility.java +++ b/Mage/src/mage/abilities/keyword/SuspendAbility.java @@ -328,7 +328,7 @@ class SuspendPlayCardAbility extends TriggeredAbilityImpl { @Override public String getRule() { - return "When the last time counter is removed from this card, if it's removed from the game, " + super.getRule(); + return "When the last time counter is removed from this card ({this}), if it's removed from the game, " + super.getRule(); } @Override @@ -436,7 +436,7 @@ class SuspendBeginningOfUpkeepTriggeredAbility extends ConditionalTriggeredAbili public SuspendBeginningOfUpkeepTriggeredAbility() { super(new BeginningOfUpkeepTriggeredAbility(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), TargetController.YOU, false), SuspendedCondition.getInstance(), - "At the beginning of your upkeep, if this card is suspended, remove a time counter from it."); + "At the beginning of your upkeep, if this card ({this}) is suspended, remove a time counter from it."); this.setRuleVisible(false); }