built routes for creation of char
This commit is contained in:
@@ -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():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user