built routes for creation of char

This commit is contained in:
2025-11-03 21:42:39 -06:00
parent 6efd3b3aa8
commit 0c83f8cb1a
6 changed files with 188 additions and 10 deletions

View File

@@ -51,6 +51,9 @@ PATH_THEMES = _load_path_themes(themes_filename)
# ----------------- Generator -----------------
def generate_abilities_direct_damage(class_name: str,path: str,level: int, primary_stat:str , per_tier: int = 2,content_version: int = 1) -> List[Ability]:
if path not in PATH_THEMES:
return []
theme = PATH_THEMES[path]
rng = random.Random(_stable_seed(class_name, path, level, per_tier, version=content_version))
spells: List[Ability] = []

View File

@@ -13,24 +13,25 @@ dice = Dice()
progression = DEFAULT_LEVEL_PROGRESSION
def build_char(name:str, origin_story:str, race_id:str, profession_id:str,ability_pathway:str,level:int=1) -> Entity:
def build_char(name:str, origin_story:str, race_id:str, profession_id:str,ability_pathway:str="",level:int=1) -> Entity:
races = RaceRepository()
professions = ProfessionRepository()
race = races.get(race_id)
profession = professions.get(profession_id)
profession.ability_paths
e = Entity(
uuid = str(uuid.uuid4()),
name = name,
origin_story = origin_story,
race =race,
ability_pathway=ability_pathway,
profession = profession
)
if ability_pathway != "":
e.ability_pathway=ability_pathway
# apply race ability scores
for stat, delta in vars(race.ability_scores).items():