Merge pull request #4086 from magefree/master

merge master
This commit is contained in:
theelk801 2017-10-02 20:57:15 -04:00 committed by GitHub
commit 408230afc9
5 changed files with 124 additions and 26 deletions

View file

@ -5,10 +5,7 @@
*/
package org.mage.card.arcane;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Paint;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Iterator;
@ -19,8 +16,8 @@ import java.util.regex.Pattern;
/**
* @author stravant@gmail.com
*
* Various static utilities for use in the card renderer
* <p>
* Various static utilities for use in the card renderer
*/
public final class CardRendererUtils {
@ -124,6 +121,8 @@ public final class CardRendererUtils {
}
public static String killReminderText(String rule) {
return killReminderTextPattern.matcher(rule).replaceAll("");
return killReminderTextPattern.matcher(rule).replaceAll("")
.replaceAll("<i>", "")
.replaceAll("</i>", "");
}
}

View file

@ -73,9 +73,7 @@ public class Standard extends Constructed {
}
}
banned.add("Aetherworks Marvel");
banned.add("Emrakul, the Promised End");
banned.add("Felidar Guardian");
banned.add("Reflector Mage");
banned.add("Smuggler's Copter");
}
@ -83,6 +81,6 @@ public class Standard extends Constructed {
Calendar cal = Calendar.getInstance();
cal.setTime(set.getReleaseDate());
// Sets from fall block are normally released in September and January
return cal.get(Calendar.MONTH) > 8 || cal.get(Calendar.MONTH) < 2;
return cal.get(Calendar.MONTH) > 7 || cal.get(Calendar.MONTH) < 2;
}
}

View file

@ -33,14 +33,17 @@ import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.effects.common.ExileSourceEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlSourceEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
@ -60,9 +63,7 @@ public class AethergeodeMiner extends CardImpl {
this.addAbility(new AttacksTriggeredAbility(new GetEnergyCountersControllerEffect(2), false));
// Pay {E}{E}: Exile Aethergeode Miner, then return it to the battlefield under its owner's control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileSourceEffect(true), new PayEnergyCost(2));
ability.addEffect(new ReturnToBattlefieldUnderOwnerControlSourceEffect());
this.addAbility(ability);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new AethergeodeMinerEffect(), new PayEnergyCost(2)));
}
public AethergeodeMiner(final AethergeodeMiner card) {
@ -74,3 +75,34 @@ public class AethergeodeMiner extends CardImpl {
return new AethergeodeMiner(this);
}
}
class AethergeodeMinerEffect extends OneShotEffect {
public AethergeodeMinerEffect() {
super(Outcome.Neutral);
this.staticText = "Exile {this}, then return it to the battlefield under its owner's control";
}
public AethergeodeMinerEffect(final AethergeodeMinerEffect effect) {
super(effect);
}
@Override
public AethergeodeMinerEffect copy() {
return new AethergeodeMinerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Aethergeode Miner", source.getSourceId(), game)) {
Card card = game.getExile().getCard(source.getSourceId(), game);
if (card != null) {
return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
}
}
}
return false;
}
}

View file

@ -53,6 +53,8 @@ public class DubiousChallenge extends CardImpl {
// Look at the top ten cards of your library, exile up to two creature cards from among them, then shuffle your library. Target opponent may choose one of the exiled cards and put it onto the battlefield under his or her control. Put the rest onto the battlefield under your control.
getSpellAbility().addEffect(new DubiousChallengeEffect());
getSpellAbility().addTarget(new TargetOpponent());
getSpellAbility().addEffect(new DubiousChallengeMoveToBattlefieldEffect());
getSpellAbility().addEffect(new DubiousChallengeMoveToBattlefieldEffect());
}
public DubiousChallenge(final DubiousChallenge card) {
@ -69,7 +71,7 @@ class DubiousChallengeEffect extends OneShotEffect {
public DubiousChallengeEffect() {
super(Outcome.Benefit);
this.staticText = "Look at the top ten cards of your library, exile up to two creature cards from among them, then shuffle your library. Target opponent may choose one of the exiled cards and put it onto the battlefield under his or her control. Put the rest onto the battlefield under your control";
this.staticText = "Look at the top ten cards of your library, exile up to two creature cards from among them, then shuffle your library. Target opponent may choose one of the exiled cards and put it onto the battlefield under his or her control. Put the rest onto the battlefield under your control.";
}
public DubiousChallengeEffect(final DubiousChallengeEffect effect) {
@ -98,15 +100,17 @@ class DubiousChallengeEffect extends OneShotEffect {
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
if (opponent != null) {
TargetCard targetOpponentCreature = new TargetCard(0, 1, Zone.EXILED, new FilterCreatureCard());
DubiousChallengeMoveToBattlefieldEffect opponentEffect = (DubiousChallengeMoveToBattlefieldEffect) source.getEffects().get(1);
DubiousChallengeMoveToBattlefieldEffect controllerEffect = (DubiousChallengeMoveToBattlefieldEffect) source.getEffects().get(2);
if (opponent.choose(outcome, exiledCards, targetOpponentCreature, game)) {
Card card = game.getCard(targetOpponentCreature.getFirstTarget());
if (card != null) {
opponent.moveCards(card, Zone.BATTLEFIELD, source, game);
opponentEffect.setPlayerAndCards(opponent, new CardsImpl(card));
exiledCards.remove(card);
}
}
if (!exiledCards.isEmpty()) {
controller.moveCards(exiledCards, Zone.BATTLEFIELD, source, game);
controllerEffect.setPlayerAndCards(controller, exiledCards);
}
}
} else {
@ -117,3 +121,36 @@ class DubiousChallengeEffect extends OneShotEffect {
return false;
}
}
class DubiousChallengeMoveToBattlefieldEffect extends OneShotEffect {
public DubiousChallengeMoveToBattlefieldEffect() {
super(Outcome.Benefit);
}
public DubiousChallengeMoveToBattlefieldEffect(final DubiousChallengeMoveToBattlefieldEffect effect) {
super(effect);
}
@Override
public DubiousChallengeMoveToBattlefieldEffect copy() {
return new DubiousChallengeMoveToBattlefieldEffect(this);
}
public void setPlayerAndCards(Player targetPlayer, Cards targetCards)
{
this.player = targetPlayer;
this.cards = targetCards;
}
@Override
public boolean apply(Game game, Ability source) {
if (cards != null && player != null) {
return player.moveCards(cards, Zone.BATTLEFIELD, source, game);
}
return false;
}
private Cards cards;
private Player player;
}

View file

@ -32,14 +32,17 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ExileSourceEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlSourceEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
@ -48,19 +51,17 @@ import mage.constants.Zone;
public class FlickeringSpirit extends CardImpl {
public FlickeringSpirit(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add(SubType.SPIRIT);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// {3}{W}: Exile Flickering Spirit, then return it to the battlefield under its owner's control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileSourceEffect(true), new ManaCostsImpl("{3}{W}"));
ability.addEffect(new ReturnToBattlefieldUnderOwnerControlSourceEffect());
this.addAbility(ability);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new FlickeringSpiritEffect(), new ManaCostsImpl("{3}{W}")));
}
public FlickeringSpirit(final FlickeringSpirit card) {
@ -72,3 +73,34 @@ public class FlickeringSpirit extends CardImpl {
return new FlickeringSpirit(this);
}
}
class FlickeringSpiritEffect extends OneShotEffect {
public FlickeringSpiritEffect() {
super(Outcome.Neutral);
this.staticText = "Exile {this}, then return it to the battlefield under its owner's control";
}
public FlickeringSpiritEffect(final FlickeringSpiritEffect effect) {
super(effect);
}
@Override
public FlickeringSpiritEffect copy() {
return new FlickeringSpiritEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if (permanent.moveToExile(source.getSourceId(), "Flickering Spirit", source.getSourceId(), game)) {
Card card = game.getExile().getCard(source.getSourceId(), game);
if (card != null) {
return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
}
}
}
return false;
}
}