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
onready var labNotes = 0
onready var clothes = 0
onready var bathroomClean = 0
onready var cleaningMaterials = 0
onready var canFrontDoor = false
onready var foundBanana = false
#items in the rooms that need access to the event handler
export(Array, NodePath) onready var eventItems
......@@ -103,11 +105,14 @@ func _add_clothes():
func get_clothes():
return clothes
func _clean():
func _clean(toolUsed):
bathroomClean = bathroomClean + 1
print("Cleaned " + str(bathroomClean))
if toolUsed == "Cleaning mat":
cleaningMaterials += 1
if bathroomClean == 5:
quests.finishQuest("Clean bathroom")
if cleaningMaterials == 3:
inventory.remove_item_name("Cleaning mat")
func getClean():
......
......@@ -175,7 +175,8 @@ __meta__ = {
}
[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
script = ExtResource( 6 )
__meta__ = {
......@@ -192,7 +193,7 @@ visible = false
texture = ExtResource( 3 )
[node name="Plunger" type="StaticBody2D" parent="."]
position = Vector2( 826.792, 402.253 )
position = Vector2( 632.764, 416.112 )
input_pickable = true
script = ExtResource( 4 )
__meta__ = {
......
......@@ -8,7 +8,7 @@
[ext_resource path="res://Scripts/Groceries.gd" type="Script" id=6]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 35.8254, 37.878 )
extents = Vector2( 35.8254, 43.5967 )
[sub_resource type="StreamTexture" id=2]
flags = 4
......@@ -29,6 +29,7 @@ extents = Vector2( 15.4169, 13.9691 )
[node name="BG - regular" type="Sprite" parent="."]
position = Vector2( 509.587, 297.996 )
scale = Vector2( 0.98637, 0.98637 )
z_index = -1
texture = ExtResource( 1 )
__meta__ = {
"_edit_lock_": true
......@@ -51,8 +52,9 @@ interactable = true
flavorText = "Something's in the way."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Laundry door"]
position = Vector2( 5.63037, -53.6798 )
position = Vector2( 7.24008, -23.0954 )
scale = Vector2( 5, 5 )
z_index = -1
shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="Laundry door/CollisionShape2D"]
......
......@@ -14,17 +14,14 @@ func passEvent(handler):
func objInteraction(selected):
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
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!"
print("Cleaning but bobby pins")
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."
flavorText = "Okay. That wasn't so bad..."
print("cleaning successfully")
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
emit_signal("cleaned", "Cleaning mat")
else:
dialogueBox.text = flavorText
print("already cleaned")
......
......@@ -3,6 +3,7 @@ onready var gotLabNote = false
onready var first = true
signal cleaned
onready var eventHandler
onready var clean = false
# Called when the node enters the scene tree for the first time.
func _ready():
......@@ -23,15 +24,16 @@ func mouseInteraction():
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 && flavorText != "Great! I can see my own face again.":
#inventory.remove_item(selected)
if !clean: # if the mirror is clean yet
if gotLabNote: # if the note's been removed
flavorText = "Great! I can see my own face again."
dialogueBox.text = flavorText
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
emit_signal("cleaned", "Cleaning mat")
clean = true
else:
dialogueBox.text = "Hey! Something's still written on the mirror! Looks important..."
else:
dialogueBox.text = flavorText
elif typeof(flavor) != 0: #checks if there's coded flavor text for this interaction
dialogueBox.text = flavor
else:
......
......@@ -17,9 +17,7 @@ func objInteraction(selected):
if flavorText != "Okay. That wasn't so bad...":
flavorText = "Okay. That wasn't so bad..."
dialogueBox.text = flavorText
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
emit_signal("cleaned", "Cleaning mat")
else:
dialogueBox.text = "I cleaned that already!"
......
......@@ -23,7 +23,7 @@ func objInteraction(selected): # when an object is used on it
if (flavorText != "Okay. That wasn't so bad... "):
flavorText = "Okay. That wasn't so bad... "
dialogueBox.text = "Time to tango, toilet."
emit_signal("cleaned")
emit_signal("cleaned", "Plunger")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
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