mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Banisher Priest - Fixed a bug that if Banisher Priest was copied by a token, the target creature exiled by the token did not return as the token left the battlefield.
This commit is contained in:
parent
f7651f7d38
commit
fce95b2fde
3 changed files with 50 additions and 6 deletions
|
@ -28,9 +28,6 @@
|
|||
package mage.sets.darkascension;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
|
@ -39,7 +36,9 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
|
|
|
@ -30,6 +30,7 @@ package mage.sets.magic2014;
|
|||
import java.util.LinkedList;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
@ -176,13 +177,13 @@ class ReturnExiledCreatureEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ExileZone exile = game.getExile().getExileZone(source.getSourceId());
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (exile != null && sourceCard != null) {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (exile != null && sourceObject != null) {
|
||||
LinkedList<UUID> cards = new LinkedList<>(exile);
|
||||
for (UUID cardId : cards) {
|
||||
Card card = game.getCard(cardId);
|
||||
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
|
||||
game.informPlayers(new StringBuilder(sourceCard.getName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
|
||||
game.informPlayers(new StringBuilder(sourceObject.getLogName()).append(": ").append(card.getName()).append(" returns to battlefield from exile").toString());
|
||||
}
|
||||
exile.clear();
|
||||
return true;
|
||||
|
|
|
@ -105,5 +105,49 @@ public class BanisherPriestTest extends CardTestPlayerBase {
|
|||
// check that returning Rockslide Elemental did not get a +1/+1 counter from dying Banisher Priest
|
||||
assertPowerToughness(playerB, "Rockslide Elemental", 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Banisher Priest is removed from graveyard with Seance and
|
||||
* the target creature exiled with the token returns to the game, when
|
||||
* the token is exiled.
|
||||
*/
|
||||
@Test
|
||||
public void testBanisherPriestToken() {
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
|
||||
|
||||
/**
|
||||
* Banisher Priest
|
||||
* Creature — Human Cleric 2/2, 1WW
|
||||
* When Banisher Priest enters the battlefield, exile target creature an opponent controls until Banisher Priest leaves the battlefield.
|
||||
*/
|
||||
addCard(Zone.GRAVEYARD, playerB, "Banisher Priest");
|
||||
|
||||
/**
|
||||
* Seance {2}{W}{W}
|
||||
* Enchantment
|
||||
* At the beginning of each upkeep, you may exile target creature card from your graveyard.
|
||||
* If you do, put a token onto the battlefield that's a copy of that card except it's a
|
||||
* Spirit in addition to its other types. Exile it at the beginning of the next end step.
|
||||
*/
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Seance");
|
||||
playerB.addChoice("Banisher Priest"); // return the Banisher Priest from graveyard with Seance
|
||||
playerB.addChoice("Silvercoat Lion"); // Exile the Silvercoat Lion with the triggered ability of the Banisher Priest token
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
// Banisher Priest should be in exile
|
||||
assertExileCount("Banisher Priest", 1);
|
||||
// Token ceased to exist
|
||||
assertPermanentCount(playerB, "Banisher Priest", 0);
|
||||
// Silvercoat Lion should be back on battlefield
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue