diff --git a/Mage.Sets/src/mage/cards/a/AncientSilverDragon.java b/Mage.Sets/src/mage/cards/a/AncientSilverDragon.java new file mode 100644 index 00000000000..baebb4e30bb --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AncientSilverDragon.java @@ -0,0 +1,81 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AncientSilverDragon extends CardImpl { + + public AncientSilverDragon(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{U}{U}"); + + this.subtype.add(SubType.ELDER); + this.subtype.add(SubType.DRAGON); + this.power = new MageInt(8); + this.toughness = new MageInt(8); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever Ancient Silver Dragon deals combat damage to a player, roll a d20. Draw cards equal to the result. You have no maximum hand size for the rest of the game. + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new AncientSilverDragonEffect(), false); + ability.addEffect(new MaximumHandSizeControllerEffect( + Integer.MAX_VALUE, Duration.EndOfGame, MaximumHandSizeControllerEffect.HandSizeModification.SET + )); + } + + private AncientSilverDragon(final AncientSilverDragon card) { + super(card); + } + + @Override + public AncientSilverDragon copy() { + return new AncientSilverDragon(this); + } +} + +class AncientSilverDragonEffect extends OneShotEffect { + + AncientSilverDragonEffect() { + super(Outcome.Benefit); + staticText = "roll a d20. Draw cards equal to the result."; + } + + private AncientSilverDragonEffect(final AncientSilverDragonEffect effect) { + super(effect); + } + + @Override + public AncientSilverDragonEffect copy() { + return new AncientSilverDragonEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int amount = player.rollDice(Outcome.Benefit, source, game, 20); + if (amount > 0) { + player.drawCards(amount, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index daae39ac6d5..ecca6d66ce1 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -29,6 +29,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Amethyst Dragon", 160, Rarity.UNCOMMON, mage.cards.a.AmethystDragon.class)); cards.add(new SetCardInfo("Ancient Brass Dragon", 111, Rarity.MYTHIC, mage.cards.a.AncientBrassDragon.class)); cards.add(new SetCardInfo("Ancient Copper Dragon", 161, Rarity.MYTHIC, mage.cards.a.AncientCopperDragon.class)); + cards.add(new SetCardInfo("Ancient Silver Dragon", 56, Rarity.MYTHIC, mage.cards.a.AncientSilverDragon.class)); cards.add(new SetCardInfo("Arcane Encyclopedia", 297, Rarity.UNCOMMON, mage.cards.a.ArcaneEncyclopedia.class)); cards.add(new SetCardInfo("Arcane Signet", 298, Rarity.UNCOMMON, mage.cards.a.ArcaneSignet.class)); cards.add(new SetCardInfo("Archivist of Oghma", 4, Rarity.RARE, mage.cards.a.ArchivistOfOghma.class));