[LCI] Implement Starving Revenant (#11378)

This commit is contained in:
Susucre 2023-11-02 15:17:30 +01:00 committed by GitHub
parent 3c837e9dff
commit bab07a421d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 242 additions and 21 deletions

View file

@ -0,0 +1,87 @@
package org.mage.test.cards.single.lci;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.player.TestPlayer;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class StarvingRevenantTest extends CardTestPlayerBase {
/**
* {@link mage.cards.s.StarvingRevenant} <br>
* Starving Revenant {2}{B}{B} <br>
* Creature Spirit Horror <br>
* When Starving Revenant enters the battlefield, surveil 2. Then for each card you put on top of your library, you draw a card and you lose 3 life. <br>
* Descend 8 Whenever you draw a card, if there are eight or more permanent cards in your graveyard, target opponent loses 1 life and you gain 1 life. <br>
* 4/4
*/
private static final String revenant = "Starving Revenant";
@Test
public void surveil_both_graveyard() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.HAND, playerA, revenant);
addCard(Zone.LIBRARY, playerA, "Plains");
addCard(Zone.LIBRARY, playerA, "Island");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, revenant);
addTarget(playerA, "Plains^Island");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20);
assertGraveyardCount(playerA, 2);
assertHandCount(playerA, 0);
}
@Test
public void surveil_one_on_top() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.HAND, playerA, revenant);
addCard(Zone.LIBRARY, playerA, "Plains");
addCard(Zone.LIBRARY, playerA, "Island");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, revenant);
addTarget(playerA, "Plains");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20 - 3);
assertGraveyardCount(playerA, 1);
assertHandCount(playerA, 1);
}
@Test
public void surveil_both_on_top() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.HAND, playerA, revenant);
addCard(Zone.LIBRARY, playerA, "Plains");
addCard(Zone.LIBRARY, playerA, "Island");
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, revenant);
addTarget(playerA, TestPlayer.TARGET_SKIP);
setChoice(playerA, "Plains"); // Plains put on top first
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertLife(playerA, 20 - 3 * 2);
assertGraveyardCount(playerA, 0);
assertHandCount(playerA, 2);
}
}

View file

@ -1145,7 +1145,7 @@ public class TestPlayer implements Player {
Assert.fail(action.getActionName() + " - can't find permanent to check: " + cardName);
return null;
}
private void printStart(Game game, String name) {
System.out.println("\n" + game.toString());
System.out.println(name + ":");
@ -2867,7 +2867,7 @@ public class TestPlayer implements Player {
@Override
public List<Integer> getMultiAmountWithIndividualConstraints(Outcome outcome, List<MultiAmountMessage> messages,
int min, int max, MultiAmountType type, Game game) {
int min, int max, MultiAmountType type, Game game) {
assertAliasSupportInChoices(false);
int needCount = messages.size();
@ -3171,12 +3171,12 @@ public class TestPlayer implements Player {
}
@Override
public Map<UUID, Map<MageIdentifier,ManaCosts<ManaCost>>> getCastSourceIdManaCosts() {
public Map<UUID, Map<MageIdentifier, ManaCosts<ManaCost>>> getCastSourceIdManaCosts() {
return computerPlayer.getCastSourceIdManaCosts();
}
@Override
public Map<UUID, Map<MageIdentifier,Costs<Cost>>> getCastSourceIdCosts() {
public Map<UUID, Map<MageIdentifier, Costs<Cost>>> getCastSourceIdCosts() {
return computerPlayer.getCastSourceIdCosts();
}
@ -4372,10 +4372,8 @@ public class TestPlayer implements Player {
}
@Override
public boolean surveil(int value, Ability source,
Game game
) {
return computerPlayer.surveil(value, source, game);
public SurveilResult doSurveil(int value, Ability source, Game game) {
return computerPlayer.doSurveil(value, source, game);
}
@Override

View file

@ -986,7 +986,7 @@ public class PlayerStub implements Player {
@Override
public List<Integer> getMultiAmountWithIndividualConstraints(Outcome outcome, List<MultiAmountMessage> messages,
int min, int max, MultiAmountType type, Game game) {
int min, int max, MultiAmountType type, Game game) {
return null;
}
@ -1281,7 +1281,7 @@ public class PlayerStub implements Player {
}
@Override
public Map<UUID, Map<MageIdentifier,Costs<Cost>>> getCastSourceIdCosts() {
public Map<UUID, Map<MageIdentifier, Costs<Cost>>> getCastSourceIdCosts() {
return null;
}
@ -1346,8 +1346,8 @@ public class PlayerStub implements Player {
}
@Override
public boolean surveil(int value, Ability source, Game game) {
return false;
public SurveilResult doSurveil(int value, Ability source, Game game) {
return SurveilResult.noSurveil();
}
@Override