Tamiyo fixes #2078

This commit is contained in:
drmDev 2016-07-15 21:15:04 -04:00
parent 966de10386
commit 2ecadbc30b
2 changed files with 35 additions and 12 deletions

View file

@ -143,7 +143,7 @@ class TamiyoFieldResearcherEffect1 extends OneShotEffect {
creatures.add(new MageObjectReference(uuid, game));
}
if (!creatures.isEmpty()) {
DelayedTriggeredAbility delayedAbility = new TamiyoFieldResearcherDelayedTriggeredAbility(creatures);
DelayedTriggeredAbility delayedAbility = new TamiyoFieldResearcherDelayedTriggeredAbility(creatures, game.getTurnNum());
game.addDelayedTriggeredAbility(delayedAbility, source);
}
return true;
@ -153,17 +153,20 @@ class TamiyoFieldResearcherEffect1 extends OneShotEffect {
}
class TamiyoFieldResearcherDelayedTriggeredAbility extends DelayedTriggeredAbility {
private int startingTurn;
private List<MageObjectReference> creatures;
public TamiyoFieldResearcherDelayedTriggeredAbility(List<MageObjectReference> creatures) {
super(new DrawCardSourceControllerEffect(1), Duration.UntilYourNextTurn, false);
public TamiyoFieldResearcherDelayedTriggeredAbility(List<MageObjectReference> creatures, int startingTurn) {
super(new DrawCardSourceControllerEffect(1), Duration.Custom, false);
this.creatures = creatures;
}
this.startingTurn = startingTurn;
}
public TamiyoFieldResearcherDelayedTriggeredAbility(final TamiyoFieldResearcherDelayedTriggeredAbility ability) {
super(ability);
this.creatures = ability.creatures;
this.startingTurn = ability.startingTurn;
}
@Override
@ -181,6 +184,11 @@ class TamiyoFieldResearcherDelayedTriggeredAbility extends DelayedTriggeredAbili
}
return false;
}
@Override
public boolean isInactive(Game game) {
return game.getActivePlayerId().equals(getControllerId()) && game.getTurnNum() != startingTurn;
}
@Override
public TamiyoFieldResearcherDelayedTriggeredAbility copy() {

View file

@ -89,9 +89,14 @@ public class TamiyoTest extends CardTestPlayerBase {
// Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty
// +1: Choose up to two target creatures. Until your next turn,
// whenever either of those creatures deals combat damage, you draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Tamiyo, Field Researcher", 1);
addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Bronze Sable", 1); // 2/1
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two");
addTarget(playerA, "Bronze Sable");
@ -113,10 +118,15 @@ public class TamiyoTest extends CardTestPlayerBase {
// Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty
// +1: Choose up to two target creatures. Until your next turn,
// whenever either of those creatures deals combat damage, you draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Tamiyo, Field Researcher", 1);
addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Bronze Sable", 1); // 2/1
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // 2/3
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two");
addTarget(playerA, "Bronze Sable^Sylvan Advocate");
@ -139,10 +149,15 @@ public class TamiyoTest extends CardTestPlayerBase {
// Tamiyo, Field Researcher {1}{G}{W}{U} - 4 loyalty
// +1: Choose up to two target creatures. Until your next turn,
// whenever either of those creatures deals combat damage, you draw a card.
addCard(Zone.BATTLEFIELD, playerA, "Tamiyo, Field Researcher", 1);
addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // 2/3
addCard(Zone.BATTLEFIELD, playerB, "Memnite", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tamiyo, Field Researcher");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: Choose up to two");
addTarget(playerA, "Sylvan Advocate");
@ -172,7 +187,7 @@ public class TamiyoTest extends CardTestPlayerBase {
addCard(Zone.HAND, playerA, "Tamiyo, Field Researcher", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate", 1); // 2/3
addCard(Zone.HAND, playerB, "Hero's Downfall", 1);