Commit 8234d1e1 authored by Julia Santos's avatar Julia Santos

Added plant notebook puzzle, also finished Feed Banana quest properly

parent 3b7b285a
......@@ -28,6 +28,7 @@ onready var fridge = get_parent().get_node("Fridge")
onready var desk = get_parent().get_node("Desk")
onready var insideCabinet = get_parent().get_node("Inside cabinet")
onready var livingRoom = get_parent().get_node("Living room")
onready var plantNotepad = get_parent().get_node("Living room - Notepad")
onready var hallway = get_parent().get_node("Hallway")
onready var balcony = get_parent().get_node("Balcony")
onready var neighborsRoom = get_parent().get_node("Neighbor's room")
......@@ -184,7 +185,44 @@ func _return_laundry_notepad(): # exiting laundry notebook puzzle
laundryNotepad.hide()
notepad._open_UI()
notepad.get_node("Quests").show()
notepad.get_node("Title").text = "To do"
notepad.get_node("Title").text = "To do (click to expand):"
notepad.get_node("Words").hide()
movementHandle.checkRoom()
func _enter_notebook_plants(): # trying to engage in the notebook puzzle for doing laundry
if !quests.hasQuest("Repot plants"):
return "Did that already"
else: # if the groceries have been put away
#if inventory.hasItem("Pot") and inventory.hasItem("Tabo with water") and inventory.hasItem("Shovel"):
livingRoom.hide()
plantNotepad.show()
zoom_in()
notepad._open_UI()
notepad.get_node("Quests").hide()
notepad.get_node("Title").text = "Words"
var notepad_words = notepad.get_node("Words")
notepad.get_node("Words").clear()
notepad_words.show()
notepad_words.add_item("Look")
notepad_words.add_item("Clean")
notepad_words.add_item("Pick up")
notepad_words.add_item("Put down")
notepad_words.add_item("Put in")
return "Awww my babies are growing up so fast. Looks like they've outgrown their pots. Time for some big boy pants!"
func _plants_finished():
quests.finishQuest("Repot plants")
livingRoom.get_node("Plants").interactable = false
livingRoom.get_node("Plants").retrievable = true
livingRoom.get_node("Plants").flavorText = "Time to bring these outside for some sunlight!"
func _return_plant_notepad(): # exiting laundry notebook puzzle
zoom_out()
livingRoom.show()
plantNotepad.hide()
notepad._open_UI()
notepad.get_node("Quests").show()
notepad.get_node("Title").text = "To do (click to expand):"
notepad.get_node("Words").hide()
movementHandle.checkRoom()
......
......@@ -8,6 +8,3 @@ func _ready():
func overrideInventory(inv):
inventory = inv
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
[gd_scene load_steps=12 format=2]
[gd_scene load_steps=15 format=2]
[ext_resource path="res://assets/Thesis Clickables/other plants.png" type="Texture" id=1]
[ext_resource path="res://Item.gd" type="Script" id=2]
[ext_resource path="res://assets/Thesis Clickables/pot.png" type="Texture" id=3]
[ext_resource path="res://assets/Thesis Clickables/nana.png" type="Texture" id=4]
[ext_resource path="res://Scripts/Dialogue control/Dialogue Contro - Living room.gd" type="Script" id=5]
[ext_resource path="res://Scripts/Dialogue control/Dialogue Contro - Living room notepad.gd" type="Script" id=5]
[ext_resource path="res://Scripts/Movement scripts/Door to living room.gd" type="Script" id=6]
[ext_resource path="res://Scripts/Other plants.gd" type="Script" id=7]
[ext_resource path="res://assets/Thesis Clickables/plants.png" type="Texture" id=8]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 19.9228, 36.7719 )
[sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 19.9228, 32.1977 )
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 15.6685, 16.4124 )
......@@ -39,7 +44,7 @@ __meta__ = {
position = Vector2( 797.184, 280.808 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 2 )
script = ExtResource( 7 )
__meta__ = {
"_edit_group_": true
}
......@@ -56,6 +61,25 @@ position = Vector2( 0.449585, 0.542709 )
scale = Vector2( 0.201615, 0.377395 )
texture = ExtResource( 1 )
[node name="Repotted plants" type="StaticBody2D" parent="."]
visible = false
position = Vector2( 932.003, 339.541 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
__meta__ = {
"_edit_group_": true
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="Repotted plants"]
position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 )
shape = SubResource( 6 )
[node name="Sprite" type="Sprite" parent="Repotted plants/CollisionShape2D"]
position = Vector2( 0.127625, 0.542709 )
scale = Vector2( 0.201615, 0.325884 )
texture = ExtResource( 8 )
[node name="Pot" type="StaticBody2D" parent="."]
position = Vector2( 732.928, 428.219 )
scale = Vector2( 0.829244, 0.829244 )
......
[gd_scene load_steps=14 format=2]
[ext_resource path="res://Item - Notepad.gd" type="Script" id=1]
[ext_resource path="res://Scripts/Dialogue control/Dialogue Contro - Living room notepad.gd" type="Script" id=2]
[ext_resource path="res://Scripts/Movement scripts/Return_plant_notepad.gd" type="Script" id=3]
[ext_resource path="res://assets/Thesis Clickables/plants.png" type="Texture" id=7]
[ext_resource path="res://assets/Thesis Clickables/pot.png" type="Texture" id=12]
[ext_resource path="res://assets/Thesis Clickables/placeholder.png" type="Texture" id=13]
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 20.5876, 32.5145 )
[sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 26.4732, 26.6968 )
[sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 19.9646, 20.1882 )
[sub_resource type="StreamTexture" id=9]
flags = 4
load_path = "res://.import/placeholder.png-8b1c9447dca72ebf4053074879f48883.stex"
[sub_resource type="RectangleShape2D" id=7]
extents = Vector2( 19.9646, 20.1882 )
[sub_resource type="RectangleShape2D" id=10]
extents = Vector2( 15.414, 13.6335 )
[sub_resource type="StreamTexture" id=11]
flags = 4
load_path = "res://.import/return arrow.png-ba7c2fea6c5a220a249845f29bbe9177.stex"
[node name="Node2D" type="Node2D"]
[node name="BG" type="Sprite" parent="."]
[node name="Dialogue control" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Plant" type="StaticBody2D" parent="."]
position = Vector2( 276.321, 282.901 )
scale = Vector2( 1.3, 1.3 )
input_pickable = true
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
interactable = true
flavorText = "Click plant"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Plant"]
position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 )
shape = SubResource( 3 )
[node name="Sprite" type="Sprite" parent="Plant/CollisionShape2D"]
position = Vector2( -0.42981, 1.07585 )
scale = Vector2( 0.201448, 0.330516 )
texture = ExtResource( 7 )
[node name="Pot" type="StaticBody2D" parent="."]
position = Vector2( 544.299, 392.085 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
interactable = true
flavorText = "Click pot"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Pot"]
position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 )
shape = SubResource( 6 )
[node name="Sprite" type="Sprite" parent="Pot/CollisionShape2D"]
position = Vector2( -0.42984, 0.692932 )
scale = Vector2( 0.264918, 0.264918 )
texture = ExtResource( 12 )
[node name="Soil" type="StaticBody2D" parent="."]
position = Vector2( 777.244, 150.832 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
interactable = true
flavorText = "Click soil"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Soil"]
position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 )
shape = SubResource( 8 )
[node name="Sprite" type="Sprite" parent="Soil/CollisionShape2D"]
position = Vector2( -0.238403, 0.501556 )
scale = Vector2( 0.186433, 0.186433 )
texture = SubResource( 9 )
[node name="Water" type="StaticBody2D" parent="."]
position = Vector2( 902.649, 207.978 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true
}
interactable = true
flavorText = "Click water"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Water"]
position = Vector2( -16.8367, -2.11676 )
scale = Vector2( 5, 5 )
shape = SubResource( 7 )
[node name="Sprite" type="Sprite" parent="Water/CollisionShape2D"]
position = Vector2( -0.238403, 0.501556 )
scale = Vector2( 0.186433, 0.186433 )
texture = ExtResource( 13 )
[node name="Return" type="StaticBody2D" parent="."]
position = Vector2( 95.853, 523.599 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 3 )
__meta__ = {
"_edit_group_": true
}
interactable = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Return"]
position = Vector2( -2.89487, 2.65125 )
scale = Vector2( 5, 5 )
shape = SubResource( 10 )
[node name="Sprite" type="Sprite" parent="Return/CollisionShape2D"]
position = Vector2( -1.10974, 0.0285645 )
scale = Vector2( 0.0338674, 0.0338674 )
texture = SubResource( 11 )
[node name="Label" type="Label" parent="Return"]
visible = false
margin_left = -74.0
margin_top = -27.7054
margin_right = 84.0
margin_bottom = 3.29462
text = "Groceries
"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[gd_scene load_steps=16 format=2]
[gd_scene load_steps=17 format=2]
[ext_resource path="res://Scripts/Dialogue control/Dialogue Contro - Living room.gd" type="Script" id=1]
[ext_resource path="res://assets/Thesis Clickables/yoga mat.png" type="Texture" id=2]
......@@ -10,6 +10,7 @@
[ext_resource path="res://Scripts/Movement scripts/Balcony door.gd" type="Script" id=8]
[ext_resource path="res://Scripts/Movement scripts/Front door.gd" type="Script" id=9]
[ext_resource path="res://Lab Note.gd" type="Script" id=10]
[ext_resource path="res://Scripts/Plants.gd" type="Script" id=11]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 34.6417, 40.1913 )
......@@ -83,12 +84,12 @@ texture = ExtResource( 7 )
position = Vector2( 453.418, 369.4 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 5 )
script = ExtResource( 11 )
__meta__ = {
"_edit_group_": true
}
interactable = true
flavorText = "Plants don't complain. So you gotta check on them every now and then. These are in terrible condition though, they're so dry!"
flavorText = " Plants don't complain. So you gotta check on them every now and then. These are in terrible condition though, they're so dry!"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Plants"]
position = Vector2( -16.8367, -2.11676 )
......
......@@ -7,12 +7,13 @@ onready var dialogueBox = get_parent().get_node("UI/Dialogue Box/RichTextLabel")
onready var inventory = get_parent().get_node("UI/Inventory")
onready var quests = get_parent().get_node("UI/To do/Quests")
onready var path = get_parent().get_node("Moxie/Path2D/PathFollow2D")
onready var words = get_parent().get_node("UI/To do/Words")
#variables that are editable in the Inspector
export(Array, NodePath) onready var items
#other variables
onready var current = self.get_name() #name of the room Movie is currently in
onready var current = self.get_name() #name of the room Moxie is currently in
#some references
# https://www.reddit.com/r/godot/comments/puiioy/exporting_node_references_in_gdscript_is_tricky/
......@@ -26,6 +27,9 @@ func _ready(): # Called when the node enters the scene tree for the first time.
func passUI(): # gives reference to the nodes to each item in the room
var totalItems = 0
for item in items:
if get_name() == "Living room - Notepad" or get_name() == "Laundry - Notepad":
get_node(item).passUI(words,dialogueBox,quests,path)
else:
get_node(item).passUI(inventory,dialogueBox, quests, path)
totalItems = totalItems + 1
#print("Passed UI to " + get_node(item).get_name())
......
[gd_scene load_steps=38 format=2]
[gd_scene load_steps=39 format=2]
[ext_resource path="res://Main rooms/Test room 1.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/189066690_228150108704696_3850052974465333899_n.png" type="Texture" id=2]
......@@ -31,6 +31,7 @@
[ext_resource path="res://Cutscenes/Cutscene 2b.tscn" type="PackedScene" id=29]
[ext_resource path="res://MoxieSprite.gd" type="Script" id=30]
[ext_resource path="res://Paths/Bedroom.tres" type="Curve2D" id=31]
[ext_resource path="res://Main rooms/Living room - Notepad.tscn" type="PackedScene" id=32]
[sub_resource type="Animation" id=1]
resource_name = "Notepad open"
......@@ -117,6 +118,11 @@ visible = false
script = ExtResource( 4 )
items = [ NodePath("Balcony door"), NodePath("Plants"), NodePath("Lab notes"), NodePath("Yoga mat"), NodePath("Front door") ]
[node name="Living room - Notepad" parent="." instance=ExtResource( 32 )]
visible = false
script = ExtResource( 4 )
items = [ NodePath("Plant"), NodePath("Pot"), NodePath("Soil"), NodePath("Water"), NodePath("Return") ]
[node name="Hallway" parent="." instance=ExtResource( 25 )]
visible = false
script = ExtResource( 4 )
......@@ -140,7 +146,7 @@ items = [ NodePath("Nana from afar"), NodePath("Other balcony"), NodePath("Balco
[node name="Event Handler" type="Node2D" parent="."]
position = Vector2( 460.602, 18.6417 )
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") ]
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") ]
[node name="Moxie" type="Control" parent="."]
margin_left = 513.815
......@@ -378,6 +384,7 @@ visible = false
[editable path="Bathroom"]
[editable path="Inside cabinet"]
[editable path="Living room"]
[editable path="Living room - Notepad"]
[editable path="Hallway"]
[editable path="Balcony"]
[editable path="Neighbor's room"]
......
extends Control
onready var potClean = false
onready var holding = ""
onready var soilIn = false
onready var plantIn = false
onready var cleanRoots = false
onready var soilCover = false
signal finished
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
#clean new pot
#put soil in new pot (so plant has a 'base' to sit on)
#remove plant from old pot
#clean plant roots
#transfer plant
#put more soil to hold pot in place
#water plant
func passEvent(handler):
connect("finished", handler, "_plants_finished")
func interaction(selected, clicked): #selected = item in inventory, clicked = item in environment
match clicked:
"Plant":
match selected:
"Look":
return "A plant, kinda dry"
"Clean":
if holding == "Plant": # putting clean plant in
cleanRoots = true
return "Nice and clean roots"
elif holding == "": # trying to clean potted plant
return "I need to take it out of the pot first"
else: # holding something else while cleaning
return "I'm still holding something"
"Pick up":
if holding == "":
holding = "Plant"
return "Hup."
else:
return "I'm already holding something."
"Put down":
if holding == clicked:
holding = ""
return "Put down."
else:
return "Wrong thing!"
"Put in":
if holding == "":
return "I'm not holding anything!"
else:
if potClean and soilIn and cleanRoots and soilCover and holding == "Water":
emit_signal("finished")
return "Hydration"
elif holding == "Soil" and plantIn:
return "I need to put it in the pot, not on the leaves!"
else:
return "That doesn't really make any sense"
_:
return "That doesn't really make sense."
"Pot":
match selected:
"Look":
if !potClean:
return "A little dirty from sitting on the balcony."
else:
return "Ready to go"
"Clean":
if !potClean:
potClean = true
#change sprite
return "Cleaned."
else:
return "It's already clean."
"Pick up":
if potClean and holding == "":
holding = "Pot"
return "Hup"
elif !potClean:
return "I'm not touching that!"
else:
return "I'm already holding something."
"Put down":
if holding == clicked:
holding = ""
return "Put down."
else:
return "Wrong thing!"
"Put in":
if holding == "":
return "I'm not holding anything!"
else:
match holding:
"Soil": # putting soil into clean pot
if !soilIn and potClean:
holding = ""
soilIn = true
return "Soil in pot, just need to cover it up now"
elif !potClean: # trying to put soil in dirty pot
return "I don't know what's in there"
elif soilIn and !soilCover:
soilCover = true
plantIn = true
holding = ""
return "Now that's nice and covered"
else: # putting soil in already-filled pot
return "That's enough soil"
"Plant":
if soilIn and cleanRoots: # putting plant in the new pot
holding = ""
get_parent().get_node("Plant").position = Vector2(547.85,149.965)
get_parent().get_node("Plant").scale = Vector2(1.3, 0.9)
#original: (276.321, 282.901)
#new: (547.85,149.965)
return "Plant in pot"
elif !cleanRoots:
return "I need to clean the roots!"
else:
return "There's nothing in there!"
_:
return "I don't think that's the place for that."
_:
return "That doesn't really make sense."
"Soil":
match selected:
"Look":
return "Some soil"
"Clean":
return "Can't clean dirt!"
"Pick up":
if holding == "":
holding = "Soil"
return "Hup."
else:
return "I'm already holding something."
"Put down":
if holding == clicked:
holding = ""
return "Put down."
else:
return "Wrong thing!"
"Put in":
if holding == "":
return "I'm not holding anything!"
else:
return "I'm not putting anything in this sack"
_:
return "That doesn't really make sense."
"Water":
match selected:
"Look":
return "Some water"
"Clean":
return "It's as clean as tap water can get"
"Pick up":
if holding == "":
holding = "Water"
return "Hup."
else:
return "I'm already holding something."
"Put down":
if holding == clicked:
holding = ""
return "Put down."
else:
return "Wrong thing!"
"Put in":
if holding == "":
return "I'm not holding anything!"
else:
return "I'm not making soup!"
_:
return "That doesn't really make sense."
......@@ -20,7 +20,7 @@ func checkWin():
return "I haven't put everything in yet."
func passEvent(handler):
print("Handler laundry passed")
#print("Handler laundry passed")
connect("laundry_finished", handler, "_laundry_finished")
func interaction(selected, clicked): #selected = item in inventory, clicked = item in environment
......
extends "res://Item.gd"
signal returnPlant
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
connect("returnPlant", handler, "_return_plant_notepad")
func mouseInteraction():
emit_signal("returnPlant")
extends "res://Item.gd"
signal done
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
connect("done", handler,"_remove_quest")
pass
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) == "Plants":
dialogueBox.text = "Hello plant, meet your old friend, plant!"
get_parent().get_node("Repotted plants").show()
emit_signal("done", "Repot plants")
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
extends "res://Item.gd"
onready var first = true
signal notebook_puzzle
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func passEvent(handler):
connect("notebook_puzzle", handler,"_enter_notebook_plants")
func mouseInteraction():
.mouseInteraction()
if !quests.hasQuest("Feed Banana"):
flavorText = "I need to take care of these plants, but I don't know where to start.."
else:
flavorText = "Plants later. Banana first. I don't even wanna know how long she's been trapped out here, poor thing..."
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) == "To do list":
if quests.hasQuest("Feed Banana"): # Need to feed banana first
dialogueBox.text = "Plants later. Banana first. I don't even wanna know how long she's been trapped out here, poor thing..."
else:
if inventory.hasItem("Pot") and inventory.hasItem("Shovel") and inventory.hasItem("Tabo with water"):
# banana is fed and have all needed equipment
emit_signal("notebook_puzzle")
else:
# dont have all equipment yet
dialogueBox.text = "I don't think I have all my equipment for this 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
extends "res://Item.gd"
signal checked
signal fed
onready var hasBanana = false # if the player has put banana in the terrarium
# This script changes the flavor text after the first interaction
......@@ -15,8 +15,7 @@ func mouseInteraction():
inventory.add_item("Nana", load("res://.import/nana.png-3afacff9a6dfeb0ea38c0e651d0707be.stex"))
func passEvent(handler):
#connect("checked", handler,"_add_quest")
# will need handler later maybe but for now its not needed anymore
connect("fed", handler,"_remove_quest")
pass
func objInteraction(selected): # when an object is used on it
......@@ -29,6 +28,7 @@ func objInteraction(selected): # when an object is used on it
elif inventory.get_item_text(selected) == "Nana's food": # trying to feed Banana
if hasBanana: # if banana is in the tank
dialogueBox.text = "Your meal, sir."
emit_signal("fed", "Feed Banana")
inventory.remove_item(selected)
else:
dialogueBox.text = "Where's Banana?"
......
......@@ -12,13 +12,13 @@
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 10.2686, 10.4499 )
[sub_resource type="RectangleShape2D" id=2]
[sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 10.2686, 10.4499 )
[sub_resource type="RectangleShape2D" id=3]
[sub_resource type="RectangleShape2D" id=7]
extents = Vector2( 16.2132, 16.4708 )
[sub_resource type="RectangleShape2D" id=4]
[sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 17.4279, 15.7667 )
[sub_resource type="StreamTexture" id=5]
......@@ -65,11 +65,13 @@ script = ExtResource( 2 )
__meta__ = {
"_edit_group_": true
}
retrievable = true
flavorText = "A shovel!"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shovel"]
position = Vector2( -0.433167, 2.2196 )
scale = Vector2( 5, 5 )
shape = SubResource( 2 )
shape = SubResource( 6 )
[node name="Sprite" type="Sprite" parent="Shovel/CollisionShape2D"]
position = Vector2( 0.178162, -0.0184937 )
......@@ -109,7 +111,7 @@ flavorText = "Finally, some food for Banana."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Nana\'s food"]
position = Vector2( -0.433167, 2.2196 )
scale = Vector2( 5, 5 )
shape = SubResource( 3 )
shape = SubResource( 7 )
[node name="Sprite" type="Sprite" parent="Nana\'s food/CollisionShape2D"]
position = Vector2( 0.178162, -0.0184937 )
......@@ -129,7 +131,7 @@ interactable = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Return"]
position = Vector2( -2.31012, 0.749359 )
scale = Vector2( 5, 5 )
shape = SubResource( 4 )
shape = SubResource( 8 )
[node name="Sprite" type="Sprite" parent="Return/CollisionShape2D"]
position = Vector2( -0.670166, 0.427979 )
......
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