Skip to content
Snippets Groups Projects
Commit 7d1aee89 authored by dg's avatar dg
Browse files

Correctly compute encumbrance

git-svn-id: http://svn.net-core.org/repos/t-engine4@4682 51575b47-30f0-44d4-a5cc-537603b46e54
parent 9b5fa4f8
No related branches found
No related tags found
No related merge requests found
...@@ -1935,7 +1935,7 @@ function _M:getEncumbrance() ...@@ -1935,7 +1935,7 @@ function _M:getEncumbrance()
-- Compute encumbrance -- Compute encumbrance
for inven_id, inven in pairs(self.inven) do for inven_id, inven in pairs(self.inven) do
for item, o in ipairs(inven) do for item, o in ipairs(inven) do
if not o.__transmo then if not o.__transmo and not o.__transmo_pre then
o:forAllStack(fct) o:forAllStack(fct)
end end
end end
...@@ -3098,14 +3098,13 @@ function _M:on_set_temporary_effect(eff_id, e, p) ...@@ -3098,14 +3098,13 @@ function _M:on_set_temporary_effect(eff_id, e, p)
p.dur = util.bound(duration, p.minimum or 0, p.maximum) p.dur = util.bound(duration, p.minimum or 0, p.maximum)
p.amount_decreased = p.maximum - p.dur p.amount_decreased = p.maximum - p.dur
local save_type = nil local save_type = nil
if p.apply_save then save_type = p.apply_save else save_type = save_for_effects[e.type] end if p.apply_save then save_type = p.apply_save else save_type = save_for_effects[e.type] end
if save_type == "combatPhysicalResist" if save_type == "combatPhysicalResist" then p.save_string = "Physical save"
then p.save_string = "Physical save" elseif save_type == "combatMentalResist" then p.save_string = "Mental save"
elseif save_type == "combatMentalResist" elseif save_type == "combatSpellResist" then p.save_string = "Spell save"
then p.save_string = "Mental save"
elseif save_type == "combatSpellResist"
then p.save_string = "Spell save"
end end
if not p.no_ct_effect and not e.no_ct_effect and e.status == "detrimental" then self:crossTierEffect(eff_id, p.apply_power, p.apply_save or save_for_effects[e.type]) end if not p.no_ct_effect and not e.no_ct_effect and e.status == "detrimental" then self:crossTierEffect(eff_id, p.apply_power, p.apply_save or save_for_effects[e.type]) end
p.total_dur = p.dur p.total_dur = p.dur
p.apply_power = nil p.apply_power = nil
......
...@@ -169,10 +169,12 @@ function _M:describeFloor(x, y) ...@@ -169,10 +169,12 @@ function _M:describeFloor(x, y)
local desc = true local desc = true
if obj.auto_pickup and self:pickupFloor(i, true) then desc = false end if obj.auto_pickup and self:pickupFloor(i, true) then desc = false end
if desc and self:attr("has_transmo") and obj.__transmo == nil and (not obj.quest and not obj.plot) then if desc and self:attr("has_transmo") and obj.__transmo == nil and (not obj.quest and not obj.plot) then
obj.__transmo_pre = true
if self:pickupFloor(i, true) then if self:pickupFloor(i, true) then
desc = false desc = false
obj.__transmo = true obj.__transmo = true
end end
obj.__transmo_pre = nil
end end
if desc then if desc then
if self:attr("auto_id") and obj:getPowerRank() <= self.auto_id then obj:identify(true) end if self:attr("auto_id") and obj:getPowerRank() <= self.auto_id then obj:identify(true) end
......
...@@ -81,7 +81,6 @@ function _M:learnLore(lore, nopopup, silent) ...@@ -81,7 +81,6 @@ function _M:learnLore(lore, nopopup, silent)
game.logPlayer(self, "Lore found: #0080FF#%s", l.name) game.logPlayer(self, "Lore found: #0080FF#%s", l.name)
if not nopopup then if not nopopup then
LorePopup.new(l, game.w * 0.6, 0.8) LorePopup.new(l, game.w * 0.6, 0.8)
-- game.logPlayer(self, "#ANTIQUE_WHITE#%s", util.getval(l.lore))
game.logPlayer(self, "You can read all your collected lore in the game menu, by pressing Escape.") game.logPlayer(self, "You can read all your collected lore in the game menu, by pressing Escape.")
end end
learnt = true learnt = true
......
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