Commit 38b610c8 authored by Julia Santos's avatar Julia Santos

Can now clean the mirror, only if the lab note has been retrieved. Can also...

Can now clean the mirror, only if the lab note has been retrieved. Can also only open cabinet once unjammed with a screwdriver
parent c5df099c
......@@ -31,6 +31,7 @@ onready var quests = notepad.get_node("Quests")
onready var groceries = false #if groceries were put away
onready var newQuests = false
onready var lockedNotepad #if ur locked from certain areas bc u havent gotten the notebook yet
onready var labNotes = 0
#items in the rooms that need access to the event handler
export(Array, NodePath) onready var eventItems
......@@ -78,6 +79,14 @@ func _add_quest(questName):
func _remove_quest(questName):
print("Removed "+ questName)
quests.finishQuest(questName)
func _add_lab_note(): # when a new lab note is retrieved
labNotes = labNotes + 1
func get_lab_notes(): # returns how many lab notes the player has found
return labNotes
# ----------------- Notebook puzzle events -----------------
func _enter_notebook_laundry(): # trying to engage in the notebook puzzle for doing laundry
......
extends "res://Item.gd"
signal retrieved
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
connect("retrieved", handler,"_add_lab_note")
func pickup():
.pickup()
if get_name() == "Lab Note - Bathroom":
get_parent().get_node("Mirror").gotNote()
emit_signal("retrieved")
[gd_scene load_steps=16 format=2]
[gd_scene load_steps=18 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]
......@@ -6,6 +6,8 @@
[ext_resource path="res://Item.gd" type="Script" id=4]
[ext_resource path="res://assets/placeholder item.png" type="Texture" id=5]
[ext_resource path="res://Scripts/Movement scripts/Door - to Bedroom.gd" type="Script" id=6]
[ext_resource path="res://Scripts/Mirror.gd" type="Script" id=7]
[ext_resource path="res://Lab Note.gd" type="Script" id=8]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 156.074, 141.192 )
......@@ -47,7 +49,7 @@ __meta__ = {
[node name="Mirror" type="StaticBody2D" parent="."]
position = Vector2( 375.163, 247.488 )
input_pickable = true
script = ExtResource( 4 )
script = ExtResource( 7 )
__meta__ = {
"_edit_group_": true
}
......@@ -76,7 +78,7 @@ __meta__ = {
position = Vector2( 307.312, 129.87 )
scale = Vector2( 0.842056, 0.913043 )
input_pickable = true
script = ExtResource( 4 )
script = ExtResource( 8 )
__meta__ = {
"_edit_group_": true
}
......
......@@ -98,6 +98,7 @@ __meta__ = {
"_edit_group_": true
}
interactable = true
flavorText = "Nana needs her food, but the cabinet is jammed! Why is everything in my house falling apart? I need some tools to get this cabinet open. Maybe I can go out and find some?"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Cabinet"]
position = Vector2( 7.28166, -20.2055 )
......
extends "res://Item.gd"
onready var labNotes = 0
signal finished_lab
signal finish_lab
signal start_lab
onready var started = false
onready var eventHandler
# Called when the node enters the scene tree for the first time.
func _ready():
......@@ -9,15 +10,14 @@ func _ready():
func passEvent(handler):
connect("start_lab", handler,"_start_lab")
connect("finished_lab", handler, "_finished_lab")
pass
func addNotes(): # when a new lab note is retrieved
labNotes = labNotes + 1
func getNotes(): # returns how many lab notes the player has found
return labNotes
connect("finish_lab", handler, "_finished_lab")
eventHandler = handler
func mouseInteraction():
.mouseInteraction()
emit_signal("start_lab")
if !started:
emit_signal("start_lab")
started = true
else:
if eventHandler.get_lab_notes() == 4:
emit_signal("finish_lab")
......@@ -6,20 +6,19 @@ func _ready():
func interaction(selected, clicked): #selected = item in inventory, clicked = item in environment
match clicked:
"Laundry basket":
"Mirror":
match selected:
"Shirt", "Towel", "Pants", "Sando":
return "Into the basket you go."
"Placeholder 2":
"Toilet":
match selected:
"Placeholder 1":
return "Using Placeholder 1 on 2"
"Placeholder 3":
return "Using Placeholder 3 on 2"
"Placeholder 3":
"Sink":
match selected:
"Placeholder 1":
return "Using Placeholder 1 on 3"
......
extends "res://Item.gd"
onready var gotLabNote = false
onready var first = true
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func mouseInteraction():
.mouseInteraction()
if first:
flavorText = "Do I have anything to clean this with?"
first = false
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)
dialogueBox.text = "Great! I can see my own face again."
else:
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
dialogueBox.text = flavor
else:
dialogueBox.text = "No flavor text found" #can replace this later!
inventory.unselect_all() #unselect item
func gotNote():
print("Got lab note")
gotLabNote = true
extends "res://Item.gd"
signal cabinet
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
onready var unlocked = false
onready var first = true
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func mouseInteraction():
emit_signal("cabinet")
if unlocked:
emit_signal("cabinet")
elif first:
.mouseInteraction()
flavorText = "I need some tools to get this cabinet open. Maybe I can go out and find some?"
first = false
else:
.mouseInteraction()
func passEvent(handler):
connect("cabinet", handler,"_open_cabinet")
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func objInteraction(selected):
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) == "Screwdriver": # unlocking the door with a bobby pin
dialogueBox.text = "Food, you are now free from your prison. You're welcome."
emit_signal("cabinet")
unlocked = true
inventory.remove_item(selected)
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