Fix level calculation, allow collecting decks outside mass decks

This commit is contained in:
mez 2025-07-06 11:42:38 +01:00
parent 5c3f54d280
commit 03c3cedb6b
3 changed files with 27 additions and 7 deletions

View file

@ -25,6 +25,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- =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
- =faves=: a list of cards to showcase on the index page
@ -33,7 +34,7 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- =sketchprize=: prize you normally want for sketchpads in the art shop (1 or 2)
- =collectthreshold=: minimum number of owned cards for putting a deck in the “collecting” category (all cards in mass decks will be included)
- =mediumthreshold=: minimum number of owned cards for marking a deck as medium priority
- =massmediumthreshold=: minimum number of owned cards for marking a deck in a mass deck medium priority (should normally be lower than =mediumthreshold=)
- =collectingmediumthreshold=: minimum number of owned cards for marking a deck being collected as medium priority (should normally be lower than =mediumthreshold=)
- =highthreshold=: minimum number of owned cards for marking a deck as high priority
- =keepsig=: =True= if you always want to keep one copy of your signature, =False= if you want to make them all available for trading
- =tradestatement=: statement to place on your trading page

View file

@ -132,7 +132,7 @@ for event in log.log:
if thecard["priority"] == 0:
if thedeck in variables.highpriority:
thecard["priority"] = 1
elif len(thecard["mass"]) > 0:
elif len(thecard["mass"]) > 0 or thedeck in variables.lowpriority:
thecard["priority"] = 3
else:
thecard["priority"] = 4
@ -276,7 +276,7 @@ print("Calculating level")
if len(cardlist) + tradepend > 14400:
rankcode = "rainbow"
extra = len(cardlist) + tradepend - 14400
extra = len(cardlist) + tradepend - 14401
plusranks = int(extra / 300)
if plusranks > 0:
rank = "rainbow + " + str(plusranks)
@ -463,8 +463,8 @@ for deck in decklist:
deck["mastered"] = False
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:
if deck["count"] >= variables.massmediumthreshold:
elif len(deck["mass"]) > 0 or deck["name"] in variables.lowpriority:
if deck["count"] >= variables.collectingmediumthreshold:
deck["priority"] = 2
else:
deck["priority"] = 3
@ -525,6 +525,24 @@ 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]
wantedcard["priority"] = 1
wantedlist.append(wantedcard)
for deck in variables.lowpriority:
if deck not in decknames:
for number in numbers:
wantedcard = {}
wantedcard["name"] = deck + number
wantedcard["colour"] = deckkey[deck]
wantedcard["priority"] = 3
wantedlist.append(wantedcard)
for theme in variables.masscollect:
try:
for deck in variables.masscollect[theme]["decks"]:
@ -2180,7 +2198,7 @@ def massindexgen():
os.remove(thefile)
headerwrite(thefile,"mass")
content = open(thefile,"a")
content.write("<h1>mass collecting/keeping</h1>\n<ul>\n")
content.write("<h1>mass collecting</h1>\n<ul>\n")
massindex = 1
for series in masslist:
content.write("<li><a href=\"")

View file

@ -6,6 +6,7 @@ name = "your name"
sig = False
banner = False
highpriority = ["deckname","nameofadeck"]
lowpriority = ["deckname","nameofadeck"]
trademedium = True
tradepost = "URL"
faves = ["favecard01","favecard02"]
@ -14,7 +15,7 @@ british = True
sketchprize = 1
collectthreshold = 2
mediumthreshold = 5
massmediumthreshold = 1
collectingmediumthreshold = 1
highthreshold = 10
keepsig = True
tradestatement = ""