Page 1 of 1
Fix for dammod description
Posted: Wed Apr 20, 2011 4:23 am
by yufra
First, kudos to DG and everyone else for great work. It has been a while since I booted ToME up and I am loving all the new features.
I noticed that some gauntlets actually have a negative dammod, but this is currently displayed as "+-60%" instead of "-60%". The attached patch fixes this.
Re: Fix for dammod description
Posted: Mon May 23, 2011 12:49 am
by edge2054
I'm still trying to figure out how to fix this. I'd like for it to display 40% (the -60% it's showing is actually a modifier to the base of 1 from self.combat).
So while +-60% is wrong -60% is too.
The range on gauntlets is having the same issue (also a modifier to the base) so it'll display 0.3 instead of 1.4.
Re: Fix for dammod description
Posted: Mon May 23, 2011 8:47 pm
by yufra
edge2054 wrote:I'm still trying to figure out how to fix this. I'd like for it to display 40% (the -60% it's showing is actually a modifier to the base of 1 from self.combat).
So while +-60% is wrong -60% is too.
The range on gauntlets is having the same issue (also a modifier to the base) so it'll display 0.3 instead of 1.4.
The dammod have always shown the differences from the base, not the percentage of the base. Do you really want +60% to show 160%? If you do then this should do the trick:
Code: Select all
diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua
index 5379879..f3fbb20 100644
--- a/game/modules/tome/class/Object.lua
+++ b/game/modules/tome/class/Object.lua
@@ -238,7 +238,7 @@ function _M:getTextualDesc()
local desc_combat = function(combat)
local dm = {}
for stat, i in pairs(combat.dammod or {}) do
- dm[#dm+1] = ("+%d%% %s"):format(i * 100, Stats.stats_def[stat].name)
+ dm[#dm+1] = ("%d%% %s"):format(i * 100 + 100, Stats.stats_def[stat].name)
end
if #dm > 0 or (combat.dam or 0) ~= 0 or combat.damrange or (combat.atk or 0) ~= 0 or (combat.apr or 0) ~= 0 or (combat.physcrit or 0) ~= 0 then
desc:add(("%d Power [Range %0.2f] (%s), %d Accuracy, %d Armor Penetration, Crit %d%%"):format(combat.dam or 0, combat.damrange or 1.1, table.concat(dm, ','), combat.atk or 0, combat.apr or 0, combat.physcrit or 0), true)
Re: Fix for dammod description
Posted: Mon May 23, 2011 10:51 pm
by edge2054
I talked with yufra about this on IRC and we came up with a decent solution.
The problem is I have no idea how to implement it. I've been goofing around with it but had very little success.
Line 457 in object.lua should take the players base combat values, subtract out whatever they're currently wearing, and then add in the tooltip for the item. The problem I'm having is I have no idea how to mix tables together like that.
Re: Fix for dammod description
Posted: Tue May 24, 2011 1:11 am
by edge2054
With yufra and tiger eye's help got a fix put together for this and a diff mailed to Darkgod.
Should be fixed for next beta.