mirror of
https://gitea.your-land.de/Sokomine/yl_speak_up.git
synced 2025-06-21 22:58:03 +02:00
74 lines
2.6 KiB
Lua
74 lines
2.6 KiB
Lua
|
|
-- some helper lists for creating the formspecs and evaulating
|
|
-- the player's answers:
|
|
|
|
-- general direction of what could make up an effect
|
|
local check_what = {
|
|
"- please select -",
|
|
"an internal state (i.e. of a quest)", -- 2
|
|
"a block somewhere", -- 3
|
|
"NPC crafts soemthing", -- 4
|
|
}
|
|
|
|
-- how to store these as r_type in the precondition:
|
|
local values_what = {"", "state", "block", "craft"}
|
|
|
|
-- unlike in the preconditions, the "I cannot punch it" option is
|
|
-- not offered here - because the player (and later the NPC) needs
|
|
-- to be able to build at this position
|
|
local check_block = {
|
|
"- please select -", -- 1
|
|
"If there is air: Place a block so that it looks like now.", -- 2
|
|
"If there is a block: Dig it.", -- 3
|
|
-- TODO: not sure if this is possible without bugs
|
|
"Punch the block.", -- 4
|
|
-- TODO: not sure if this is possible without bugs
|
|
"Right-click the block.", -- 5
|
|
}
|
|
|
|
-- how to store these as p_value (the actual node data gets stored as p_node, p_param2 and p_pos):
|
|
local values_block = {"", "place", "dig", "punch", "right-click"}
|
|
|
|
-- comparison operators for variables
|
|
local check_operator = {
|
|
"- please select -", -- 1
|
|
"set to value:", -- 2
|
|
"is no longer needed (unset)", -- 3
|
|
}
|
|
|
|
-- how to store these as r_value (the actual variable is stored in r_variable, and the value in r_new_value):
|
|
local values_operator = {"", "set_to", "unset"}
|
|
|
|
-- these are only wrapper functions for those in fs_edit_general.lua
|
|
|
|
yl_speak_up.input_fs_edit_effects = function(player, formname, fields)
|
|
return yl_speak_up.input_fs_edit_option_related(player, formname, fields,
|
|
"r_", "o_results", yl_speak_up.max_result_effects,
|
|
"(Ef)fect", "tmp_result",
|
|
"Please punch the block you want to manipulate in your effect!",
|
|
values_what, values_operator, values_block, {}, {},
|
|
check_what, check_operator, check_block, {}, {},
|
|
-- TODO: this needs to be implemented
|
|
-- player variables with write access
|
|
get_sorted_player_var_list,
|
|
"edit_effects"
|
|
)
|
|
end
|
|
|
|
yl_speak_up.get_fs_edit_effects = function(player, table_click_result)
|
|
return yl_speak_up.get_fs_edit_option_related(player, table_click_result,
|
|
"r_", "o_results", yl_speak_up.max_result_effects,
|
|
"(Ef)fect", "tmp_result",
|
|
"What do you want to change with this effect?",
|
|
check_what, check_operator, check_block, {}, {},
|
|
-- TODO: this needs to be implemented
|
|
-- player variables with write access
|
|
get_sorted_player_var_list,
|
|
-- TODO: the show_result function needs to be implemented
|
|
yl_speak_up.show_result,
|
|
"table_of_elements",
|
|
"Change the value of the following variable:", "What to do:", "New value:",
|
|
"The NPC shall do something to the block at the following position:"
|
|
)
|
|
end
|