complete regen of hero classes, spells, races, etc

This commit is contained in:
2025-11-02 18:16:00 -06:00
parent 7bf81109b3
commit fd572076e0
34 changed files with 882 additions and 489 deletions

View File

@@ -1,32 +1,36 @@
from app.utils.logging import get_logger
from dataclasses import asdict
import json
logger = get_logger(__file__)
from app.game.generators.entity_factory import build_char
from app.game.systems.leveling import calculate_xp_and_level
from app.game.generators.level_progression import DEFAULT_LEVEL_PROGRESSION
from app.game.systems.leveling import grant_xp
player = build_char(
name="Philbert",
origin_story="I came from a place",
race_id="terran",
class_id="arcanist"
# profession_id="arcanist",
profession_id="guardian",
level=3
)
old, new = grant_xp(player,(156),DEFAULT_LEVEL_PROGRESSION)
player_dict = asdict(player)
print(json.dumps(player_dict,indent=True))
exit()
# MOVE HIT DICE TO WEAPONS!
# ADD DEFENSE STAT
# ADD ATTACK STAT - this will help with combat!
new_xp_stats = calculate_xp_and_level(current_xp=player.xp,xp_gain=200)
player.xp = new_xp_stats.get("new_xp")
player.level = new_xp_stats.get("new_level")
player.xp_to_next_level = new_xp_stats.get("xp_to_next_level")
import json
player_dict = asdict(player)
print(json.dumps(player_dict,indent=True))
# import json
# player_dict = asdict(player)
# print(json.dumps(player_dict,indent=True))
# serialize / deserialize