mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
Fixes #1696
This commit is contained in:
parent
ea53235225
commit
0534b941cd
2 changed files with 81 additions and 2 deletions
|
|
@ -77,6 +77,7 @@ class ErdwalIlluminatorTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
public ErdwalIlluminatorTriggeredAbility() {
|
public ErdwalIlluminatorTriggeredAbility() {
|
||||||
super(Zone.BATTLEFIELD, new InvestigateEffect(), false);
|
super(Zone.BATTLEFIELD, new InvestigateEffect(), false);
|
||||||
|
addWatcher(new InvestigatedWatcher());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ErdwalIlluminatorTriggeredAbility(final ErdwalIlluminatorTriggeredAbility ability) {
|
public ErdwalIlluminatorTriggeredAbility(final ErdwalIlluminatorTriggeredAbility ability) {
|
||||||
|
|
@ -126,9 +127,9 @@ class InvestigatedWatcher extends Watcher {
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (EventType.INVESTIGATED.equals(event.getType())) {
|
if (EventType.INVESTIGATED.equals(event.getType())) {
|
||||||
if (!timesInvestigated.containsKey(event.getPlayerId())) {
|
if (!timesInvestigated.containsKey(event.getPlayerId())) {
|
||||||
timesInvestigated.put(event.getPlayerId(), timesInvestigated.get(event.getPlayerId()) + 1);
|
|
||||||
} else {
|
|
||||||
timesInvestigated.put(event.getPlayerId(), 1);
|
timesInvestigated.put(event.getPlayerId(), 1);
|
||||||
|
} else {
|
||||||
|
timesInvestigated.put(event.getPlayerId(), timesInvestigated.get(event.getPlayerId()) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
|
||||||
|
package org.mage.test.cards.single.soi;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author halljared
|
||||||
|
*/
|
||||||
|
public class ErdwalIlluminatorTest extends CardTestPlayerBase {
|
||||||
|
/**
|
||||||
|
* Whenever you investigate for the first time each turn, investigate an additional time.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void investigateFirstTimeTriggers() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerA, "Thraben Inspector", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Erdwal Illuminator", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector");
|
||||||
|
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Clue", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void ignoresOpponentInvestigateTriggers() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerB, "Thraben Inspector", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Erdwal Illuminator", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
|
||||||
|
|
||||||
|
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Thraben Inspector");
|
||||||
|
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerB, "Clue", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void ignoresSecondInvestigateTriggers() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerA, "Thraben Inspector", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Erdwal Illuminator", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector");
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector");
|
||||||
|
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Clue", 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void separateTurnsInvestigateTriggers() {
|
||||||
|
|
||||||
|
addCard(Zone.HAND, playerA, "Thraben Inspector", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Erdwal Illuminator", 1);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector");
|
||||||
|
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Thraben Inspector");
|
||||||
|
setStopAt(4, PhaseStep.POSTCOMBAT_MAIN);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertPermanentCount(playerA, "Clue", 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue