mirror of
https://github.com/correl/mage.git
synced 2024-12-27 11:07:39 +00:00
NPH - Chancellor of the Annex, Chancellor of the Spires
This commit is contained in:
parent
f5164fa526
commit
ceb54518ed
7 changed files with 405 additions and 3 deletions
138
Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java
Normal file
138
Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
/*
|
||||||
|
* 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.newphyrexia;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.Constants.CardType;
|
||||||
|
import mage.Constants.Outcome;
|
||||||
|
import mage.Constants.Rarity;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.DelayedTriggeredAbility;
|
||||||
|
import mage.abilities.common.ChancellorAbility;
|
||||||
|
import mage.abilities.common.OpponentCastsSpellTriggeredAbility;
|
||||||
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.CounterUnlessPaysEffect;
|
||||||
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author BetaSteward
|
||||||
|
*/
|
||||||
|
public class ChancellorOfTheAnnex extends CardImpl<ChancellorOfTheAnnex> {
|
||||||
|
|
||||||
|
public ChancellorOfTheAnnex(UUID ownerId) {
|
||||||
|
super(ownerId, 6, "Chancellor of the Annex", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}{W}");
|
||||||
|
this.expansionSetCode = "NPH";
|
||||||
|
this.subtype.add("Angel");
|
||||||
|
|
||||||
|
this.color.setWhite(true);
|
||||||
|
this.power = new MageInt(5);
|
||||||
|
this.toughness = new MageInt(6);
|
||||||
|
|
||||||
|
// You may reveal this card from your opening hand. If you do, when each opponent casts his or her first spell of the game, counter that spell unless that player pays {1}.
|
||||||
|
this.addAbility(new ChancellorAbility(new ChancellorOfTheAnnexEffect()));
|
||||||
|
|
||||||
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
|
// Whenever an opponent casts a spell, counter it unless that player pays {1}.
|
||||||
|
this.addAbility(new OpponentCastsSpellTriggeredAbility(new CounterUnlessPaysEffect(new GenericManaCost(1)), false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChancellorOfTheAnnex(final ChancellorOfTheAnnex card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChancellorOfTheAnnex copy() {
|
||||||
|
return new ChancellorOfTheAnnex(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChancellorOfTheAnnexEffect extends OneShotEffect<ChancellorOfTheAnnexEffect> {
|
||||||
|
|
||||||
|
public ChancellorOfTheAnnexEffect () {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "when each opponent casts his or her first spell of the game, counter that spell unless that player pays {1}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChancellorOfTheAnnexEffect(ChancellorOfTheAnnexEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||||
|
DelayedTriggeredAbility ability = new ChancellorOfTheAnnexDelayedTriggeredAbility(opponentId);
|
||||||
|
ability.setSourceId(source.getSourceId());
|
||||||
|
ability.setControllerId(source.getControllerId());
|
||||||
|
game.addDelayedTriggeredAbility(ability);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChancellorOfTheAnnexEffect copy() {
|
||||||
|
return new ChancellorOfTheAnnexEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChancellorOfTheAnnexDelayedTriggeredAbility extends DelayedTriggeredAbility<ChancellorOfTheAnnexDelayedTriggeredAbility> {
|
||||||
|
|
||||||
|
private UUID playerId;
|
||||||
|
|
||||||
|
ChancellorOfTheAnnexDelayedTriggeredAbility (UUID playerId) {
|
||||||
|
super(new CounterUnlessPaysEffect(new GenericManaCost(1)));
|
||||||
|
this.playerId = playerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
ChancellorOfTheAnnexDelayedTriggeredAbility(ChancellorOfTheAnnexDelayedTriggeredAbility ability) {
|
||||||
|
super(ability);
|
||||||
|
this.playerId = ability.playerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(playerId)) {
|
||||||
|
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChancellorOfTheAnnexDelayedTriggeredAbility copy() {
|
||||||
|
return new ChancellorOfTheAnnexDelayedTriggeredAbility(this);
|
||||||
|
}
|
||||||
|
}
|
156
Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java
Normal file
156
Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java
Normal file
|
@ -0,0 +1,156 @@
|
||||||
|
/*
|
||||||
|
* 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.newphyrexia;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.Constants.CardType;
|
||||||
|
import mage.Constants.Outcome;
|
||||||
|
import mage.Constants.Rarity;
|
||||||
|
import mage.Constants.Zone;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.DelayedTriggeredAbility;
|
||||||
|
import mage.abilities.common.ChancellorAbility;
|
||||||
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.PlayTargetWithoutPayingManaEffect;
|
||||||
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.filter.Filter.ComparisonScope;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.common.TargetCardInOpponentsGraveyard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author BetaSteward
|
||||||
|
*/
|
||||||
|
public class ChancellorOfTheSpires extends CardImpl<ChancellorOfTheSpires> {
|
||||||
|
|
||||||
|
private static final String abilityText = "at the beginning of the first upkeep, each opponent puts the top seven cards of his or her library into his or her graveyard";
|
||||||
|
|
||||||
|
private static final FilterCard filter = new FilterCard("instant or sorcery card");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.getCardType().add(CardType.INSTANT);
|
||||||
|
filter.getCardType().add(CardType.SORCERY);
|
||||||
|
filter.setScopeCardType(ComparisonScope.Any);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChancellorOfTheSpires(UUID ownerId) {
|
||||||
|
super(ownerId, 31, "Chancellor of the Spires", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}{U}{U}");
|
||||||
|
this.expansionSetCode = "NPH";
|
||||||
|
this.subtype.add("Sphinx");
|
||||||
|
|
||||||
|
this.color.setBlue(true);
|
||||||
|
this.power = new MageInt(5);
|
||||||
|
this.toughness = new MageInt(7);
|
||||||
|
|
||||||
|
// You may reveal this card from your opening hand. If you do, at the beginning of the first upkeep, each opponent puts the top seven cards of his or her library into his or her graveyard.
|
||||||
|
this.addAbility(new ChancellorAbility(new ChancellorOfTheSpiresDelayedTriggeredAbility(), abilityText));
|
||||||
|
|
||||||
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
|
// When Chancellor of the Spires enters the battlefield, you may cast target instant or sorcery card from an opponent's graveyard without paying its mana cost.
|
||||||
|
Ability ability = new EntersBattlefieldTriggeredAbility(new PlayTargetWithoutPayingManaEffect(), true);
|
||||||
|
ability.addTarget(new TargetCardInOpponentsGraveyard(filter));
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChancellorOfTheSpires(final ChancellorOfTheSpires card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChancellorOfTheSpires copy() {
|
||||||
|
return new ChancellorOfTheSpires(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChancellorOfTheSpiresDelayedTriggeredAbility extends DelayedTriggeredAbility<ChancellorOfTheSpiresDelayedTriggeredAbility> {
|
||||||
|
|
||||||
|
ChancellorOfTheSpiresDelayedTriggeredAbility () {
|
||||||
|
super(new ChancellorOfTheSpiresEffect());
|
||||||
|
}
|
||||||
|
|
||||||
|
ChancellorOfTheSpiresDelayedTriggeredAbility(ChancellorOfTheSpiresDelayedTriggeredAbility ability) {
|
||||||
|
super(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public ChancellorOfTheSpiresDelayedTriggeredAbility copy() {
|
||||||
|
return new ChancellorOfTheSpiresDelayedTriggeredAbility(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChancellorOfTheSpiresEffect extends OneShotEffect<ChancellorOfTheSpiresEffect> {
|
||||||
|
|
||||||
|
ChancellorOfTheSpiresEffect () {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "each opponent puts the top seven cards of his or her library into his or her graveyard";
|
||||||
|
}
|
||||||
|
|
||||||
|
ChancellorOfTheSpiresEffect(ChancellorOfTheSpiresEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||||
|
Player player = game.getPlayer(opponentId);
|
||||||
|
if (player != null) {
|
||||||
|
int cardsCount = Math.min(7, player.getLibrary().size());
|
||||||
|
for (int i = 0; i < cardsCount; i++) {
|
||||||
|
Card card = player.getLibrary().removeFromTop(game);
|
||||||
|
if (card != null)
|
||||||
|
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ChancellorOfTheSpiresEffect copy() {
|
||||||
|
return new ChancellorOfTheSpiresEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -45,6 +45,10 @@ public class ChancellorAbility extends StaticAbility<ChancellorAbility> {
|
||||||
super(Zone.HAND, new ChancellorEffect(ability, text));
|
super(Zone.HAND, new ChancellorEffect(ability, text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ChancellorAbility(OneShotEffect effect) {
|
||||||
|
super(Zone.HAND, effect);
|
||||||
|
}
|
||||||
|
|
||||||
public ChancellorAbility(final ChancellorAbility ability) {
|
public ChancellorAbility(final ChancellorAbility ability) {
|
||||||
super(ability);
|
super(ability);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2011 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.abilities.common;
|
||||||
|
|
||||||
|
import mage.Constants.Zone;
|
||||||
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.stack.Spell;
|
||||||
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
*/
|
||||||
|
public class OpponentCastsSpellTriggeredAbility extends TriggeredAbilityImpl<OpponentCastsSpellTriggeredAbility> {
|
||||||
|
private static final FilterCard spellCard = new FilterCard("a spell");
|
||||||
|
protected FilterCard filter;
|
||||||
|
|
||||||
|
public OpponentCastsSpellTriggeredAbility(Effect effect, boolean optional) {
|
||||||
|
this(effect, spellCard, optional);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpponentCastsSpellTriggeredAbility(Effect effect, FilterCard filter, boolean optional) {
|
||||||
|
super(Zone.BATTLEFIELD, effect, optional);
|
||||||
|
this.filter = filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OpponentCastsSpellTriggeredAbility(final OpponentCastsSpellTriggeredAbility ability) {
|
||||||
|
super(ability);
|
||||||
|
filter = ability.filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
if (event.getType() == GameEvent.EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) {
|
||||||
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
|
if (spell != null && filter.match(spell)) {
|
||||||
|
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule() {
|
||||||
|
return "Whenever an opponent casts " + filter.getMessage() + ", " + super.getRule();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OpponentCastsSpellTriggeredAbility copy() {
|
||||||
|
return new OpponentCastsSpellTriggeredAbility(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -62,7 +62,7 @@ public class CounterUnlessPaysEffect extends OneShotEffect<CounterUnlessPaysEffe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
StackObject spell = game.getStack().getStackObject(source.getFirstTarget());
|
StackObject spell = game.getStack().getStackObject(targetPointer.getFirst(source));
|
||||||
if (spell != null) {
|
if (spell != null) {
|
||||||
Player player = game.getPlayer(spell.getControllerId());
|
Player player = game.getPlayer(spell.getControllerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
@ -77,7 +77,15 @@ public class CounterUnlessPaysEffect extends OneShotEffect<CounterUnlessPaysEffe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText(Mode mode) {
|
public String getText(Mode mode) {
|
||||||
return "Counter target " + mode.getTargets().get(0).getTargetName() + " unless its controller pays " + cost.getText();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
if (mode.getTargets().size() == 0) {
|
||||||
|
sb.append("counter it");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sb.append("Counter target ").append(mode.getTargets().get(0).getTargetName());
|
||||||
|
}
|
||||||
|
sb.append(" unless its controller pays ").append(cost.getText());
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,12 +29,14 @@
|
||||||
package mage.abilities.effects.common;
|
package mage.abilities.effects.common;
|
||||||
|
|
||||||
import mage.Constants.Outcome;
|
import mage.Constants.Outcome;
|
||||||
|
import mage.Constants.Zone;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
import mage.target.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -67,6 +69,16 @@ public class PlayTargetWithoutPayingManaEffect extends OneShotEffect<PlayTargetW
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText(Mode mode) {
|
public String getText(Mode mode) {
|
||||||
return "you may put " + mode.getTargets().get(0).getTargetName() + " from your hand onto the battlefield";
|
StringBuilder sb = new StringBuilder();
|
||||||
|
if (mode.getTargets().size() > 0) {
|
||||||
|
Target target = mode.getTargets().get(0);
|
||||||
|
if (mode.getTargets().get(0).getZone() == Zone.HAND) {
|
||||||
|
sb.append("you may put ").append(target.getTargetName()).append(" from your hand onto the battlefield");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sb.append("you may cast target ").append(target.getTargetName()).append(" without paying its mana cost");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
||||||
public Spell(Card card, SpellAbility ability, UUID controllerId) {
|
public Spell(Card card, SpellAbility ability, UUID controllerId) {
|
||||||
this.card = card;
|
this.card = card;
|
||||||
this.ability = ability;
|
this.ability = ability;
|
||||||
|
this.ability.setControllerId(controllerId);
|
||||||
this.controllerId = controllerId;
|
this.controllerId = controllerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue