Skip to content
Snippets Groups Projects
Commit d2322faf authored by DarkGod's avatar DarkGod
Browse files

this message is not plop

parent 54e9bf6f
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -909,11 +909,11 @@ function _M:addTemporaryValue(prop, v, noupdate)
table.sort(b, function(a, b) return a[1] > b[1] end)
base[prop] = b[1] and b[1][2]
else
if type(base[prop] or 0) ~= "number" or type(v) ~= "number" then
print("ERROR: Attempting to add value", v, "property", prop, "to", base[prop]) table.print(base[prop]) table.print(v)
print("Entity:", self) -- table.print(self)
game.debug._debug_entity = self
end
-- if type(base[prop] or 0) ~= "number" or type(v) ~= "number" then
-- print("ERROR: Attempting to add value", v, "property", prop, "to", base[prop]) table.print(base[prop]) table.print(v)
-- print("Entity:", self) -- table.print(self)
-- game.debug._debug_entity = self
-- end
base[prop] = (base[prop] or 0) + v
end
self:onTemporaryValueChange(prop, v, base)
......
......@@ -86,7 +86,12 @@ function _M:getLore(lore, silent)
if l.template then
local tpl = slt2.loadstring(l.lore)
l.lore = slt2.render(tpl, {player=self:findMember{main=true}, self=self, Lore=_M})
local ok, err = pcall(function()
l.lore = slt2.render(tpl, {player=self:findMember{main=true}, self=self, Lore=_M})
end)
if not ok and err then
error("Error while lore learning '"..tostring(lore).."' : "..tostring(err))
end
end
return l
......
......@@ -233,7 +233,7 @@ ActorResource:defineResource("Psi", "psi", ActorTalents.T_PSI_POOL, "psi_regen",
tactical = { -- tactical AI
want_level = function(act, aitarget) -- compute want level for psi
local life_regen, psi_regen = act:regenLife(true) -- (includes Solipsism effect on psi_regen)
local depleted = 1-(act:getPsi() + math.max(0, psi_regen))/act.max_psi
local depleted = 1-(act:getPsi() + math.max(0, psi_regen or 0))/act.max_psi
-- use std resource formula, accounting for Solipsism regeneration
depleted = depleted/math.max(0.001, 1-depleted)*act.global_speed
return 10*(depleted/(depleted + 2.5))^2
......
......@@ -192,11 +192,11 @@ newInscription{
info = function(self, t)
local data = self:getInscriptionData(t.short_name)
return ([[Activate the infusion to heal for %d%% of all damage taken (calculated before resistances) and reduce the duration of a random debuff by %d each turn for %d turns.]]):
format(data.power+data.inc_stat*10, data.reduce + data.inc_stat, data.dur)
format(data.power+data.inc_stat*10, (data.reduce or 0) + data.inc_stat, data.dur)
end,
short_info = function(self, t)
local data = self:getInscriptionData(t.short_name)
return ([[affinity %d%%; reduction %d; dur %d; cd %d]]):format(data.power + data.inc_stat*10, data.reduce + data.inc_stat, data.dur, data.cooldown )
return ([[affinity %d%%; reduction %d; dur %d; cd %d]]):format(data.power + data.inc_stat*10, (data.reduce or 0) + data.inc_stat, data.dur, data.cooldown )
end,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment