Remove high priority collecting, fix statistics function

This commit is contained in:
mez 2025-07-27 20:47:12 +01:00
parent fd47368d5a
commit 07e850e612
4 changed files with 28 additions and 39 deletions

View file

@ -24,7 +24,6 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- =name=: the name you use in the game - =name=: the name you use in the game
- =sig=: set to =True= when you have a signature card - =sig=: set to =True= when you have a signature card
- =banner=: set to =True= when you have a player banner, and save this in =build/assets/= as =banner.png= - =banner=: set to =True= when you have a player banner, and save this in =build/assets/= as =banner.png=
- =highpriority=: a list of high priority decks you’re collecting
- =lowpriority=: a list of decks you’re collecting that aren’t in mass decks - =lowpriority=: a list of decks you’re collecting that aren’t in mass decks
- =trademedium=: whether to allow trading medium-priority cards away in exchange for high-priority cards (special cards will not be listed as tradeable) - =trademedium=: whether to allow trading medium-priority cards away in exchange for high-priority cards (special cards will not be listed as tradeable)
- =tradepost=: URL of your trade post on Dreamwidth - =tradepost=: URL of your trade post on Dreamwidth

View file

@ -152,9 +152,7 @@ for event in log.log:
thecard["priority"] = 1 thecard["priority"] = 1
else: else:
if thecard["priority"] == 0: if thecard["priority"] == 0:
if thedeck in variables.highpriority: if len(thecard["mass"]) > 0 or thedeck in variables.lowpriority:
thecard["priority"] = 1
elif len(thecard["mass"]) > 0 or thedeck in variables.lowpriority:
thecard["priority"] = 3 thecard["priority"] = 3
else: else:
thecard["priority"] = 4 thecard["priority"] = 4
@ -499,7 +497,7 @@ for deck in decklist:
deck["mastered"] = dates[-1] deck["mastered"] = dates[-1]
else: else:
deck["mastered"] = False deck["mastered"] = False
if deck["name"] in variables.highpriority or deck["count"] >= variables.highthreshold or deck["name"] in portdecks or deck["colour"] == "limited": if deck["count"] >= variables.highthreshold or deck["name"] in portdecks or deck["colour"] == "limited":
deck["priority"] = 1 deck["priority"] = 1
elif len(deck["mass"]) > 0 or deck["name"] in variables.lowpriority: elif len(deck["mass"]) > 0 or deck["name"] in variables.lowpriority:
if deck["count"] >= variables.collectingmediumthreshold: if deck["count"] >= variables.collectingmediumthreshold:
@ -554,6 +552,7 @@ for deck in decklist:
wantedcard["colour"] = deck["colour"] wantedcard["colour"] = deck["colour"]
wantedcard["series"] = deck["series"] wantedcard["series"] = deck["series"]
wantedcard["priority"] = deck["priority"] wantedcard["priority"] = deck["priority"]
wantedcard["mass"] = deck["mass"]
wantedlist.append(wantedcard) wantedlist.append(wantedcard)
decknames = [] decknames = []
@ -564,16 +563,6 @@ cardnames = []
for card in cardlist: for card in cardlist:
cardnames.append(card["name"]) cardnames.append(card["name"])
for deck in variables.highpriority:
if deck not in decknames:
for number in numbers:
wantedcard = {}
wantedcard["name"] = deck + number
wantedcard["colour"] = deckkey[deck]["type"]
wantedcard["series"] = deckkey[deck]["series"]
wantedcard["priority"] = 1
wantedlist.append(wantedcard)
for deck in variables.lowpriority: for deck in variables.lowpriority:
if deck not in decknames: if deck not in decknames:
for number in numbers: for number in numbers:

View file

@ -1616,34 +1616,36 @@ def stats():
print("Wantlist: " + str(len(colors.wantedlist)) + " cards") print("Wantlist: " + str(len(colors.wantedlist)) + " cards")
print("Mastered: " + str(masteredsize) + " decks") print("Mastered: " + str(masteredsize) + " decks")
print("Mass collection progress:") print("Mass collection progress:")
masslist = sorted(list(variables.masscollect.keys())) for mass in sorted(variables.masscollect):
seriesdict = {} held = 0
for series in masslist:
seriesdict[series] = 0
for card in colors.cardlist: for card in colors.cardlist:
if not card["dupe"]: if not card["dupe"]:
for series in card["mass"]: if mass in card["mass"]:
for theseries in masslist: held += 1
if series == theseries: themecount = 0
seriesdict[series] += 1
totaldict = {}
for key,value in variables.masscollect.items():
thenumber = 0
try: try:
thenumber += 20 * len(value["decks"]) allseries = 0
except: for series in variables.masscollect[mass]["series"]:
seriescount = 0
for deck in colors.deckkey:
if colors.deckkey[deck]["series"].lower() == series.lower():
seriescount += 1
allseries += seriescount
themecount += 20 * allseries
except KeyError:
pass pass
try: try:
thenumber += len(value["singles"]) themecount += 20 * len(variables.masscollect[mass]["decks"])
except: except KeyError:
pass pass
totaldict[key] = thenumber try:
totaldict = dict(sorted(totaldict.items())) themecount += len(variables.masscollect[mass]["singles"])
for key in seriesdict: except KeyError:
if totaldict[key] > seriesdict[key]: pass
print(" " + key + ": " + str(seriesdict[key]) + "/" + str(totaldict[key]) + " (" + str(int((float(seriesdict[key])/float(totaldict[key])) * 100)) + "%)") if held == themecount:
print(" " + mass + ": complete")
else: else:
print(" " + key + ": complete") print(" " + mass + ": " + str(held) + "/" + str(themecount) + " (" + str(int((float(held)/float(themecount)) * 100)) + "%)")
def tradecheck(): def tradecheck():
inoffer = input("Paste cards they offered here: ").split(", ") inoffer = input("Paste cards they offered here: ").split(", ")

View file

@ -5,7 +5,6 @@ url = ""
name = "your name" name = "your name"
sig = False sig = False
banner = False banner = False
highpriority = ["deckname","nameofadeck"]
lowpriority = ["deckname","nameofadeck"] lowpriority = ["deckname","nameofadeck"]
trademedium = True trademedium = True
tradepost = "URL" tradepost = "URL"