feat: let the player talk to villagers and accept or decline personal requests

This commit is contained in:
2026-08-09 00:10:36 +02:00
parent 5e6c963d23
commit 0936ae6450
10 changed files with 520 additions and 36 deletions
+53
View File
@@ -0,0 +1,53 @@
class_name PlayerTalkResult
extends RefCounted
var npc_id: int
var npc_name: String
var greeting: String
var has_need: bool
var need_text: String
var quest_available: bool
var quest_reward: float
var can_accept: bool
var can_decline: bool
func _init(
talk_npc_id: int,
talk_npc_name: String,
talk_greeting: String,
talk_has_need: bool,
talk_need_text: String,
talk_quest_available: bool,
talk_quest_reward: float,
talk_can_accept: bool,
talk_can_decline: bool
) -> void:
npc_id = talk_npc_id
npc_name = talk_npc_name
greeting = talk_greeting
has_need = talk_has_need
need_text = talk_need_text
quest_available = talk_quest_available
quest_reward = talk_quest_reward
can_accept = talk_can_accept
can_decline = talk_can_decline
func cache_key() -> String:
return (
"|"
. join(
[
str(npc_id),
npc_name,
greeting,
str(has_need),
need_text,
str(quest_available),
"%.2f" % quest_reward,
str(can_accept),
str(can_decline),
]
)
)