mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
* Mana Clash - Fixed use in available mana calculation (related to #6698).
This commit is contained in:
parent
674fd6b1a5
commit
6a65e5bb23
6 changed files with 61 additions and 15 deletions
|
|
@ -289,4 +289,49 @@ public class NonTappingManaAbilitiesTest extends CardTestPlayerBase {
|
|||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{B}{B}{B}{B}", manaOptions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Test_ManaCache() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
|
||||
// At the beginning of each player's end step, put a charge counter on Mana Cache for each untapped land that player controls.
|
||||
// Remove a charge counter from Mana Cache: Add {C}. Any player may activate this ability but only during their turn before the end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mana Cache", 1);
|
||||
|
||||
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertCounterCount("Mana Cache", CounterType.CHARGE, 2);
|
||||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}{B}{B}", manaOptions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Test_ManaCacheOpponent() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
|
||||
// At the beginning of each player's end step, put a charge counter on Mana Cache for each untapped land that player controls.
|
||||
// Remove a charge counter from Mana Cache: Add {C}. Any player may activate this ability but only during their turn before the end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mana Cache", 1);
|
||||
|
||||
setStopAt(2, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertCounterCount("Mana Cache", CounterType.CHARGE, 2);
|
||||
|
||||
ManaOptions manaOptions = playerB.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}", manaOptions);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ public class TestPlayer implements Player {
|
|||
|
||||
for (MageObject mageObject : manaObjects) {
|
||||
if (mageObject instanceof Permanent) {
|
||||
for (Ability manaAbility : ((Permanent) mageObject).getAbilities(game).getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, game)) {
|
||||
for (Ability manaAbility : ((Permanent) mageObject).getAbilities(game).getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, getId(), game)) {
|
||||
if (hasAbilityTargetNameOrAlias(game, manaAbility, groups[0])) {
|
||||
Ability newManaAbility = manaAbility.copy();
|
||||
computerPlayer.activateAbility((ActivatedAbility) newManaAbility, game);
|
||||
|
|
@ -622,7 +622,7 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
}
|
||||
} else if (mageObject instanceof Card) {
|
||||
for (Ability manaAbility : ((Card) mageObject).getAbilities(game).getAvailableActivatedManaAbilities(game.getState().getZone(mageObject.getId()), game)) {
|
||||
for (Ability manaAbility : ((Card) mageObject).getAbilities(game).getAvailableActivatedManaAbilities(game.getState().getZone(mageObject.getId()), getId(), game)) {
|
||||
if (hasAbilityTargetNameOrAlias(game, manaAbility, groups[0])) {
|
||||
Ability newManaAbility = manaAbility.copy();
|
||||
computerPlayer.activateAbility((ActivatedAbility) newManaAbility, game);
|
||||
|
|
@ -631,7 +631,7 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
for (Ability manaAbility : mageObject.getAbilities().getAvailableActivatedManaAbilities(game.getState().getZone(mageObject.getId()), game)) {
|
||||
for (Ability manaAbility : mageObject.getAbilities().getAvailableActivatedManaAbilities(game.getState().getZone(mageObject.getId()), getId(), game)) {
|
||||
if (hasAbilityTargetNameOrAlias(game, manaAbility, groups[0])) {
|
||||
Ability newManaAbility = manaAbility.copy();
|
||||
computerPlayer.activateAbility((ActivatedAbility) newManaAbility, game);
|
||||
|
|
@ -643,7 +643,7 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
List<Permanent> manaPermsWithCost = computerPlayer.getAvailableManaProducersWithCost(game);
|
||||
for (Permanent perm : manaPermsWithCost) {
|
||||
for (ActivatedManaAbilityImpl manaAbility : perm.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, game)) {
|
||||
for (ActivatedManaAbilityImpl manaAbility : perm.getAbilities().getAvailableActivatedManaAbilities(Zone.BATTLEFIELD, getId(), game)) {
|
||||
if (hasAbilityTargetNameOrAlias(game, manaAbility, groups[0])
|
||||
&& manaAbility.canActivate(computerPlayer.getId(), game).canActivate()) {
|
||||
Ability newManaAbility = manaAbility.copy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue