Merge branch 'tales' into 'master'

KHC: Tales of the Ancestors and support

See merge request core-developers/forge!3768
This commit is contained in:
Michael Kamensky
2021-02-06 04:17:02 +00:00
3 changed files with 22 additions and 2 deletions

View File

@@ -1563,6 +1563,17 @@ public class CardFactoryUtil {
}
}
if (sq[0].contains("InRememberedHand")) {
if (c.getRemembered() != null) {
for (final Object o : c.getRemembered()) {
if (o instanceof Player) {
Player remPlayer = (Player) o;
someCards.addAll(remPlayer.getCardsIn(ZoneType.Hand));
}
}
}
}
if (sq[0].contains("InChosenYard")) {
if (c.getChosenPlayer() != null) {
someCards.addAll(c.getChosenPlayer().getCardsIn(ZoneType.Graveyard));

View File

@@ -243,8 +243,7 @@ public class PlayerProperty {
final String[] type = property.substring(10).split("_");
final CardCollectionView list = CardLists.getValidCards(player.getCardsIn(ZoneType.smartValueOf(type[0])), type[1], sourceController, source);
String comparator = type[2];
String compareTo = comparator.substring(2);
int y = StringUtils.isNumeric(compareTo) ? Integer.parseInt(compareTo) : 0;
int y = AbilityUtils.calculateAmount(source, comparator.substring(2), null);
if (!Expressions.compare(list.size(), comparator, y)) {
return false;
}

View File

@@ -0,0 +1,10 @@
Name:Tales of the Ancestors
ManaCost:3 U
Types:Sorcery
A:SP$ RepeatEach | RepeatPlayers$ Player.HasCardsInHand_Card_LTX | References$ X | RepeatSubAbility$ DBDraw | SpellDescription$ Each player with fewer cards in hand than the player with the most cards in hand draws cards equal to the difference.
SVar:DBDraw:DB$ Draw | Defined$ Player.IsRemembered | NumCards$ Z | References$ X,Y,Z
SVar:X:PlayerCountPlayers$HighestCardsInHand
SVar:Y:Count$InRememberedHand
SVar:Z:SVar$X/Minus.Y
K:Foretell:1 U
Oracle:Each player with fewer cards in hand than the player with the most cards in hand draws cards equal to the difference.\nForetell {1}{U} (During your turn, you may pay {2} and exile this card from your hand face down. Cast it on a later turn for its foretell cost.)