mirror of
https://github.com/correl/mage.git
synced 2025-01-12 11:08:01 +00:00
* Fixed that continuous effects were not yet applied to lands entering the battlefield (preventing Prismatic Omen and Valakut the Molten Pinnacle combo to work).
This commit is contained in:
parent
cfb10c869e
commit
19e231e860
3 changed files with 51 additions and 32 deletions
|
@ -30,13 +30,6 @@ package mage.sets.shadowmoor;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
|
@ -48,6 +41,13 @@ import mage.abilities.mana.GreenManaAbility;
|
|||
import mage.abilities.mana.RedManaAbility;
|
||||
import mage.abilities.mana.WhiteManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
@ -62,7 +62,6 @@ public class PrismaticOmen extends CardImpl {
|
|||
super(ownerId, 126, "Prismatic Omen", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
|
||||
this.expansionSetCode = "SHM";
|
||||
|
||||
|
||||
// Lands you control are every basic land type in addition to their other types.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesBasicLandTypeAllEffect("Swamp", "Mountain", "Forest", "Island", "Plains")));
|
||||
}
|
||||
|
@ -109,11 +108,11 @@ class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
Mana mana = new Mana();
|
||||
for (Ability ability : land.getAbilities()){
|
||||
for (Ability ability : land.getAbilities()) {
|
||||
if (ability instanceof BasicManaAbility) {
|
||||
for (Mana netMana: ((BasicManaAbility)ability ).getNetMana(game)) {
|
||||
for (Mana netMana : ((BasicManaAbility) ability).getNetMana(game)) {
|
||||
mana.add(netMana);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mana.getGreen() == 0 && landTypes.contains("Forest")) {
|
||||
|
|
|
@ -26,13 +26,10 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package org.mage.test.cards.abilities.enters;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
@ -40,17 +37,15 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Valakut, the Molten Pinnacle
|
||||
* Land
|
||||
* Valakut, the Molten Pinnacle enters the battlefield tapped.
|
||||
* Whenever a Mountain enters the battlefield under your control, if you control at least five other Mountains, you may have Valakut, the Molten Pinnacle deal 3 damage to target creature or player.
|
||||
* {T}: Add {R} to your mana pool.
|
||||
* Valakut, the Molten Pinnacle Land Valakut, the Molten Pinnacle enters the
|
||||
* battlefield tapped. Whenever a Mountain enters the battlefield under your
|
||||
* control, if you control at least five other Mountains, you may have
|
||||
* Valakut, the Molten Pinnacle deal 3 damage to target creature or player.
|
||||
* {T}: Add {R} to your mana pool.
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void onlyFourMountainsNoDamage() {
|
||||
|
||||
|
@ -85,13 +80,11 @@ public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase {
|
|||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 17);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Scapeshift {2}{G}{G}
|
||||
// Sorcery
|
||||
// Sacrifice any number of lands. Search your library for that many land cards, put them onto the battlefield tapped, then shuffle your library.
|
||||
|
||||
// Scapeshift {2}{G}{G}
|
||||
// Sorcery
|
||||
// Sacrifice any number of lands. Search your library for that many land cards, put them onto the battlefield tapped, then shuffle your library.
|
||||
@Test
|
||||
public void sixEnterWithScapeshiftDamageToPlayerB() {
|
||||
|
||||
|
@ -113,7 +106,6 @@ public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase {
|
|||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 2); // 6 * 3 damage = 18
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -166,4 +158,36 @@ public class ValakutTheMoltenPinnacleTest extends CardTestPlayerBase {
|
|||
assertLife(playerB, 2); // 6 * 3 damage = 18
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Some lands aren't triggering Valakut, the Molten Pinnacle with Prismatic
|
||||
* Omen and 6+ lands in play. So far I've noticed that Misty Rainforest and
|
||||
* basic Island did not trigger Valakut, but an additional copy of Valakut
|
||||
* did.
|
||||
*/
|
||||
@Test
|
||||
public void withPrismaticOmen() {
|
||||
// Valakut, the Molten Pinnacle enters the battlefield tapped.
|
||||
// Whenever a Mountain enters the battlefield under your control, if you control at least five other Mountains,
|
||||
// you may have Valakut, the Molten Pinnacle deal 3 damage to target creature or player.
|
||||
// {T}: Add {R} to your mana pool.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Valakut, the Molten Pinnacle");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
|
||||
addCard(Zone.HAND, playerA, "Forest", 1);
|
||||
|
||||
// Lands you control are every basic land type in addition to their other types.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Prismatic Omen");
|
||||
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
|
||||
addTarget(playerA, playerB);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 17);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -916,11 +916,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
EntersTheBattlefieldEvent event = new EntersTheBattlefieldEvent(this, sourceId, getControllerId(), fromZone);
|
||||
if (!game.replaceEvent(event)) {
|
||||
if (fireEvent) {
|
||||
if (sourceId == null) { // play lands
|
||||
game.fireEvent(event);
|
||||
} else { // from effects
|
||||
game.addSimultaneousEvent(event);
|
||||
}
|
||||
game.addSimultaneousEvent(event);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue