1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-02 03:18:09 -09:00

[LTR] Implement Dunedain Rangers

This commit is contained in:
theelk801 2023-06-08 20:46:20 -04:00
parent 145440ccb1
commit 972d8fb324
3 changed files with 78 additions and 0 deletions
Mage.Sets/src/mage
Mage/src/main/java/mage/filter/predicate/permanent

View file

@ -0,0 +1,60 @@
package mage.cards.d;
import mage.MageInt;
import mage.abilities.common.LandfallAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.keyword.TheRingTemptsYouEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.permanent.RingBearerPredicate;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DunedainRangers extends CardImpl {
private static final FilterPermanent filter = new FilterControlledPermanent();
static {
filter.add(RingBearerPredicate.instance);
}
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
filter, ComparisonType.EQUAL_TO, 0
);
public DunedainRangers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.RANGER);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Landfall -- Whenever a land enters the battlefield under your control, if you don't control a Ring-bearer, the Ring tempts you.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new LandfallAbility(new TheRingTemptsYouEffect()),
condition, "Whenever a land enters the battlefield under your control, " +
"if you don't control a Ring-bearer, the Ring tempts you."
).setAbilityWord(AbilityWord.LANDFALL));
}
private DunedainRangers(final DunedainRangers card) {
super(card);
}
@Override
public DunedainRangers copy() {
return new DunedainRangers(this);
}
}

View file

@ -38,6 +38,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet {
cards.add(new SetCardInfo("Council's Deliberation", 46, Rarity.UNCOMMON, mage.cards.c.CouncilsDeliberation.class));
cards.add(new SetCardInfo("Display of Power", 119, Rarity.RARE, mage.cards.d.DisplayOfPower.class));
cards.add(new SetCardInfo("Dunedain Blade", 6, Rarity.COMMON, mage.cards.d.DunedainBlade.class));
cards.add(new SetCardInfo("Dunedain Rangers", 159, Rarity.UNCOMMON, mage.cards.d.DunedainRangers.class));
cards.add(new SetCardInfo("Dunland Crebain", 82, Rarity.COMMON, mage.cards.d.DunlandCrebain.class));
cards.add(new SetCardInfo("Eagles of the North", 7, Rarity.COMMON, mage.cards.e.EaglesOfTheNorth.class));
cards.add(new SetCardInfo("Easterling Vanguard", 83, Rarity.COMMON, mage.cards.e.EasterlingVanguard.class));

View file

@ -0,0 +1,17 @@
package mage.filter.predicate.permanent;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* @author TheElk801
*/
public enum RingBearerPredicate implements Predicate<Permanent> {
instance;
@Override
public boolean apply(Permanent input, Game game) {
return input.isRingBearer(game);
}
}