Rewrote entity system
This commit is contained in:
@@ -13,12 +13,13 @@ func _ready() -> void:
|
||||
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(questKey)
|
||||
QUEST.questUpdated.emit(questKey)
|
||||
QUEST.questStarted.emit(self)
|
||||
QUEST.questUpdated.emit(self)
|
||||
|
||||
func isCompleted() -> bool:
|
||||
return questComplete
|
||||
|
@@ -1,7 +1,13 @@
|
||||
class_name QuestObjective extends Node
|
||||
|
||||
# enum Type {
|
||||
# }
|
||||
enum Type {
|
||||
Item,
|
||||
}
|
||||
|
||||
@export var objectiveName:String = "Some objective"
|
||||
# @export var objectiveType:Type = Type.Item
|
||||
@export var objectiveType:Type = Type.Item
|
||||
|
||||
var quest:Quest
|
||||
|
||||
func onQuestReady(quest:Quest) -> void:
|
||||
self.quest = quest
|
Reference in New Issue
Block a user