mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
- Added Conflux, Child of Alara, Maelstrom Archangel, and Malfegor.
This commit is contained in:
parent
7ffde6b00b
commit
f6cb13dce0
4 changed files with 520 additions and 0 deletions
76
Mage.Sets/src/mage/sets/conflux/ChildOfAlara.java
Normal file
76
Mage.Sets/src/mage/sets/conflux/ChildOfAlara.java
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* 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.sets.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterNonlandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class ChildOfAlara extends CardImpl<ChildOfAlara> {
|
||||
|
||||
public ChildOfAlara(UUID ownerId) {
|
||||
super(ownerId, 101, "Child of Alara", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}");
|
||||
this.expansionSetCode = "CON";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Avatar");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// When Child of Alara dies, destroy all nonland permanents. They can't be regenerated.
|
||||
this.addAbility(new DiesTriggeredAbility(new DestroyAllEffect(new FilterNonlandPermanent("nonland permanents"), true)));
|
||||
|
||||
}
|
||||
|
||||
public ChildOfAlara(final ChildOfAlara card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChildOfAlara copy() {
|
||||
return new ChildOfAlara(this);
|
||||
}
|
||||
}
|
185
Mage.Sets/src/mage/sets/conflux/Conflux.java
Normal file
185
Mage.Sets/src/mage/sets/conflux/Conflux.java
Normal file
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
* 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.sets.conflux;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class Conflux extends CardImpl<Conflux> {
|
||||
|
||||
public Conflux(UUID ownerId) {
|
||||
super(ownerId, 102, "Conflux", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{3}{W}{U}{B}{R}{G}");
|
||||
this.expansionSetCode = "CON";
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Search your library for a white card, a blue card, a black card, a red card, and a green card. Reveal those cards and put them into your hand. Then shuffle your library.
|
||||
this.getSpellAbility().addEffect(new ConfluxEffect());
|
||||
|
||||
}
|
||||
|
||||
public Conflux(final Conflux card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conflux copy() {
|
||||
return new Conflux(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ConfluxEffect extends OneShotEffect<ConfluxEffect> {
|
||||
|
||||
public ConfluxEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
this.staticText = "Search your library for a white card, a blue card, a black card, a red card, and a green card. Reveal those cards and put them into your hand. Then shuffle your library";
|
||||
}
|
||||
|
||||
public ConfluxEffect(final ConfluxEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfluxEffect copy() {
|
||||
return new ConfluxEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
Cards cards = new CardsImpl();
|
||||
FilterCard filterWhite = new FilterCard("white card");
|
||||
filterWhite.add(new ColorPredicate(ObjectColor.WHITE));
|
||||
FilterCard filterBlue = new FilterCard("blue card");
|
||||
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
|
||||
FilterCard filterBlack = new FilterCard("black card");
|
||||
filterBlack.add(new ColorPredicate(ObjectColor.BLACK));
|
||||
FilterCard filterRed = new FilterCard("red card");
|
||||
filterRed.add(new ColorPredicate(ObjectColor.RED));
|
||||
FilterCard filterGreen = new FilterCard("green card");
|
||||
filterGreen.add(new ColorPredicate(ObjectColor.GREEN));
|
||||
TargetCardInLibrary targetWhite = new TargetCardInLibrary(filterWhite);
|
||||
TargetCardInLibrary targetBlue = new TargetCardInLibrary(filterBlue);
|
||||
TargetCardInLibrary targetBlack = new TargetCardInLibrary(filterBlack);
|
||||
TargetCardInLibrary targetRed = new TargetCardInLibrary(filterRed);
|
||||
TargetCardInLibrary targetGreen = new TargetCardInLibrary(filterGreen);
|
||||
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetWhite, game)) {
|
||||
if (targetWhite.getTargets().size() > 0) {
|
||||
for (UUID cardId : (List<UUID>) targetWhite.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetBlue, game)) {
|
||||
if (targetBlue.getTargets().size() > 0) {
|
||||
for (UUID cardId : (List<UUID>) targetBlue.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetBlack, game)) {
|
||||
if (targetBlack.getTargets().size() > 0) {
|
||||
for (UUID cardId : (List<UUID>) targetBlack.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetRed, game)) {
|
||||
if (targetRed.getTargets().size() > 0) {
|
||||
for (UUID cardId : (List<UUID>) targetRed.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (you != null && you.getLibrary().size() > 0) {
|
||||
if (you.searchLibrary(targetGreen, game)) {
|
||||
if (targetGreen.getTargets().size() > 0) {
|
||||
for (UUID cardId : (List<UUID>) targetGreen.getTargets()) {
|
||||
Card card = you.getLibrary().remove(cardId, game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (you != null) {
|
||||
you.revealCards("Conflux", cards, game);
|
||||
for (Card card : cards.getCards(game)) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, true);
|
||||
}
|
||||
you.shuffleLibrary(game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
132
Mage.Sets/src/mage/sets/conflux/MaelstromArchangel.java
Normal file
132
Mage.Sets/src/mage/sets/conflux/MaelstromArchangel.java
Normal file
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* 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.sets.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.effects.CostModificationEffectImpl;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.RetraceAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class MaelstromArchangel extends CardImpl<MaelstromArchangel> {
|
||||
|
||||
public MaelstromArchangel(UUID ownerId) {
|
||||
super(ownerId, 115, "Maelstrom Archangel", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}");
|
||||
this.expansionSetCode = "CON";
|
||||
this.subtype.add("Angel");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Whenever Maelstrom Archangel deals combat damage to a player, you may cast a nonland card from your hand without paying its mana cost.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new MaelstromArchangelEffect(), true));
|
||||
|
||||
}
|
||||
|
||||
public MaelstromArchangel(final MaelstromArchangel card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaelstromArchangel copy() {
|
||||
return new MaelstromArchangel(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MaelstromArchangelEffect extends CostModificationEffectImpl<MaelstromArchangelEffect> {
|
||||
|
||||
public MaelstromArchangelEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.PlayForFree);
|
||||
staticText = "You may cast nonland cards from your hand without paying their mana costs";
|
||||
}
|
||||
|
||||
private MaelstromArchangelEffect(final MaelstromArchangelEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
SpellAbility spellAbility = (SpellAbility) abilityToModify;
|
||||
spellAbility.getManaCostsToPay().clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility || abilityToModify instanceof RetraceAbility) {
|
||||
Card sourceCard = game.getCard(abilityToModify.getSourceId());
|
||||
StackObject stackObject = game.getStack().getStackObject(abilityToModify.getSourceId());
|
||||
if (stackObject != null && stackObject instanceof Spell) {
|
||||
Zone zone = ((Spell)stackObject).getFromZone();
|
||||
if (zone != null && zone.equals(Zone.HAND)) {
|
||||
if (sourceCard != null && sourceCard.getOwnerId().equals(source.getControllerId())
|
||||
&& !sourceCard.getCardType().contains(CardType.LAND)) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
String message = "Cast " + sourceCard.getName() + " without paying its mana costs?";
|
||||
if (you != null && you.chooseUse(Outcome.PlayForFree, message, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaelstromArchangelEffect copy() {
|
||||
return new MaelstromArchangelEffect(this);
|
||||
}
|
||||
}
|
127
Mage.Sets/src/mage/sets/conflux/Malfegor.java
Normal file
127
Mage.Sets/src/mage/sets/conflux/Malfegor.java
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* 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.sets.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class Malfegor extends CardImpl<Malfegor> {
|
||||
|
||||
public Malfegor(UUID ownerId) {
|
||||
super(ownerId, 117, "Malfegor", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{R}{R}");
|
||||
this.expansionSetCode = "CON";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Demon");
|
||||
this.subtype.add("Dragon");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Malfegor enters the battlefield, discard your hand. Each opponent sacrifices a creature for each card discarded this way.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new MalfegorEffect(), false));
|
||||
|
||||
}
|
||||
|
||||
public Malfegor(final Malfegor card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Malfegor copy() {
|
||||
return new Malfegor(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MalfegorEffect extends OneShotEffect<MalfegorEffect> {
|
||||
|
||||
public MalfegorEffect() {
|
||||
super(Outcome.Neutral);
|
||||
staticText = "discard your hand. Each opponent sacrifices a creature for each card discarded this way";
|
||||
}
|
||||
|
||||
public MalfegorEffect(final MalfegorEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you == null) {
|
||||
return false;
|
||||
}
|
||||
int handSizeBefore = you.getHand().size();
|
||||
you.discardToMax(game);
|
||||
int sacrificeNumber = handSizeBefore - you.getHand().size();
|
||||
for (UUID opponentId : game.getOpponents(you.getId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
for (int i = 0; i < sacrificeNumber; i++) {
|
||||
Target target = new TargetControlledPermanent(new FilterControlledCreaturePermanent());
|
||||
if (target.canChoose(opponentId, game)) {
|
||||
while (!target.isChosen() && target.canChoose(opponentId, game)) {
|
||||
opponent.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
}
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MalfegorEffect copy() {
|
||||
return new MalfegorEffect(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue