Added Darien, King of Kjeldor, Captain Sisay, Howltooth Hollow, Blackmail, Cao Cao, Lord of Wei and Diaochan Artful Beauty.

This commit is contained in:
LevelX2 2014-04-04 16:44:19 +02:00
parent 73885ab01d
commit 87dd02ecfc
16 changed files with 959 additions and 161 deletions

View file

@ -0,0 +1,130 @@
/*
* 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.coldsnap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.SoldierToken;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class DarienKingOfKjeldor extends CardImpl<DarienKingOfKjeldor> {
public DarienKingOfKjeldor(UUID ownerId) {
super(ownerId, 4, "Darien, King of Kjeldor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}");
this.expansionSetCode = "CSP";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Soldier");
this.color.setWhite(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Whenever you're dealt damage, you may put that many 1/1 white Soldier creature tokens onto the battlefield.
this.addAbility(new DarienKingOfKjeldorTriggeredAbility());
}
public DarienKingOfKjeldor(final DarienKingOfKjeldor card) {
super(card);
}
@Override
public DarienKingOfKjeldor copy() {
return new DarienKingOfKjeldor(this);
}
}
class DarienKingOfKjeldorTriggeredAbility extends TriggeredAbilityImpl<DarienKingOfKjeldorTriggeredAbility> {
public DarienKingOfKjeldorTriggeredAbility() {
super(Zone.BATTLEFIELD, new DarienKingOfKjeldorEffect(), true);
}
public DarienKingOfKjeldorTriggeredAbility(final DarienKingOfKjeldorTriggeredAbility ability) {
super(ability);
}
@Override
public DarienKingOfKjeldorTriggeredAbility copy() {
return new DarienKingOfKjeldorTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever you are dealt damage, you may put that many 1/1 white Soldier creature tokens onto the battlefield.";
}
}
class DarienKingOfKjeldorEffect extends OneShotEffect<DarienKingOfKjeldorEffect> {
public DarienKingOfKjeldorEffect() {
super(Outcome.Benefit);
}
public DarienKingOfKjeldorEffect(final DarienKingOfKjeldorEffect effect) {
super(effect);
}
@Override
public DarienKingOfKjeldorEffect copy() {
return new DarienKingOfKjeldorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int damage = (Integer) this.getValue("damageAmount");
return new CreateTokenEffect(new SoldierToken(), damage).apply(game, source);
}
return false;
}
}

View file

@ -31,17 +31,14 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.MyTurnBeforeAttackersDeclaredCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TurnPhase;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.turn.Phase;
import mage.target.common.TargetCardInYourGraveyard;
/**
@ -75,30 +72,3 @@ public class HuaTuoHonoredPhysician extends CardImpl<HuaTuoHonoredPhysician> {
return new HuaTuoHonoredPhysician(this);
}
}
class MyTurnBeforeAttackersDeclaredCondition implements Condition {
private static MyTurnBeforeAttackersDeclaredCondition fInstance = new MyTurnBeforeAttackersDeclaredCondition();
public static Condition getInstance() {
return fInstance;
}
@Override
public boolean apply(Game game, Ability source) {
if (game.getActivePlayerId().equals(source.getControllerId())) {
TurnPhase turnPhase = game.getTurn().getPhase().getType();
if (turnPhase.equals(TurnPhase.BEGINNING) || turnPhase.equals(TurnPhase.PRECOMBAT_MAIN)) {
return true;
}
if (turnPhase.equals(TurnPhase.COMBAT)) {
return !game.getTurn().isDeclareAttackersStepStarted();
}
}
return false;
}
@Override
public String toString() {
return "during your turn, before attackers are declared";
}
}

View file

@ -133,12 +133,11 @@ class VizkopaConfessorEffect extends OneShotEffect<VizkopaConfessorEffect> {
targetInHand.setRequired(true);
if (!revealedCards.isEmpty()) {
targetPlayer.revealCards("Vizkopa Confessor", revealedCards, game);
targetPlayer.revealCards(sourceCard.getName(), revealedCards, game);
controller.chooseTarget(Outcome.Exile, revealedCards, targetInHand, source, game);
Card card = revealedCards.get(targetInHand.getFirstTarget(), game);
if (card != null) {
card.moveToExile(null, null, source.getSourceId(), game);
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": Exiled card ").append(card.getName()).toString());
controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.HAND);
}
}
return true;

View file

@ -0,0 +1,79 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author LevelX2
*/
public class CaptainSisay extends CardImpl<CaptainSisay> {
private static final FilterCard filter = new FilterCard("legendary card");
static {
filter.add(new SupertypePredicate("Legendary"));
}
public CaptainSisay(UUID ownerId) {
super(ownerId, 237, "Captain Sisay", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
this.expansionSetCode = "INV";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Soldier");
this.color.setGreen(true);
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {tap}: Search your library for a legendary card, reveal that card, and put it into your hand. Then shuffle your library.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), new TapSourceCost()));
}
public CaptainSisay(final CaptainSisay card) {
super(card);
}
@Override
public CaptainSisay copy() {
return new CaptainSisay(this);
}
}

View file

@ -0,0 +1,78 @@
/*
* 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.lorwyn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.HideawayPlayEffect;
import mage.abilities.keyword.HideawayAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
/**
*
* @author LevelX2
*/
public class HowltoothHollow extends CardImpl<HowltoothHollow> {
public HowltoothHollow(UUID ownerId) {
super(ownerId, 269, "Howltooth Hollow", Rarity.RARE, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "LRW";
// Hideaway
this.addAbility(new HideawayAbility(this));
// {tap}: Add {B} to your mana pool.
this.addAbility(new BlackManaAbility());
// {B}, {tap}: You may play the exiled card without paying its mana cost if each player has no cards in hand.
Ability ability = new ActivateIfConditionActivatedAbility(
Zone.BATTLEFIELD,
new HideawayPlayEffect(),
new ManaCostsImpl("{B}"),
new CardsInHandCondition(CardsInHandCondition.CountType.EQUAL_TO, 0, null, TargetController.ANY));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public HowltoothHollow(final HowltoothHollow card) {
super(card);
}
@Override
public HowltoothHollow copy() {
return new HowltoothHollow(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.ninthedition;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class Blackmail extends mage.sets.onslaught.Blackmail {
public Blackmail(UUID ownerId) {
super(ownerId);
this.cardNumber = 115;
this.expansionSetCode = "9ED";
}
public Blackmail(final Blackmail card) {
super(card);
}
@Override
public Blackmail copy() {
return new Blackmail(this);
}
}

View file

@ -0,0 +1,63 @@
/*
* 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.onslaught;
import java.util.UUID;
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.target.TargetPlayer;
/**
*
* @author LevelX2
*/
public class Blackmail extends CardImpl<Blackmail> {
public Blackmail(UUID ownerId) {
super(ownerId, 127, "Blackmail", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}");
this.expansionSetCode = "ONS";
this.color.setBlack(true);
// Target player reveals three cards from his or her hand and you choose one of them. That player discards that card.
this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(TargetController.ANY, 3));
this.getSpellAbility().addTarget(new TargetPlayer(true));
}
public Blackmail(final Blackmail card) {
super(card);
}
@Override
public Blackmail copy() {
return new Blackmail(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.portalthreekingdoms;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.condition.common.MyTurnBeforeAttackersDeclaredCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DiscardTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetOpponent;
/**
*
* @author LevelX2
*/
public class CaoCaoLordOfWei extends CardImpl<CaoCaoLordOfWei> {
public CaoCaoLordOfWei(UUID ownerId) {
super(ownerId, 68, "Cao Cao, Lord of Wei", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.expansionSetCode = "PTK";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Soldier");
this.color.setBlack(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// {tap}: Target opponent discards two cards. Activate this ability only during your turn, before attackers are declared.
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(2), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.getInstance());
ability.addTarget(new TargetOpponent(true));
this.addAbility(ability);
}
public CaoCaoLordOfWei(final CaoCaoLordOfWei card) {
super(card);
}
@Override
public CaoCaoLordOfWei copy() {
return new CaoCaoLordOfWei(this);
}
}

View file

@ -0,0 +1,174 @@
/*
* 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.portalthreekingdoms;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.condition.common.MyTurnBeforeAttackersDeclaredCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
/**
*
* @author LevelX2
*/
public class DiaochanArtfulBeauty extends CardImpl<DiaochanArtfulBeauty> {
public DiaochanArtfulBeauty(UUID ownerId) {
super(ownerId, 108, "Diaochan, Artful Beauty", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "PTK";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Advisor");
this.color.setRed(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {tap}: Destroy target creature of your choice, then destroy target creature of an opponent's choice. Activate this ability only during your turn, before attackers are declared.
Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiaochanArtfulBeautyDestroyEffect(), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.getInstance());
ability.addTarget(new TargetCreaturePermanent(true));
ability.addTarget(new TargetOpponentsChoiceCreaturePermanent());
this.addAbility(ability);
}
public DiaochanArtfulBeauty(final DiaochanArtfulBeauty card) {
super(card);
}
@Override
public DiaochanArtfulBeauty copy() {
return new DiaochanArtfulBeauty(this);
}
}
class DiaochanArtfulBeautyDestroyEffect extends OneShotEffect<DiaochanArtfulBeautyDestroyEffect> {
public DiaochanArtfulBeautyDestroyEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Destroy target creature of your choice, then destroy target creature of an opponent's choice";
}
public DiaochanArtfulBeautyDestroyEffect(final DiaochanArtfulBeautyDestroyEffect effect) {
super(effect);
}
@Override
public DiaochanArtfulBeautyDestroyEffect copy() {
return new DiaochanArtfulBeautyDestroyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent firstTarget = game.getPermanent(source.getFirstTarget());
if (firstTarget != null) {
firstTarget.destroy(source.getSourceId(), game, false);
}
Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (secondTarget != null) {
secondTarget.destroy(source.getSourceId(), game, false);
}
return true;
}
return false;
}
}
class TargetOpponentsChoiceCreaturePermanent extends TargetPermanent<TargetOpponentsChoiceCreaturePermanent> {
private UUID opponentId = null;
public TargetOpponentsChoiceCreaturePermanent() {
super(1, 1, new FilterCreaturePermanent(), false);
this.setRequired(true);
this.targetName = filter.getMessage();
}
public TargetOpponentsChoiceCreaturePermanent(final TargetOpponentsChoiceCreaturePermanent target) {
super(target);
this.opponentId = target.opponentId;
}
@Override
public boolean canTarget(UUID controllerId, UUID id, UUID sourceId, Game game, boolean flag) {
if (opponentId != null) {
return super.canTarget(opponentId, id, sourceId, game, flag);
}
return false;
}
@Override
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
if (opponentId != null) {
return super.canTarget(opponentId, id, source, game);
}
return false;
}
@Override
public boolean chooseTarget(Outcome outcome, UUID playerId, Ability source, Game game) {
return super.chooseTarget(outcome, getOpponentId(playerId, source, game), source, game);
}
@Override
public TargetOpponentsChoiceCreaturePermanent copy() {
return new TargetOpponentsChoiceCreaturePermanent(this);
}
private UUID getOpponentId(UUID playerId, Ability source, Game game) {
if (opponentId == null) {
TargetOpponent target = new TargetOpponent(true);
Player player = game.getPlayer(playerId);
if (player != null) {
if (player.chooseTarget(Outcome.Detriment, target, source, game)) {
opponentId = target.getFirstTarget();
}
}
}
return opponentId;
}
}

View file

@ -27,32 +27,31 @@
*/
package mage.sets.worldwake;
import java.util.List;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.filter.FilterCard;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.TargetPlayer;
import mage.target.common.TargetCardInHand;
/**
*
* @author jeffwadsworth
*/
public class MiresToll extends CardImpl<MiresToll> {
private static final FilterLandPermanent filter = new FilterLandPermanent("the number of Swamps you control");
static {
filter.add(new SubtypePredicate("Swamp"));
filter.add(new ControllerPredicate(TargetController.YOU));
}
public MiresToll(UUID ownerId) {
super(ownerId, 60, "Mire's Toll", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}");
this.expansionSetCode = "WWK";
@ -60,8 +59,8 @@ public class MiresToll extends CardImpl<MiresToll> {
this.color.setBlack(true);
// Target player reveals a number of cards from his or her hand equal to the number of Swamps you control. You choose one of them. That player discards that card.
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new MiresTollEffect());
this.getSpellAbility().addTarget(new TargetPlayer(true));
this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(TargetController.ANY, new PermanentsOnBattlefieldCount(filter)));
}
@ -74,70 +73,3 @@ public class MiresToll extends CardImpl<MiresToll> {
return new MiresToll(this);
}
}
class MiresTollEffect extends OneShotEffect<MiresTollEffect> {
private static final FilterLandPermanent filter = new FilterLandPermanent("Swamps");
static {
filter.add(new SubtypePredicate("Swamp"));
filter.add(new ControllerPredicate(TargetController.YOU));
}
public MiresTollEffect() {
super(Outcome.Discard);
staticText = "Target player reveals a number of cards from his or her hand equal to the number of Swamps you control. You choose one of them. That player discards that card";
}
public MiresTollEffect(final MiresTollEffect effect) {
super(effect);
}
@Override
public MiresTollEffect copy() {
return new MiresTollEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
int swamps = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (swamps > 0 && targetPlayer != null) {
Cards revealedCards = new CardsImpl(Zone.PICK);
int amount = Math.min(targetPlayer.getHand().size(), swamps);
FilterCard filter = new FilterCard("card in target player's hand");
TargetCardInHand chosenCards = new TargetCardInHand(amount, amount, filter);
chosenCards.setRequired(true);
chosenCards.setNotTarget(true);
if (chosenCards.canChoose(targetPlayer.getId(), game) && targetPlayer.choose(Outcome.Discard, targetPlayer.getHand(), chosenCards, game)) {
if (!chosenCards.getTargets().isEmpty()) {
List<UUID> targets = chosenCards.getTargets();
for (UUID targetid : targets) {
Card card = game.getCard(targetid);
if (card != null) {
revealedCards.add(card);
}
}
}
}
targetPlayer.revealCards("Mire's Toll", revealedCards, game);
Player you = game.getPlayer(source.getControllerId());
if (you != null) {
TargetCard yourChoice = new TargetCard(Zone.PICK, new FilterCard());
yourChoice.setRequired(true);
yourChoice.setNotTarget(true);
if (you.choose(Outcome.Benefit, revealedCards, yourChoice, game)) {
Card card = targetPlayer.getHand().get(yourChoice.getFirstTarget(), game);
if (card != null) {
return targetPlayer.discard(card, source, game);
}
}
}
}
return false;
}
}