Support for Starving Revenant (#4172)

This commit is contained in:
tool4ever
2023-11-15 17:21:53 +01:00
committed by GitHub
parent 75e917b0e4
commit 21a9f12c3b
2 changed files with 12 additions and 7 deletions

View File

@@ -391,6 +391,9 @@ public class DigEffect extends SpellAbilityEffect {
}
if (destZone1.equals(ZoneType.Battlefield)) {
moveParams.put(AbilityKey.SimultaneousETB, movedCards);
if (sa.hasParam("GainControl")) {
c.setController(player, game.getNextTimestamp());
}
if (sa.hasParam("WithCounter")) {
final int numCtr = AbilityUtils.calculateAmount(host,
sa.getParamOrDefault("WithCounterNum", "1"), sa);

View File

@@ -1160,7 +1160,7 @@ public class Player extends GameEntity implements Comparable<Player> {
return;
}
final CardCollection topN = new CardCollection(this.getCardsIn(ZoneType.Library, num));
final CardCollection topN = getTopXCardsFromLibrary(num);
if (topN.isEmpty()) {
return;
@@ -1188,6 +1188,9 @@ public class Player extends GameEntity implements Comparable<Player> {
getGame().getAction().moveToLibrary(c, cause, params);
numToTop++;
}
if (cause.hasParam("RememberKept")) {
cause.getHostCard().addRemembered(toTop);
}
}
getGame().fireEvent(new GameEventSurveil(this, numToTop, numToGrave));
@@ -1653,19 +1656,18 @@ public class Player extends GameEntity implements Comparable<Player> {
}
}
CardCollectionView milledView = getCardsIn(ZoneType.Library);
Iterable<Card> milledView = getCardsIn(ZoneType.Library);
// 614.13c
if (sa.getRootAbility().getReplacingObject(AbilityKey.SimultaneousETB) != null) {
Iterables.removeAll(milledView, (CardCollection) sa.getRootAbility().getReplacingObject(AbilityKey.SimultaneousETB));
milledView = Iterables.filter(milledView, c -> !((CardCollection) sa.getRootAbility().getReplacingObject(AbilityKey.SimultaneousETB)).contains(c));
}
CardCollection milled = new CardCollection(Iterables.limit(milledView, n));
milledView = milled;
CardCollectionView milled = new CardCollection(Iterables.limit(milledView, n));
if (destination == ZoneType.Graveyard) {
milledView = GameActionUtil.orderCardsByTheirOwners(game, milledView, ZoneType.Graveyard, sa);
milled = GameActionUtil.orderCardsByTheirOwners(game, milled, ZoneType.Graveyard, sa);
}
for (Card m : milledView) {
for (Card m : milled) {
final ZoneType origin = m.getZone().getZoneType();
final Card d = game.getAction().moveTo(destination, m, sa, params);
if (d.getZone().is(destination)) {