Implemented Amplifire

This commit is contained in:
Evan Kranzler 2019-01-03 21:47:42 -05:00
parent 5c0084699b
commit 3e092805d9
2 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,90 @@
package mage.cards.a;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.cards.*;
import mage.constants.*;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class Amplifire extends CardImpl {
public Amplifire(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// At the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card. Until your next turn, Amplifire's base power becomes twice that card's power and its base toughness becomes twice that card's toughness. Put the revealed cards on the bottom of your library in a random order.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new AmplifireEffect(), TargetController.YOU, false
));
}
private Amplifire(final Amplifire card) {
super(card);
}
@Override
public Amplifire copy() {
return new Amplifire(this);
}
}
class AmplifireEffect extends OneShotEffect {
AmplifireEffect() {
super(Outcome.Benefit);
staticText = "reveal cards from the top of your library until you reveal a creature card. " +
"Until your next turn, {this}'s base power becomes twice that card's power " +
"and its base toughness becomes twice that card's toughness. " +
"Put the revealed cards on the bottom of your library in a random order.";
}
private AmplifireEffect(final AmplifireEffect effect) {
super(effect);
}
@Override
public AmplifireEffect copy() {
return new AmplifireEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Cards cards = new CardsImpl();
Card lastCard = null;
for (Card card : player.getLibrary().getCards(game)) {
if (card != null) {
cards.add(card);
if (card.isCreature()) {
lastCard = card;
break;
}
}
}
player.revealCards(source, cards, game);
if (lastCard != null) {
game.addEffect(new SetPowerToughnessSourceEffect(
2 * lastCard.getPower().getValue(),
2 * lastCard.getToughness().getValue(),
Duration.UntilYourNextTurn
), source);
}
player.putCardsOnBottomOfLibrary(cards, game, source, false);
return true;
}
}

View file

@ -34,6 +34,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Absorb", 151, Rarity.RARE, mage.cards.a.Absorb.class));
cards.add(new SetCardInfo("Aeromunculus", 152, Rarity.COMMON, mage.cards.a.Aeromunculus.class));
cards.add(new SetCardInfo("Amplifire", 92, Rarity.RARE, mage.cards.a.Amplifire.class));
cards.add(new SetCardInfo("Azorius Guildgate", 243, Rarity.COMMON, mage.cards.a.AzoriusGuildgate.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Azorius Guildgate", 244, Rarity.COMMON, mage.cards.a.AzoriusGuildgate.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Azorius Locket", 231, Rarity.COMMON, mage.cards.a.AzoriusLocket.class));