mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Draft Matters - How many cards you've drafted this round (#5203)
This commit is contained in:
@@ -288,6 +288,7 @@ public class Match {
|
||||
}
|
||||
|
||||
Deck myDeck = psc.getDeck();
|
||||
player.setDraftNotes(myDeck.getDraftNotes());
|
||||
|
||||
Set<PaperCard> myRemovedAnteCards = null;
|
||||
if (!rules.useAnte()) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user