28 lines
727 B
GDScript
28 lines
727 B
GDScript
extends NPC
|
|
|
|
var eatingTomato = false
|
|
var tomatoItem = preload("res://Items/Foods/Fruits/Tomato.gd")
|
|
|
|
func _ready():
|
|
dialogueResource = load("res://NPCs/HomeArea/ExperiencingHorse/ExperiencingHorse.dialogue")
|
|
tomatoItem = tomatoItem.new()
|
|
|
|
func tomato_check():
|
|
var tomatoCount = InventoryManager.get_item_count(tomatoItem)
|
|
if tomatoCount > 0:
|
|
return true
|
|
return false
|
|
|
|
func eat_tomato():
|
|
InventoryManager.remove_item_from_inventory(tomatoItem)
|
|
$Sprite.play("tomatoEating")
|
|
eatingTomato = true
|
|
LevelManager.get_skill("appreciating").experience_event("Tomato eat a tomato", "watched", 50)
|
|
|
|
func eating_check():
|
|
return eatingTomato
|
|
|
|
func _on_sprite_animation_finished():
|
|
$Sprite.play("default")
|
|
eatingTomato = false
|