mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
- Added Bamboozle.
This commit is contained in:
parent
ab5fe47ce7
commit
92b76b7c09
2 changed files with 118 additions and 0 deletions
117
Mage.Sets/src/mage/cards/b/Bamboozle.java
Normal file
117
Mage.Sets/src/mage/cards/b/Bamboozle.java
Normal file
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* 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.b;
|
||||
|
||||
import java.util.Set;
|
||||
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.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class Bamboozle extends CardImpl {
|
||||
|
||||
public Bamboozle(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
|
||||
|
||||
// Target player reveals the top four cards of his or her library. You choose two of those cards and put them into his or her graveyard. Put the rest on top of his or her library in any order.
|
||||
this.getSpellAbility().addEffect(new BamboozleEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
||||
}
|
||||
|
||||
public Bamboozle(final Bamboozle card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bamboozle copy() {
|
||||
return new Bamboozle(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BamboozleEffect extends OneShotEffect {
|
||||
|
||||
BamboozleEffect() {
|
||||
super(Outcome.Discard);
|
||||
staticText = "Target player reveals the top four cards of his or her library. You choose two of those cards and put them into his or her graveyard. Put the rest on top of his or her library in any order";
|
||||
}
|
||||
|
||||
BamboozleEffect(final BamboozleEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Cards putOnTopLibrary = new CardsImpl();
|
||||
Cards putInGraveyard = new CardsImpl();
|
||||
if (targetPlayer != null
|
||||
&& controller != null) {
|
||||
Set<Card> top4Cards = targetPlayer.getLibrary().getTopCards(game, 4);
|
||||
for (Card card : top4Cards) {
|
||||
putOnTopLibrary.add(card);
|
||||
}
|
||||
targetPlayer.revealCards("Bamboozle Reveal", putOnTopLibrary, game);
|
||||
TargetCard target = new TargetCard(2, Zone.LIBRARY, new FilterCard("2 cards out of this stack to put into his or her graveyard"));
|
||||
if (controller.choose(Outcome.Discard, putOnTopLibrary, target, game)) {
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
putInGraveyard.add(game.getCard(cardId));
|
||||
putOnTopLibrary.remove(game.getCard(cardId));
|
||||
}
|
||||
targetPlayer.moveCards(putInGraveyard, Zone.GRAVEYARD, source, game);
|
||||
targetPlayer.putCardsOnTopOfLibrary(putOnTopLibrary, game, source, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BamboozleEffect copy() {
|
||||
return new BamboozleEffect(this);
|
||||
}
|
||||
|
||||
}
|
|
@ -78,6 +78,7 @@ public class Odyssey extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Balancing Act", 10, Rarity.RARE, mage.cards.b.BalancingAct.class));
|
||||
cards.add(new SetCardInfo("Balshan Beguiler", 66, Rarity.UNCOMMON, mage.cards.b.BalshanBeguiler.class));
|
||||
cards.add(new SetCardInfo("Balshan Griffin", 67, Rarity.UNCOMMON, mage.cards.b.BalshanGriffin.class));
|
||||
cards.add(new SetCardInfo("Bamboozle", 68, Rarity.UNCOMMON, mage.cards.b.Bamboozle.class));
|
||||
cards.add(new SetCardInfo("Barbarian Lunatic", 175, Rarity.COMMON, mage.cards.b.BarbarianLunatic.class));
|
||||
cards.add(new SetCardInfo("Barbarian Ring", 313, Rarity.UNCOMMON, mage.cards.b.BarbarianRing.class));
|
||||
cards.add(new SetCardInfo("Bash to Bits", 176, Rarity.UNCOMMON, mage.cards.b.BashToBits.class));
|
||||
|
|
Loading…
Reference in a new issue