Draft Matters - How many cards you've drafted this round (#5203)

This commit is contained in:
Chris H
2024-05-21 05:36:59 -04:00
committed by GitHub
parent 6eebb1861f
commit 6087167673
30 changed files with 548 additions and 167 deletions

View File

@@ -288,6 +288,7 @@ public class Match {
}
Deck myDeck = psc.getDeck();
player.setDraftNotes(myDeck.getDraftNotes());
Set<PaperCard> myRemovedAnteCards = null;
if (!rules.useAnte()) {

View File

@@ -2358,6 +2358,23 @@ public class AbilityUtils {
return doXMath(player.getNotedNumberForName(c.getName()), expr, c, ctb);
}
if (sq[0].equals("DraftNotesHighest")) {
// Just in case you are playing this card in a deck without draft notes
String note = player.getDraftNotes().getOrDefault(sq[1], "0");
int highest = 0;
for (String n : note.split(",")) {
int num = Integer.parseInt(n);
if (num > highest) {
highest = num;
}
}
return doXMath(highest, expr, c, ctb);
// Other draft notes include: Names, Colors, Players, Creature Type.
// But these aren't really things you count so they'll show up in properties most likely
}
//Count$TypesSharedWith [defined]
if (sq[0].startsWith("TypesSharedWith")) {
Set<CardType.CoreType> thisTypes = Sets.newHashSet(c.getType().getCoreTypes());

View File

@@ -124,6 +124,7 @@ public class Player extends GameEntity implements Comparable<Player> {
private final Map<String, FCollection<String>> notes = Maps.newHashMap();
private final Map<String, Integer> notedNum = Maps.newHashMap();
private final Map<String, String> draftNotes = Maps.newHashMap();
private boolean revolt = false;
private int descended = 0;
@@ -2376,6 +2377,15 @@ public class Player extends GameEntity implements Comparable<Player> {
return getName().compareTo(o.getName());
}
public void setDraftNotes(Map<String, String> notes) {
this.draftNotes.clear();
this.draftNotes.putAll(notes);
}
public Map<String, String> getDraftNotes() {
return draftNotes;
}
public static class Accessors {
public static Function<Player, String> FN_GET_NAME = new Function<Player, String>() {
@Override