Compare commits
2 commits
a8783c9574
...
ab0c692141
Author | SHA1 | Date | |
---|---|---|---|
ab0c692141 | |||
02e73e2c93 |
1 changed files with 45 additions and 35 deletions
80
tools.py
80
tools.py
|
@ -406,7 +406,6 @@ def nextportfolio(monochrome=False):
|
||||||
print("Master some more decks first")
|
print("Master some more decks first")
|
||||||
|
|
||||||
def switchit():
|
def switchit():
|
||||||
wantedbypriority = sorted(colors.wantedlist, key=lambda d: d["priority"])
|
|
||||||
redtrade = []
|
redtrade = []
|
||||||
orangetrade = []
|
orangetrade = []
|
||||||
yellowtrade = []
|
yellowtrade = []
|
||||||
|
@ -434,7 +433,7 @@ def switchit():
|
||||||
elif card["colour"] == "gray":
|
elif card["colour"] == "gray":
|
||||||
greytrade.append(card["name"])
|
greytrade.append(card["name"])
|
||||||
wantednames = []
|
wantednames = []
|
||||||
for card in wantedbypriority:
|
for card in colors.wantedlist:
|
||||||
wantednames.append(card["name"])
|
wantednames.append(card["name"])
|
||||||
wantall = []
|
wantall = []
|
||||||
tradeall = []
|
tradeall = []
|
||||||
|
@ -1708,9 +1707,13 @@ def natsume():
|
||||||
natsuwantgrouped.append(listone)
|
natsuwantgrouped.append(listone)
|
||||||
listone = []
|
listone = []
|
||||||
listone.append(card)
|
listone.append(card)
|
||||||
|
if index + 1 == len(natsuwant):
|
||||||
|
natsuwantgrouped.append(listone)
|
||||||
else:
|
else:
|
||||||
listone = []
|
listone = []
|
||||||
listone.append(card)
|
listone.append(card)
|
||||||
|
if len(natsuwant) == 1:
|
||||||
|
natsuwantgrouped.append(listone)
|
||||||
index += 1
|
index += 1
|
||||||
index = 0
|
index = 0
|
||||||
for card in natsugivech:
|
for card in natsugivech:
|
||||||
|
@ -1723,9 +1726,13 @@ def natsume():
|
||||||
natsugivechgrouped.append(listtwo)
|
natsugivechgrouped.append(listtwo)
|
||||||
listtwo = []
|
listtwo = []
|
||||||
listtwo.append(card["name"])
|
listtwo.append(card["name"])
|
||||||
|
if index + 1 == len(natsugivech):
|
||||||
|
natsugivechgrouped.append(listtwo)
|
||||||
else:
|
else:
|
||||||
listtwo = []
|
listtwo = []
|
||||||
listtwo.append(card["name"])
|
listtwo.append(card["name"])
|
||||||
|
if len(natsugivech) == 1:
|
||||||
|
natsugivechgrouped.append(listtwo)
|
||||||
index += 1
|
index += 1
|
||||||
index = 0
|
index = 0
|
||||||
for card in natsugivesp:
|
for card in natsugivesp:
|
||||||
|
@ -1738,54 +1745,57 @@ def natsume():
|
||||||
natsugivespgrouped.append(listthree)
|
natsugivespgrouped.append(listthree)
|
||||||
listthree = []
|
listthree = []
|
||||||
listthree.append(card["name"])
|
listthree.append(card["name"])
|
||||||
|
if index + 1 == len(natsugivesp):
|
||||||
|
natsugivespgrouped.append(listthree)
|
||||||
else:
|
else:
|
||||||
listthree = []
|
listthree = []
|
||||||
listthree.append(card["name"])
|
listthree.append(card["name"])
|
||||||
|
if len(natsugivesp) == 1:
|
||||||
|
natsugivespgrouped.append(listthree)
|
||||||
index += 1
|
index += 1
|
||||||
natsugivechgrouped = natsugivechgrouped[:5]
|
natsugivechgrouped = natsugivechgrouped[:5]
|
||||||
natsugivespgrouped = natsugivespgrouped[:5]
|
natsugivespgrouped = natsugivespgrouped[:5]
|
||||||
finalwant = []
|
finalwant = []
|
||||||
finalgive = []
|
finalgive = []
|
||||||
for group in natsuwantgrouped:
|
for group in natsuwantgrouped:
|
||||||
if len(finalwant) < 5:
|
if group[0]["colour"] == "special":
|
||||||
if group[0]["colour"] == "special":
|
if len(natsugivespgrouped) > 0:
|
||||||
if len(natsugivespgrouped) > 0:
|
if natsugivespgrouped[0][0][:-2] == group[0]["name"][:-2]:
|
||||||
if natsugivespgrouped[0][0][:-2] == group[0]["name"][:-2]:
|
if len(natsugivespgrouped) > 1:
|
||||||
if len(natsugivespgrouped) > 1:
|
group = group[:len(natsugivespgrouped[1])]
|
||||||
group = group[:len(natsugivespgrouped[1])]
|
natsugivespgrouped[1] = natsugivespgrouped[1][:len(group)]
|
||||||
natsugivespgrouped[1] = natsugivespgrouped[1][:len(group)]
|
for givecard in natsugivespgrouped[1]:
|
||||||
for givecard in natsugivespgrouped[1]:
|
|
||||||
finalgive.append(givecard)
|
|
||||||
natsugivespgrouped.pop(1)
|
|
||||||
for card in group:
|
|
||||||
finalwant.append(card["name"])
|
|
||||||
else:
|
|
||||||
group = group[:len(natsugivespgrouped[0])]
|
|
||||||
natsugivespgrouped[0] = natsugivespgrouped[0][:len(group)]
|
|
||||||
for givecard in natsugivespgrouped[0]:
|
|
||||||
finalgive.append(givecard)
|
finalgive.append(givecard)
|
||||||
natsugivespgrouped.pop(0)
|
natsugivespgrouped.pop(1)
|
||||||
for card in group:
|
for card in group:
|
||||||
finalwant.append(card["name"])
|
finalwant.append(card["name"])
|
||||||
else:
|
else:
|
||||||
if len(natsugivechgrouped) > 0:
|
group = group[:len(natsugivespgrouped[0])]
|
||||||
if natsugivechgrouped[0][0][:-2] == group[0]["name"][:-2]:
|
natsugivespgrouped[0] = natsugivespgrouped[0][:len(group)]
|
||||||
if len(natsugivechgrouped) > 1:
|
for givecard in natsugivespgrouped[0]:
|
||||||
group = group[:len(natsugivechgrouped[1])]
|
finalgive.append(givecard)
|
||||||
natsugivechgrouped[1] = natsugivechgrouped[1][:len(group)]
|
natsugivespgrouped.pop(0)
|
||||||
for givecard in natsugivechgrouped[1]:
|
for card in group:
|
||||||
finalgive.append(givecard)
|
finalwant.append(card["name"])
|
||||||
natsugivechgrouped.pop(1)
|
else:
|
||||||
for card in group:
|
if len(natsugivechgrouped) > 0:
|
||||||
finalwant.append(card["name"])
|
if natsugivechgrouped[0][0][:-2] == group[0]["name"][:-2]:
|
||||||
else:
|
if len(natsugivechgrouped) > 1:
|
||||||
group = group[:len(natsugivechgrouped[0])]
|
group = group[:len(natsugivechgrouped[1])]
|
||||||
natsugivechgrouped[0] = natsugivechgrouped[0][:len(group)]
|
natsugivechgrouped[1] = natsugivechgrouped[1][:len(group)]
|
||||||
for givecard in natsugivechgrouped[0]:
|
for givecard in natsugivechgrouped[1]:
|
||||||
finalgive.append(givecard)
|
finalgive.append(givecard)
|
||||||
natsugivechgrouped.pop(0)
|
natsugivechgrouped.pop(1)
|
||||||
for card in group:
|
for card in group:
|
||||||
finalwant.append(card["name"])
|
finalwant.append(card["name"])
|
||||||
|
else:
|
||||||
|
group = group[:len(natsugivechgrouped[0])]
|
||||||
|
natsugivechgrouped[0] = natsugivechgrouped[0][:len(group)]
|
||||||
|
for givecard in natsugivechgrouped[0]:
|
||||||
|
finalgive.append(givecard)
|
||||||
|
natsugivechgrouped.pop(0)
|
||||||
|
for card in group:
|
||||||
|
finalwant.append(card["name"])
|
||||||
finalwant = finalwant[:5]
|
finalwant = finalwant[:5]
|
||||||
finalgive = finalgive[:5]
|
finalgive = finalgive[:5]
|
||||||
if len(finalwant) > 0:
|
if len(finalwant) > 0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue