1
main
beiyanpiki 1 year ago
parent 9fdf034eb2
commit ca4408d2ec

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -303,6 +303,7 @@ def main():
sets = PSet(set_name, set_symbol, set_publish_date, set_series)
cidx = set()
for card in collection['cards']:
if card['details']['rarityText'].find('') != -1:
continue
@ -314,10 +315,7 @@ def main():
label = get_label(card)
if card_type == CardType.BasicEnergy and name.find('') != -1:
name = name.replace('','').replace('','')
name = name.replace('', '').replace('', '')
card_idx, coll_num = get_card_in_coll(card)
artist = card['details'].get('illustratorName', [None])[0]
@ -332,7 +330,12 @@ def main():
card_after = Card(name, card_text, card_type, mechanic, label, pokemon_attr, collect_attr, energy_attr,
regulation_mark)
card_after.img_path = card['image']
sets.cards.append(card_after)
if card_idx in cidx:
continue
else:
sets.cards.append(card_after)
cidx.add(card_idx)
database[set_symbol] = sets
database["SMP"] = database.pop("PROMO")
@ -431,7 +434,6 @@ def convert_to_json(obj, compress=False):
default=custom_encoder,
separators=(',', ':'))
if __name__ == '__main__':
data = main()

@ -279,7 +279,7 @@ class Card:
f"{self.pokemon_attr.hp}|"
f"{self.pokemon_attr.energy_type.value}|"
f"{self.pokemon_attr.ability.name if self.pokemon_attr.ability else ''}|"
f"{[attack.name for attack in self.pokemon_attr.attacks]}|"
f"{[f'{attack.name}|{attack.text}|{attack.damage}' for attack in self.pokemon_attr.attacks]}|"
f"{self.pokemon_attr.weakness.value if self.pokemon_attr.weakness else ''}|"
f"{self.pokemon_attr.resistance.resistance_type.value if self.pokemon_attr.resistance else ''}|"
f"{self.pokemon_attr.resistance.resistance_value if self.pokemon_attr.resistance else ''}|"

Loading…
Cancel
Save