Files
Dawn-Godot/scripts/Quest/Quest.gd

36 lines
830 B
GDScript

class_name Quest extends Node
@export_multiline var title:String = ""
@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
func objectiveUpdated(objective:QuestObjective) -> void:
QUEST.questUpdated.emit(self)
func getLocaleData() -> Dictionary[String, String]:
var dict: Dictionary[String, String] = {}
return dict