mirror of
https://gitea.your-land.de/Sokomine/yl_speak_up.git
synced 2025-11-03 05:43:09 +01:00
removed obsolete effect "custom" (use evaluate instead)
This commit is contained in:
parent
7deca89a5d
commit
a5bb692533
@ -207,7 +207,7 @@ yl_speak_up.check_and_add_as_generic_dialog = function(dialog, n_id)
|
|||||||
and r.r_type ~= "take_item"
|
and r.r_type ~= "take_item"
|
||||||
and r.r_type ~= "move"
|
and r.r_type ~= "move"
|
||||||
and r.r_type ~= "function"
|
and r.r_type ~= "function"
|
||||||
and r.r_type ~= "custom"
|
and r.r_type ~= "evaluate"
|
||||||
and r.r_type ~= "dialog"
|
and r.r_type ~= "dialog"
|
||||||
) then
|
) then
|
||||||
return "Effect "..tostring(r_id)..
|
return "Effect "..tostring(r_id)..
|
||||||
|
|||||||
@ -794,10 +794,6 @@ yl_speak_up.execute_effect = function(player, n_id, o_id, r)
|
|||||||
minetest.colorize(yl_speak_up.chat_all_color, text))
|
minetest.colorize(yl_speak_up.chat_all_color, text))
|
||||||
-- sending a chat message always counts as successful
|
-- sending a chat message always counts as successful
|
||||||
return true
|
return true
|
||||||
-- "Call custom functions that are supposed to be overridden by the server.", -- 13
|
|
||||||
elseif(r.r_type == "custom") then
|
|
||||||
-- execute the custom function
|
|
||||||
return yl_speak_up.effect_custom(player, r.r_value)
|
|
||||||
end
|
end
|
||||||
-- fallback: unkown type
|
-- fallback: unkown type
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -66,9 +66,6 @@
|
|||||||
-- execute lua code ("function"): requires npc_master priv
|
-- execute lua code ("function"): requires npc_master priv
|
||||||
-- r_value the lua code that shall be executed
|
-- r_value the lua code that shall be executed
|
||||||
--
|
--
|
||||||
-- call a custom function ("custom"):
|
|
||||||
-- r_value parameter that is passed on to the custom function
|
|
||||||
--
|
|
||||||
-- Unlike in preconditions, trade (the trade action already happened) and
|
-- Unlike in preconditions, trade (the trade action already happened) and
|
||||||
-- inventory actions are not supported as effects.
|
-- inventory actions are not supported as effects.
|
||||||
--
|
--
|
||||||
@ -94,7 +91,6 @@ local check_what = {
|
|||||||
"take item from player and destroy it (requires npc_master priv)", -- 10
|
"take item from player and destroy it (requires npc_master priv)", -- 10
|
||||||
"move the player to a given position (requires npc_master priv)", -- 11
|
"move the player to a given position (requires npc_master priv)", -- 11
|
||||||
"execute Lua code (requires npc_master priv)", -- 12
|
"execute Lua code (requires npc_master priv)", -- 12
|
||||||
"Call custom functions that are supposed to be overridden by the server.", -- 13
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- how to store these as r_type in the precondition:
|
-- how to store these as r_type in the precondition:
|
||||||
@ -108,8 +104,7 @@ local values_what = {"", "state",
|
|||||||
"craft", "on_failure", "chat_all",
|
"craft", "on_failure", "chat_all",
|
||||||
-- the following require the npc_master priv:
|
-- the following require the npc_master priv:
|
||||||
"give_item", "take_item", "move", "function",
|
"give_item", "take_item", "move", "function",
|
||||||
-- custom function (does not require npc_master priv)
|
}
|
||||||
"custom"}
|
|
||||||
|
|
||||||
-- unlike in the preconditions, the "I cannot punch it" option is
|
-- unlike in the preconditions, the "I cannot punch it" option is
|
||||||
-- not offered here - because the player (and later the NPC) needs
|
-- not offered here - because the player (and later the NPC) needs
|
||||||
@ -282,8 +277,6 @@ yl_speak_up.show_effect = function(r, pname)
|
|||||||
return "If the *previous* effect failed, go to dialog \""..tostring(r.r_value).. "\"."
|
return "If the *previous* effect failed, go to dialog \""..tostring(r.r_value).. "\"."
|
||||||
elseif(r.r_type == "chat_all") then
|
elseif(r.r_type == "chat_all") then
|
||||||
return "Send chat message: \""..tostring(r.r_value).."\""
|
return "Send chat message: \""..tostring(r.r_value).."\""
|
||||||
elseif(r.r_type == "custom") then
|
|
||||||
return "Call custom function with param: \""..tostring(r.r_value).."\"."
|
|
||||||
elseif(r.r_type == "put_into_block_inv") then
|
elseif(r.r_type == "put_into_block_inv") then
|
||||||
if(not(r.r_pos) or type(r.r_pos) ~= "table"
|
if(not(r.r_pos) or type(r.r_pos) ~= "table"
|
||||||
or not(r.r_pos.x) or not(r.r_pos.y) or not(r.r_pos.z)) then
|
or not(r.r_pos.x) or not(r.r_pos.y) or not(r.r_pos.z)) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user