Skip to content
Snippets Groups Projects
Commit 3e9aa8b4 authored by dg's avatar dg
Browse files

Fix Backlash

git-svn-id: http://svn.net-core.org/repos/t-engine4@6141 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5268c09e
No related branches found
No related tags found
No related merge requests found
......@@ -745,6 +745,7 @@ function _M:removeTemporaryValue(prop, id, noupdate)
base[prop] = b[1] and b[1][2]
if not next(base["__tlast_"..prop]) then base["__tlast_"..prop] = nil end
else
if not base[prop] then error("Error removing property "..tostring(prop).." with value "..tostring(v).." : base[prop] is nil") end
base[prop] = base[prop] - v
end
self:onTemporaryValueChange(prop, -v, base)
......
......@@ -1802,7 +1802,7 @@ function _M:onTakeHit(value, src)
self.summoner:incFeedback(feedback_gain)
end
-- Trigger backlash retribution damage
if self:knowTalent(self.T_BACKLASH) and not src.no_backlash_loops and not src.turn_procs.backlash then
if src and src.turn_procs and self:knowTalent(self.T_BACKLASH) and not src.no_backlash_loops and not src.turn_procs.backlash then
if src.y and src.x and not src.dead then
local t = self:getTalentFromId(self.T_BACKLASH)
t.doBacklash(self, src, feedback_gain, t)
......
......@@ -425,5 +425,7 @@ function _M:dumpToJSON(js, bypass, nosub)
js:hiddenData("tile", self.has_custom_tile)
end
self:triggerHook{"ToME:PlayerDumpJSON", title=title, js=js, tags=tags}
return title, tags
end
......@@ -73,6 +73,7 @@ newTalent{
end
local def = self.tempeffect_def[item.curse]
item.special = true
item.add_name = (item.add_name or "").." ("..def.short_desc..")"
end,
-- curses all items on the floor
......
......@@ -64,6 +64,7 @@ newTalent{
o.old_atk = t.boost(self, t)
o.old_dam = t.boost(self, t)
game.logPlayer(self, "You reshape your %s.", o:getName{do_colour=true, no_count=true})
o.special = true
if not o.been_reshaped then
o.name = "reshaped" .. " "..o.name..""
o.been_reshaped = true
......@@ -134,6 +135,7 @@ newTalent{
o.wielder.fatigue = o.orig_fat
end
o.old_fat = t.fat_red(self, t)
o.special = true
game.logPlayer(self, "You reshape your %s.", o:getName{do_colour=true, no_count=true})
if not o.been_reshaped then
o.name = "reshaped" .. " "..o.name..""
......
......@@ -140,6 +140,7 @@ newTalent{
o.been_imbued = true
game.logPlayer(self, "You imbue your %s with %s.", o:getName{do_colour=true, no_count=true}, gem:getName{do_colour=true, no_count=true})
o.name = o.name .. " ("..gem.name..")"
o.special = true
d.used_talent = true
game:unregisterDialog(d)
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