Commit e76b4b13 authored by Julia Santos's avatar Julia Santos

Added quest progression to mouse click data

parent 91ad8a6d
......@@ -13,6 +13,7 @@ func _ready(): # Called when the node enters the scene tree for the first time.
func add(q): # adds a quest to the list
quests.append(q)
showQuests()
storeData("QUESTS: Added " + q)
func finishQuest(q): # removes a quest from the list
var index = 0
......@@ -31,6 +32,8 @@ func finishQuest(q): # removes a quest from the list
index += 1
if !found:
print("Unable to delete " + q)
else:
storeData("QUESTS: Finished " + q)
if q != "Eat" and q !="Do laundry" :
if quests.size() == 1 and (quests[0] == "Do Lab (Notes: 3/4)" or quests[0] == "Do Lab (Notes: 2/4)"):
get_parent().get_parent().get_parent().get_node("Event Handler").finished2ndRound()
......@@ -73,3 +76,17 @@ func addLabNote():
quests.set(index, newQuest)
showQuests()
func storeData(newString): # specifically for using one item on another, stores mouse click data to data.save
var save_data = File.new()
var curTime = OS.get_time()
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE)
save_data.store_string("FILE START\n")
save_data.store_string("\n" + timestamp + " " + newString)
print("Created file")
else:
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.store_string("\n" + timestamp + " " + newString)
save_data.close()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment