Skip to content

Commit c3e2bd1

Browse files
authored
Update Blade & Sorcery save parser to 1.0 (#152)
1 parent 19599a8 commit c3e2bd1

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

games/game_bladeandsorcery.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ def __init__(self, filepath: Path):
1818
super().__init__(filepath)
1919
with open(self._filepath, "rb") as save:
2020
save_data = json.load(save)
21-
self._gameMode: str = save_data["gameModeId"]
21+
self._gameMode = save_data["mode"]["saveData"]["gameModeId"]
2222
self._gender = (
23-
"Male" if save_data["creatureId"] == "PlayerDefaultMale" else "Female"
23+
"Male"
24+
if save_data["customization"]["creatureId"] == "PlayerDefaultMale"
25+
else "Female"
2426
)
25-
self._ethnicity: str = save_data["ethnicGroupId"]
27+
self._ethnicity = save_data["customization"]["ethnicGroupId"]
2628
h, m, s = save_data["playTime"].split(":")
27-
self._elapsed = (int(h), int(m), float(s))
29+
self._elapsed = (float(h), int(m), float(s))
2830
f_stat = self._filepath.stat()
2931
self._created = f_stat.st_birthtime
3032
self._modified = f_stat.st_mtime
@@ -65,8 +67,8 @@ def bas_parse_metadata(p: Path, save: mobase.ISaveGame) -> Mapping[str, str]:
6567

6668
class BaSGame(BasicGame):
6769
Name = "Blade & Sorcery Plugin"
68-
Author = "R3z Shark & Silarn"
69-
Version = "0.5.0"
70+
Author = "R3z Shark & Silarn & Jonny_Bro"
71+
Version = "0.5.1"
7072

7173
GameName = "Blade & Sorcery"
7274
GameShortName = "bladeandsorcery"

0 commit comments

Comments
 (0)