From 8cfd03c6eceef0c4d62a03ed1196f28f9a19425e Mon Sep 17 00:00:00 2001 From: Nate Bowman Date: Tue, 27 Oct 2026 19:22:44 -0400 Subject: [PATCH] Allow creation of fighting cards in bulk --- flashcards/fighting.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/flashcards/fighting.py b/flashcards/fighting.py index 5d9c9fe..0d063ca 100644 --- a/flashcards/fighting.py +++ b/flashcards/fighting.py @@ -139,13 +139,6 @@ def generate_notes(attack_bonus_names, armor_bonus_names, hp_bonus_names): if len(hp_bonus_names) > 0: notes += f'with {" and ".join(hp_bonus_names)} applied. ' - other = attack_bonus_names + armor_bonus_names - if len(other) > 0: - verb = 'is' - if len(other) > 1: - verb = 'are' - notes += f'{" and ".join(other)} {verb} incoporated into net attack range' - return notes @@ -321,7 +314,9 @@ def generate_all_fight_results(data, nums): loops over all possible values of blacksmith research and any other relevant non-blacksmith bonuses found in fighting.constants.bonuses. ''' + all_results = {} for attacker, defender in itertools.product(nums.keys(), nums.keys()): + fight_results = [] attack_type = get_attack_type(nums[attacker], data) bonus_names = get_possible_bonus_names_for_fight(attacker, defender) combos = generate_all_combinations(*bonus_names) @@ -336,5 +331,7 @@ def generate_all_fight_results(data, nums): combo[0], combo[1], combo[2], - True) - print(results) + False) + fight_results.append(results) + all_results[(attacker, defender)] = fight_results + return all_results