Add more NPCs, update dialogue manager to 4.4 compatible version

This commit is contained in:
2025-03-12 00:29:39 -07:00
parent 76b94f7be3
commit 22c9590442
167 changed files with 5874 additions and 5697 deletions

View File

@@ -2,14 +2,11 @@
class_name DialogueLine extends RefCounted
const _DialogueConstants = preload("./constants.gd")
## The ID of this line
var id: String
## The internal type of this dialogue object. One of [code]TYPE_DIALOGUE[/code] or [code]TYPE_MUTATION[/code]
var type: String = _DialogueConstants.TYPE_DIALOGUE
var type: String = DMConstants.TYPE_DIALOGUE
## The next line ID after this line.
var next_id: String = ""
@@ -41,6 +38,9 @@ var inline_mutations: Array[Array] = []
## A list of responses attached to this line of dialogue.
var responses: Array = []
## A list of lines that are spoken simultaneously with this one.
var concurrent_lines: Array[DialogueLine] = []
## A list of any extra game states to check when resolving variables and mutations.
var extra_game_states: Array = []
@@ -65,7 +65,7 @@ func _init(data: Dictionary = {}) -> void:
extra_game_states = data.get("extra_game_states", [])
match type:
_DialogueConstants.TYPE_DIALOGUE:
DMConstants.TYPE_DIALOGUE:
character = data.character
character_replacements = data.get("character_replacements", [] as Array[Dictionary])
text = data.text
@@ -76,16 +76,17 @@ func _init(data: Dictionary = {}) -> void:
inline_mutations = data.get("inline_mutations", [] as Array[Array])
time = data.get("time", "")
tags = data.get("tags", [])
concurrent_lines = data.get("concurrent_lines", [] as Array[DialogueLine])
_DialogueConstants.TYPE_MUTATION:
DMConstants.TYPE_MUTATION:
mutation = data.mutation
func _to_string() -> String:
match type:
_DialogueConstants.TYPE_DIALOGUE:
DMConstants.TYPE_DIALOGUE:
return "<DialogueLine character=\"%s\" text=\"%s\">" % [character, text]
_DialogueConstants.TYPE_MUTATION:
DMConstants.TYPE_MUTATION:
return "<DialogueLine mutation>"
return ""