Quest system base

This commit is contained in:
2ndbeam 2024-05-25 22:32:48 +03:00
commit 8a40de576e
20 changed files with 178 additions and 9 deletions

View file

@ -8,10 +8,13 @@ const SELL_FETCH = "BASE_FETCH_SELL"
const BUY_ITEM = "BASE_BUY_ITEM"
## This message will trigger dialogue to get selected item data
const SELL_ITEM = "BASE_SELL_ITEM"
## This message will trigger quest node to make answer format
const TAKE_QUEST = "BASE_TAKE_QUEST"
@onready var dialogue = $DialogueView
@onready var buy_sell = $"../../BuySell"
@onready var actions_menu = $"../Actions/ActionsMenu"
@onready var quest = $"../../Quest"
func _ready():
var tween = create_tween() \
@ -40,6 +43,8 @@ func send_message(msg: Message):
var item_name = list[id].name
format["amount"] = actions_menu.buy_sell_amount
format["item_name"] = item_name
TAKE_QUEST:
format["answer"] = quest.answer
var new_msg = tr(msg.fact + "_RECEIVED").format(format)
var old_len = len(dialogue.get_parsed_text())
dialogue.append_text(new_msg)