Remove high priority collecting, fix statistics function
This commit is contained in:
parent
fd47368d5a
commit
07e850e612
4 changed files with 28 additions and 39 deletions
|
@ -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
|
||||
- =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
|
||||
|
|
17
colors.py
17
colors.py
|
@ -152,9 +152,7 @@ for event in log.log:
|
|||
thecard["priority"] = 1
|
||||
else:
|
||||
if thecard["priority"] == 0:
|
||||
if thedeck in variables.highpriority:
|
||||
thecard["priority"] = 1
|
||||
elif len(thecard["mass"]) > 0 or thedeck in variables.lowpriority:
|
||||
if len(thecard["mass"]) > 0 or thedeck in variables.lowpriority:
|
||||
thecard["priority"] = 3
|
||||
else:
|
||||
thecard["priority"] = 4
|
||||
|
@ -499,7 +497,7 @@ for deck in decklist:
|
|||
deck["mastered"] = dates[-1]
|
||||
else:
|
||||
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
|
||||
elif len(deck["mass"]) > 0 or deck["name"] in variables.lowpriority:
|
||||
if deck["count"] >= variables.collectingmediumthreshold:
|
||||
|
@ -554,6 +552,7 @@ for deck in decklist:
|
|||
wantedcard["colour"] = deck["colour"]
|
||||
wantedcard["series"] = deck["series"]
|
||||
wantedcard["priority"] = deck["priority"]
|
||||
wantedcard["mass"] = deck["mass"]
|
||||
wantedlist.append(wantedcard)
|
||||
|
||||
decknames = []
|
||||
|
@ -564,16 +563,6 @@ 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:
|
||||
|
|
48
tools.py
48
tools.py
|
@ -1616,34 +1616,36 @@ def stats():
|
|||
print("Wantlist: " + str(len(colors.wantedlist)) + " cards")
|
||||
print("Mastered: " + str(masteredsize) + " decks")
|
||||
print("Mass collection progress:")
|
||||
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
|
||||
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
|
||||
try:
|
||||
thenumber += 20 * len(value["decks"])
|
||||
except:
|
||||
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:
|
||||
pass
|
||||
try:
|
||||
thenumber += len(value["singles"])
|
||||
except:
|
||||
themecount += 20 * len(variables.masscollect[mass]["decks"])
|
||||
except KeyError:
|
||||
pass
|
||||
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)) + "%)")
|
||||
try:
|
||||
themecount += len(variables.masscollect[mass]["singles"])
|
||||
except KeyError:
|
||||
pass
|
||||
if held == themecount:
|
||||
print(" " + mass + ": complete")
|
||||
else:
|
||||
print(" " + key + ": complete")
|
||||
print(" " + mass + ": " + str(held) + "/" + str(themecount) + " (" + str(int((float(held)/float(themecount)) * 100)) + "%)")
|
||||
|
||||
def tradecheck():
|
||||
inoffer = input("Paste cards they offered here: ").split(", ")
|
||||
|
|
|
@ -5,7 +5,6 @@ url = ""
|
|||
name = "your name"
|
||||
sig = False
|
||||
banner = False
|
||||
highpriority = ["deckname","nameofadeck"]
|
||||
lowpriority = ["deckname","nameofadeck"]
|
||||
trademedium = True
|
||||
tradepost = "URL"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue