[LTR] Implement Elrond, Lord of Rivendell

This commit is contained in:
theelk801 2023-06-05 23:18:12 -04:00
parent 31c0c2b070
commit a998017ddd
3 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,49 @@
package mage.cards.e;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility;
import mage.abilities.effects.common.IfAbilityHasResolvedXTimesEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.abilities.effects.keyword.TheRingTemptsYouEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ElrondLordOfRivendell extends CardImpl {
public ElrondLordOfRivendell(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.NOBLE);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Whenever Elrond, Lord of Rivendell or another creature enters the battlefield under your control, scry 1. If this is the second time this ability has resolved this turn, the Ring tempts you.
Ability ability = new EntersBattlefieldThisOrAnotherTriggeredAbility(
new ScryEffect(1, false),
StaticFilters.FILTER_PERMANENT_CREATURE, false, true
);
ability.addEffect(new IfAbilityHasResolvedXTimesEffect(2, new TheRingTemptsYouEffect()));
this.addAbility(ability);
}
private ElrondLordOfRivendell(final ElrondLordOfRivendell card) {
super(card);
}
@Override
public ElrondLordOfRivendell copy() {
return new ElrondLordOfRivendell(this);
}
}

View file

@ -37,6 +37,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet {
cards.add(new SetCardInfo("Dunedain Blade", 6, Rarity.COMMON, mage.cards.d.DunedainBlade.class));
cards.add(new SetCardInfo("Easterling Vanguard", 83, Rarity.COMMON, mage.cards.e.EasterlingVanguard.class));
cards.add(new SetCardInfo("Eastfarthing Farmer", 8, Rarity.COMMON, mage.cards.e.EastfarthingFarmer.class));
cards.add(new SetCardInfo("Elrond, Lord of Rivendell", 49, Rarity.UNCOMMON, mage.cards.e.ElrondLordOfRivendell.class));
cards.add(new SetCardInfo("Fall of Gil-galad", 165, Rarity.RARE, mage.cards.f.FallOfGilGalad.class));
cards.add(new SetCardInfo("Fangorn, Tree Shepherd", 166, Rarity.RARE, mage.cards.f.FangornTreeShepherd.class));
cards.add(new SetCardInfo("Fiery Inscription", 126, Rarity.UNCOMMON, mage.cards.f.FieryInscription.class));

View file

@ -18,6 +18,10 @@ public class IfAbilityHasResolvedXTimesEffect extends OneShotEffect {
private final int resolutionNumber;
private final Effect effect;
public IfAbilityHasResolvedXTimesEffect(int resolutionNumber, Effect effect) {
this(effect.getOutcome(), resolutionNumber, effect);
}
public IfAbilityHasResolvedXTimesEffect(Outcome outcome, int resolutionNumber, Effect effect) {
super(outcome);
this.resolutionNumber = resolutionNumber;