From 6c5d5b8a90cf93c256dfee4831e1644902ca22d7 Mon Sep 17 00:00:00 2001 From: xenohedron Date: Tue, 5 Dec 2023 23:42:25 -0500 Subject: [PATCH] fix The Everflowing Well, related cleanup --- .../src/mage/cards/t/TheEverflowingWell.java | 26 +++--- .../common/ControllerMainPhaseCondition.java | 28 ------ .../common/MillThenDrawControllerEffect.java | 87 ------------------- .../ActivatedOrTriggeredAbilityPredicate.java | 4 - 4 files changed, 12 insertions(+), 133 deletions(-) delete mode 100644 Mage/src/main/java/mage/abilities/condition/common/ControllerMainPhaseCondition.java delete mode 100644 Mage/src/main/java/mage/abilities/effects/common/MillThenDrawControllerEffect.java diff --git a/Mage.Sets/src/mage/cards/t/TheEverflowingWell.java b/Mage.Sets/src/mage/cards/t/TheEverflowingWell.java index d9799c9a36d..85c39780d6c 100644 --- a/Mage.Sets/src/mage/cards/t/TheEverflowingWell.java +++ b/Mage.Sets/src/mage/cards/t/TheEverflowingWell.java @@ -1,16 +1,12 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template - */ package mage.cards.t; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.common.DescendCondition; -import mage.abilities.decorator.ConditionalTriggeredAbility; -import mage.abilities.effects.common.MillThenDrawControllerEffect; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.MillCardsControllerEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; @@ -20,6 +16,8 @@ import mage.constants.CardType; import mage.constants.SuperType; import mage.constants.TargetController; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -33,16 +31,16 @@ public class TheEverflowingWell extends CardImpl { this.secondSideCardClazz = mage.cards.t.TheMyriadPools.class; this.color.setBlue(true); - // When the Everflowing Well enters the battlefield, mill two cards, then draw two cards - this.addAbility(new EntersBattlefieldTriggeredAbility( - new MillThenDrawControllerEffect(2, 2), false) - ); + // When the Everflowing Well enters the battlefield, mill two cards, then draw two cards. + Ability entersAbility = new EntersBattlefieldTriggeredAbility(new MillCardsControllerEffect(2)); + entersAbility.addEffect(new DrawCardSourceControllerEffect(2).concatBy(", then")); + this.addAbility(entersAbility); - // Descend 8 -- At the beginning of your upkeep, if there are eight of more permanent cards in your graveyard, transform The Everflowing Well. + // Descend 8 -- At the beginning of your upkeep, if there are eight or more permanent cards in your graveyard, transform The Everflowing Well. this.addAbility(new TransformAbility()); - Ability ability = new ConditionalTriggeredAbility(new BeginningOfUpkeepTriggeredAbility( + Ability ability = new ConditionalInterveningIfTriggeredAbility(new BeginningOfUpkeepTriggeredAbility( new TransformSourceEffect(), TargetController.YOU, false), - DescendCondition.EIGHT, "Descend 8 -- At the beginning of your upkeep, if there are eight of more permanent cards in your graveyard, transform {this}."); + DescendCondition.EIGHT, "At the beginning of your upkeep, if there are eight or more permanent cards in your graveyard, transform {this}."); ability.setAbilityWord(AbilityWord.DESCEND_8).addHint(DescendCondition.getHint()); this.addAbility(ability); } diff --git a/Mage/src/main/java/mage/abilities/condition/common/ControllerMainPhaseCondition.java b/Mage/src/main/java/mage/abilities/condition/common/ControllerMainPhaseCondition.java deleted file mode 100644 index 1ead6d9873b..00000000000 --- a/Mage/src/main/java/mage/abilities/condition/common/ControllerMainPhaseCondition.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template - */ -package mage.abilities.condition.common; - -import mage.abilities.Ability; -import mage.abilities.condition.Condition; -import mage.game.Game; - -/** - * - * @author jeffwadsworth - */ -public enum ControllerMainPhaseCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - return game.isActivePlayer(source.getControllerId()) - && game.isMainPhase(); - } - - @Override - public String toString() { - return "If this is your main phase,"; - } -} diff --git a/Mage/src/main/java/mage/abilities/effects/common/MillThenDrawControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/MillThenDrawControllerEffect.java deleted file mode 100644 index 1ee4e72d937..00000000000 --- a/Mage/src/main/java/mage/abilities/effects/common/MillThenDrawControllerEffect.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template - */ -package mage.abilities.effects.common; - -import mage.abilities.Ability; -import mage.abilities.Mode; -import mage.abilities.effects.OneShotEffect; -import mage.constants.Outcome; -import mage.game.Game; -import mage.players.Player; -import mage.util.CardUtil; - -/** - * - * @author jeffwadsworth - */ -public class MillThenDrawControllerEffect extends OneShotEffect { - - private final int cardsToMill; - private final int cardsToDraw; - private final boolean optional; - - public MillThenDrawControllerEffect() { - this(1, 1); - } - - public MillThenDrawControllerEffect(boolean optional) { - this(1, 1, optional); - } - - public MillThenDrawControllerEffect(int cardsToMill, int cardsToDraw) { - this(cardsToMill, cardsToDraw, false); - } - - public MillThenDrawControllerEffect(int cardsToMill, int cardsToDraw, boolean optional) { - super(Outcome.Benefit); - this.cardsToMill = cardsToMill; - this.cardsToDraw = cardsToDraw; - this.optional = optional; - } - - protected MillThenDrawControllerEffect(final MillThenDrawControllerEffect effect) { - super(effect); - this.cardsToMill = effect.cardsToMill; - this.cardsToDraw = effect.cardsToDraw; - this.optional = effect.optional; - } - - @Override - public MillThenDrawControllerEffect copy() { - return new MillThenDrawControllerEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller == null) { - return false; - } - if (optional && !controller.chooseUse(outcome, "Mill, then draw?", source, game)) { - return true; - } - controller.millCards(cardsToDraw, source, game); - controller.drawCards(cardsToMill, source, game); - return true; - } - - @Override - public String getText(Mode mode) { - if (staticText != null - && !staticText.isEmpty()) { - return staticText; - } - return (optional ? "you may " : "") + - "mill " + - (cardsToMill == 1 ? "a" : CardUtil.numberToText(cardsToMill)) + - " card" + - (cardsToMill == 1 ? "" : "s") + - (optional ? ". If you do," : ", then") + - " draw " + - (cardsToDraw == 1 ? "a" : CardUtil.numberToText(cardsToDraw)) + - " card" + - (cardsToDraw == 1 ? "" : "s"); - } -} diff --git a/Mage/src/main/java/mage/filter/predicate/other/ActivatedOrTriggeredAbilityPredicate.java b/Mage/src/main/java/mage/filter/predicate/other/ActivatedOrTriggeredAbilityPredicate.java index 4f11514415d..ef4a855fafa 100644 --- a/Mage/src/main/java/mage/filter/predicate/other/ActivatedOrTriggeredAbilityPredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/other/ActivatedOrTriggeredAbilityPredicate.java @@ -1,7 +1,3 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template - */ package mage.filter.predicate.other; import mage.abilities.Ability;