fix The Everflowing Well, related cleanup

This commit is contained in:
xenohedron 2023-12-05 23:42:25 -05:00
parent 62f58df8a0
commit 6c5d5b8a90
4 changed files with 12 additions and 133 deletions

View file

@ -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);
}

View file

@ -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,";
}
}

View file

@ -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");
}
}

View file

@ -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;