- Added Funeral Pyre. Fixed Orcish Settlers.

This commit is contained in:
Jeff 2017-08-21 16:24:15 -05:00
parent 9ac7fe27f0
commit 7b1ba214e2
3 changed files with 116 additions and 13 deletions

View file

@ -0,0 +1,102 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.f;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.token.SpiritWhiteToken;
import mage.game.permanent.token.Token;
import mage.players.Player;
import mage.target.common.TargetCardInGraveyard;
import mage.util.CardUtil;
/**
*
* @author jeffwadsworth
*/
public class FuneralPyre extends CardImpl {
public FuneralPyre(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}");
// Exile target card from a graveyard. Its owner puts a 1/1 white Spirit creature token with flying onto the battlefield.
this.getSpellAbility().addEffect(new FuneralPyreEffect());
this.getSpellAbility().addTarget(new TargetCardInGraveyard());
}
public FuneralPyre(final FuneralPyre card) {
super(card);
}
@Override
public FuneralPyre copy() {
return new FuneralPyre(this);
}
}
class FuneralPyreEffect extends OneShotEffect {
public FuneralPyreEffect() {
super(Outcome.Benefit);
this.staticText = "Exile target card from a graveyard. Its owner puts a 1/1 white Spirit creature token with flying onto the battlefield";
}
public FuneralPyreEffect(final FuneralPyreEffect effect) {
super(effect);
}
@Override
public FuneralPyreEffect copy() {
return new FuneralPyreEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card exiledCard = game.getCard(source.getTargets().getFirstTarget());
if (exiledCard != null) {
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), 0);
if (exiledCard.moveToExile(exileId, "Funeral Pyre", source.getSourceId(), game)) {
Player owner = game.getPlayer(exiledCard.getOwnerId());
if (owner != null) {
Token token = new SpiritWhiteToken();
return token.putOntoBattlefield(1, game, source.getSourceId(), owner.getId());
}
}
}
return false;
}
}

View file

@ -55,7 +55,7 @@ import mage.target.common.TargetLandPermanent;
public class OrcishSettlers extends CardImpl {
public OrcishSettlers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add("Orc");
this.power = new MageInt(1);
@ -96,24 +96,24 @@ class OrcishSettlersEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int amount = new ManacostVariableValue().calculate(game, source, this);
TargetLandPermanent target = new TargetLandPermanent(amount);
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
int amount = source.getManaCostsToPay().getX();
if (amount == 0) {
return false;
}
if (player.choose(Outcome.DestroyPermanent, target, id, game)) {
TargetLandPermanent target = new TargetLandPermanent(amount);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null
&& target.canChoose(controller.getId(), game)
&& controller.choose(Outcome.DestroyPermanent, target, source.getSourceId(), game)) {
List<UUID> targets = target.getTargets();
for (UUID landId : targets) {
targets.forEach((landId) -> {
Permanent land = game.getPermanent(landId);
if (land != null) {
land.destroy(landId, game, false);
}
}
});
return true;
}
return true;
return false;
}
}

View file

@ -78,7 +78,7 @@ public class Judgment extends ExpansionSet {
cards.add(new SetCardInfo("Canopy Claws", 108, Rarity.COMMON, mage.cards.c.CanopyClaws.class));
cards.add(new SetCardInfo("Centaur Rootcaster", 109, Rarity.COMMON, mage.cards.c.CentaurRootcaster.class));
cards.add(new SetCardInfo("Cephalid Constable", 35, Rarity.RARE, mage.cards.c.CephalidConstable.class));
cards.add(new SetCardInfo("Cephalid Inkshrouder", 36, Rarity.UNCOMMON, mage.cards.c.CephalidInkshrouder.class));
cards.add(new SetCardInfo("Cephalid Inkshrouder", 36, Rarity.UNCOMMON, mage.cards.c.CephalidInkshrouder.class));
cards.add(new SetCardInfo("Chastise", 8, Rarity.UNCOMMON, mage.cards.c.Chastise.class));
cards.add(new SetCardInfo("Commander Eesha", 9, Rarity.RARE, mage.cards.c.CommanderEesha.class));
cards.add(new SetCardInfo("Crush of Wurms", 110, Rarity.RARE, mage.cards.c.CrushOfWurms.class));
@ -100,6 +100,7 @@ public class Judgment extends ExpansionSet {
cards.add(new SetCardInfo("Flash of Insight", 40, Rarity.UNCOMMON, mage.cards.f.FlashOfInsight.class));
cards.add(new SetCardInfo("Fledgling Dragon", 90, Rarity.RARE, mage.cards.f.FledglingDragon.class));
cards.add(new SetCardInfo("Folk Medicine", 115, Rarity.COMMON, mage.cards.f.FolkMedicine.class));
cards.add(new SetCardInfo("Funeral Pyre", 10, Rarity.COMMON, mage.cards.f.FuneralPyre.class));
cards.add(new SetCardInfo("Genesis", 117, Rarity.RARE, mage.cards.g.Genesis.class));
cards.add(new SetCardInfo("Giant Warthog", 118, Rarity.COMMON, mage.cards.g.GiantWarthog.class));
cards.add(new SetCardInfo("Glory", 11, Rarity.RARE, mage.cards.g.Glory.class));