mirror of
https://github.com/correl/mage.git
synced 2024-11-29 03:00:12 +00:00
[DMC] Fix Zaxara triggered ability. Closes #9597.
This commit is contained in:
parent
5e450d5c72
commit
5fa9a850b1
2 changed files with 61 additions and 3 deletions
|
@ -83,11 +83,11 @@ class ZaxaraTheExemplaryHydraTokenAbility extends TriggeredAbilityImpl {
|
||||||
}
|
}
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
if (spell == null || !spell.getSpellAbility().getManaCostsToPay().containsX()) {
|
if (spell == null || !spell.getSpellAbility().getManaCostsToPay().containsX()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
game.getState().setValue(this.getSourceId() + ZaxaraTheExemplary.needPrefix, spell);
|
game.getState().setValue(this.getSourceId() + ZaxaraTheExemplary.needPrefix, spell);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TriggeredAbility copy() {
|
public TriggeredAbility copy() {
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
package org.mage.test.cards.single.dmc;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link mage.cards.z.ZaxaraTheExemplary Zaxara, the Exemplar}
|
||||||
|
* Deathtouch
|
||||||
|
* {T}: Add two mana of any one color.
|
||||||
|
* Whenever you cast a spell with {X} in its mana cost, create a 0/0 green Hydra creature token, then put X +1/+1 counters on it.
|
||||||
|
*
|
||||||
|
* @author Alex-Vasile
|
||||||
|
*/
|
||||||
|
public class ZaxaraTheExemplaryTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
private static final String zaxara = "Zaxara, the Exemplary";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reported bug: https://github.com/magefree/mage/issues/9597
|
||||||
|
* Whenever you cast a spell with X in its cost and Zaxara on the board, Zaxara does nothing.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void triggersOfXSpells() {
|
||||||
|
// {X}
|
||||||
|
String stonecoilSerpent = "Stonecoil Serpent";
|
||||||
|
addCard(Zone.HAND, playerA, stonecoilSerpent);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, zaxara);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, stonecoilSerpent);
|
||||||
|
setChoice(playerA, "X=2");
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Hydra Token", 1);
|
||||||
|
assertPowerToughness(playerA, "Hydra Token", 2, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reported bug: https://github.com/magefree/mage/issues/9597
|
||||||
|
* Whenever you cast a spell without X in its cost and Zaxara on the board, Zaxara will create a 0/0 Hydra and put no counters on it.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void DoesNotTriggerOfNonXSpells() {
|
||||||
|
String lighningBolt = "Lightning Bolt";
|
||||||
|
addCard(Zone.HAND, playerA, lighningBolt);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, zaxara);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lighningBolt, playerB);
|
||||||
|
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1);
|
||||||
|
checkStackSize("Should not have triggered", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 0);
|
||||||
|
|
||||||
|
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue