mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
* Fixed missing check for restricting effects of activated abilities of permanents (fixes #6657). I guess that got lost by refactoring get playable abilities.
This commit is contained in:
parent
3beaec4525
commit
c41fc0284d
4 changed files with 67 additions and 5 deletions
|
|
@ -0,0 +1,57 @@
|
|||
package org.mage.test.cards.restriction;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CantUseActivatedAbilitiesTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* I can activate artifacts despite my opponent having Collector Ouphe or
|
||||
* Karn, the Great Creator in play. The artifact says it can't be activated, but that's a lie.
|
||||
*/
|
||||
@Test
|
||||
public void testCantActivateManaAbility() {
|
||||
// Activated abilities of artifacts can't be activated.
|
||||
addCard(Zone.HAND, playerA, "Collector Ouphe"); // Creature {1}{G} 2/2
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
// {T}: Add {C}{C}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Sol Ring"); // Artifact
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Collector Ouphe");
|
||||
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
// Sol Ring can't produce mana
|
||||
Assert.assertTrue("PlayerB may not be able to produce any mana but he he can produce " + playerB.getManaAvailable(currentGame).toString(), playerB.getManaAvailable(currentGame).toString().equals("[]"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCantActivateActivatedAbility() {
|
||||
// Activated abilities of artifacts can't be activated.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Collector Ouphe"); // Creature {1}{G} 2/2
|
||||
|
||||
// {1}: Adarkar Sentinel gets +0/+1 until end of turn.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Adarkar Sentinel"); // Artifact Creature — Soldier (3/3)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{1}: ");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerB, "Adarkar Sentinel", 3, 3);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1165,9 +1165,9 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
if (mustHave) {
|
||||
Assert.assertEquals(action.getActionName() + " - permanent " + permanentName + " must have ability " + abilityClass, true, founded);
|
||||
Assert.assertEquals(action.getActionName() + " - permanent " + permanentName + " must have the ability " + abilityClass, true, founded);
|
||||
} else {
|
||||
Assert.assertEquals(action.getActionName() + " - permanent " + permanentName + " must have not ability " + abilityClass, false, founded);
|
||||
Assert.assertEquals(action.getActionName() + " - permanent " + permanentName + " must not have the ability " + abilityClass, false, founded);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue