* Cabal Ritual, Gemstone Caverns, River of Tears - Fixed a problem that the tap for mana event was sent twice for theses lands (fixes #4288).

This commit is contained in:
LevelX2 2017-12-28 12:57:16 +01:00
parent 2197fe2bcd
commit d85637336e
2 changed files with 14 additions and 11 deletions

View file

@ -31,7 +31,6 @@ import mage.constants.ManaType;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@ -68,19 +67,20 @@ public class VorinclexVoiceOfHungerTest extends CardTestPlayerBase {
* Vorinclex, Voice of Hunger is not mana doubling River of Tears.
*/
@Test
@Ignore // TODO: need to fix Vorinclex, Voice of Hunger -- it's double fireup mana tap event
// @Ignore // TODO: need to fix Vorinclex, Voice of Hunger -- it's double fireup mana tap event
public void testVorinclexVoiceofHungerRiverOfTearsManaMultiplier() {
addCard(Zone.BATTLEFIELD, playerA, "Upwelling", 1);
addCard(Zone.HAND, playerA, "River of Tears", 1);
// Trample
// Whenever you tap a land for mana, add one mana to your mana pool of any type that land produced.
// Whenever an opponent taps a land for mana, that land doesn't untap during its controller's next untap step.
addCard(Zone.BATTLEFIELD, playerA, "Vorinclex, Voice of Hunger", 1);
// {T}: Add {U} to your mana pool. If you played a land this turn, add {B} to your mana pool instead.
addCard(Zone.BATTLEFIELD, playerA, "River of Tears", 1);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "River of Tears");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U} to your mana pool");
activateManaAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U} to your mana pool");
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
setStopAt(3, PhaseStep.BEGIN_COMBAT);
execute();
assertManaPool(playerA, ManaType.BLUE, 2);

View file

@ -79,8 +79,10 @@ public class ConditionalManaEffect extends ManaEffect {
otherwiseEffect.setTargetPointer(this.targetPointer);
}
Mana mana = getMana(game, source);
if (mana != null && mana.getAny() > 0) {
if (mana == null) {
return false;
}
if (mana.getAny() > 0) {
int amount = mana.getAny();
ChoiceColor choice = new ChoiceColor(true);
@ -92,13 +94,14 @@ public class ConditionalManaEffect extends ManaEffect {
createdMana = choice.getMana(amount);
}
if (createdMana == null) {
return false;
}
mana = createdMana;
}
if (mana != null) {
// because the mana type is now choosen, fire the event with the mana information
checkToFirePossibleEvents(mana, game, source);
controller.getManaPool().addMana(mana, game, source);
}
controller.getManaPool().addMana(mana, game, source);
return true;
}