built routes for creation of char
This commit is contained in:
@@ -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] = []
|
||||
|
||||
@@ -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():
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ def set_level(entity:Entity, target_level: int, prog: LevelProgression) -> None:
|
||||
|
||||
# entity get's a random number of spells based on the number of levels gained
|
||||
skills_per_level = calculate_skills_gained(current,target_level)
|
||||
|
||||
|
||||
skills = newly_unlocked_abilities(class_name=entity.profession.name,
|
||||
path=entity.ability_pathway,
|
||||
level=target_level,
|
||||
|
||||
Reference in New Issue
Block a user