2 Commits

Author SHA1 Message Date
cclecle
7a2eb6db47 fix linux path style
fix missing directory in testfiles
2023-07-23 13:55:19 +01:00
cclecle
95daa73463 fix: wrong commented out line 2023-07-23 13:48:48 +01:00
3 changed files with 11 additions and 11 deletions

View File

@@ -133,25 +133,25 @@ class SOTFSaveThune:
def resuscitate_virginia(self) -> None:
self.open_last_save()
nestedjson = json.loads(self.lastGameStateSaveData["Data"]["GameState"])
if "IsVirginiaDead" in nestedjson:
#print(nestedjson["IsVirginiaDead"])
# if "IsVirginiaDead" in nestedjson:
# print(nestedjson["IsVirginiaDead"])
nestedjson["IsVirginiaDead"] = False
#print(nestedjson["IsVirginiaDead"])
# print(nestedjson["IsVirginiaDead"])
self.lastGameStateSaveData["Data"]["GameState"] = json.dumps(nestedjson)
nestedjson = json.loads(self.lastSaveData["Data"]["VailWorldSim"])
#print(nestedjson["Actors"])
# print(nestedjson["Actors"])
Virginia = [_ for _ in nestedjson["Actors"] if _["TypeId"] == 10][0]
#print(Virginia)
# print(Virginia)
if "PlayerKilled" in Virginia and Virginia["PlayerKilled"] == True:
del Virginia["PlayerKilled"]
Virginia["FamilyId "] = 0
Virginia["State "] = 2
Virginia["Stats"] = {"Health": 100, "Anger": 0, "Fear": 0, "Fullness": 44, "Hydration": 16, "Energy": 100, "Affection": 50}
Virginia["StateFlags "] = 0
#print(nestedjson["Actors"])
# print(nestedjson["Actors"])
self.lastSaveData["Data"]["VailWorldSim"] = json.dumps(nestedjson)
self.save_last_save()

View File

@@ -24,22 +24,22 @@ class TestSOTF(unittest.TestCase):
self.assertNotEqual(sotffixcompanions.__version__, "?.?.?")
def test_SOTFSaveThune_searchlastsave(self):
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles" / "Saves")
testSOTF.search_last_save()
def test_SOTFSaveThune_SaveNotFound(self):
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\NoSaves")
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles" / "NoSaves")
with self.assertRaises(sotffixcompanions.SOTFSaveThune_Exception_SaveNotFound):
testSOTF.open_last_save()
def test_SOTFSaveThune_openlastsave(self):
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles" / "Saves")
testSOTF.open_last_save()
def test_SOTFSaveThune_resuscitate_kelvin(self):
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles" / "Saves")
testSOTF.resuscitate_kelvin()
def test_SOTFSaveThune_resuscitate_virginia(self):
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles" / "Saves")
testSOTF.resuscitate_virginia()

View File