diff --git a/Mage.Sets/src/mage/cards/r/RangerClass.java b/Mage.Sets/src/mage/cards/r/RangerClass.java new file mode 100644 index 0000000000..19e83d4256 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RangerClass.java @@ -0,0 +1,76 @@ +package mage.cards.r; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksWithCreaturesTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect; +import mage.abilities.effects.common.continuous.LookAtTopCardOfLibraryAnyTimeEffect; +import mage.abilities.effects.common.continuous.PlayTheTopCardEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.ClassLevelAbility; +import mage.abilities.keyword.ClassReminderAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.game.permanent.token.WolfToken; +import mage.target.common.TargetAttackingCreature; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RangerClass extends CardImpl { + + private static final FilterCard filter = new FilterCreatureCard("cast creature spells"); + + public RangerClass(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + + this.subtype.add(SubType.CLASS); + + // (Gain the next level as a sorcery to add its ability.) + this.addAbility(new ClassReminderAbility()); + + // When Ranger Class enters the battlefield, create a 2/2 green Wolf creature token. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new WolfToken()))); + + // {1}{G}: Level 2 + this.addAbility(new ClassLevelAbility(2, "{1}{G}")); + + // Whenever you attack, put a +1/+1 counter on target attacking creature. + Ability ability = new AttacksWithCreaturesTriggeredAbility( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), 0 + ); + ability.addTarget(new TargetAttackingCreature()); + this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(ability, 2))); + + // {3}{G}: Level 3 + this.addAbility(new ClassLevelAbility(3, "{3}{G}")); + + // You may look at the top card of your library any time. + this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect( + new LookAtTopCardOfLibraryAnyTimeEffect(), 3 + ))); + + // You may cast creature spells from the top of your library. + this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect( + new PlayTheTopCardEffect(filter, false), 3 + ))); + } + + private RangerClass(final RangerClass card) { + super(card); + } + + @Override + public RangerClass copy() { + return new RangerClass(this); + } +} diff --git a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java index 2d2cc4d0e2..8510184de0 100644 --- a/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java +++ b/Mage.Sets/src/mage/sets/AdventuresInTheForgottenRealms.java @@ -190,6 +190,7 @@ public final class AdventuresInTheForgottenRealms extends ExpansionSet { cards.add(new SetCardInfo("Prosperous Innkeeper", 200, Rarity.UNCOMMON, mage.cards.p.ProsperousInnkeeper.class)); cards.add(new SetCardInfo("Purple Worm", 201, Rarity.UNCOMMON, mage.cards.p.PurpleWorm.class)); cards.add(new SetCardInfo("Rally Maneuver", 36, Rarity.UNCOMMON, mage.cards.r.RallyManeuver.class)); + cards.add(new SetCardInfo("Ranger Class", 202, Rarity.RARE, mage.cards.r.RangerClass.class)); cards.add(new SetCardInfo("Ranger's Hawk", 37, Rarity.COMMON, mage.cards.r.RangersHawk.class)); cards.add(new SetCardInfo("Ranger's Longbow", 203, Rarity.COMMON, mage.cards.r.RangersLongbow.class)); cards.add(new SetCardInfo("Ray of Enfeeblement", 116, Rarity.UNCOMMON, mage.cards.r.RayOfEnfeeblement.class));