Commit 8eece222 authored by Julia Santos's avatar Julia Santos

Edited event handler and quest node so that it can search the list of quests...

Edited event handler and quest node so that it can search the list of quests instead of just using booleans
parent 5c044aef
......@@ -29,8 +29,6 @@ onready var neighborsBalcony = get_parent().get_node("Neighbor's balcony")
#functioning stuff
onready var quests = notepad.get_node("Quests")
onready var groceries = false #if groceries were put away
onready var eat = false # if moxie has eaten the first time
onready var laundry = false #if laundry has been done
onready var newQuests = false
onready var lockedNotepad #if ur locked from certain areas bc u havent gotten the notebook yet
......@@ -64,10 +62,9 @@ func _groceries_put_away(): # when the groceries are put away
func _eaten(): # completing first "Eat" quest
quests.finishQuest("Eat")
eat = true
func _start_lab():
if laundry and eat:
if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"):
quests.add("Feed Nana")
quests.add("Clean bathroom")
quests.add("Take care of plants")
......@@ -98,7 +95,6 @@ func _enter_notebook_laundry(): # trying to engage in the notebook puzzle for do
func _laundry_finished(): # finishing notebook puzzle for laundry
print("Finished laundry")
quests.finishQuest("Do laundry")
laundry = true
func _return_laundry_notepad(): # exiting laundry notebook puzzle
zoom_out()
......
......@@ -26,3 +26,10 @@ func finishQuest(q):
func showQuests():
text = "- " + quests.join("\n- ") # prints all quests on the notepad
#print(quests.join("\n- "))
func hasQuest(questInq): # checks if the array contains a certain quest
var has = false
for quest in quests:
if quest == questInq:
has = true
return has
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