Simplify running more than one fight at a time

This still requires too much manual work, so I probably will change
things up again, but I wanted to have a record just in case.
This commit is contained in:
Nate Bowman
2026-10-18 17:44:17 -04:00
parent 93372fed4a
commit ec3eb15731
3 changed files with 167 additions and 30 deletions

75
flashcards/constants.py Normal file
View File

@@ -0,0 +1,75 @@
from flashcards.types import ArmorClasses
ranges = {ArmorClasses.MELEE: {
'standard': range(-3, 5),
'parthian tactics (armor)': range(-3, 5),
'villager': range(-3, 5),
},
ArmorClasses.PIERCE: {
'standard': range(-4, 5),
'parthian tactics (armor)': range(-6, 5),
'parthian tactics (attack)': range(-4, 7),
'gambesons': range(-5, 5),
'villager': range(-2, 5),
}
}
class UnitLines():
lines = {'Scout Cavalry': {
'names': [
'Scout Cavalry',
'Light Cavalry',
'Hussar'
],
'attack_type': ArmorClasses.MELEE,
'hp_bonus_names': ['Bloodlines'],
},
'Spearman': {
'names': [
'Spearman',
'Pikeman',
'Halberdier'
],
'attack_type': ArmorClasses.MELEE,
},
'Knight': {
'names': [
'Knight',
'Cavalier',
'Paladin'
],
'attack_type': ArmorClasses.MELEE,
'hp_bonus_names': ['Bloodlines'],
},
}
@classmethod
def get_names(cls, name: str) -> list(str):
line = cls.lines[name]
try:
names = line['names']
except KeyError:
names = [name]
print(names)
return names
@classmethod
def get_attack(cls, name: str) -> ArmorClasses:
return cls.lines[name]['attack_type']
@classmethod
def get_hp_bonus_names(cls, name: str) -> list(str):
line = cls.lines[name]
try:
bonuses = line['hp_bonus_names']
except KeyError:
bonuses = []
return bonuses