Commit fe7a1e35 authored by Julia Santos's avatar Julia Santos

Fixed issue with the laundry room door and the groceries' hitboxes, also fixed...

Fixed issue with the laundry room door and the groceries' hitboxes, also fixed the issue where the Cleaning Materials disappeared too quickly
parent 48ba7cfc
...@@ -34,9 +34,11 @@ onready var lockedNotepad #if ur locked from certain areas bc u havent gotten th ...@@ -34,9 +34,11 @@ onready var lockedNotepad #if ur locked from certain areas bc u havent gotten th
onready var labNotes = 0 onready var labNotes = 0
onready var clothes = 0 onready var clothes = 0
onready var bathroomClean = 0 onready var bathroomClean = 0
onready var cleaningMaterials = 0
onready var canFrontDoor = false onready var canFrontDoor = false
onready var foundBanana = false onready var foundBanana = false
#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
...@@ -103,11 +105,14 @@ func _add_clothes(): ...@@ -103,11 +105,14 @@ func _add_clothes():
func get_clothes(): func get_clothes():
return clothes return clothes
func _clean(): func _clean(toolUsed):
bathroomClean = bathroomClean + 1 bathroomClean = bathroomClean + 1
print("Cleaned " + str(bathroomClean)) print("Cleaned " + str(bathroomClean))
if toolUsed == "Cleaning mat":
cleaningMaterials += 1
if bathroomClean == 5: if bathroomClean == 5:
quests.finishQuest("Clean bathroom") quests.finishQuest("Clean bathroom")
if cleaningMaterials == 3:
inventory.remove_item_name("Cleaning mat") inventory.remove_item_name("Cleaning mat")
func getClean(): func getClean():
......
...@@ -175,7 +175,8 @@ __meta__ = { ...@@ -175,7 +175,8 @@ __meta__ = {
} }
[node name="Door - to Bedroom" type="StaticBody2D" parent="."] [node name="Door - to Bedroom" type="StaticBody2D" parent="."]
position = Vector2( 934.312, 201.87 ) position = Vector2( 810.84, 174.152 )
z_index = -1
input_pickable = true input_pickable = true
script = ExtResource( 6 ) script = ExtResource( 6 )
__meta__ = { __meta__ = {
...@@ -192,7 +193,7 @@ visible = false ...@@ -192,7 +193,7 @@ visible = false
texture = ExtResource( 3 ) texture = ExtResource( 3 )
[node name="Plunger" type="StaticBody2D" parent="."] [node name="Plunger" type="StaticBody2D" parent="."]
position = Vector2( 826.792, 402.253 ) position = Vector2( 632.764, 416.112 )
input_pickable = true input_pickable = true
script = ExtResource( 4 ) script = ExtResource( 4 )
__meta__ = { __meta__ = {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
[ext_resource path="res://Scripts/Groceries.gd" type="Script" id=6] [ext_resource path="res://Scripts/Groceries.gd" type="Script" id=6]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 35.8254, 37.878 ) extents = Vector2( 35.8254, 43.5967 )
[sub_resource type="StreamTexture" id=2] [sub_resource type="StreamTexture" id=2]
flags = 4 flags = 4
...@@ -29,6 +29,7 @@ extents = Vector2( 15.4169, 13.9691 ) ...@@ -29,6 +29,7 @@ extents = Vector2( 15.4169, 13.9691 )
[node name="BG - regular" type="Sprite" parent="."] [node name="BG - regular" type="Sprite" parent="."]
position = Vector2( 509.587, 297.996 ) position = Vector2( 509.587, 297.996 )
scale = Vector2( 0.98637, 0.98637 ) scale = Vector2( 0.98637, 0.98637 )
z_index = -1
texture = ExtResource( 1 ) texture = ExtResource( 1 )
__meta__ = { __meta__ = {
"_edit_lock_": true "_edit_lock_": true
...@@ -51,8 +52,9 @@ interactable = true ...@@ -51,8 +52,9 @@ interactable = true
flavorText = "Something's in the way." flavorText = "Something's in the way."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Laundry door"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Laundry door"]
position = Vector2( 5.63037, -53.6798 ) position = Vector2( 7.24008, -23.0954 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
z_index = -1
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="Laundry door/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Laundry door/CollisionShape2D"]
......
...@@ -14,17 +14,14 @@ func passEvent(handler): ...@@ -14,17 +14,14 @@ func passEvent(handler):
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 inventory.hasItem("Bobby pins") == -1: if inventory.hasItem("Bobby pins") == -1: #if the bobby pins haven't been picked up yet
dialogueBox.text = "Ow! I stepped on something!" dialogueBox.text = "Ow! I stepped on something!"
print("Cleaning but bobby pins") print("Cleaning but bobby pins")
else: else:
if flavorText != "Okay. That wasn't so bad...": if flavorText != "Okay. That wasn't so bad...": #if it hasnt been cleaned yet
dialogueBox.text = "Finally... I can walk around my own bathroom." dialogueBox.text = "Finally... I can walk around my own bathroom."
flavorText = "Okay. That wasn't so bad..." flavorText = "Okay. That wasn't so bad..."
print("cleaning successfully") emit_signal("cleaned", "Cleaning mat")
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
else: else:
dialogueBox.text = flavorText dialogueBox.text = flavorText
print("already cleaned") print("already cleaned")
......
...@@ -3,6 +3,7 @@ onready var gotLabNote = false ...@@ -3,6 +3,7 @@ onready var gotLabNote = false
onready var first = true onready var first = true
signal cleaned signal cleaned
onready var eventHandler onready var eventHandler
onready var clean = false
# 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():
...@@ -23,15 +24,16 @@ func mouseInteraction(): ...@@ -23,15 +24,16 @@ 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 && flavorText != "Great! I can see my own face again.": if !clean: # if the mirror is clean yet
#inventory.remove_item(selected) if gotLabNote: # if the note's been removed
flavorText = "Great! I can see my own face again." flavorText = "Great! I can see my own face again."
dialogueBox.text = flavorText dialogueBox.text = flavorText
emit_signal("cleaned") emit_signal("cleaned", "Cleaning mat")
if eventHandler.getClean() == 3: clean = true
inventory.remove_item(selected) else:
dialogueBox.text = "Hey! Something's still written on the mirror! Looks important..."
else: else:
dialogueBox.text = "Hey! Something's still written on the mirror! Looks important..." dialogueBox.text = flavorText
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
dialogueBox.text = flavor dialogueBox.text = flavor
else: else:
......
...@@ -17,9 +17,7 @@ func objInteraction(selected): ...@@ -17,9 +17,7 @@ func objInteraction(selected):
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 = flavorText dialogueBox.text = flavorText
emit_signal("cleaned") emit_signal("cleaned", "Cleaning mat")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
else: else:
dialogueBox.text = "I cleaned that already!" dialogueBox.text = "I cleaned that already!"
......
...@@ -23,7 +23,7 @@ func objInteraction(selected): # when an object is used on it ...@@ -23,7 +23,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") emit_signal("cleaned", "Plunger")
if eventHandler.getClean() == 3: if eventHandler.getClean() == 3:
inventory.remove_item(selected) inventory.remove_item(selected)
else: else:
......
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