mirror of
https://github.com/correl/mage.git
synced 2025-04-10 01:01:05 -09:00
Fire discard cards event when discarding as a cost (#7436)
Fire discard cards event when discarding as a cost, fixes #7368
This commit is contained in:
parent
2d96d36ec8
commit
68613672b1
2 changed files with 79 additions and 1 deletions
Mage.Tests/src/test/java/org/mage/test/cards/abilities/other
Mage/src/main/java/mage/players
|
@ -0,0 +1,78 @@
|
||||||
|
|
||||||
|
package org.mage.test.cards.abilities.other;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author smartinsempere
|
||||||
|
*/
|
||||||
|
public class RielleTheEverwiseTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRielleTheEverwiseAbilityDiscarding() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerA, "Faithless Looting");
|
||||||
|
addCard(Zone.HAND, playerA, "Brainwash");
|
||||||
|
addCard(Zone.HAND, playerA, "Brainwash");
|
||||||
|
addCard(Zone.HAND, playerA, "Brainwash");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Rielle, the Everwise");
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Faithless Looting");
|
||||||
|
setChoice(playerA, "Brainwash"); // discard
|
||||||
|
setChoice(playerA, "Brainwash"); // discard
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
assertHandCount(playerA, 5);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRielleTheEverwiseAbilityCycling() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerA, "Unearth");
|
||||||
|
addCard(Zone.HAND, playerA, "Brainwash");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Rielle, the Everwise");
|
||||||
|
|
||||||
|
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cycling {2}");
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
assertHandCount(playerA, 3);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRielleTheEverwiseAbilityTransmute() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerA, "Tolaria West");
|
||||||
|
addCard(Zone.HAND, playerA, "Brainwash");
|
||||||
|
addCard(Zone.LIBRARY, playerA, "Memnite");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Rielle, the Everwise");
|
||||||
|
|
||||||
|
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Transmute {1}{U}{U}");
|
||||||
|
addTarget(playerA, "Memnite");
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
assertAllCommandsUsed();
|
||||||
|
|
||||||
|
assertHandCount(playerA, 3);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -783,7 +783,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean discard(Card card, boolean payForCost, Ability source, Game game) {
|
public boolean discard(Card card, boolean payForCost, Ability source, Game game) {
|
||||||
return doDiscard(card, source, game, payForCost, false);
|
return doDiscard(card, source, game, payForCost, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean doDiscard(Card card, Ability source, Game game, boolean payForCost, boolean fireFinalEvent) {
|
private boolean doDiscard(Card card, Ability source, Game game, boolean payForCost, boolean fireFinalEvent) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue