From e13a975cbe1d00eba6f5edcd02abe33061670715 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" <48434875+JonnyBro@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:51:46 +0500 Subject: [PATCH 1/2] Update Blade & Sorcery save parser to 1.0 --- games/game_bladeandsorcery.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/games/game_bladeandsorcery.py b/games/game_bladeandsorcery.py index 6d7187e..b4d232f 100644 --- a/games/game_bladeandsorcery.py +++ b/games/game_bladeandsorcery.py @@ -18,13 +18,13 @@ 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 @@ -65,7 +65,7 @@ def bas_parse_metadata(p: Path, save: mobase.ISaveGame) -> Mapping[str, str]: class BaSGame(BasicGame): Name = "Blade & Sorcery Plugin" - Author = "R3z Shark & Silarn" + Author = "R3z Shark & Silarn & Jonny_Bro" Version = "0.5.0" GameName = "Blade & Sorcery" From 81402015ec4628c1797a08efc8580ac68fc39eb3 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Mon, 5 Aug 2024 17:42:27 +0500 Subject: [PATCH 2/2] Bump version and fix linting --- games/game_bladeandsorcery.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/games/game_bladeandsorcery.py b/games/game_bladeandsorcery.py index b4d232f..3656205 100644 --- a/games/game_bladeandsorcery.py +++ b/games/game_bladeandsorcery.py @@ -20,7 +20,9 @@ def __init__(self, filepath: Path): save_data = json.load(save) self._gameMode = save_data["mode"]["saveData"]["gameModeId"] self._gender = ( - "Male" if save_data["customization"]["creatureId"] == "PlayerDefaultMale" else "Female" + "Male" + if save_data["customization"]["creatureId"] == "PlayerDefaultMale" + else "Female" ) self._ethnicity = save_data["customization"]["ethnicGroupId"] h, m, s = save_data["playTime"].split(":") @@ -66,7 +68,7 @@ def bas_parse_metadata(p: Path, save: mobase.ISaveGame) -> Mapping[str, str]: class BaSGame(BasicGame): Name = "Blade & Sorcery Plugin" Author = "R3z Shark & Silarn & Jonny_Bro" - Version = "0.5.0" + Version = "0.5.1" GameName = "Blade & Sorcery" GameShortName = "bladeandsorcery"