fixed options, fixed save, new Screenshots, v.140

This commit is contained in:
TAASONI3
2023-05-10 13:57:36 +02:00
parent 6dc7063cec
commit 7387a4d9a5
112 changed files with 11929 additions and 8220 deletions

View File

@@ -20,7 +20,7 @@ namespace Assets.Scripts
// Start is called before the first frame update
void Start()
{
if (quests == null)
if (quests == null && PlayerPrefs.GetInt("isLoad") != 1)
{
quests = new Dictionary<string, List<Quest>>();
quests.Add("find", new List<Quest>());
@@ -129,18 +129,24 @@ namespace Assets.Scripts
}
}
}
int rand = new System.Random().Next(100) + 1;
foreach (string key in toDelete.Keys)
{
foreach (Quest quest in toDelete[key])
{
rand = new System.Random().Next(4);
if (quest is CollectQuest)
{
((CollectQuest)quest).removeItems(inventory);
}
quest.delete();
quests[key].Remove(quest);
inventory.addItem(new Item(luck));
if(rand == 1){
inventory.addItem(new Equipment(luck));
}
else{
inventory.addItem(new Item(luck, false));
}
}
}
}
@@ -175,6 +181,13 @@ namespace Assets.Scripts
return result;
}
private void clearQuestlog(){
int children = content.transform.childCount;
for(int i = 0; i < children; i++){
Destroy(content.transform.GetChild(i).gameObject);
}
}
public void loadQuests(JToken json)
{
var jsonData = JObject.Parse(json.ToString()).Children();
@@ -182,10 +195,9 @@ namespace Assets.Scripts
List<JToken> quests;
string key = "";
Quest questItem;
if (this.quests == null)
{
this.quests = new Dictionary<string, List<Quest>>();
}
this.quests = new Dictionary<string, List<Quest>>();
this.quests.Clear();
clearQuestlog();
foreach (JToken keyword in keywords)
{
jsonData = JObject.Parse(keyword.ToString()).Children();