[TDM] Implement Warden of the Grove

This commit is contained in:
theelk801 2025-04-08 08:44:31 -04:00
parent 0df5f17603
commit 235e5200d0
3 changed files with 103 additions and 4 deletions

View file

@ -39,12 +39,19 @@ public class EndureSourceEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return doEndure(source.getSourcePermanentOrLKI(game), 1, game, source);
}
public static boolean doEndure(Permanent permanent, int amount, Game game, Ability source) {
if (permanent == null || amount < 1) {
return false;
}
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent != null && player.chooseUse(
Player controller = game.getPlayer(permanent.getControllerId());
if (controller == null) {
return false;
}
if (permanent.getZoneChangeCounter(game) == game.getState().getZoneChangeCounter(permanent.getId())
&& controller.chooseUse(
Outcome.BoostCreature, "Put " + CardUtil.numberToText(amount, "a") + " +1/+1 counter" +
(amount > 1 ? "s" : "") + " on " + permanent.getName() + " or create " +
CardUtil.addArticle("" + amount) + ' ' + amount + '/' + amount + " Spirit token?",