Commit 4ffd83e1 authored by Julia Santos's avatar Julia Santos

Merge branch 'test' into 'master'

Test

See merge request breakdown/Reyes-Santos-Tsai-Thesis!7
parents 276a82af e117ade1
......@@ -114,8 +114,10 @@ func get_clothes():
# ----------------- Notebook puzzle events -----------------
func _enter_notebook_laundry(): # trying to engage in the notebook puzzle for doing laundry
if groceries: # if the groceries have been put away
dialogue.text = "Alright, lets do this!"
if !quests.hasQuest("Do laundry"):
return "Let me let the washing machine do its thing."
elif groceries: # if the groceries have been put away
if clothes == 4:
laundryArea.hide()
laundryNotepad.show()
zoom_in()
......@@ -130,12 +132,17 @@ func _enter_notebook_laundry(): # trying to engage in the notebook puzzle for do
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
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
print("Finished 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
zoom_out()
......
......@@ -6,10 +6,20 @@ extends ItemList
func _ready():
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
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):
func pickup():
if (eventHandler.get_lab_notes() == 0):
dialogueBox.text = flavorText
inventory.add_item("Lab Notes", texture)
if get_name() == "Lab Note - Bathroom":
get_parent().get_node("Mirror").gotNote()
dialogueBox.text = flavorText
queue_free()
inventory.unselect_all()
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://assets/room zoom out.png" type="Texture" id=2]
......@@ -9,6 +9,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://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]
extents = Vector2( 156.074, 141.192 )
......@@ -34,9 +35,16 @@ extents = Vector2( 82.0634, 51.3664 )
[sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 205.176, 46.6856 )
[sub_resource type="RectangleShape2D" id=9]
[sub_resource type="RectangleShape2D" id=11]
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]
extents = Vector2( 39.2613, 32.3414 )
......@@ -110,7 +118,7 @@ __meta__ = {
[node name="Toilet" type="StaticBody2D" parent="."]
position = Vector2( 704.312, 410.87 )
input_pickable = true
script = ExtResource( 4 )
script = ExtResource( 10 )
__meta__ = {
"_edit_group_": true
}
......@@ -254,9 +262,36 @@ position = Vector2( -1.45947, -0.173828 )
scale = Vector2( 2.00236, 0.457652 )
texture = ExtResource( 9 )
[node name="Trash" type="StaticBody2D" parent="."]
[node name="Trash can" type="StaticBody2D" parent="."]
position = Vector2( 926.026, 491.279 )
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 )
__meta__ = {
"_edit_group_": true
......@@ -268,8 +303,8 @@ flavorText = "Ew."
shape = SubResource( 9 )
[node name="Sprite" type="Sprite" parent="Trash/CollisionShape2D"]
position = Vector2( -3.94922, -2.52094 )
scale = Vector2( 0.395, 0.565 )
position = Vector2( -0.581909, 0.846497 )
scale = Vector2( 0.395, 0.374182 )
texture = ExtResource( 5 )
[node name="Label" type="Label" parent="Trash/CollisionShape2D"]
......
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():
......@@ -12,8 +13,9 @@ func passEvent(handler):
func pickup():
if (eventHandler.get_clothes() == 0):
inventory.add_item("Dirty clothes", clothesTexture)
dialogueBox.text = flavorText
inventory.add_item("Dirty clothes", get_parent().get_node("Pile of clothes/CollisionShape2D/Sprite").get_texture())
queue_free()
inventory.unselect_all()
emit_signal("retrieved")
#test
extends Control
signal notebook_laundry
onready var eventHandler
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
......@@ -10,8 +10,8 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
"Laundry door":
match selected:
"To do list":
emit_signal("notebook_laundry")
return ""
#emit_signal("notebook_laundry")
return eventHandler._enter_notebook_laundry()
"Towel", "Shirt", "Pants", "Sando":
return "I'm not sure how to start this."
_:
......@@ -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.)"
func passEvent(handler):
eventHandler = handler
connect("notebook_laundry", handler, "_enter_notebook_laundry")
......@@ -16,7 +16,7 @@ func objInteraction(selected):
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if inventory.get_item_text(selected) == "Cleaning mat":
if gotLabNote:
inventory.remove_item(selected)
#inventory.remove_item(selected)
dialogueBox.text = "Great! I can see my own face again."
else:
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