Commit 76160deb authored by Julia Santos's avatar Julia Santos

Can now give Nana to the neighbor, and get her back

parent b6a0e30a
extends "res://Item.gd" extends "res://Item.gd"
# This script progresses the dialogue between the Moxie and Brodie, hiding itself and resetting the conversation after it has ended # This script progresses the dialogue between the Moxie and Brodie, hiding itself and resetting the conversation after it has ended
onready var currentScene = "Intro"
onready var sceneProgress = 0 onready var sceneProgress = 0
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
...@@ -8,17 +8,43 @@ func _ready(): ...@@ -8,17 +8,43 @@ func _ready():
pass # Replace with function body. pass # Replace with function body.
func mouseInteraction(): func mouseInteraction():
var dialogue dialogueBox.text = getDialogue(currentScene)
match sceneProgress:
0:
dialogue = "Moxie: ..... Trying to help....?"
sceneProgress += 1
1:
dialogue = "Then can you give me some space? This is area is a danger zone until I finish what I'm doing"
sceneProgress += 1
2:
dialogue = "(Geez. He won't budge. I guess I'll have to distract him somehow...)"
sceneProgress = 0
hide()
dialogueBox.text = dialogue
func setScene(sname):
currentScene = sname
func getDialogue(sceneName):
var dialogue
if sceneName == "Intro":
match sceneProgress:
0:
dialogue = "Moxie: ..... Trying to help....?"
sceneProgress += 1
1:
dialogue = "Then can you give me some space? This is area is a danger zone until I finish what I'm doing"
sceneProgress += 1
2:
dialogue = "(Geez. He won't budge. I guess I'll have to distract him somehow...)"
sceneProgress = 0
hide()
elif sceneName == "First Nana pass":
match sceneProgress:
0:
dialogue = "Brodie: OH MY GOSH IS THAT A LIZARD???"
sceneProgress += 1
1:
dialogue = "Moxie: Yeah, and she’s very friendly."
sceneProgress += 1
2:
dialogue = "Brodie: She’s so cute! C-can I play with her…? Please."
sceneProgress += 1
3:
dialogue = "Moxie: Sure! Just put her back in the terrarium when you’re done!"
inventory.remove_item_name("Nana")
sceneProgress = 0
hide()
elif sceneName == "Nana again":
dialogue = "Brodie: OF COURSE, ALWAYS."
inventory.remove_item_name("Nana")
hide()
return dialogue
extends "res://Item.gd" extends "res://Item.gd"
onready var dialogueArrow = get_parent().get_node("Dialogue arrow") onready var dialogueArrow = get_parent().get_node("Dialogue arrow")
onready var hasNana = false # whether or not the neighbor currently has nana
onready var hadNana = false
# This script initiates the dialogue sequence with the neighbor # This script initiates the dialogue sequence with the neighbor
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
...@@ -7,6 +9,35 @@ func _ready(): ...@@ -7,6 +9,35 @@ func _ready():
pass # Replace with function body. pass # Replace with function body.
func mouseInteraction(): func mouseInteraction():
.mouseInteraction() if !hasNana:
dialogueArrow.show() .mouseInteraction()
print("Starting scene") dialogueArrow.setScene("Intro")
dialogueArrow.show()
print("Starting scene")
else:
dialogueBox.text = "Brodie: Thank you for this I love her"
inventory.add_item("Nana", load("res://.import/nana.png-3afacff9a6dfeb0ea38c0e651d0707be.stex"))
hasNana = false
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) == "Nana":
if !hadNana:
dialogueBox.text = "Moxie: Hey Brodie! Have you met Nana?"
dialogueArrow.setScene("First Nana pass")
dialogueArrow.show()
hadNana = true
else:
dialogueBox.text = "Moxie: Hey, could you hold Nana for me for a sec?"
dialogueArrow.setScene("Nana again")
dialogueArrow.show()
hasNana = true
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 doesHaveNana():
return hasNana
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