From b208dc332f2cddb7ca49d41e1e52f05c3d7932be Mon Sep 17 00:00:00 2001 From: Sarah Souders Date: Wed, 4 Dec 2019 21:59:03 -0500 Subject: [PATCH] Fixed Rankle's triggered ability (#6064) * Fixed Rankle's triggered ability Any number of available modes can now be selected, including zero. * Update AbilityImpl.java * getTargets now returns empty Target for null Mode Reverted null Target check changes in StackAbility. * Update HumanPlayer.java --- .../Mage.Player.Human/src/mage/player/human/HumanPlayer.java | 4 ++++ Mage.Sets/src/mage/cards/r/RankleMasterOfPranks.java | 2 +- Mage/src/main/java/mage/abilities/AbilityImpl.java | 2 +- 3 files changed, 6 insertions(+), 2 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 25e018a02e..415573b89f 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 @@ -1856,6 +1856,10 @@ public class HumanPlayer extends PlayerImpl { } } } + else if (modes.getSelectedModes().size() >= modes.getMinModes()) { + /* let the player cancel mode selection if they do not need to select any further modes */ + done = true; + } if (source.getAbilityType() != AbilityType.TRIGGERED) { done = true; } diff --git a/Mage.Sets/src/mage/cards/r/RankleMasterOfPranks.java b/Mage.Sets/src/mage/cards/r/RankleMasterOfPranks.java index 9686f52d2c..a823b84f7c 100644 --- a/Mage.Sets/src/mage/cards/r/RankleMasterOfPranks.java +++ b/Mage.Sets/src/mage/cards/r/RankleMasterOfPranks.java @@ -51,7 +51,7 @@ public final class RankleMasterOfPranks extends CardImpl { // • Each player sacrifices a creature. ability.addMode(new Mode(new SacrificeAllEffect(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); - ability.getModes().setMinModes(1); + ability.getModes().setMinModes(0); ability.getModes().setMaxModes(3); ability.getModes().setChooseText("choose any number —"); this.addAbility(ability); diff --git a/Mage/src/main/java/mage/abilities/AbilityImpl.java b/Mage/src/main/java/mage/abilities/AbilityImpl.java index 5ae344cb49..d5e096a39e 100644 --- a/Mage/src/main/java/mage/abilities/AbilityImpl.java +++ b/Mage/src/main/java/mage/abilities/AbilityImpl.java @@ -889,7 +889,7 @@ public abstract class AbilityImpl implements Ability { if (getModes().getMode() != null) { return getModes().getMode().getTargets(); } - return null; + return new Targets(); } @Override