Commit 03975cf5 authored by Julia Santos's avatar Julia Santos

Clothes now stack, and laundry notebook puzzle is only accessible when all the...

Clothes now stack, and laundry notebook puzzle is only accessible when all the clothes are collected. Finishing the laundry puzzle removes the dirty clothes and the detergent from the inventory.
parent 0de9cc25
...@@ -32,6 +32,7 @@ onready var groceries = false #if groceries were put away ...@@ -32,6 +32,7 @@ onready var groceries = false #if groceries were put away
onready var newQuests = false 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
#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
...@@ -104,32 +105,43 @@ func _add_lab_note(): # when a new lab note is retrieved ...@@ -104,32 +105,43 @@ func _add_lab_note(): # when a new lab note is retrieved
func get_lab_notes(): # returns how many lab notes the player has found func get_lab_notes(): # returns how many lab notes the player has found
return labNotes return labNotes
func _add_clothes():
clothes = clothes + 1
func get_clothes():
return clothes
# ----------------- 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 groceries: # if the groceries have been put away if !quests.hasQuest("Do laundry"):
dialogue.text = "Alright, lets do this!" return "Let me let the washing machine do its thing."
laundryArea.hide() elif groceries: # if the groceries have been put away
laundryNotepad.show() if clothes == 4:
zoom_in() laundryArea.hide()
notepad._open_UI() laundryNotepad.show()
notepad.get_node("Quests").hide() zoom_in()
notepad.get_node("Title").text = "Words" notepad._open_UI()
var notepad_words = notepad.get_node("Words") notepad.get_node("Quests").hide()
notepad.get_node("Words").clear() notepad.get_node("Title").text = "Words"
notepad_words.show() var notepad_words = notepad.get_node("Words")
notepad_words.add_item("Open") notepad.get_node("Words").clear()
notepad_words.add_item("Close") notepad_words.show()
notepad_words.add_item("Turn on") notepad_words.add_item("Open")
notepad_words.add_item("Put in") notepad_words.add_item("Close")
notepad_words.add_item("Look") notepad_words.add_item("Turn on")
notepad_words.add_item("Put in")
notepad_words.add_item("Look")
return "Alright, lets do this!"
else:
return "I still need to pick up all my clothes!"
else: # if not, don't progress yet else: # if not, don't progress yet
dialogue.text = "The groceries are still in the way." return "The groceries are still in the way."
func _laundry_finished(): # finishing notebook puzzle for laundry func _laundry_finished(): # finishing notebook puzzle for laundry
print("Finished laundry") print("Finished laundry")
quests.finishQuest("Do laundry") quests.finishQuest("Do laundry")
inventory.remove_item_name("Dirty clothes")
inventory.remove_item_name("Laundry detergent")
func _return_laundry_notepad(): # exiting laundry notebook puzzle func _return_laundry_notepad(): # exiting laundry notebook puzzle
zoom_out() zoom_out()
......
...@@ -6,10 +6,20 @@ extends ItemList ...@@ -6,10 +6,20 @@ extends ItemList
func _ready(): func _ready():
pass pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Button_pressed(): #when the deselect button is clicked, deselect the item currently selected func _on_Button_pressed(): #when the deselect button is clicked, deselect the item currently selected
unselect_all() unselect_all()
func hasItem(toFind):
var i = 0
while i < get_item_count():
if get_item_text(i) == toFind:
return i
else:
i = i + 1
return -1
func remove_item_name(toRemove):
var index = hasItem(toRemove)
if index != -1:
remove_item(index)
...@@ -12,10 +12,10 @@ func passEvent(handler): ...@@ -12,10 +12,10 @@ func passEvent(handler):
func pickup(): func pickup():
if (eventHandler.get_lab_notes() == 0): if (eventHandler.get_lab_notes() == 0):
dialogueBox.text = flavorText
inventory.add_item("Lab Notes", texture) inventory.add_item("Lab Notes", texture)
if get_name() == "Lab Note - Bathroom": if get_name() == "Lab Note - Bathroom":
get_parent().get_node("Mirror").gotNote() get_parent().get_node("Mirror").gotNote()
dialogueBox.text = flavorText
queue_free() queue_free()
inventory.unselect_all() inventory.unselect_all()
emit_signal("retrieved") emit_signal("retrieved")
[gd_scene load_steps=20 format=2] [gd_scene load_steps=23 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]
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
[ext_resource path="res://Scripts/Mirror.gd" type="Script" id=7] [ext_resource path="res://Scripts/Mirror.gd" type="Script" id=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]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 156.074, 141.192 ) extents = Vector2( 156.074, 141.192 )
...@@ -34,9 +35,16 @@ extents = Vector2( 82.0634, 51.3664 ) ...@@ -34,9 +35,16 @@ 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=9] [sub_resource type="RectangleShape2D" id=11]
extents = Vector2( 35.5088, 57.7678 ) extents = Vector2( 35.5088, 57.7678 )
[sub_resource type="StreamTexture" id=12]
flags = 4
load_path = "res://.import/placeholder item.png-cd6e4c1231156687d87915032ec4361d.stex"
[sub_resource type="RectangleShape2D" id=9]
extents = Vector2( 38.8846, 35.3253 )
[sub_resource type="RectangleShape2D" id=10] [sub_resource type="RectangleShape2D" id=10]
extents = Vector2( 39.2613, 32.3414 ) extents = Vector2( 39.2613, 32.3414 )
...@@ -110,7 +118,7 @@ __meta__ = { ...@@ -110,7 +118,7 @@ __meta__ = {
[node name="Toilet" type="StaticBody2D" parent="."] [node name="Toilet" type="StaticBody2D" parent="."]
position = Vector2( 704.312, 410.87 ) position = Vector2( 704.312, 410.87 )
input_pickable = true input_pickable = true
script = ExtResource( 4 ) script = ExtResource( 10 )
__meta__ = { __meta__ = {
"_edit_group_": true "_edit_group_": true
} }
...@@ -254,9 +262,36 @@ position = Vector2( -1.45947, -0.173828 ) ...@@ -254,9 +262,36 @@ position = Vector2( -1.45947, -0.173828 )
scale = Vector2( 2.00236, 0.457652 ) scale = Vector2( 2.00236, 0.457652 )
texture = ExtResource( 9 ) texture = ExtResource( 9 )
[node name="Trash" type="StaticBody2D" parent="."] [node name="Trash can" type="StaticBody2D" parent="."]
position = Vector2( 926.026, 491.279 ) position = Vector2( 926.026, 491.279 )
input_pickable = true input_pickable = true
__meta__ = {
"_edit_group_": true
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="Trash can"]
visible = false
shape = SubResource( 11 )
disabled = true
[node name="Sprite" type="Sprite" parent="Trash can"]
position = Vector2( -3.94922, -2.52094 )
scale = Vector2( 0.395, 0.565 )
texture = SubResource( 12 )
[node name="Label" type="Label" parent="Trash can"]
margin_left = -21.3268
margin_top = -30.3065
margin_right = 19.6732
margin_bottom = -16.3065
text = "TRASH"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Trash" type="StaticBody2D" parent="."]
position = Vector2( 922.659, 431.789 )
input_pickable = true
script = ExtResource( 4 ) script = ExtResource( 4 )
__meta__ = { __meta__ = {
"_edit_group_": true "_edit_group_": true
...@@ -268,8 +303,8 @@ flavorText = "Ew." ...@@ -268,8 +303,8 @@ flavorText = "Ew."
shape = SubResource( 9 ) shape = SubResource( 9 )
[node name="Sprite" type="Sprite" parent="Trash/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Trash/CollisionShape2D"]
position = Vector2( -3.94922, -2.52094 ) position = Vector2( -0.581909, 0.846497 )
scale = Vector2( 0.395, 0.565 ) scale = Vector2( 0.395, 0.374182 )
texture = ExtResource( 5 ) texture = ExtResource( 5 )
[node name="Label" type="Label" parent="Trash/CollisionShape2D"] [node name="Label" type="Label" parent="Trash/CollisionShape2D"]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
[ext_resource path="res://assets/Placeholder BGs/room zoom out.png" type="Texture" id=1] [ext_resource path="res://assets/Placeholder BGs/room zoom out.png" type="Texture" id=1]
[ext_resource path="res://assets/placeholder item.png" type="Texture" id=2] [ext_resource path="res://assets/placeholder item.png" type="Texture" id=2]
[ext_resource path="res://Item.gd" type="Script" id=3] [ext_resource path="res://Scripts/Clothes trail.gd" type="Script" id=3]
[ext_resource path="res://Scripts/Dialogue control/Dialogue control - Test Room 1.gd" type="Script" id=4] [ext_resource path="res://Scripts/Dialogue control/Dialogue control - Test Room 1.gd" type="Script" id=4]
[ext_resource path="res://assets/Thesis Clickables/trail 1.png" type="Texture" id=5] [ext_resource path="res://assets/Thesis Clickables/trail 1.png" type="Texture" id=5]
[ext_resource path="res://assets/Thesis Clickables/trail 2.png" type="Texture" id=6] [ext_resource path="res://assets/Thesis Clickables/trail 2.png" type="Texture" id=6]
...@@ -144,7 +144,7 @@ __meta__ = { ...@@ -144,7 +144,7 @@ __meta__ = {
"_edit_group_": true "_edit_group_": true
} }
retrievable = true retrievable = true
flavorText = "A deconstructed pile of clothes" flavorText = "A deconstructed pile of clothes."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Pants"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Pants"]
position = Vector2( -2.31012, 0.749359 ) position = Vector2( -2.31012, 0.749359 )
...@@ -165,7 +165,7 @@ __meta__ = { ...@@ -165,7 +165,7 @@ __meta__ = {
"_edit_group_": true "_edit_group_": true
} }
retrievable = true retrievable = true
flavorText = "A deconstructed pile of clothes" flavorText = "A deconstructed pile of clothes."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shirt"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Shirt"]
position = Vector2( -1.78223, 0.549072 ) position = Vector2( -1.78223, 0.549072 )
...@@ -251,7 +251,7 @@ __meta__ = { ...@@ -251,7 +251,7 @@ __meta__ = {
"_edit_group_": true "_edit_group_": true
} }
retrievable = true retrievable = true
flavorText = "Augh my back." flavorText = "A deconstructed pile of clothes."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Towel"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Towel"]
position = Vector2( -3.5491, 1.06189 ) position = Vector2( -3.5491, 1.06189 )
......
...@@ -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") ] 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") ]
[node name="Moxie" type="Sprite" parent="."] [node name="Moxie" type="Sprite" parent="."]
position = Vector2( 214.135, 386.725 ) position = Vector2( 214.135, 386.725 )
......
extends "res://Item.gd"
signal retrieved
onready var eventHandler
onready var clothesTexture = get_parent().get_node("Pile of clothes/CollisionShape2D/Sprite").get_texture()
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
eventHandler = handler
connect("retrieved", handler,"_add_clothes")
func pickup():
if (eventHandler.get_clothes() == 0):
inventory.add_item("Dirty clothes", clothesTexture)
dialogueBox.text = flavorText
queue_free()
inventory.unselect_all()
emit_signal("retrieved")
extends Control extends Control
signal notebook_laundry signal notebook_laundry
onready var eventHandler
# 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.
...@@ -10,8 +10,8 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it ...@@ -10,8 +10,8 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
"Laundry door": "Laundry door":
match selected: match selected:
"To do list": "To do list":
emit_signal("notebook_laundry") #emit_signal("notebook_laundry")
return "" return eventHandler._enter_notebook_laundry()
"Towel", "Shirt", "Pants", "Sando": "Towel", "Shirt", "Pants", "Sando":
return "I'm not sure how to start this." return "I'm not sure how to start this."
_: _:
...@@ -22,4 +22,5 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it ...@@ -22,4 +22,5 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
return "This apartment was made for tall people. Sigh.\n(You put your groceries away on the shelf.)" return "This apartment was made for tall people. Sigh.\n(You put your groceries away on the shelf.)"
func passEvent(handler): func passEvent(handler):
eventHandler = handler
connect("notebook_laundry", handler, "_enter_notebook_laundry") connect("notebook_laundry", handler, "_enter_notebook_laundry")
...@@ -16,7 +16,7 @@ func objInteraction(selected): ...@@ -16,7 +16,7 @@ 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:
inventory.remove_item(selected) #inventory.remove_item(selected)
dialogueBox.text = "Great! I can see my own face again." dialogueBox.text = "Great! I can see my own face again."
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..."
......
extends "res://Item.gd"
onready var first
func _ready():
pass # Replace with function body.
func objInteraction(selected): # when an object is used on it
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
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
if (inventory.get_item_text(selected) == "Plunger"):
if (flavorText != "Okay. That wasn't so bad... "):
flavorText = "Okay. That wasn't so bad... "
dialogueBox.text = "Time to tango, toilet."
else:
dialogueBox.text = "I can't make it any LESS unclogged.."
inventory.unselect_all() #unselect item
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