Files
Dawn-Godot/scripts/Quest/Quest.gd
2025-05-09 22:33:51 -05:00

29 lines
636 B
GDScript

class_name Quest extends Node
@export var questName:String = "Some quest"
@export var questKey:QuestSystem.QuestKey = QuestSystem.QuestKey.TEST_QUEST
var questStarted:bool = false
var questComplete:bool = false
var objectives:Array[QuestObjective]
func _ready() -> void:
objectives = []
for child in get_children():
if child is QuestObjective:
objectives.append(child)
child.onQuestReady(self)
func start() -> void:
questStarted = true
questComplete = false
QUEST.questStarted.emit(self)
QUEST.questUpdated.emit(self)
func isCompleted() -> bool:
return questComplete
func isStarted() -> bool:
return questStarted