Compare commits

..

No commits in common. "07e850e612bcf157a800b955ffd019703473ec03" and "93de038712a72fe126dfd0e1f7dbb109ec58bde4" have entirely different histories.

4 changed files with 40 additions and 29 deletions

View file

@ -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 - =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,7 +152,9 @@ for event in log.log:
thecard["priority"] = 1 thecard["priority"] = 1
else: else:
if thecard["priority"] == 0: 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 thecard["priority"] = 3
else: else:
thecard["priority"] = 4 thecard["priority"] = 4
@ -497,7 +499,7 @@ for deck in decklist:
deck["mastered"] = dates[-1] deck["mastered"] = dates[-1]
else: else:
deck["mastered"] = False 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 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:
@ -552,7 +554,6 @@ 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 = []
@ -563,6 +564,16 @@ 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

@ -825,6 +825,7 @@ def studio():
print("Nothing requested") print("Nothing requested")
def randoms(specials=False): def randoms(specials=False):
totalrandoms = int(input("How many? "))
pool = [] pool = []
for card in colors.cardlist: for card in colors.cardlist:
if card["priority"] == 4 and card["dupe"] == False and card["colour"] != "sig" and card["colour"] != "limited": 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: else:
if card["colour"] != "special": if card["colour"] != "special":
pool.append(card["name"]) pool.append(card["name"])
totalrandoms = int(input("How many? (maximum " + str(len(pool)) + ") "))
try: try:
chosen = sorted(random.sample(pool,totalrandoms)) chosen = sorted(random.sample(pool,totalrandoms))
print(", ".join(chosen)) print(", ".join(chosen))
@ -1616,36 +1616,34 @@ 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:")
for mass in sorted(variables.masscollect): masslist = sorted(list(variables.masscollect.keys()))
held = 0 seriesdict = {}
for card in colors.cardlist: for series in masslist:
if not card["dupe"]: seriesdict[series] = 0
if mass in card["mass"]: for card in colors.cardlist:
held += 1 if not card["dupe"]:
themecount = 0 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: try:
allseries = 0 thenumber += 20 * len(value["decks"])
for series in variables.masscollect[mass]["series"]: except:
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:
themecount += 20 * len(variables.masscollect[mass]["decks"]) thenumber += len(value["singles"])
except KeyError: except:
pass pass
try: totaldict[key] = thenumber
themecount += len(variables.masscollect[mass]["singles"]) totaldict = dict(sorted(totaldict.items()))
except KeyError: for key in seriesdict:
pass if totaldict[key] > seriesdict[key]:
if held == themecount: print(" " + key + ": " + str(seriesdict[key]) + "/" + str(totaldict[key]) + " (" + str(int((float(seriesdict[key])/float(totaldict[key])) * 100)) + "%)")
print(" " + mass + ": complete")
else: else:
print(" " + mass + ": " + str(held) + "/" + str(themecount) + " (" + str(int((float(held)/float(themecount)) * 100)) + "%)") print(" " + key + ": complete")
def tradecheck(): def tradecheck():
inoffer = input("Paste cards they offered here: ").split(", ") inoffer = input("Paste cards they offered here: ").split(", ")

View file

@ -5,6 +5,7 @@ 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"