From f154af22285d048f55dc8c1207ba434e952fecb8 Mon Sep 17 00:00:00 2001 From: Pop4484 <67192138+Pop4484@users.noreply.github.com> Date: Wed, 17 Nov 2021 16:46:31 +0200 Subject: [PATCH] Load stats from overworld to encounters cool --- Assets/Scripts/Status/PlayerCharacter.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Status/PlayerCharacter.cs b/Assets/Scripts/Status/PlayerCharacter.cs index e8342385d..b128eb81a 100644 --- a/Assets/Scripts/Status/PlayerCharacter.cs +++ b/Assets/Scripts/Status/PlayerCharacter.cs @@ -66,7 +66,7 @@ public void Reset(bool resetName = true) { if (resetName) Name = ControlPanel.instance.BasisName; SetLevel(1); - SetEXP(0); + SetEXP(0); //ok so here you change the level! SetGold(0); Weapon = "Fists"; Armor = "Funny Clothes"; @@ -74,6 +74,17 @@ public void Reset(bool resetName = true) { ArmorDEF = 10; HP = MaxHP; MusicManager.SetSoundDictionary("RESETDICTIONARY", ""); + + if (File.Exists(Application.persistentDataPath + "/AlMightySave.gd")) //load level from overworld save file into battle too :D + { + Debug.Log("We found an almighty save at this location : " + Application.persistentDataPath + "/AlMightySave.gd"); + BinaryFormatter bf = new BinaryFormatter(); + FileStream file = File.Open(Application.persistentDataPath + "/AlMightySave.gd", FileMode.Open); + almightycurrentGame = (AlMightyGameState)bf.Deserialize(file); + almightycurrentGame.LoadVariables(); + file.Close(); + return true; + } } public int GetNext() {