convert to numbers were necessary in the effects
This commit is contained in:
parent
5cab21449d
commit
d16cc44e6c
@ -454,36 +454,36 @@ yl_speak_up.execute_effect = function(player, n_id, o_id, r)
|
|||||||
-- quest_step and maximum are effectively the same
|
-- quest_step and maximum are effectively the same
|
||||||
-- TODO: later on, quest steps may be strings
|
-- TODO: later on, quest steps may be strings
|
||||||
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
||||||
if(var_value) then
|
if(var_value and tonumber(var_val) and tonumber(r.r_var_cmp_value)) then
|
||||||
new_value = math.max(var_val, r.r_var_cmp_value)
|
new_value = math.max(tonumber(var_val), tonumber(r.r_var_cmp_value))
|
||||||
else
|
else
|
||||||
new_value = r.r_var_cmp_value
|
new_value = r.r_var_cmp_value
|
||||||
end
|
end
|
||||||
elseif(r.r_operator and r.r_operator == "maximum") then
|
elseif(r.r_operator and r.r_operator == "maximum") then
|
||||||
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
||||||
if(var_value) then
|
if(var_value and tonumber(var_val) and tonumber(r.r_var_cmp_value)) then
|
||||||
new_value = math.max(var_val, r.r_var_cmp_value)
|
new_value = math.max(tonumber(var_val), tonumber(r.r_var_cmp_value))
|
||||||
else
|
else
|
||||||
new_value = r.r_var_cmp_value
|
new_value = r.r_var_cmp_value
|
||||||
end
|
end
|
||||||
elseif(r.r_operator and r.r_operator == "minimum") then
|
elseif(r.r_operator and r.r_operator == "minimum") then
|
||||||
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
||||||
if(var_value) then
|
if(var_value and tonumber(var_val) and tonumber(r.r_var_cmp_value)) then
|
||||||
new_value = math.min(var_val, r.r_var_cmp_value)
|
new_value = math.min(tonumber(var_val), tonumber(r.r_var_cmp_value))
|
||||||
else
|
else
|
||||||
new_value = r.r_var_cmp_value
|
new_value = r.r_var_cmp_value
|
||||||
end
|
end
|
||||||
elseif(r.r_operator and r.r_operator == "increment") then
|
elseif(r.r_operator and r.r_operator == "increment") then
|
||||||
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
||||||
if(var_value) then
|
if(var_value and tonumber(var_val) and tonumber(r.r_var_cmp_value)) then
|
||||||
new_value = var_val + r.r_var_cmp_value
|
new_value = tonumber(var_val) + tonumber(r.r_var_cmp_value)
|
||||||
else
|
else
|
||||||
new_value = r.r_var_cmp_value
|
new_value = r.r_var_cmp_value
|
||||||
end
|
end
|
||||||
elseif(r.r_operator and r.r_operator == "decrement") then
|
elseif(r.r_operator and r.r_operator == "decrement") then
|
||||||
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
local var_val = yl_speak_up.get_quest_variable_value(pname, r.r_variable)
|
||||||
if(var_value) then
|
if(var_value and tonumber(var_val) and tonumber(r.r_var_cmp_value)) then
|
||||||
new_value = var_val + r.r_var_cmp_value
|
new_value = tonumber(var_val) + tonumber(r.r_var_cmp_value)
|
||||||
else
|
else
|
||||||
new_value = -1 * r.r_var_cmp_value
|
new_value = -1 * r.r_var_cmp_value
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user