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():
quests.finishQuest("Clean bathroom")
inventory.remove_item_name("Cleaning mat")
func getClean():
return bathroomClean
func _foundBanana():
quests.finishQuest("Find Banana")
foundBanana = true
......
extends "res://Item.gd"
signal cleaned
onready var eventHandler
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
eventHandler = handler
connect("cleaned", handler,"_clean")
pass
......@@ -21,6 +23,8 @@ func objInteraction(selected):
flavorText = "Okay. That wasn't so bad..."
print("cleaning successfully")
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
else:
dialogueBox.text = flavorText
print("already cleaned")
......
......@@ -2,6 +2,7 @@ extends "res://Item.gd"
onready var gotLabNote = false
onready var first = true
signal cleaned
onready var eventHandler
# Called when the node enters the scene tree for the first time.
func _ready():
......@@ -9,6 +10,7 @@ func _ready():
func passEvent(handler):
connect("cleaned", handler,"_clean")
eventHandler = handler
pass
......@@ -26,6 +28,8 @@ func objInteraction(selected):
flavorText = "Great! I can see my own face again."
dialogueBox.text = flavorText
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
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
......
extends "res://Item.gd"
signal cleaned
onready var eventHandler
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
eventHandler = handler
connect("cleaned", handler,"_clean")
pass
......@@ -17,6 +18,8 @@ func objInteraction(selected):
flavorText = "Okay. That wasn't so bad..."
dialogueBox.text = flavorText
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
else:
dialogueBox.text = "I cleaned that already!"
......
......@@ -2,11 +2,13 @@ extends "res://Item.gd"
onready var first
onready var clean
signal cleaned
onready var eventHandler
func _ready():
pass # Replace with function body.
func passEvent(handler):
eventHandler = handler
connect("cleaned", handler,"_clean")
pass
......@@ -22,6 +24,8 @@ func objInteraction(selected): # when an object is used on it
flavorText = "Okay. That wasn't so bad... "
dialogueBox.text = "Time to tango, toilet."
emit_signal("cleaned")
if eventHandler.getClean() == 3:
inventory.remove_item(selected)
else:
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