mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Fixed that some mana effects did not send all neded events (prevented that Contamination chnaged conditonal mana from Cavern of Souls to black mana).
This commit is contained in:
parent
ef1ee0adbf
commit
70f152feb1
6 changed files with 33 additions and 4 deletions
|
@ -223,4 +223,31 @@ public class CavernOfSoulsTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Silvercoat Lion", 0);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Cavern of Souls can produce any colour of mana with its second ability when Contamination is in play.
|
||||
*/
|
||||
@Test
|
||||
public void testUseWithConversionInPlay() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
addCard(Zone.HAND, playerA, "Cavern of Souls");
|
||||
// Creature - Drake {3}{R}
|
||||
addCard(Zone.HAND, playerA, "Desert Drake");
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Contamination", 1);
|
||||
|
||||
|
||||
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cavern of Souls");
|
||||
setChoice(playerA, "Drake");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Desert Drake");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Cavern of Souls", 1);
|
||||
assertPermanentCount(playerA, "Desert Drake", 0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -106,6 +106,7 @@ public class AddConditionalManaOfAnyColorEffect extends ManaEffect {
|
|||
}
|
||||
|
||||
if (mana != null) {
|
||||
checkToFirePossibleEvents(mana, game, source);
|
||||
controller.getManaPool().addMana(mana, game, source);
|
||||
result = true;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class AddContinuousEffectToGame extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ContinuousEffect effectToAdd = (ContinuousEffect) effect.copy();
|
||||
ContinuousEffect effectToAdd = effect.copy();
|
||||
game.addEffect(effectToAdd, source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -88,8 +88,8 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
|
|||
createdMana = Mana.WhiteMana(amount);
|
||||
}
|
||||
if (createdMana != null) {
|
||||
controller.getManaPool().addMana(createdMana, game, source);
|
||||
checkToFirePossibleEvents(createdMana, game, source);
|
||||
controller.getManaPool().addMana(createdMana, game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -111,8 +111,9 @@ public class AddManaOfAnyTypeProducedEffect extends ManaEffect {
|
|||
newMana.setColorless(1);
|
||||
break;
|
||||
}
|
||||
targetController.getManaPool().addMana(newMana, game, source);
|
||||
checkToFirePossibleEvents(newMana, game, source);
|
||||
targetController.getManaPool().addMana(newMana, game, source);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public abstract class ManaEffect extends OneShotEffect {
|
|||
public abstract Mana getMana(Game game, Ability source);
|
||||
|
||||
/**
|
||||
* Only used for mana effects that decide which mana is produced during resolution of the effect.
|
||||
* Only used for mana effects that decide which kind of mana is produced during resolution of the effect.
|
||||
*
|
||||
* @param mana
|
||||
* @param game
|
||||
|
|
Loading…
Reference in a new issue