forked from External/mage
* Reflecting Pool - Fixed that mana from dynamic mana abilities were not taken into account (e.g. Gaea's Cradle or Serra's Sanctum).
This commit is contained in:
parent
2eae39b82f
commit
8d6d8d25e5
3 changed files with 34 additions and 7 deletions
|
|
@ -24,17 +24,16 @@
|
|||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
*/
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.Mana;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.mana.DynamicManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
||||
|
|
@ -42,19 +41,21 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
*
|
||||
* @author Backfir3
|
||||
*/
|
||||
|
||||
public class GaeasCradle extends CardImpl {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature you control");;
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature you control");
|
||||
|
||||
;
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
}
|
||||
|
||||
public GaeasCradle(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
this.supertype.add("Legendary");
|
||||
|
||||
// {T}: Add {G} to your mana pool for each creature you control.
|
||||
DynamicManaAbility ability = new DynamicManaAbility(Mana.GreenMana(1), new PermanentsOnBattlefieldCount(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -67,4 +68,4 @@ public class GaeasCradle extends CardImpl {
|
|||
public GaeasCradle copy() {
|
||||
return new GaeasCradle(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,4 +89,25 @@ public class ReflectingPoolTest extends CardTestPlayerBase {
|
|||
Assert.assertEquals("Player should be able to create 2 red mana", "{R}{R}", options.get(0).toString());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reflecting Pool does not see Gaea's Cradle or Serra's Sanctum as
|
||||
* producing mana
|
||||
*/
|
||||
@Test
|
||||
public void testWithGaeasCradle() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
|
||||
|
||||
// {T}: Add to your mana pool one mana of any type that a land you control could produce.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1);
|
||||
// {T}: Add {G} to your mana pool for each creature you control.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Gaea's Cradle", 1);
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
ManaOptions options = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("Player should be able to create 2 red mana", "{G}{G}", options.get(0).toString());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,4 +115,9 @@ public class DynamicManaAbility extends ActivatedManaAbilityImpl {
|
|||
}
|
||||
return newNetMana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean definesMana() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue