mirror of
https://github.com/correl/mage.git
synced 2024-11-25 11:09:53 +00:00
fixed interactions between effects which replace a token and effects which care about tokens after they've been made
This commit is contained in:
parent
0540557455
commit
676c3a8bb4
2 changed files with 31 additions and 7 deletions
|
@ -9,7 +9,6 @@ import org.junit.Test;
|
||||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author luziferius
|
* @author luziferius
|
||||||
*/
|
*/
|
||||||
public class DivineVisitationTest extends CardTestPlayerBase {
|
public class DivineVisitationTest extends CardTestPlayerBase {
|
||||||
|
@ -78,4 +77,21 @@ public class DivineVisitationTest extends CardTestPlayerBase {
|
||||||
assertNotSubtype("Angel Token", SubType.GOBLIN);
|
assertNotSubtype("Angel Token", SubType.GOBLIN);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSacrificeEOT() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Divine Visitation");
|
||||||
|
addCard(Zone.HAND, playerA, "Thatcher Revolt");
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thatcher Revolt");
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Human Token", 0);
|
||||||
|
assertPermanentCount(playerA, "Angel Token", 0);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -238,6 +238,14 @@ public abstract class TokenImpl extends MageObjectImpl implements Token {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
putOntoBattlefieldHelper(event, game, source, tapped, attacking, attackedPlayer, created);
|
putOntoBattlefieldHelper(event, game, source, tapped, attacking, attackedPlayer, created);
|
||||||
|
event.getTokens()
|
||||||
|
.keySet()
|
||||||
|
.stream()
|
||||||
|
.map(Token::getLastAddedTokenIds)
|
||||||
|
.flatMap(Collection::stream)
|
||||||
|
.distinct()
|
||||||
|
.filter(uuid -> !this.lastAddedTokenIds.contains(uuid))
|
||||||
|
.forEach(this.lastAddedTokenIds::add);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue