This commit is contained in:
Kenny Wottrich 2016-04-24 17:36:15 -05:00
commit ea342f9336
3 changed files with 44 additions and 3 deletions

View file

@ -124,7 +124,7 @@ class ActivatedLoyaltyAbilityWatcher extends Watcher {
return new ActivatedLoyaltyAbilityWatcher(this);
}
public boolean activatedLayaltyAbility(UUID playerId) {
public boolean activatedLoyaltyAbility(UUID playerId) {
return playerIds.contains(playerId);
}
}
@ -177,7 +177,7 @@ class TheChainVeilCondition implements Condition {
public boolean apply(Game game, Ability source) {
ActivatedLoyaltyAbilityWatcher watcher = (ActivatedLoyaltyAbilityWatcher) game.getState().getWatchers().get("ActivatedLoyaltyAbilityWatcher");
if (watcher != null) {
if (!watcher.activatedLayaltyAbility(source.getControllerId())) {
if (!watcher.activatedLoyaltyAbility(source.getControllerId())) {
return true;
}
}

View file

@ -97,4 +97,41 @@ public class SpendOtherManaTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Chandra, Flamecaller", 1);
}
/**
* I was unable to cast Nissa, Voice of Zendikar using black mana with Oath
* of Nissa in play. Pretty sure Oath is working usually, so here were the
* conditions in my game:
*
* -Cast Dark Petition with spell mastery -Attempt to cast Nissa, Voice of
* Zendikar using the triple black mana from Dark Petition
*/
@Test
public void testOathOfNissaWithDarkPetition() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
// When Oath of Nissa enters the battlefield, look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
// You may spend mana as though it were mana of any color to cast planeswalker spells.
addCard(Zone.BATTLEFIELD, playerA, "Oath of Nissa");
addCard(Zone.GRAVEYARD, playerA, "Lightning Bolt", 2);
// Search your library for a card and put that card into your hand. Then shuffle your library.
// <i>Spell mastery</i> - If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool.
addCard(Zone.HAND, playerA, "Dark Petition"); // {3}{B}{B}
// +1: Put a 0/1 green Plant creature token onto the battlefield.
// -2: Put a +1/+1 counter on each creature you control.
// -7: You gain X life and draw X cards, where X is the number of lands you control.
addCard(Zone.LIBRARY, playerA, "Nissa, Voice of Zendikar"); // {1}{G}{G}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dark Petition");
setChoice(playerA, "Nissa, Voice of Zendikar");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Voice of Zendikar");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Dark Petition", 1);
assertHandCount(playerA, "Nissa, Voice of Zendikar", 0);
assertPermanentCount(playerA, "Nissa, Voice of Zendikar", 1);
}
}

View file

@ -47,6 +47,7 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.events.ManaEvent;
import mage.game.stack.Spell;
/**
*
@ -130,7 +131,10 @@ public class ManaPool implements Serializable {
for (ManaPoolItem mana : manaItems) {
if (filter != null) {
if (!filter.match(mana.getSourceObject(), game)) {
continue;
// Prevent that cost reduction by convoke is filtered out
if (!(mana.getSourceObject() instanceof Spell) || ability.getSourceId().equals(mana.getSourceId())) {
continue;
}
}
}
if (!manaType.equals(unlockedManaType) && autoPayment && autoPaymentRestricted && mana.count() == mana.getStock()) {