28 lines
616 B
GDScript
28 lines
616 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)
|
|
|
|
func start() -> void:
|
|
questStarted = true
|
|
questComplete = false
|
|
QUEST.questStarted.emit(questKey)
|
|
QUEST.questUpdated.emit(questKey)
|
|
|
|
func isCompleted() -> bool:
|
|
return questComplete
|
|
|
|
func isStarted() -> bool:
|
|
return questStarted
|