Fix level calculation, allow collecting decks outside mass decks
This commit is contained in:
parent
5c3f54d280
commit
03c3cedb6b
3 changed files with 27 additions and 7 deletions
|
@ -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
|
- =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
|
- =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)
|
- =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
|
||||||
- =faves=: a list of cards to showcase on the index page
|
- =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)
|
- =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)
|
- =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
|
- =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
|
- =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
|
- =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
|
- =tradestatement=: statement to place on your trading page
|
||||||
|
|
28
colors.py
28
colors.py
|
@ -132,7 +132,7 @@ for event in log.log:
|
||||||
if thecard["priority"] == 0:
|
if thecard["priority"] == 0:
|
||||||
if thedeck in variables.highpriority:
|
if thedeck in variables.highpriority:
|
||||||
thecard["priority"] = 1
|
thecard["priority"] = 1
|
||||||
elif len(thecard["mass"]) > 0:
|
elif len(thecard["mass"]) > 0 or thedeck in variables.lowpriority:
|
||||||
thecard["priority"] = 3
|
thecard["priority"] = 3
|
||||||
else:
|
else:
|
||||||
thecard["priority"] = 4
|
thecard["priority"] = 4
|
||||||
|
@ -276,7 +276,7 @@ print("Calculating level")
|
||||||
|
|
||||||
if len(cardlist) + tradepend > 14400:
|
if len(cardlist) + tradepend > 14400:
|
||||||
rankcode = "rainbow"
|
rankcode = "rainbow"
|
||||||
extra = len(cardlist) + tradepend - 14400
|
extra = len(cardlist) + tradepend - 14401
|
||||||
plusranks = int(extra / 300)
|
plusranks = int(extra / 300)
|
||||||
if plusranks > 0:
|
if plusranks > 0:
|
||||||
rank = "rainbow + " + str(plusranks)
|
rank = "rainbow + " + str(plusranks)
|
||||||
|
@ -463,8 +463,8 @@ for deck in decklist:
|
||||||
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["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:
|
elif len(deck["mass"]) > 0 or deck["name"] in variables.lowpriority:
|
||||||
if deck["count"] >= variables.massmediumthreshold:
|
if deck["count"] >= variables.collectingmediumthreshold:
|
||||||
deck["priority"] = 2
|
deck["priority"] = 2
|
||||||
else:
|
else:
|
||||||
deck["priority"] = 3
|
deck["priority"] = 3
|
||||||
|
@ -525,6 +525,24 @@ 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]
|
||||||
|
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:
|
for theme in variables.masscollect:
|
||||||
try:
|
try:
|
||||||
for deck in variables.masscollect[theme]["decks"]:
|
for deck in variables.masscollect[theme]["decks"]:
|
||||||
|
@ -2180,7 +2198,7 @@ def massindexgen():
|
||||||
os.remove(thefile)
|
os.remove(thefile)
|
||||||
headerwrite(thefile,"mass")
|
headerwrite(thefile,"mass")
|
||||||
content = open(thefile,"a")
|
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
|
massindex = 1
|
||||||
for series in masslist:
|
for series in masslist:
|
||||||
content.write("<li><a href=\"")
|
content.write("<li><a href=\"")
|
||||||
|
|
|
@ -6,6 +6,7 @@ name = "your name"
|
||||||
sig = False
|
sig = False
|
||||||
banner = False
|
banner = False
|
||||||
highpriority = ["deckname","nameofadeck"]
|
highpriority = ["deckname","nameofadeck"]
|
||||||
|
lowpriority = ["deckname","nameofadeck"]
|
||||||
trademedium = True
|
trademedium = True
|
||||||
tradepost = "URL"
|
tradepost = "URL"
|
||||||
faves = ["favecard01","favecard02"]
|
faves = ["favecard01","favecard02"]
|
||||||
|
@ -14,7 +15,7 @@ british = True
|
||||||
sketchprize = 1
|
sketchprize = 1
|
||||||
collectthreshold = 2
|
collectthreshold = 2
|
||||||
mediumthreshold = 5
|
mediumthreshold = 5
|
||||||
massmediumthreshold = 1
|
collectingmediumthreshold = 1
|
||||||
highthreshold = 10
|
highthreshold = 10
|
||||||
keepsig = True
|
keepsig = True
|
||||||
tradestatement = ""
|
tradestatement = ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue