forked from External/mage
Simplify Transform triggers, fix Wildsong Howler
This commit is contained in:
parent
16c789aaf7
commit
84a7e9f5b8
3 changed files with 26 additions and 21 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
package org.mage.test.cards.abilities.keywords;
|
package org.mage.test.cards.abilities.keywords;
|
||||||
|
|
||||||
import mage.cards.s.SpringOfEternalPeace;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.PhaseStep;
|
import mage.constants.PhaseStep;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
|
@ -384,7 +383,6 @@ public class TransformTest extends CardTestPlayerBase {
|
||||||
assertPowerToughness(playerA, "Huntmaster of the Fells", 2, 2);
|
assertPowerToughness(playerA, "Huntmaster of the Fells", 2, 2);
|
||||||
assertTappedCount("Plains", true, 2);
|
assertTappedCount("Plains", true, 2);
|
||||||
assertTappedCount("Wastes", true, 1);
|
assertTappedCount("Wastes", true, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -413,8 +411,32 @@ public class TransformTest extends CardTestPlayerBase {
|
||||||
assertPermanentCount(playerA, "Ravager of the Fells", 0);
|
assertPermanentCount(playerA, "Ravager of the Fells", 0);
|
||||||
assertPermanentCount(playerA, "Huntmaster of the Fells", 1);
|
assertPermanentCount(playerA, "Huntmaster of the Fells", 1);
|
||||||
assertPowerToughness(playerA, "Huntmaster of the Fells", 2, 2);
|
assertPowerToughness(playerA, "Huntmaster of the Fells", 2, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testWildsongHowlerTrigger() {
|
||||||
|
// The only Daybound/Nightbound card with a Transforms trigger on the back side
|
||||||
|
removeAllCardsFromLibrary(playerA);
|
||||||
|
addCard(Zone.HAND, playerA, "Howlpack Piper", 2); // Creature {2}{R}{G}
|
||||||
|
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 50);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Howlpack Piper");
|
||||||
|
setChoice(playerA, true); //Transform trigger
|
||||||
|
addTarget(playerA, "Silvercoat Lion");
|
||||||
|
|
||||||
|
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Howlpack Piper");
|
||||||
|
setChoice(playerA, true); //ETB trigger
|
||||||
|
addTarget(playerA, "Silvercoat Lion");
|
||||||
|
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Wildsong Howler", 2);
|
||||||
|
assertPermanentCount(playerA, "Howlpack Piper", 0); // They should be both transformed
|
||||||
|
assertHandCount(playerA, "Silvercoat Lion", 3);
|
||||||
|
assertHandCount(playerA, 3); //The two Silvercoat Lions from triggers and 1 from natural card draw
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import mage.abilities.effects.Effect;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
|
|
@ -41,10 +40,6 @@ public class TransformIntoSourceTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (!event.getTargetId().equals(this.getSourceId())) {
|
return event.getTargetId().equals(this.getSourceId());
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Permanent permanent = getSourcePermanentIfItStillExists(game);
|
|
||||||
return permanent != null && permanent.isTransformed();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,11 @@ import mage.abilities.effects.Effect;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TheElk801
|
* @author TheElk801
|
||||||
*/
|
*/
|
||||||
public class TransformsOrEntersTriggeredAbility extends TriggeredAbilityImpl {
|
public class TransformsOrEntersTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
public TransformsOrEntersTriggeredAbility(Effect effect, boolean optional) {
|
public TransformsOrEntersTriggeredAbility(Effect effect, boolean optional) {
|
||||||
super(Zone.BATTLEFIELD, effect, optional);
|
super(Zone.BATTLEFIELD, effect, optional);
|
||||||
setTriggerPhrase("Whenever this creature enters or transforms into {this}, ");
|
setTriggerPhrase("Whenever this creature enters or transforms into {this}, ");
|
||||||
|
|
@ -34,16 +32,6 @@ public class TransformsOrEntersTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (!event.getTargetId().equals(this.getSourceId())) {
|
return event.getTargetId().equals(this.getSourceId());
|
||||||
return false;
|
|
||||||
}
|
|
||||||
switch (event.getType()) {
|
|
||||||
case TRANSFORMED:
|
|
||||||
Permanent permanent = getSourcePermanentIfItStillExists(game);
|
|
||||||
return permanent != null && !permanent.isTransformed();
|
|
||||||
case ENTERS_THE_BATTLEFIELD:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue