mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Added Sadistic Augermage, Rings of Brighthearth, Whipcorder, Gilded Drake.
This commit is contained in:
parent
1241f6582b
commit
8de37b2bfa
7 changed files with 527 additions and 1 deletions
|
@ -128,7 +128,8 @@ class WidespreadPanicEffect extends OneShotEffect {
|
|||
shuffler.choose(Outcome.Detriment, target, source.getSourceId(), game);
|
||||
Card card = shuffler.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
return card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
shuffler.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
113
Mage.Sets/src/mage/sets/jacevsvraska/SadisticAugermage.java
Normal file
113
Mage.Sets/src/mage/sets/jacevsvraska/SadisticAugermage.java
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* 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.jacevsvraska;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
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.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SadisticAugermage extends CardImpl {
|
||||
|
||||
public SadisticAugermage(UUID ownerId) {
|
||||
super(ownerId, 52, "Sadistic Augermage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}");
|
||||
this.expansionSetCode = "DDM";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Wizard");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// When Sadistic Augermage dies, each player puts a card from his or her hand on top of his or her library.
|
||||
this.getSpellAbility().addEffect(null);
|
||||
}
|
||||
|
||||
public SadisticAugermage(final SadisticAugermage card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SadisticAugermage copy() {
|
||||
return new SadisticAugermage(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WidespreadPanicEffect extends OneShotEffect {
|
||||
|
||||
public WidespreadPanicEffect() {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "each player puts a card from his or her hand on top of his or her library";
|
||||
}
|
||||
|
||||
public WidespreadPanicEffect(final WidespreadPanicEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WidespreadPanicEffect copy() {
|
||||
return new WidespreadPanicEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId: controller.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.getHand().size() > 0) {
|
||||
TargetCardInHand target = new TargetCardInHand();
|
||||
target.setTargetName("a card from your hand to put on top of your library");
|
||||
player.choose(Outcome.Detriment, target, source.getSourceId(), game);
|
||||
Card card = player.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
154
Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java
Normal file
154
Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java
Normal file
|
@ -0,0 +1,154 @@
|
|||
/*
|
||||
* 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.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.mana.ManaAbility;
|
||||
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.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.StackAbility;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class RingsOfBrighthearth extends CardImpl {
|
||||
|
||||
public RingsOfBrighthearth(UUID ownerId) {
|
||||
super(ownerId, 259, "Rings of Brighthearth", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
this.expansionSetCode = "LRW";
|
||||
|
||||
// Whenever you activate an ability, if it isn't a mana ability, you may pay {2}. If you do, copy that ability. You may choose new targets for the copy.
|
||||
this.addAbility(new RingsOfBrighthearthTriggeredAbility());
|
||||
}
|
||||
|
||||
public RingsOfBrighthearth(final RingsOfBrighthearth card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RingsOfBrighthearth copy() {
|
||||
return new RingsOfBrighthearth(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
RingsOfBrighthearthTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new RingsOfBrighthearthEffect(), false);
|
||||
}
|
||||
|
||||
RingsOfBrighthearthTriggeredAbility(final RingsOfBrighthearthTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RingsOfBrighthearthTriggeredAbility copy() {
|
||||
return new RingsOfBrighthearthTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.ACTIVATED_ABILITY) {
|
||||
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
|
||||
if (!(stackAbility.getStackAbility() instanceof ManaAbility)) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setValue("stackAbility", stackAbility.getStackAbility());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you activate an ability, if it isn't a mana ability, you may pay {2}. If you do, copy that ability. You may choose new targets for the copy.";
|
||||
}
|
||||
}
|
||||
|
||||
class RingsOfBrighthearthEffect extends OneShotEffect {
|
||||
|
||||
RingsOfBrighthearthEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = ", you may pay {2}. If you do, copy that ability. You may choose new targets for the copy.";
|
||||
}
|
||||
|
||||
RingsOfBrighthearthEffect(final RingsOfBrighthearthEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RingsOfBrighthearthEffect copy() {
|
||||
return new RingsOfBrighthearthEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
ManaCostsImpl cost = new ManaCostsImpl("{2}");
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "? If you do, copy that ability. You may choose new targets for the copy.", game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
|
||||
Ability ability = (Ability) getValue("stackAbility");
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (ability != null && controller != null) {
|
||||
Ability newAbility = ability.copy();
|
||||
newAbility.newId();
|
||||
game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
|
||||
if (newAbility.getTargets().size() > 0) {
|
||||
if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
|
||||
newAbility.getTargets().clearChosen();
|
||||
if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(controller.getName()).append(" copied activated ability").toString());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
78
Mage.Sets/src/mage/sets/onslaught/Whipcorder.java
Normal file
78
Mage.Sets/src/mage/sets/onslaught/Whipcorder.java
Normal 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.onslaught;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.keyword.MorphAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class Whipcorder extends CardImpl {
|
||||
|
||||
public Whipcorder(UUID ownerId) {
|
||||
super(ownerId, 60, "Whipcorder", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}");
|
||||
this.expansionSetCode = "ONS";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Soldier");
|
||||
this.subtype.add("Rebel");
|
||||
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// {W}, {tap}: Tap target creature.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{W}"));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
// Morph {W}
|
||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{W}")));
|
||||
}
|
||||
|
||||
public Whipcorder(final Whipcorder card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Whipcorder copy() {
|
||||
return new Whipcorder(this);
|
||||
}
|
||||
}
|
52
Mage.Sets/src/mage/sets/ravnika/SadisticAugermage.java
Normal file
52
Mage.Sets/src/mage/sets/ravnika/SadisticAugermage.java
Normal 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.ravnika;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SadisticAugermage extends mage.sets.jacevsvraska.SadisticAugermage {
|
||||
|
||||
public SadisticAugermage(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 103;
|
||||
this.expansionSetCode = "RAV";
|
||||
}
|
||||
|
||||
public SadisticAugermage(final SadisticAugermage card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SadisticAugermage copy() {
|
||||
return new SadisticAugermage(this);
|
||||
}
|
||||
}
|
126
Mage.Sets/src/mage/sets/urzassaga/GildedDrake.java
Normal file
126
Mage.Sets/src/mage/sets/urzassaga/GildedDrake.java
Normal file
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
* 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.urzassaga;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.ExchangeControlTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class GildedDrake extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||
}
|
||||
|
||||
public GildedDrake(UUID ownerId) {
|
||||
super(ownerId, 76, "Gilded Drake", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||
this.expansionSetCode = "USG";
|
||||
this.subtype.add("Drake");
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Gilded Drake enters the battlefield, exchange control of Gilded Drake and up to one target creature an opponent controls. If you don't make an exchange, sacrifice Gilded Drake. This ability can't be countered except by spells and abilities.
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new GildedDrakeEffect());
|
||||
ability.addTarget(new TargetCreaturePermanent(0,1,filter, false));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public GildedDrake(final GildedDrake card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GildedDrake copy() {
|
||||
return new GildedDrake(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GildedDrakeEffect extends OneShotEffect {
|
||||
|
||||
public GildedDrakeEffect() {
|
||||
super(Outcome.GainControl);
|
||||
this.staticText = "exchange control of {this} and up to one target creature an opponent controls. If you don't make an exchange, sacrifice {this}. This ability can't be countered except by spells and abilities";
|
||||
}
|
||||
|
||||
public GildedDrakeEffect(final GildedDrakeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GildedDrakeEffect copy() {
|
||||
return new GildedDrakeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
Permanent targetPermanent = null;
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (targetPointer.getFirst(game, source) != null) {
|
||||
targetPermanent = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (targetPermanent != null) {
|
||||
ContinuousEffect effect = new ExchangeControlTargetEffect(Duration.EndOfGame, "", true);
|
||||
effect.setTargetPointer(targetPointer);
|
||||
game.addEffect(effect, source);
|
||||
} else {
|
||||
sourceObject.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -81,11 +81,13 @@ public class PutOnLibraryTargetEffect extends OneShotEffect {
|
|||
if (permanent != null) {
|
||||
result |= controller.moveCardToLibraryWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD, onTop, true);
|
||||
}
|
||||
break;
|
||||
case GRAVEYARD:
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null && game.getState().getZone(targetId).equals(Zone.GRAVEYARD)) {
|
||||
result |= controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, onTop, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue