1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-11 01:01:05 -09:00

Fixed Bolas's Citadel combo with adventure cards

This commit is contained in:
Oleg Agafonov 2019-12-14 18:51:35 +04:00
parent d271feb0cb
commit c9ea0f1877
2 changed files with 7 additions and 11 deletions
Mage.Sets/src/mage/cards/b
Mage.Tests/src/test/java/org/mage/test/cards/cost/alternate

View file

@ -96,15 +96,14 @@ class BolassCitadelPlayTheTopCardEffect extends AsThoughEffectImpl {
@Override
public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID playerId) {
Card cardOnTop = game.getCard(objectId);
if (cardOnTop == null) {
return false;
}
if (playerId.equals(source.getControllerId())
&& cardOnTop.isOwnedBy(source.getControllerId())) {
Player controller = game.getPlayer(cardOnTop.getOwnerId());
Card cardToCheck = game.getCard(objectId);
objectId = game.getCard(objectId).getMainCard().getId(); // for split cards
if (playerId.equals(source.getControllerId()) && cardToCheck.isOwnedBy(source.getControllerId())) {
Player controller = game.getPlayer(cardToCheck.getOwnerId());
if (controller != null
&& cardOnTop.equals(controller.getLibrary().getFromTop(game))) {
&& controller.getLibrary().getFromTop(game) != null
&& objectId.equals(controller.getLibrary().getFromTop(game).getId())) {
if (affectedAbility instanceof ActivatedAbility) {
ActivatedAbility activatedAbility = (ActivatedAbility) affectedAbility;
// add the life cost first

View file

@ -32,7 +32,6 @@ public class BolassCitadelTest extends CardTestPlayerBase {
}
@Test
@Ignore("This is broken for now.")
public void testCastAdventure() {
/*
* Curious Pair {1}{G}
@ -44,7 +43,6 @@ public class BolassCitadelTest extends CardTestPlayerBase {
* Create a Food token.
*/
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Forest");
addCard(Zone.BATTLEFIELD, playerA, "Bolas's Citadel");
removeAllCardsFromLibrary(playerA);
addCard(Zone.LIBRARY, playerA, "Curious Pair");
@ -54,7 +52,6 @@ public class BolassCitadelTest extends CardTestPlayerBase {
execute();
assertAllCommandsUsed();
assertTapped("Forest", false);
assertHandCount(playerA, 0);
assertPermanentCount(playerA, "Food", 1);
assertExileCount(playerA, "Curious Pair", 1);