mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
* Some minor chnages.
This commit is contained in:
parent
00dd941260
commit
d10d6361ac
5 changed files with 58 additions and 18 deletions
|
|
@ -137,7 +137,7 @@ class ContestedWarZoneEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString());
|
UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString());
|
||||||
if (permanent != null && controllerId != null) {
|
if (permanent != null && controllerId != null) {
|
||||||
return permanent.changeControllerId(controllerId, game);
|
return permanent.changeControllerId(controllerId, game);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ package org.mage.test.cards.abilities.keywords;
|
||||||
|
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
|
@ -512,4 +513,45 @@ public class FlashbackTest extends CardTestPlayerBase {
|
||||||
assertExileCount(playerA, dReturn, 1);
|
assertExileCount(playerA, dReturn, 1);
|
||||||
assertPermanentCount(playerA, bSable, 1);
|
assertPermanentCount(playerA, bSable, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* I can play Force of Will with flashback paying his alternative mana cost.
|
||||||
|
* The ruling say no to it, because we only can choose one alternative cost
|
||||||
|
* to a spell, and the flashback cost is already an alternative cost.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Ignore
|
||||||
|
public void testSnapcasterMageSpellWithAlternateCost() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||||
|
// When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn.
|
||||||
|
// The flashback cost is equal to its mana cost.
|
||||||
|
addCard(Zone.HAND, playerA, "Snapcaster Mage", 2); // Creature{1}{U}
|
||||||
|
|
||||||
|
// You may pay 1 life and exile a blue card from your hand rather than pay Force of Will's mana cost.
|
||||||
|
// Counter target spell.
|
||||||
|
addCard(Zone.GRAVEYARD, playerA, "Force of Will");
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage");
|
||||||
|
setChoice(playerA, "Force of Will");
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Snapcaster Mage");
|
||||||
|
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback", null, "Lightning Bolt");
|
||||||
|
addTarget(playerA, "Lightning Bolt");
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Snapcaster Mage", 0);
|
||||||
|
assertGraveyardCount(playerA, "Snapcaster Mage", 1);
|
||||||
|
|
||||||
|
assertGraveyardCount(playerA, "Force of Will", 1);
|
||||||
|
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||||
|
|
||||||
|
assertLife(playerA, 20);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,9 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
|
||||||
String mes = String.format("Select color of %d mana to add it to your mana pool", this.amount);
|
String mes = String.format("Select color of %d mana to add it to your mana pool", this.amount);
|
||||||
ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId()));
|
ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId()));
|
||||||
if (controller.choose(outcome, choice, game)) {
|
if (controller.choose(outcome, choice, game)) {
|
||||||
|
if (choice.getColor() == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Mana createdMana = choice.getMana(amount);
|
Mana createdMana = choice.getMana(amount);
|
||||||
if (createdMana != null) {
|
if (createdMana != null) {
|
||||||
checkToFirePossibleEvents(createdMana, game, source);
|
checkToFirePossibleEvents(createdMana, game, source);
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ import mage.constants.SubLayer;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class PlayLandsFromGraveyardEffect extends ContinuousEffectImpl {
|
public class PlayLandsFromGraveyardEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
public PlayLandsFromGraveyardEffect() {
|
public PlayLandsFromGraveyardEffect() {
|
||||||
|
|
@ -33,11 +31,10 @@ public class PlayLandsFromGraveyardEffect extends ContinuousEffectImpl {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
for (UUID cardId: player.getGraveyard()) {
|
for (Card card : player.getGraveyard().getCards(game)) {
|
||||||
Card card = game.getCard(cardId);
|
|
||||||
if (card != null && card.isLand()) {
|
if (card != null && card.isLand()) {
|
||||||
PlayLandFromGraveyardAbility ability = new PlayLandFromGraveyardAbility(card.getName());
|
PlayLandFromGraveyardAbility ability = new PlayLandFromGraveyardAbility(card.getName());
|
||||||
ability.setSourceId(cardId);
|
ability.setSourceId(card.getId());
|
||||||
ability.setControllerId(card.getOwnerId());
|
ability.setControllerId(card.getOwnerId());
|
||||||
game.getState().addOtherAbility(card, ability);
|
game.getState().addOtherAbility(card, ability);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,7 @@ package mage.game.draft;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.repository.CardCriteria;
|
|
||||||
import mage.cards.repository.CardInfo;
|
import mage.cards.repository.CardInfo;
|
||||||
import mage.cards.repository.CardRepository;
|
import mage.cards.repository.CardRepository;
|
||||||
import mage.util.RandomUtil;
|
import mage.util.RandomUtil;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue