X-Git-Url: https://git.yukkurigames.com/?p=mlpccg-meta.git;a=blobdiff_plain;f=mlpccg%2FDeckList.py;h=ec576456dbebf93b51238d740c76d383ef710a46;hp=0e0cba1f6d5ea3a07ca905bb85b127a92ad7c054;hb=858c55746fe4f039a9908646e75cc7df07298c3e;hpb=0460c3c46cd330bbae7043e42a8a490662bf1e60 diff --git a/mlpccg/DeckList.py b/mlpccg/DeckList.py index 0e0cba1..ec57645 100644 --- a/mlpccg/DeckList.py +++ b/mlpccg/DeckList.py @@ -35,13 +35,12 @@ class DeckList: aspects_sorted = sorted(aspects.iteritems(), reverse=True, key=operator.itemgetter(1)) aspects_sum = float(sum([aspect[1] for aspect in aspects_sorted])) aspects_filtered = [] - cutoff = 0.66 + cutoff = 0.6 amount = 0.0 for aspect, value in aspects_sorted: amount += value / aspects_sum - if amount < cutoff: - aspects_filtered += [aspect] - else: + aspects_filtered += [aspect] + if amount >= cutoff: break return (mane, aspects_filtered) @@ -58,7 +57,7 @@ class DeckList: def ponyhead_link(self): cards = defaultdict(int) for card in self.cards: - cards[card['id'].replace('f', 'F')] += 1 + cards[card['id'].replace('pf', 'PF').replace('f', 'F')] += 1 cards = ['%sx%d' % (id, amount) for id, amount in cards.iteritems()]