2022-06-03 10:34:31 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
2022-12-06 01:20:01 +01:00
|
|
|
using System.IO;
|
2022-06-03 10:34:31 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class NewGame : MonoBehaviour
|
|
|
|
{
|
|
|
|
public void ResetSettings()
|
|
|
|
{
|
2022-10-02 18:45:58 +02:00
|
|
|
// when new game is started, clear all rememberred vars (for now, added for this one with dynamic names)
|
|
|
|
PlayerPrefs.DeleteAll();
|
|
|
|
|
|
|
|
// !!! TODO do local save in other way !!!
|
|
|
|
// !!! comment on changed elements
|
|
|
|
|
2022-06-03 10:34:31 +02:00
|
|
|
int rock = 1;
|
2022-11-03 20:30:40 +01:00
|
|
|
PlayerPrefs.SetInt("rock", rock); // Is it used anywhere? I have not found it
|
2022-10-02 18:45:58 +02:00
|
|
|
/*
|
|
|
|
string pickaxe1 = "create";
|
|
|
|
PlayerPrefs.SetString("pickaxe1", pickaxe1);
|
|
|
|
*/
|
2022-10-23 13:29:22 +02:00
|
|
|
PlayerPrefs.SetFloat("exp", 0);
|
|
|
|
PlayerPrefs.SetInt("lvl", 1);
|
|
|
|
PlayerPrefs.SetFloat("maxExp", 10);
|
2022-11-14 22:22:08 +01:00
|
|
|
|
2022-12-24 15:14:41 +01:00
|
|
|
PlayerPrefs.SetInt(AccountBalanceManager.PLAYER_ACCOUNT_VALUE, 0);
|
|
|
|
|
2022-06-03 10:34:31 +02:00
|
|
|
string name = "none";
|
|
|
|
PlayerPrefs.SetString("name", name);
|
2022-10-02 18:45:58 +02:00
|
|
|
|
2022-11-14 22:22:08 +01:00
|
|
|
int isQuest = 1;
|
|
|
|
PlayerPrefs.SetInt("lumberjack", isQuest);
|
2023-01-06 21:52:59 +01:00
|
|
|
|
2022-10-02 18:45:58 +02:00
|
|
|
/*
|
|
|
|
int isKilled = 0;
|
|
|
|
PlayerPrefs.SetInt("bat0", isKilled);
|
|
|
|
PlayerPrefs.SetInt("bat1", isKilled);
|
|
|
|
PlayerPrefs.SetInt("skeleton0", isKilled);
|
|
|
|
PlayerPrefs.SetInt("slime0", isKilled);
|
|
|
|
PlayerPrefs.SetInt("slime1", isKilled);
|
|
|
|
*/
|
|
|
|
|
2022-06-15 16:32:14 +02:00
|
|
|
float health = 10.0f;
|
2022-11-14 22:22:08 +01:00
|
|
|
PlayerPrefs.SetFloat("maxHealth", 10);
|
|
|
|
PlayerPrefs.SetFloat("health", 10);
|
2023-01-06 21:52:59 +01:00
|
|
|
PlayerPrefs.SetInt("HasEverPlayed",1);
|
2022-10-02 18:45:58 +02:00
|
|
|
//PlayerPrefs.SetInt("continued", 0);
|
|
|
|
|
2022-11-03 20:30:40 +01:00
|
|
|
PlayerPrefs.SetInt("rock", 0); // Is it used anywhere? I have not found it
|
2022-10-02 18:45:58 +02:00
|
|
|
|
|
|
|
//PlayerPrefs.SetInt("goldOre", 0);
|
|
|
|
|
2022-06-15 19:54:44 +02:00
|
|
|
PlayerPrefs.SetInt("pickaxe", 0);
|
2022-11-03 20:30:40 +01:00
|
|
|
|
2022-12-25 03:39:31 +01:00
|
|
|
// PLAYER SKILLS ------------------------------------------------------
|
|
|
|
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_FREE_POINTS, 0);
|
2022-11-14 22:22:08 +01:00
|
|
|
|
2022-12-25 03:39:31 +01:00
|
|
|
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_HEALTH_POINTS, 0); // healthPoints
|
|
|
|
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_DEFENSE_POINTS, 0); // defensePoints
|
|
|
|
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_STRENGHT_POINTS, 0); // StrengthPoints
|
2023-01-05 20:13:14 +01:00
|
|
|
PlayerPrefs.SetInt(SkillsPointsManger.PLAYER_SKILS_INTELIGENCE_POINTS, 0); // IntelligencePoints
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
//LETTER --------------------------------------------------------------
|
|
|
|
PlayerPrefs.SetInt("PrologueLetter.WhereDisplayed", 0);
|
|
|
|
PlayerPrefs.SetInt("ControlLetter.WhereDisplayed", 0);
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
//NPC ACTIONS HERE ----------------------------------------------------
|
|
|
|
|
|
|
|
// -> Wizard House
|
2023-01-06 21:54:50 +01:00
|
|
|
PlayerPrefs.SetInt("Wizard.FirstMission", 0);
|
2022-12-11 23:06:16 +01:00
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
2022-12-06 01:20:01 +01:00
|
|
|
OnMapAppearanceMethod.SetNewGameStatus();
|
|
|
|
|
|
|
|
// remove all binary files from Application.persistentDataPath + "/";
|
|
|
|
|
|
|
|
System.IO.DirectoryInfo di = new DirectoryInfo(Application.persistentDataPath);
|
|
|
|
|
|
|
|
foreach (FileInfo file in di.GetFiles())
|
|
|
|
{
|
2022-12-13 01:03:03 +01:00
|
|
|
if (file.FullName.Contains("Player.log"))
|
|
|
|
continue;
|
|
|
|
|
2022-12-06 01:20:01 +01:00
|
|
|
file.Delete();
|
|
|
|
}
|
2022-12-13 01:03:03 +01:00
|
|
|
|
2022-12-06 01:20:01 +01:00
|
|
|
foreach (DirectoryInfo dir in di.GetDirectories())
|
|
|
|
{
|
|
|
|
dir.Delete(true);
|
|
|
|
}
|
2022-06-03 10:34:31 +02:00
|
|
|
}
|
2023-01-06 21:54:50 +01:00
|
|
|
}
|