forked from External/mage
* 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.
This commit is contained in:
parent
69dc4f10ac
commit
de639cc1d6
3 changed files with 10 additions and 8 deletions
|
|
@ -383,7 +383,7 @@ public class HumanPlayer extends PlayerImpl {
|
|||
}
|
||||
while (!abort) {
|
||||
Set<UUID> 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue