Commit 184d1ea2 authored by Julia Santos's avatar Julia Santos

Clean bathroom quest can now be completed

parent 505341b9
...@@ -33,6 +33,7 @@ onready var newQuests = false ...@@ -33,6 +33,7 @@ onready var newQuests = false
onready var lockedNotepad #if ur locked from certain areas bc u havent gotten the notebook yet onready var lockedNotepad #if ur locked from certain areas bc u havent gotten the notebook yet
onready var labNotes = 0 onready var labNotes = 0
onready var clothes = 0 onready var clothes = 0
onready var bathroomClean = 0
#items in the rooms that need access to the event handler #items in the rooms that need access to the event handler
export(Array, NodePath) onready var eventItems export(Array, NodePath) onready var eventItems
...@@ -82,7 +83,7 @@ func _groceries_put_away(): # when the groceries are put away ...@@ -82,7 +83,7 @@ func _groceries_put_away(): # when the groceries are put away
func _eaten(): # completing first "Eat" quest func _eaten(): # completing first "Eat" quest
quests.finishQuest("Eat") quests.finishQuest("Eat")
func _start_lab(): func _start_lab(): # trying the lab the first time, adds the new quests
if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"): if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"):
quests.add("Clean bathroom") quests.add("Clean bathroom")
quests.add("Take care of plants") quests.add("Take care of plants")
...@@ -111,6 +112,13 @@ func _add_clothes(): ...@@ -111,6 +112,13 @@ func _add_clothes():
func get_clothes(): func get_clothes():
return clothes return clothes
func _clean():
bathroomClean = bathroomClean + 1
print("Cleaned " + str(bathroomClean))
if bathroomClean == 3:
quests.finishQuest("Clean bathroom")
inventory.remove_item_name("Cleaning mat")
# ----------------- Notebook puzzle events ----------------- # ----------------- Notebook puzzle events -----------------
func _enter_notebook_laundry(): # trying to engage in the notebook puzzle for doing laundry func _enter_notebook_laundry(): # trying to engage in the notebook puzzle for doing laundry
if !quests.hasQuest("Do laundry"): if !quests.hasQuest("Do laundry"):
...@@ -231,10 +239,13 @@ func _return_laundry(): # returning from laundry basket view ...@@ -231,10 +239,13 @@ func _return_laundry(): # returning from laundry basket view
zoom_out() zoom_out()
func _open_fridge(): # looking into the fridge func _open_fridge(): # looking into the fridge
kitchen.hide() if quests.hasQuest("Eat"):
fridge.show() kitchen.hide()
zoom_in() fridge.show()
notepad.hide() zoom_in()
notepad.hide()
else:
dialogue.text = "Fueled up and ready to go."
func _return_fridge(): # returning from fridge view func _return_fridge(): # returning from fridge view
fridge.hide() fridge.hide()
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
[ext_resource path="res://Scripts/Dialogue control/Dialogue Contro - Living room.gd" type="Script" id=5] [ext_resource path="res://Scripts/Dialogue control/Dialogue Contro - Living room.gd" type="Script" id=5]
[ext_resource path="res://Scripts/Movement scripts/Door to living room.gd" type="Script" id=6] [ext_resource path="res://Scripts/Movement scripts/Door to living room.gd" type="Script" id=6]
[sub_resource type="RectangleShape2D" id=6] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 19.9228, 36.7719 ) extents = Vector2( 19.9228, 36.7719 )
[sub_resource type="RectangleShape2D" id=4] [sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15.6685, 16.4124 ) extents = Vector2( 15.6685, 16.4124 )
[sub_resource type="RectangleShape2D" id=7] [sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 34.6417, 40.1913 ) extents = Vector2( 34.6417, 40.1913 )
[sub_resource type="StreamTexture" id=8] [sub_resource type="StreamTexture" id=4]
flags = 4 flags = 4
load_path = "res://.import/Balcony door.png-b1c8d05a5eb532517313dc4785195288.stex" load_path = "res://.import/Balcony door.png-b1c8d05a5eb532517313dc4785195288.stex"
...@@ -49,7 +49,7 @@ flavorText = "Great listeners! Terrible conversationalists." ...@@ -49,7 +49,7 @@ flavorText = "Great listeners! Terrible conversationalists."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Other plants"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Other plants"]
position = Vector2( -16.8367, -2.11676 ) position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 6 ) shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="Other plants/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Other plants/CollisionShape2D"]
position = Vector2( 0.449585, 0.542709 ) position = Vector2( 0.449585, 0.542709 )
...@@ -70,7 +70,7 @@ flavorText = "Ew... It's so dirty. Is it even water? I'm not feeding that to my ...@@ -70,7 +70,7 @@ flavorText = "Ew... It's so dirty. Is it even water? I'm not feeding that to my
[node name="CollisionShape2D" type="CollisionShape2D" parent="Pot"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Pot"]
position = Vector2( -16.8367, -2.11676 ) position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 4 ) shape = SubResource( 2 )
[node name="Sprite" type="Sprite" parent="Pot/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Pot/CollisionShape2D"]
position = Vector2( -0.00619507, -0.0649719 ) position = Vector2( -0.00619507, -0.0649719 )
...@@ -91,12 +91,12 @@ flavorText = "Clicked" ...@@ -91,12 +91,12 @@ flavorText = "Clicked"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Door to living room"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Door to living room"]
position = Vector2( -16.8367, -2.11676 ) position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 7 ) shape = SubResource( 3 )
[node name="Sprite" type="Sprite" parent="Door to living room/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Door to living room/CollisionShape2D"]
position = Vector2( 0.574005, 0.358818 ) position = Vector2( 0.574005, 0.358818 )
scale = Vector2( 0.343423, 0.403654 ) scale = Vector2( 0.343423, 0.403654 )
texture = SubResource( 8 ) texture = SubResource( 4 )
[node name="Nana" type="StaticBody2D" parent="."] [node name="Nana" type="StaticBody2D" parent="."]
position = Vector2( 240.299, 200.173 ) position = Vector2( 240.299, 200.173 )
......
[gd_scene load_steps=23 format=2] [gd_scene load_steps=24 format=2]
[ext_resource path="res://Scripts/Dialogue control/Dialogue Control - Bathroom.gd" type="Script" id=1] [ext_resource path="res://Scripts/Dialogue control/Dialogue Control - Bathroom.gd" type="Script" id=1]
[ext_resource path="res://assets/room zoom out.png" type="Texture" id=2] [ext_resource path="res://assets/room zoom out.png" type="Texture" id=2]
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
[ext_resource path="res://Lab Note.gd" type="Script" id=8] [ext_resource path="res://Lab Note.gd" type="Script" id=8]
[ext_resource path="res://assets/Thesis Clickables/mess on floor.png" type="Texture" id=9] [ext_resource path="res://assets/Thesis Clickables/mess on floor.png" type="Texture" id=9]
[ext_resource path="res://Scripts/Toilet.gd" type="Script" id=10] [ext_resource path="res://Scripts/Toilet.gd" type="Script" id=10]
[ext_resource path="res://Scripts/Sink.gd" type="Script" id=11]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 156.074, 141.192 ) extents = Vector2( 156.074, 141.192 )
...@@ -35,17 +36,17 @@ extents = Vector2( 82.0634, 51.3664 ) ...@@ -35,17 +36,17 @@ extents = Vector2( 82.0634, 51.3664 )
[sub_resource type="RectangleShape2D" id=8] [sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 205.176, 46.6856 ) extents = Vector2( 205.176, 46.6856 )
[sub_resource type="RectangleShape2D" id=11] [sub_resource type="RectangleShape2D" id=9]
extents = Vector2( 35.5088, 57.7678 ) extents = Vector2( 35.5088, 57.7678 )
[sub_resource type="StreamTexture" id=12] [sub_resource type="StreamTexture" id=10]
flags = 4 flags = 4
load_path = "res://.import/placeholder item.png-cd6e4c1231156687d87915032ec4361d.stex" load_path = "res://.import/placeholder item.png-cd6e4c1231156687d87915032ec4361d.stex"
[sub_resource type="RectangleShape2D" id=9] [sub_resource type="RectangleShape2D" id=11]
extents = Vector2( 38.8846, 35.3253 ) extents = Vector2( 38.8846, 35.3253 )
[sub_resource type="RectangleShape2D" id=10] [sub_resource type="RectangleShape2D" id=12]
extents = Vector2( 39.2613, 32.3414 ) extents = Vector2( 39.2613, 32.3414 )
[node name="Bathroom" type="Node2D"] [node name="Bathroom" type="Node2D"]
...@@ -146,7 +147,7 @@ __meta__ = { ...@@ -146,7 +147,7 @@ __meta__ = {
[node name="Sink" type="StaticBody2D" parent="."] [node name="Sink" type="StaticBody2D" parent="."]
position = Vector2( 374.557, 450.135 ) position = Vector2( 374.557, 450.135 )
input_pickable = true input_pickable = true
script = ExtResource( 4 ) script = ExtResource( 11 )
__meta__ = { __meta__ = {
"_edit_group_": true "_edit_group_": true
} }
...@@ -271,13 +272,13 @@ __meta__ = { ...@@ -271,13 +272,13 @@ __meta__ = {
[node name="CollisionShape2D" type="CollisionShape2D" parent="Trash can"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Trash can"]
visible = false visible = false
shape = SubResource( 11 ) shape = SubResource( 9 )
disabled = true disabled = true
[node name="Sprite" type="Sprite" parent="Trash can"] [node name="Sprite" type="Sprite" parent="Trash can"]
position = Vector2( -3.94922, -2.52094 ) position = Vector2( -3.94922, -2.52094 )
scale = Vector2( 0.395, 0.565 ) scale = Vector2( 0.395, 0.565 )
texture = SubResource( 12 ) texture = SubResource( 10 )
[node name="Label" type="Label" parent="Trash can"] [node name="Label" type="Label" parent="Trash can"]
margin_left = -21.3268 margin_left = -21.3268
...@@ -300,7 +301,7 @@ retrievable = true ...@@ -300,7 +301,7 @@ retrievable = true
flavorText = "Ew." flavorText = "Ew."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Trash"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Trash"]
shape = SubResource( 9 ) shape = SubResource( 11 )
[node name="Sprite" type="Sprite" parent="Trash/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Trash/CollisionShape2D"]
position = Vector2( -0.581909, 0.846497 ) position = Vector2( -0.581909, 0.846497 )
...@@ -328,7 +329,7 @@ retrievable = true ...@@ -328,7 +329,7 @@ retrievable = true
flavorText = "Hydration." flavorText = "Hydration."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Tabo"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Tabo"]
shape = SubResource( 10 ) shape = SubResource( 12 )
[node name="Sprite" type="Sprite" parent="Tabo/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Tabo/CollisionShape2D"]
position = Vector2( -0.112305, 2.77536 ) position = Vector2( -0.112305, 2.77536 )
......
...@@ -132,7 +132,7 @@ items = [ NodePath("Nana from afar"), NodePath("Other balcony"), NodePath("Balco ...@@ -132,7 +132,7 @@ items = [ NodePath("Nana from afar"), NodePath("Other balcony"), NodePath("Balco
[node name="Event Handler" type="Node2D" parent="."] [node name="Event Handler" type="Node2D" parent="."]
position = Vector2( 460.602, 18.6417 ) position = Vector2( 460.602, 18.6417 )
script = ExtResource( 12 ) script = ExtResource( 12 )
eventItems = [ NodePath("../Laundry basket/To do list"), NodePath("../Bedroom/Laundry basket"), NodePath("../Laundry basket/Return"), NodePath("../Fridge/Return"), NodePath("../Kitchen/Fridge"), NodePath("../Laundry area/Groceries"), NodePath("../Fridge/Energy handler"), NodePath("../Laundry area/Dialogue control"), NodePath("../Laundry - Notepad/Return"), NodePath("../Laundry - Notepad/Dialogue control"), NodePath("../Bedroom/Bathroom door"), NodePath("../Bathroom/Door - to Bedroom"), NodePath("../Living room/Balcony door"), NodePath("../Balcony/Door to living room"), NodePath("../Living room/Front door"), NodePath("../Hallway/Door to Moxie"), NodePath("../Hallway/Door to neighbor"), NodePath("../Neighbor\'s room/Neighbor to hallway"), NodePath("../Neighbor\'s balcony/Balcony to neighbor\'s room"), NodePath("../Neighbor\'s room/Neighbor to balcony"), NodePath("../Bedroom/Laptop"), NodePath("../Desk/Return"), NodePath("../Inside cabinet/Return"), NodePath("../Kitchen/Cabinet"), NodePath("../Desk/Laptop"), NodePath("../Bedroom/Terrarium"), NodePath("../Bathroom/Lab Note - Bathroom"), NodePath("../Inside cabinet/Lab notes"), NodePath("../Living room/Lab notes"), NodePath("../Bedroom/Pants"), NodePath("../Bedroom/Shirt"), NodePath("../Bedroom/Sando"), NodePath("../Bedroom/Towel") ] eventItems = [ NodePath("../Laundry basket/To do list"), NodePath("../Bedroom/Laundry basket"), NodePath("../Laundry basket/Return"), NodePath("../Fridge/Return"), NodePath("../Kitchen/Fridge"), NodePath("../Laundry area/Groceries"), NodePath("../Fridge/Energy handler"), NodePath("../Laundry area/Dialogue control"), NodePath("../Laundry - Notepad/Return"), NodePath("../Laundry - Notepad/Dialogue control"), NodePath("../Bedroom/Bathroom door"), NodePath("../Bathroom/Door - to Bedroom"), NodePath("../Living room/Balcony door"), NodePath("../Balcony/Door to living room"), NodePath("../Living room/Front door"), NodePath("../Hallway/Door to Moxie"), NodePath("../Hallway/Door to neighbor"), NodePath("../Neighbor\'s room/Neighbor to hallway"), NodePath("../Neighbor\'s balcony/Balcony to neighbor\'s room"), NodePath("../Neighbor\'s room/Neighbor to balcony"), NodePath("../Bedroom/Laptop"), NodePath("../Desk/Return"), NodePath("../Inside cabinet/Return"), NodePath("../Kitchen/Cabinet"), NodePath("../Desk/Laptop"), NodePath("../Bedroom/Terrarium"), NodePath("../Bathroom/Lab Note - Bathroom"), NodePath("../Inside cabinet/Lab notes"), NodePath("../Living room/Lab notes"), NodePath("../Bedroom/Pants"), NodePath("../Bedroom/Shirt"), NodePath("../Bedroom/Sando"), NodePath("../Bedroom/Towel"), NodePath("../Bathroom/Sink"), NodePath("../Bathroom/Toilet"), NodePath("../Bathroom/Mirror") ]
[node name="Moxie" type="Sprite" parent="."] [node name="Moxie" type="Sprite" parent="."]
position = Vector2( 214.135, 386.725 ) position = Vector2( 214.135, 386.725 )
......
...@@ -15,13 +15,18 @@ func add(q): ...@@ -15,13 +15,18 @@ func add(q):
func finishQuest(q): func finishQuest(q):
var index = 0 var index = 0
var found = false
print("trying to find quest to remove " + q) print("trying to find quest to remove " + q)
for quest in quests: for quest in quests:
if quest == q: if quest == q:
quests.remove(index) quests.remove(index)
print("Quest found, will remove") print("Quest found, will remove")
showQuests() showQuests()
found = true
index += 1 index += 1
if !found:
print("Unable to delete quest")
func showQuests(): func showQuests():
if quests.size() > 0: if quests.size() > 0:
......
extends "res://Item.gd"
signal cleaned
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
connect("cleaned", handler,"_clean")
pass
func objInteraction(selected):
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if inventory.get_item_text(selected) == "Cleaning mat":
if flavorText != "Okay. That wasn't so bad...":
flavorText = "Okay. That wasn't so bad..."
else:
dialogueBox.text = flavor
emit_signal("cleaned")
elif typeof(flavor) != 0: #checks if there's coded flavor text for this interaction
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
extends "res://Item.gd" extends "res://Item.gd"
onready var gotLabNote = false onready var gotLabNote = false
onready var first = true onready var first = true
signal cleaned
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
pass # Replace with function body. pass # Replace with function body.
func passEvent(handler):
connect("cleaned", handler,"_clean")
pass
func mouseInteraction(): func mouseInteraction():
.mouseInteraction() .mouseInteraction()
if first: if first:
...@@ -15,9 +21,11 @@ func mouseInteraction(): ...@@ -15,9 +21,11 @@ func mouseInteraction():
func objInteraction(selected): func objInteraction(selected):
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name()) var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if inventory.get_item_text(selected) == "Cleaning mat": if inventory.get_item_text(selected) == "Cleaning mat":
if gotLabNote: if gotLabNote && flavorText != "Great! I can see my own face again.":
#inventory.remove_item(selected) #inventory.remove_item(selected)
dialogueBox.text = "Great! I can see my own face again." flavorText = "Great! I can see my own face again."
dialogueBox.text = flavorText
emit_signal("cleaned")
else: else:
dialogueBox.text = "Hey! Something's still written on the mirror! Looks important..." dialogueBox.text = "Hey! Something's still written on the mirror! Looks important..."
elif typeof(flavor) != 0: #checks if there's coded flavor text for this interaction elif typeof(flavor) != 0: #checks if there's coded flavor text for this interaction
......
extends "res://Item.gd"
signal cleaned
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
connect("cleaned", handler,"_clean")
pass
func objInteraction(selected):
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if inventory.get_item_text(selected) == "Cleaning mat":
if flavorText != "Okay. That wasn't so bad...":
flavorText = "Okay. That wasn't so bad..."
emit_signal("cleaned")
else:
dialogueBox.text = "I cleaned that already!"
elif typeof(flavor) != 0: #checks if there's coded flavor text for this interaction
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
extends "res://Item.gd" extends "res://Item.gd"
onready var first onready var first
onready var clean
signal cleaned
func _ready(): func _ready():
pass # Replace with function body. pass # Replace with function body.
func passEvent(handler):
connect("cleaned", handler,"_clean")
pass
func objInteraction(selected): # when an object is used on it func objInteraction(selected): # when an object is used on it
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name()) var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if typeof(flavor) != 0: #checks if there's coded flavor text for this interaction if typeof(flavor) != 0: #checks if there's coded flavor text for this interaction
...@@ -15,6 +21,7 @@ func objInteraction(selected): # when an object is used on it ...@@ -15,6 +21,7 @@ func objInteraction(selected): # when an object is used on it
if (flavorText != "Okay. That wasn't so bad... "): if (flavorText != "Okay. That wasn't so bad... "):
flavorText = "Okay. That wasn't so bad... " flavorText = "Okay. That wasn't so bad... "
dialogueBox.text = "Time to tango, toilet." dialogueBox.text = "Time to tango, toilet."
emit_signal("cleaned")
else: else:
dialogueBox.text = "I can't make it any LESS unclogged.." dialogueBox.text = "I can't make it any LESS unclogged.."
......
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