Commit 05de96a6 authored by Julia Santos's avatar Julia Santos

Added last quest: eating granola bar by opening it with some scissors. Now...

Added last quest: eating granola bar by opening it with some scissors. Now also plays final cutscene when trying to do lab after the 3rd round of quests is done
parent 63c0696d
...@@ -25,11 +25,11 @@ func getDialogue(): ...@@ -25,11 +25,11 @@ func getDialogue():
sceneProgress += 1 sceneProgress += 1
return "Dialogue 4" return "Dialogue 4"
3: 3:
sceneProgress = 0 #sceneProgress = 0
get_parent().queue_free() # dont need that scene anymore #get_parent().queue_free() # dont need that scene anymore
tracking = false tracking = false
print("Deleting scene 2b") print("Deleting scene 2b")
return "" return "Congrats, you win!"
func start(): func start():
......
...@@ -9,7 +9,7 @@ onready var energy_bar # energy bar ...@@ -9,7 +9,7 @@ onready var energy_bar # energy bar
#ingredients #ingredients
onready var bread = get_parent().get_node("Bread") onready var bread = get_parent().get_node("Bread")
onready var egg = get_parent().get_node("Egg") onready var egg = get_parent().get_node("Egg")
onready var granola = get_parent().get_node("Granola bar") #onready var granola = get_parent().get_node("Granola bar")
onready var vienna = get_parent().get_node("Vienna sausage") onready var vienna = get_parent().get_node("Vienna sausage")
onready var eat = get_parent().get_node("Eat") onready var eat = get_parent().get_node("Eat")
onready var cook = get_parent().get_node("Cook") onready var cook = get_parent().get_node("Cook")
...@@ -44,14 +44,14 @@ func _unselected_ing(ingredient): # when an ingredient is unselected, remove it ...@@ -44,14 +44,14 @@ func _unselected_ing(ingredient): # when an ingredient is unselected, remove it
func updateUI(): # whenever there's a change in selections, enables/disables ingredients depending on what food can or cannot be eaten with each other func updateUI(): # whenever there's a change in selections, enables/disables ingredients depending on what food can or cannot be eaten with each other
if ingredients.size() >= 1 and ingredients[0] != "Granola bar": # if anything aside from the granola bar is selected, disable the granola bar, as the granola bar can only be eaten alone if ingredients.size() >= 1 and ingredients[0] != "Granola bar": # if anything aside from the granola bar is selected, disable the granola bar, as the granola bar can only be eaten alone
granola.interactable = false #granola.interactable = false
granola.modulate = Color("#616161") # turn grey #granola.modulate = Color("#616161") # turn grey
eat.hide() eat.hide()
match ingredients.size(): match ingredients.size():
0: # reset if none is selected 0: # reset if none is selected
granola.interactable = true #granola.interactable = true
granola.modulate = Color("#ffffff") #granola.modulate = Color("#ffffff")
eat.hide() eat.hide()
cook.hide() cook.hide()
1: # flavor text and options for singular ingredients 1: # flavor text and options for singular ingredients
......
...@@ -45,7 +45,7 @@ onready var bathroomClean = 0 # how much of the bathroom has been cleaned ...@@ -45,7 +45,7 @@ onready var bathroomClean = 0 # how much of the bathroom has been cleaned
onready var cleaningMaterials = 0 # how many times the cleaning materials have been successfully used onready var cleaningMaterials = 0 # how many times the cleaning materials have been successfully used
onready var canFrontDoor = false # whether or not Moxie has a reason to go to leave their apartment, and so go to the hallway onready var canFrontDoor = false # whether or not Moxie has a reason to go to leave their apartment, and so go to the hallway
onready var foundBanana = false # whether or not Moxie has spotted Banana in the balcony onready var foundBanana = false # whether or not Moxie has spotted Banana in the balcony
onready var plungerUsed = false # whether or not the plunger was used to travel between balconies
#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
...@@ -70,7 +70,7 @@ func _get_notebook(): # when To Do list is retrieved for the first time ...@@ -70,7 +70,7 @@ func _get_notebook(): # when To Do list is retrieved for the first time
bedroom.get_node("Laundry basket").finished() bedroom.get_node("Laundry basket").finished()
func _groceries_put_away(): # when the groceries are put away func _groceries_put_away(): # when the groceries are put away
fridge.get_node("Granola bar").show() kitchen.get_node("Granola bar").show()
groceries = true groceries = true
laundryArea.get_node("Laundry door").flavorText = "I think I'm still missing something..." laundryArea.get_node("Laundry door").flavorText = "I think I'm still missing something..."
inventory.add_item("Oil", load("res://.import/Oil.png-29f84e969418d0f4084115c5ce859866.stex")) inventory.add_item("Oil", load("res://.import/Oil.png-29f84e969418d0f4084115c5ce859866.stex"))
...@@ -95,6 +95,11 @@ func _start_lab(): # trying the lab the first time, adds the new quests ...@@ -95,6 +95,11 @@ func _start_lab(): # trying the lab the first time, adds the new quests
#change sprite for terrarium #change sprite for terrarium
bedroom.get_node("Terrarium").flavorText = "OMG! Where did Banana go??" bedroom.get_node("Terrarium").flavorText = "OMG! Where did Banana go??"
func _finish_lab():
if quests.size() == 1 and quests.get_quest(0) == "Do Lab":
_start_cutscene_3()
else:
dialogue.text = "Too tired. Gotta relax first. Need carbohydrates. Can't I do something less stressful first? Please and thank you."
func _add_quest(questName): # adding a quest to the quest list func _add_quest(questName): # adding a quest to the quest list
quests.add(questName) quests.add(questName)
...@@ -136,8 +141,9 @@ func finished2ndRound(): ...@@ -136,8 +141,9 @@ func finished2ndRound():
func _self_care(): func _self_care():
livingRoom.get_node("Yoga mat").flavorText = "How do you do yoga again? I think that yoga guy posted a new video on some poses earlier." livingRoom.get_node("Yoga mat").flavorText = "How do you do yoga again? I think that yoga guy posted a new video on some poses earlier."
livingRoom.get_node("Yoga mat").canYoga() livingRoom.get_node("Yoga mat").canYoga()
quests.add("Eat something") quests.add("Eat a snack")
quests.add("Do something relaxing") quests.add("Do something relaxing")
kitchen.get_node("Granola bar").canEatGranola()
func _balcony_outer_lock(): func _balcony_outer_lock():
livingRoom.get_node("Balcony door").outerLock() livingRoom.get_node("Balcony door").outerLock()
...@@ -147,6 +153,10 @@ func _balcony_outer_lock(): ...@@ -147,6 +153,10 @@ func _balcony_outer_lock():
movementHandle.disableMovement() movementHandle.disableMovement()
if !quests.hasQuest("Clean bathroom"): if !quests.hasQuest("Clean bathroom"):
inventory.remove_item_name("Plunger") inventory.remove_item_name("Plunger")
plungerUsed = true
func getPlungered():
return plungerUsed
# ----------------- Cutscene initiators ----------------- # ----------------- Cutscene initiators -----------------
func _start_cutscene_1(): func _start_cutscene_1():
cutsceneHandler.get_node("1").show() cutsceneHandler.get_node("1").show()
...@@ -161,6 +171,10 @@ func _start_cutscene_2b(): ...@@ -161,6 +171,10 @@ func _start_cutscene_2b():
cutsceneHandler.get_node("2b").show() cutsceneHandler.get_node("2b").show()
cutsceneHandler.get_node("2b/Scene control").start() cutsceneHandler.get_node("2b/Scene control").start()
func _start_cutscene_3():
cutsceneHandler.get_node("3").show()
cutsceneHandler.get_node("3/Scene control").start()
# ----------------- Notebook puzzle events ----------------- # ----------------- Notebook puzzle events -----------------
func getGroceries(): func getGroceries():
return groceries return groceries
...@@ -340,7 +354,7 @@ func _open_fridge(): # looking into the fridge ...@@ -340,7 +354,7 @@ func _open_fridge(): # looking into the fridge
zoom_in() zoom_in()
notepad.hide() notepad.hide()
else: else:
dialogue.text = "Fueled up and ready to go." dialogue.text = "Not quite dinnertime yet!"
func _return_fridge(): # returning from fridge view func _return_fridge(): # returning from fridge view
fridge.hide() fridge.hide()
......
[gd_scene load_steps=14 format=2] [gd_scene load_steps=17 format=2]
[ext_resource path="res://assets/Placeholder BGs/kitchen area.png" type="Texture" id=1] [ext_resource path="res://assets/Placeholder BGs/kitchen area.png" type="Texture" id=1]
[ext_resource path="res://assets/placeholder item.png" type="Texture" id=2] [ext_resource path="res://assets/placeholder item.png" type="Texture" id=2]
[ext_resource path="res://Item.gd" type="Script" id=3] [ext_resource path="res://Item.gd" type="Script" id=3]
[ext_resource path="res://Scripts/Dialogue control/Dialogue control - Kitchen.gd" type="Script" id=4] [ext_resource path="res://Scripts/Dialogue control/Dialogue control - Kitchen.gd" type="Script" id=4]
[ext_resource path="res://assets/Thesis Clickables/stool.png" type="Texture" id=5] [ext_resource path="res://assets/Thesis Clickables/stool.png" type="Texture" id=5]
[ext_resource path="res://Scripts/Granola bar.gd" type="Script" id=6]
[ext_resource path="res://Scripts/Fridge.gd" type="Script" id=7] [ext_resource path="res://Scripts/Fridge.gd" type="Script" id=7]
[ext_resource path="res://Scripts/Movement scripts/Cabinet.gd" type="Script" id=8] [ext_resource path="res://Scripts/Movement scripts/Cabinet.gd" type="Script" id=8]
...@@ -27,6 +28,13 @@ load_path = "res://.import/placeholder item.png-cd6e4c1231156687d87915032ec4361d ...@@ -27,6 +28,13 @@ load_path = "res://.import/placeholder item.png-cd6e4c1231156687d87915032ec4361d
[sub_resource type="RectangleShape2D" id=6] [sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 15.4169, 13.9691 ) extents = Vector2( 15.4169, 13.9691 )
[sub_resource type="RectangleShape2D" id=7]
extents = Vector2( 9.26066, 9.03523 )
[sub_resource type="StreamTexture" id=8]
flags = 4
load_path = "res://.import/Granola bar.png-cef620d7191b1675ca638bd3ee9f9871.stex"
[node name="Node2D" type="Node2D"] [node name="Node2D" type="Node2D"]
[node name="BG" type="Sprite" parent="."] [node name="BG" type="Sprite" parent="."]
...@@ -141,3 +149,23 @@ script = ExtResource( 4 ) ...@@ -141,3 +149,23 @@ script = ExtResource( 4 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="Granola bar" type="StaticBody2D" parent="."]
position = Vector2( 329.894, 282.728 )
input_pickable = true
script = ExtResource( 6 )
__meta__ = {
"_edit_group_": true
}
interactable = true
flavorText = "Crunchy. But not as filling. And very hard to open."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Granola bar"]
position = Vector2( -0.433167, 2.2196 )
scale = Vector2( 5, 5 )
shape = SubResource( 7 )
[node name="Sprite" type="Sprite" parent="Granola bar/CollisionShape2D"]
position = Vector2( 0.141357, -0.408264 )
scale = Vector2( 0.0905492, 0.088454 )
texture = SubResource( 8 )
...@@ -78,11 +78,6 @@ visible = false ...@@ -78,11 +78,6 @@ visible = false
script = ExtResource( 4 ) script = ExtResource( 4 )
items = [ NodePath("Laptop"), NodePath("Return") ] items = [ NodePath("Laptop"), NodePath("Return") ]
[node name="Kitchen" parent="." instance=ExtResource( 8 )]
visible = false
script = ExtResource( 4 )
items = [ NodePath("Cleaning mat"), NodePath("Fridge"), NodePath("Stool"), NodePath("Cabinet") ]
[node name="Laundry basket" parent="." instance=ExtResource( 13 )] [node name="Laundry basket" parent="." instance=ExtResource( 13 )]
visible = false visible = false
position = Vector2( 24.0379, 4.2581 ) position = Vector2( 24.0379, 4.2581 )
...@@ -94,10 +89,15 @@ visible = false ...@@ -94,10 +89,15 @@ visible = false
script = ExtResource( 4 ) script = ExtResource( 4 )
items = [ NodePath("Laundry door"), NodePath("Groceries"), NodePath("Stool") ] items = [ NodePath("Laundry door"), NodePath("Groceries"), NodePath("Stool") ]
[node name="Kitchen" parent="." instance=ExtResource( 8 )]
visible = false
script = ExtResource( 4 )
items = [ NodePath("Fridge"), NodePath("Cabinet"), NodePath("Stool"), NodePath("Granola bar") ]
[node name="Fridge" parent="." instance=ExtResource( 17 )] [node name="Fridge" parent="." instance=ExtResource( 17 )]
visible = false visible = false
script = ExtResource( 4 ) script = ExtResource( 4 )
items = [ NodePath("Bread"), NodePath("Egg"), NodePath("Granola bar"), NodePath("Vienna sausage"), NodePath("Return"), NodePath("Cook"), NodePath("Eat") ] items = [ NodePath("Bread"), NodePath("Egg"), NodePath("Vienna sausage"), NodePath("Return"), NodePath("Cook"), NodePath("Eat") ]
[node name="Laundry - Notepad" parent="." instance=ExtResource( 18 )] [node name="Laundry - Notepad" parent="." instance=ExtResource( 18 )]
visible = false visible = false
...@@ -147,7 +147,7 @@ items = [ NodePath("Nana from afar"), NodePath("Other balcony"), NodePath("Balco ...@@ -147,7 +147,7 @@ items = [ NodePath("Nana from afar"), NodePath("Other balcony"), NodePath("Balco
[node name="Event Handler" type="Node2D" parent="."] [node name="Event Handler" type="Node2D" parent="."]
position = Vector2( 460.602, 18.6417 ) position = Vector2( 460.602, 18.6417 )
script = ExtResource( 12 ) script = ExtResource( 12 )
eventItems = [ NodePath("../Laundry basket/To do list"), NodePath("../Bedroom/Laundry basket"), NodePath("../Laundry basket/Return"), NodePath("../Fridge/Return"), NodePath("../Kitchen/Fridge"), NodePath("../Laundry area/Groceries"), NodePath("../Fridge/Energy handler"), NodePath("../Laundry area/Laundry door"), NodePath("../Laundry - Notepad/Return"), NodePath("../Laundry - Notepad/Dialogue control"), NodePath("../Bedroom/Bathroom door"), NodePath("../Bathroom/Door - to Bedroom"), NodePath("../Living room/Balcony door"), NodePath("../Balcony/Door to living room"), NodePath("../Living room/Front door"), NodePath("../Hallway/Door to Moxie"), NodePath("../Hallway/Door to neighbor"), NodePath("../Neighbor\'s room/Neighbor to hallway"), NodePath("../Neighbor\'s balcony/Balcony to neighbor\'s room"), NodePath("../Neighbor\'s room/Neighbor to balcony"), NodePath("../Bedroom/Laptop"), NodePath("../Desk/Return"), NodePath("../Inside cabinet/Return"), NodePath("../Kitchen/Cabinet"), NodePath("../Desk/Laptop"), NodePath("../Bedroom/Terrarium"), NodePath("../Bathroom/Lab Note - Bathroom"), NodePath("../Inside cabinet/Lab notes"), NodePath("../Living room/Lab notes"), NodePath("../Bedroom/Pants"), NodePath("../Bedroom/Shirt"), NodePath("../Bedroom/Sando"), NodePath("../Bedroom/Towel"), NodePath("../Bathroom/Sink"), NodePath("../Bathroom/Toilet"), NodePath("../Bathroom/Mirror"), NodePath("../Bathroom/Mess on floor"), NodePath("../Hallway/Trash chute"), NodePath("../Neighbor\'s room/Ladder"), NodePath("../Living room - Notepad/Return"), NodePath("../Living room/Plants"), NodePath("../Living room - Notepad/Dialogue control"), NodePath("../Balcony/Other plants"), NodePath("../Living room/Yoga mat"), NodePath("../Neighbor\'s balcony/Other balcony") ] eventItems = [ NodePath("../Laundry basket/To do list"), NodePath("../Bedroom/Laundry basket"), NodePath("../Laundry basket/Return"), NodePath("../Fridge/Return"), NodePath("../Kitchen/Fridge"), NodePath("../Laundry area/Groceries"), NodePath("../Fridge/Energy handler"), NodePath("../Laundry area/Laundry door"), NodePath("../Laundry - Notepad/Return"), NodePath("../Laundry - Notepad/Dialogue control"), NodePath("../Bedroom/Bathroom door"), NodePath("../Bathroom/Door - to Bedroom"), NodePath("../Living room/Balcony door"), NodePath("../Balcony/Door to living room"), NodePath("../Living room/Front door"), NodePath("../Hallway/Door to Moxie"), NodePath("../Hallway/Door to neighbor"), NodePath("../Neighbor\'s room/Neighbor to hallway"), NodePath("../Neighbor\'s balcony/Balcony to neighbor\'s room"), NodePath("../Neighbor\'s room/Neighbor to balcony"), NodePath("../Bedroom/Laptop"), NodePath("../Desk/Return"), NodePath("../Inside cabinet/Return"), NodePath("../Kitchen/Cabinet"), NodePath("../Desk/Laptop"), NodePath("../Bedroom/Terrarium"), NodePath("../Bathroom/Lab Note - Bathroom"), NodePath("../Inside cabinet/Lab notes"), NodePath("../Living room/Lab notes"), NodePath("../Bedroom/Pants"), NodePath("../Bedroom/Shirt"), NodePath("../Bedroom/Sando"), NodePath("../Bedroom/Towel"), NodePath("../Bathroom/Sink"), NodePath("../Bathroom/Toilet"), NodePath("../Bathroom/Mirror"), NodePath("../Bathroom/Mess on floor"), NodePath("../Hallway/Trash chute"), NodePath("../Neighbor\'s room/Ladder"), NodePath("../Living room - Notepad/Return"), NodePath("../Living room/Plants"), NodePath("../Living room - Notepad/Dialogue control"), NodePath("../Balcony/Other plants"), NodePath("../Living room/Yoga mat"), NodePath("../Neighbor\'s balcony/Other balcony"), NodePath("../Kitchen/Granola bar") ]
[node name="Moxie" type="Control" parent="."] [node name="Moxie" type="Control" parent="."]
margin_left = 513.815 margin_left = 513.815
...@@ -380,9 +380,9 @@ visible = false ...@@ -380,9 +380,9 @@ visible = false
[editable path="Bedroom"] [editable path="Bedroom"]
[editable path="Desk"] [editable path="Desk"]
[editable path="Kitchen"]
[editable path="Laundry basket"] [editable path="Laundry basket"]
[editable path="Laundry area"] [editable path="Laundry area"]
[editable path="Kitchen"]
[editable path="Fridge"] [editable path="Fridge"]
[editable path="Laundry - Notepad"] [editable path="Laundry - Notepad"]
[editable path="Bathroom"] [editable path="Bathroom"]
......
...@@ -24,7 +24,7 @@ func finishQuest(q): # removes a quest from the list ...@@ -24,7 +24,7 @@ func finishQuest(q): # removes a quest from the list
showQuests() showQuests()
found = true found = true
if q == "Do something relaxing" or q == "Eat a snack": if q == "Do something relaxing" or q == "Eat a snack":
energyBar.value += 30 energyBar.value += 15
else: else:
energyBar.value -= 10 energyBar.value -= 10
index += 1 index += 1
...@@ -47,3 +47,9 @@ func hasQuest(questInq): # checks if the list contains a certain questm returns ...@@ -47,3 +47,9 @@ func hasQuest(questInq): # checks if the list contains a certain questm returns
if quest == questInq: if quest == questInq:
has = true has = true
return has return has
func size():
return quests.size()
func get_quest(index):
return quests[index]
...@@ -14,7 +14,7 @@ func _ready(): ...@@ -14,7 +14,7 @@ func _ready():
func passEvent(handler): func passEvent(handler):
connect("start_lab", handler,"_start_lab") connect("start_lab", handler,"_start_lab")
connect("finish_lab", handler, "_finished_lab") connect("finish_lab", handler, "_finish_lab")
connect("tired", handler, "_self_care") connect("tired", handler, "_self_care")
eventHandler = handler eventHandler = handler
...@@ -23,12 +23,12 @@ func mouseInteraction(): ...@@ -23,12 +23,12 @@ func mouseInteraction():
if !started: # if the quests have been given yet if !started: # if the quests have been given yet
emit_signal("start_lab") emit_signal("start_lab")
else: else:
if !givenTired and flavorText == "Too tired. Gotta relax first. Need carbohydrates. Can't I do something less stressful first? Please and thank you.": if givenTired and eventHandler.get_lab_notes() == 4:
emit_signal("finish_lab")
elif !givenTired and flavorText == "Too tired. Gotta relax first. Need carbohydrates. Can't I do something less stressful first? Please and thank you.":
emit_signal("tired") emit_signal("tired")
givenTired = true givenTired = true
.mouseInteraction() .mouseInteraction()
elif eventHandler.get_lab_notes() == 4:
emit_signal("finish_lab")
else: else:
.mouseInteraction() .mouseInteraction()
......
...@@ -79,7 +79,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it ...@@ -79,7 +79,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
"Put in": "Put in":
if door: if door:
clothes.scale = Vector2(0.4,0.4) clothes.scale = Vector2(0.4,0.4)
clothes.position = Vector2(512.081,420.95) clothes.position = Vector2(432.376,406.681)
clothes_in = true clothes_in = true
#x 502.081, y 420.95 #x 502.081, y 420.95
return "In you go." return "In you go."
......
extends "res://Item.gd"
signal snack
onready var canEat = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
connect("snack", handler,"_remove_quest")
func objInteraction(selected): # when an object is used on it
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if inventory.get_item_text(selected) == "Scissors":
if canEat:
dialogueBox.text = "Yummy!"
emit_signal("snack", "Eat a snack")
inventory.remove_item(selected)
queue_free()
else:
dialogueBox.text = "I'm not hungry yet!"
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 canEatGranola():
canEat = true
...@@ -15,6 +15,7 @@ func objInteraction(selected): # when an object is used on it ...@@ -15,6 +15,7 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = "Hello plant, meet your old friend, plant!" dialogueBox.text = "Hello plant, meet your old friend, plant!"
get_parent().get_node("Repotted plants").show() get_parent().get_node("Repotted plants").show()
emit_signal("done", "Repot plants") emit_signal("done", "Repot plants")
inventory.remove_item(selected)
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:
......
...@@ -27,6 +27,8 @@ func objInteraction(selected): # when an object is used on it ...@@ -27,6 +27,8 @@ func objInteraction(selected): # when an object is used on it
dialogueBox.text = "Time to tango, toilet." dialogueBox.text = "Time to tango, toilet."
emit_signal("cleaned", "Plunger") emit_signal("cleaned", "Plunger")
clean = true clean = true
if eventHandler.getPlungered():
inventory.remove_item(selected)
else: # if they try to use the plunger on a clean toilet else: # if they try to use the plunger on a clean toilet
dialogueBox.text = "I can't make it any LESS unclogged.." dialogueBox.text = "I can't make it any LESS unclogged.."
inventory.unselect_all() #unselect item 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