diff --git a/Mage.Sets/src/mage/cards/a/AcademyLoremaster.java b/Mage.Sets/src/mage/cards/a/AcademyLoremaster.java new file mode 100644 index 0000000000..61fa895d7b --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AcademyLoremaster.java @@ -0,0 +1,76 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfDrawTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AcademyLoremaster extends CardImpl { + + public AcademyLoremaster(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // At the beginning of each player's draw step, that player may draw an additional card. If they do, spells they cast this turn cost {2} more to cast. + this.addAbility(new BeginningOfDrawTriggeredAbility( + new AcademyLoremasterEffect(), TargetController.ANY, false + )); + } + + private AcademyLoremaster(final AcademyLoremaster card) { + super(card); + } + + @Override + public AcademyLoremaster copy() { + return new AcademyLoremaster(this); + } +} + +class AcademyLoremasterEffect extends OneShotEffect { + + AcademyLoremasterEffect() { + super(Outcome.Benefit); + staticText = "that player may draw an additional card. " + + "If they do, spells they cast this turn cost {2} more to cast"; + } + + private AcademyLoremasterEffect(final AcademyLoremasterEffect effect) { + super(effect); + } + + @Override + public AcademyLoremasterEffect copy() { + return new AcademyLoremasterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(game.getActivePlayerId()); + if (player == null + || !player.chooseUse(outcome, "Draw an additional card?", source, game) + || player.drawCards(1, source, game) < 1) { + return false; + } + game.addEffect(new SpellsCostIncreasingAllEffect( + 2, StaticFilters.FILTER_CARD, TargetController.ACTIVE + ).setDuration(Duration.EndOfTurn), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/DominariaUnited.java b/Mage.Sets/src/mage/sets/DominariaUnited.java index 23c271e2fe..5986ef72e1 100644 --- a/Mage.Sets/src/mage/sets/DominariaUnited.java +++ b/Mage.Sets/src/mage/sets/DominariaUnited.java @@ -27,6 +27,7 @@ public final class DominariaUnited extends ExpansionSet { this.ratioBoosterMythic = 7; this.maxCardNumberInBooster = 281; + cards.add(new SetCardInfo("Academy Loremaster", 40, Rarity.RARE, mage.cards.a.AcademyLoremaster.class)); cards.add(new SetCardInfo("Academy Wall", 41, Rarity.COMMON, mage.cards.a.AcademyWall.class)); cards.add(new SetCardInfo("Adarkar Wastes", 243, Rarity.RARE, mage.cards.a.AdarkarWastes.class)); cards.add(new SetCardInfo("Aether Channeler", 42, Rarity.RARE, mage.cards.a.AetherChanneler.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java index b2054c0cf9..797fdce3ee 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/cost/SpellsCostIncreasingAllEffect.java @@ -55,6 +55,9 @@ public class SpellsCostIncreasingAllEffect extends CostModificationEffectImpl { case OPPONENT: sb.append(" your opponents cast"); break; + case ACTIVE: + sb.append(" the active player casts"); + break; case ANY: break; default: @@ -110,6 +113,10 @@ public class SpellsCostIncreasingAllEffect extends CostModificationEffectImpl { return false; } break; + case ACTIVE: + if (!game.isActivePlayer(abilityController.getId())) { + return false; + } case ANY: break; default: