master #3

Merged
AliasAlreadyTaken merged 56 commits from your-land-mirror/yl_speak_up:master into master 2025-03-08 04:12:18 +01:00
Showing only changes of commit bfeed37767 - Show all commits

View File

@ -177,9 +177,10 @@ yl_speak_up.execute_next_action = function(player, a_id, result_of_a_id, formnam
yl_speak_up.speak_to[pname].d_id = this_action.a_on_failure
yl_speak_up.speak_to[pname].o_id = nil
yl_speak_up.speak_to[pname].a_id = nil
yl_speak_up.show_fs(player, "talk", {n_id = n_id,
d_id = this_action.a_on_failure,
alternate_text = this_action.alternate_text})
-- allow d_end, d_trade, d_got_item etc. to work as a_on_failure
yl_speak_up.show_next_talk_fs_after_action(player, pname,
this_action.a_on_failure, formname,
dialog, d_id, n_id, this_action.alternate_text)
return
else
local this_action = actions[ sorted_key_list[ nr ]]
@ -220,6 +221,26 @@ yl_speak_up.execute_next_action = function(player, a_id, result_of_a_id, formnam
local target_dialog = res.next_dialog
yl_speak_up.speak_to[pname].o_id = nil
yl_speak_up.speak_to[pname].a_id = nil
-- the function above returns a target dialog; show that to the player
yl_speak_up.show_next_talk_fs_after_action(player, pname, target_dialog, formname,
dialog, target_dialog, n_id, res.alternate_text)
end
-- after completing the action - either successfully or if it failed:
yl_speak_up.show_next_talk_fs_after_action = function(player, pname, target_dialog, formname,
dialog, d_id, n_id, alternate_text)
-- allow to switch to d_trade from any dialog
if(target_dialog and target_dialog == "d_trade") then
yl_speak_up.show_fs(player, "trade_list")
return
end
-- allow to switch to d_got_item from any dialog
if(target_dialog and target_dialog == "d_got_item") then
yl_speak_up.show_fs(player, "player_offers_item")
return
end
-- end conversation
if(target_dialog and target_dialog == "d_end") then
yl_speak_up.stop_talking(pname)
@ -229,18 +250,16 @@ yl_speak_up.execute_next_action = function(player, a_id, result_of_a_id, formnam
end
return
end
-- the special dialogs d_trade and d_got_item have no actions or effects - thus
-- d_id cannot become d_trade or d_got_item
if(not(target_dialog)
or target_dialog == ""
or not(dialog.n_dialogs[target_dialog])) then
target_dialog = d_id
end
if(target_dialog and target_dialog == "d_trade") then
yl_speak_up.show_fs(player, "trade_list")
return
end
-- the function above returns a target dialog; show that to the player
-- actually show the next dialog to the player
yl_speak_up.show_fs(player, "talk", {n_id = n_id, d_id = target_dialog,
alternate_text = res.alternate_text})
alternate_text = alternate_text})
end