54 lines
995 B
GDScript
54 lines
995 B
GDScript
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),
|
|
]
|
|
)
|
|
)
|