[LTR] Implement Council's Deliberation

This commit is contained in:
theelk801 2023-05-31 08:38:03 -04:00
parent 20e5d97b00
commit 8570cd88d9
2 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.c;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.common.ExileSourceFromGraveCost;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CouncilsDeliberation extends CardImpl {
public CouncilsDeliberation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
// Whenever you scry, if you control an Island, you may exile Council's Deliberation from your graveyard. If you do, draw a card.
this.addAbility(new CouncilsDeliberationTriggeredAbility());
}
private CouncilsDeliberation(final CouncilsDeliberation card) {
super(card);
}
@Override
public CouncilsDeliberation copy() {
return new CouncilsDeliberation(this);
}
}
class CouncilsDeliberationTriggeredAbility extends TriggeredAbilityImpl {
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.ISLAND);
CouncilsDeliberationTriggeredAbility() {
super(Zone.GRAVEYARD, new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ExileSourceFromGraveCost()));
}
private CouncilsDeliberationTriggeredAbility(final CouncilsDeliberationTriggeredAbility ability) {
super(ability);
}
@Override
public CouncilsDeliberationTriggeredAbility copy() {
return new CouncilsDeliberationTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SCRIED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return isControlledBy(event.getPlayerId());
}
@Override
public boolean checkInterveningIfClause(Game game) {
return game.getBattlefield().contains(filter, this, game, 1);
}
@Override
public String getRule() {
return "Whenever you scry, if you control an Island, you may exile {this} from your graveyard. If you do, draw a card.";
}
}

View file

@ -24,6 +24,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet {
cards.add(new SetCardInfo("Bilbo, Retired Burglar", 196, Rarity.UNCOMMON, mage.cards.b.BilboRetiredBurglar.class));
cards.add(new SetCardInfo("Call of the Ring", 79, Rarity.RARE, mage.cards.c.CallOfTheRing.class));
cards.add(new SetCardInfo("Cast into the Fire", 118, Rarity.COMMON, mage.cards.c.CastIntoTheFire.class));
cards.add(new SetCardInfo("Council's Deliberation", 48, Rarity.UNCOMMON, mage.cards.c.CouncilsDeliberation.class));
cards.add(new SetCardInfo("Dunedain Blade", 6, Rarity.COMMON, mage.cards.d.DunedainBlade.class));
cards.add(new SetCardInfo("Dunland Crebain", 82, Rarity.COMMON, mage.cards.d.DunlandCrebain.class));
cards.add(new SetCardInfo("Forest", 270, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));