[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

@ -1108,7 +1108,48 @@ public interface Player extends MageItem, Copyable<Player> {
boolean scry(int value, Ability source, Game game);
boolean surveil(int value, Ability source, Game game);
/**
* result of the doSurveil action.
* Sometimes more info is needed for the caller after the surveil is done.
*/
class SurveilResult {
private final boolean surveilled;
private final int numberInGraveyard; // how many cards were put into the graveyard
private final int numberOnTop; // how many cards were put into the graveyard
private SurveilResult(boolean surveilled, int inGrave, int onTop) {
this.surveilled = surveilled;
this.numberInGraveyard = inGrave;
this.numberOnTop = onTop;
}
public static SurveilResult noSurveil() {
return new SurveilResult(false, 0, 0);
}
public static SurveilResult surveil(int inGrave, int onTop) {
return new SurveilResult(true, inGrave, onTop);
}
public boolean hasSurveilled() {
return this.surveilled;
}
public int getNumberPutInGraveyard() {
return this.numberInGraveyard;
}
public int getNumberPutOnTop() {
return this.numberOnTop;
}
}
SurveilResult doSurveil(int value, Ability source, Game game);
default boolean surveil(int value, Ability source, Game game) {
SurveilResult result = doSurveil(value, source, game);
return result.hasSurveilled();
}
/**
* Only used for test player for pre-setting targets