44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
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.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",
|
|
profession_id="arcanist",
|
|
ability_pathway="Frostbinder",
|
|
level=50
|
|
)
|
|
|
|
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!
|
|
|
|
|
|
# import json
|
|
# player_dict = asdict(player)
|
|
# print(json.dumps(player_dict,indent=True))
|
|
|
|
|
|
# serialize / deserialize
|
|
# to json
|
|
# player_dict = asdict(player)
|
|
|
|
# from json to dataclass
|
|
# from app.game.utils.loaders import from_dict
|
|
# from app.game.models.entities import Entity
|
|
# player_e = from_dict(Entity,player_dict)
|
|
# print(player_e)
|