diff --git a/README.org b/README.org index 4833b2e..aeb95e3 100644 --- a/README.org +++ b/README.org @@ -24,6 +24,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards - =name=: the name you use in the game - =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= + - =highpriority=: a list of high priority decks you’re collecting - =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) - =tradepost=: URL of your trade post on Dreamwidth diff --git a/colors.py b/colors.py index 1a4c6d7..3303c5d 100644 --- a/colors.py +++ b/colors.py @@ -152,7 +152,9 @@ for event in log.log: thecard["priority"] = 1 else: if thecard["priority"] == 0: - if len(thecard["mass"]) > 0 or thedeck in variables.lowpriority: + if thedeck in variables.highpriority: + thecard["priority"] = 1 + elif len(thecard["mass"]) > 0 or thedeck in variables.lowpriority: thecard["priority"] = 3 else: thecard["priority"] = 4 @@ -497,7 +499,7 @@ for deck in decklist: deck["mastered"] = dates[-1] else: deck["mastered"] = False - if deck["count"] >= variables.highthreshold or deck["name"] in portdecks or deck["colour"] == "limited": + if deck["name"] in variables.highpriority or deck["count"] >= variables.highthreshold or deck["name"] in portdecks or deck["colour"] == "limited": deck["priority"] = 1 elif len(deck["mass"]) > 0 or deck["name"] in variables.lowpriority: if deck["count"] >= variables.collectingmediumthreshold: @@ -552,7 +554,6 @@ for deck in decklist: wantedcard["colour"] = deck["colour"] wantedcard["series"] = deck["series"] wantedcard["priority"] = deck["priority"] - wantedcard["mass"] = deck["mass"] wantedlist.append(wantedcard) decknames = [] @@ -563,6 +564,16 @@ cardnames = [] for card in cardlist: 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: if deck not in decknames: for number in numbers: diff --git a/tools.py b/tools.py index 16998e4..9f69367 100644 --- a/tools.py +++ b/tools.py @@ -825,6 +825,7 @@ def studio(): print("Nothing requested") def randoms(specials=False): + totalrandoms = int(input("How many? ")) pool = [] for card in colors.cardlist: if card["priority"] == 4 and card["dupe"] == False and card["colour"] != "sig" and card["colour"] != "limited": @@ -833,7 +834,6 @@ def randoms(specials=False): else: if card["colour"] != "special": pool.append(card["name"]) - totalrandoms = int(input("How many? (maximum " + str(len(pool)) + ") ")) try: chosen = sorted(random.sample(pool,totalrandoms)) print(", ".join(chosen)) @@ -1616,36 +1616,34 @@ def stats(): print("Wantlist: " + str(len(colors.wantedlist)) + " cards") print("Mastered: " + str(masteredsize) + " decks") print("Mass collection progress:") - for mass in sorted(variables.masscollect): - held = 0 - for card in colors.cardlist: - if not card["dupe"]: - if mass in card["mass"]: - held += 1 - themecount = 0 + masslist = sorted(list(variables.masscollect.keys())) + seriesdict = {} + for series in masslist: + seriesdict[series] = 0 + for card in colors.cardlist: + if not card["dupe"]: + for series in card["mass"]: + for theseries in masslist: + if series == theseries: + seriesdict[series] += 1 + totaldict = {} + for key,value in variables.masscollect.items(): + thenumber = 0 try: - allseries = 0 - 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: + thenumber += 20 * len(value["decks"]) + except: pass try: - themecount += 20 * len(variables.masscollect[mass]["decks"]) - except KeyError: + thenumber += len(value["singles"]) + except: pass - try: - themecount += len(variables.masscollect[mass]["singles"]) - except KeyError: - pass - if held == themecount: - print(" " + mass + ": complete") + totaldict[key] = thenumber + totaldict = dict(sorted(totaldict.items())) + for key in seriesdict: + if totaldict[key] > seriesdict[key]: + print(" " + key + ": " + str(seriesdict[key]) + "/" + str(totaldict[key]) + " (" + str(int((float(seriesdict[key])/float(totaldict[key])) * 100)) + "%)") else: - print(" " + mass + ": " + str(held) + "/" + str(themecount) + " (" + str(int((float(held)/float(themecount)) * 100)) + "%)") + print(" " + key + ": complete") def tradecheck(): inoffer = input("Paste cards they offered here: ").split(", ") diff --git a/variables-template.py b/variables-template.py index b47e645..cf54f77 100644 --- a/variables-template.py +++ b/variables-template.py @@ -5,6 +5,7 @@ url = "" name = "your name" sig = False banner = False +highpriority = ["deckname","nameofadeck"] lowpriority = ["deckname","nameofadeck"] trademedium = True tradepost = "URL"