Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Blade & Sorcery save parser to 1.0 #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions games/game_bladeandsorcery.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ def __init__(self, filepath: Path):
super().__init__(filepath)
with open(self._filepath, "rb") as save:
save_data = json.load(save)
self._gameMode: str = save_data["gameModeId"]
self._gameMode = save_data["mode"]["saveData"]["gameModeId"]
self._gender = (
"Male" if save_data["creatureId"] == "PlayerDefaultMale" else "Female"
"Male"
if save_data["customization"]["creatureId"] == "PlayerDefaultMale"
else "Female"
)
self._ethnicity: str = save_data["ethnicGroupId"]
self._ethnicity = save_data["customization"]["ethnicGroupId"]
h, m, s = save_data["playTime"].split(":")
self._elapsed = (int(h), int(m), float(s))
self._elapsed = (float(h), int(m), float(s))
f_stat = self._filepath.stat()
self._created = f_stat.st_birthtime
self._modified = f_stat.st_mtime
Expand Down Expand Up @@ -65,8 +67,8 @@ def bas_parse_metadata(p: Path, save: mobase.ISaveGame) -> Mapping[str, str]:

class BaSGame(BasicGame):
Name = "Blade & Sorcery Plugin"
Author = "R3z Shark & Silarn"
Version = "0.5.0"
Author = "R3z Shark & Silarn & Jonny_Bro"
Version = "0.5.1"

GameName = "Blade & Sorcery"
GameShortName = "bladeandsorcery"
Expand Down
Loading