Compare commits
3 Commits
master
...
0.0.1.post
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82f8feb884 | ||
|
|
7a2eb6db47 | ||
|
|
95daa73463 |
@@ -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()
|
||||
|
||||
@@ -14,32 +14,32 @@ from contextlib import redirect_stdout, redirect_stderr
|
||||
print(__name__)
|
||||
print(__package__)
|
||||
|
||||
from src import sotffixcompanions
|
||||
from src.sotffixcompanions import SOTFSaveThune, __version__, SOTFSaveThune_Exception_SaveNotFound
|
||||
|
||||
testdir_path = Path(__file__).parent.resolve()
|
||||
|
||||
|
||||
class TestSOTF(unittest.TestCase):
|
||||
def test_version(self):
|
||||
self.assertNotEqual(sotffixcompanions.__version__, "?.?.?")
|
||||
self.assertNotEqual(__version__, "?.?.?")
|
||||
|
||||
def test_SOTFSaveThune_searchlastsave(self):
|
||||
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
|
||||
testSOTF = SOTFSaveThune(testdir_path / "testfiles" / "Saves")
|
||||
testSOTF.search_last_save()
|
||||
|
||||
def test_SOTFSaveThune_SaveNotFound(self):
|
||||
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\NoSaves")
|
||||
with self.assertRaises(sotffixcompanions.SOTFSaveThune_Exception_SaveNotFound):
|
||||
testSOTF = SOTFSaveThune(testdir_path / "testfiles" / "NoSaves")
|
||||
with self.assertRaises(SOTFSaveThune_Exception_SaveNotFound):
|
||||
testSOTF.open_last_save()
|
||||
|
||||
def test_SOTFSaveThune_openlastsave(self):
|
||||
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
|
||||
testSOTF = SOTFSaveThune(testdir_path / "testfiles" / "Saves")
|
||||
testSOTF.open_last_save()
|
||||
|
||||
def test_SOTFSaveThune_resuscitate_kelvin(self):
|
||||
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
|
||||
testSOTF = SOTFSaveThune(testdir_path / "testfiles" / "Saves")
|
||||
testSOTF.resuscitate_kelvin()
|
||||
|
||||
def test_SOTFSaveThune_resuscitate_virginia(self):
|
||||
testSOTF = sotffixcompanions.SOTFSaveThune(testdir_path / "testfiles\\Saves")
|
||||
testSOTF = SOTFSaveThune(testdir_path / "testfiles" / "Saves")
|
||||
testSOTF.resuscitate_virginia()
|
||||
|
||||
0
test/testfiles/NoSave/.gitkeep
Normal file
0
test/testfiles/NoSave/.gitkeep
Normal file
Reference in New Issue
Block a user