Commit 86df6fd1 authored by Julia Santos's avatar Julia Santos

Using cleaning materials on all relevant items (sink, mirror, and floor) now...

Using cleaning materials on all relevant items (sink, mirror, and floor) now removes it from the inventory
parent 797d3f43
...@@ -122,6 +122,9 @@ func _clean(): ...@@ -122,6 +122,9 @@ func _clean():
quests.finishQuest("Clean bathroom") quests.finishQuest("Clean bathroom")
inventory.remove_item_name("Cleaning mat") inventory.remove_item_name("Cleaning mat")
func getClean():
return bathroomClean
func _foundBanana(): func _foundBanana():
quests.finishQuest("Find Banana") quests.finishQuest("Find Banana")
foundBanana = true foundBanana = true
......
extends "res://Item.gd" extends "res://Item.gd"
signal cleaned signal cleaned
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.
func passEvent(handler): func passEvent(handler):
eventHandler = handler
connect("cleaned", handler,"_clean") connect("cleaned", handler,"_clean")
pass pass
...@@ -21,6 +23,8 @@ func objInteraction(selected): ...@@ -21,6 +23,8 @@ func objInteraction(selected):
flavorText = "Okay. That wasn't so bad..." flavorText = "Okay. That wasn't so bad..."
print("cleaning successfully") print("cleaning successfully")
emit_signal("cleaned") 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")
......
...@@ -2,6 +2,7 @@ extends "res://Item.gd" ...@@ -2,6 +2,7 @@ extends "res://Item.gd"
onready var gotLabNote = false onready var gotLabNote = false
onready var first = true onready var first = true
signal cleaned signal cleaned
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():
...@@ -9,6 +10,7 @@ func _ready(): ...@@ -9,6 +10,7 @@ func _ready():
func passEvent(handler): func passEvent(handler):
connect("cleaned", handler,"_clean") connect("cleaned", handler,"_clean")
eventHandler = handler
pass pass
...@@ -26,6 +28,8 @@ func objInteraction(selected): ...@@ -26,6 +28,8 @@ func objInteraction(selected):
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")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
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..."
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
......
extends "res://Item.gd" extends "res://Item.gd"
signal cleaned signal cleaned
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.
func passEvent(handler): func passEvent(handler):
eventHandler = handler
connect("cleaned", handler,"_clean") connect("cleaned", handler,"_clean")
pass pass
...@@ -17,6 +18,8 @@ func objInteraction(selected): ...@@ -17,6 +18,8 @@ func objInteraction(selected):
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")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
else: else:
dialogueBox.text = "I cleaned that already!" dialogueBox.text = "I cleaned that already!"
......
...@@ -2,11 +2,13 @@ extends "res://Item.gd" ...@@ -2,11 +2,13 @@ extends "res://Item.gd"
onready var first onready var first
onready var clean onready var clean
signal cleaned signal cleaned
onready var eventHandler
func _ready(): func _ready():
pass # Replace with function body. pass # Replace with function body.
func passEvent(handler): func passEvent(handler):
eventHandler = handler
connect("cleaned", handler,"_clean") connect("cleaned", handler,"_clean")
pass pass
...@@ -22,6 +24,8 @@ func objInteraction(selected): # when an object is used on it ...@@ -22,6 +24,8 @@ func objInteraction(selected): # when an object is used on it
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")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
else: else:
dialogueBox.text = "I can't make it any LESS unclogged.." dialogueBox.text = "I can't make it any LESS unclogged.."
......
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