Sirrocco wrote:
Assuming that your weapon is entirely strength-based.
- doubling your strength will double your effective damage on a 0 armor enemy, regardless of what else is going on.
From the code snippet DG posted earlier, we see that totstat get multiplied in directly into the final damage (no square roots or additions or substractions) so that damage will always scale linearly with the damage stats, which in your example is strength. So yes, doubling strength will double your damage against a 0 armor enemy.
Sirrocco wrote:
- the weapon mastery percentage is, effectively, multiplied into your strength for this purpose.
From DG's post, we see talented_mod, which is your weapon mastery percentage is also directly multiplied in the last step, so yes you could consider it simply multiplying your strength.
Sirrocco wrote:
- bonus "physical power" is added to your weapon's physical power to determine total physical power for the swing.
- physical power itself has diminishing returns. doubling your physical power will not, in fact, double your total damage output. I've seen the equations for this, but that doesn't mean I fully understand them. Presumably, variability fits in here somewhere?
Physical power, your weapon's base physical power, and so forth (such as from Arcane Destruction or Bloodlust) all get added together then a square root gets taken. So if you double the value, you only get roughly a factor of 1.4 increase, so yes diminishing returns.
Interestingly, the damage range gets multiplied in *after* base damage is calculated and *after* armor have been taken into account.
So the weapon display simply showing min to max damage is very misleading, since the base power has a square root taken, while the damage range gets multiplied on top of the final damage. I'd almost go as far to say the damage listing after a weapons name (61.5-98.4 power or whatever) is simply incorrect. The listing where it goes Power 61 [Range 1.6](+120% Strength) is a more accurate representation, where the various components are separated out. The relevant code can be seen below.
Code: Select all
elseif self:checkHit(atk, def) then
print("[ATTACK] raw dam", dam, "versus", armor, "with APR", apr)
dam = math.max(0, dam - math.max(0, armor - apr))
local damrange = self:combatDamageRange(weapon)
dam = rng.range(dam, dam * damrange)
print("[ATTACK] after range", dam)
dam, crit = self:physicalCrit(dam, weapon, target)
print("[ATTACK] after crit", dam)
dam = dam * mult
print("[ATTACK] after mult", dam)
if crit then game.logSeen(self, "%s performs a critical strike!", self.name:capitalize()) end
DamageType:get(damtype).projector(self, target.x, target.y, damtype, math.max(0, dam))
hitted = true
Sirrocco wrote:
- elemental damage bonuses are added on in an entirely separate calculation - you add your extra elemental damage, multiply it by your elemental damage bonus, do something with respect to armor(?) and apply target elemental resistance.
This code snippet comes after the above one (with spread diseases in between). As far as I can tell, this goes through all the "on hit melee" damage effects and applies them. They appear to ignore armor, since there's no armor calculation in it, just a straight up application of damage. The damage type multiplier bonuses (i.e. Physical, Fire, etc) get applied by projector function (as well as handling damage resistance). Damage gets multiplied by bonus (1+damage bonus/100), then by multiplied by (100-resistance)/100.
Code: Select all
-- Melee project
if hitted and not target.dead and weapon.melee_project then for typ, dam in pairs(weapon.melee_project) do
if dam > 0 then
DamageType:get(typ).projector(self, target.x, target.y, typ, dam)
end
end end
if hitted and not target.dead then for typ, dam in pairs(self.melee_project) do
if dam > 0 then
DamageType:get(typ).projector(self, target.x, target.y, typ, dam)
end
end end
Sirrocco wrote:
- I have no idea where bonus damage from attack skills comes in
When a talent gets used, say Death Dance, it calles the attackTargetWith function. At that stage it passes along a damage multiplier, which gets assigned to "mult". In the first code snippet I provided, mult multiplies the final damage just before the crit stage. So it directly increases final damage.
Sirrocco wrote:
- I have no idea how precisely armor and armor-piercing work.
Armor directly subtracts from base damage, and armor piercing directly reduces armor, to a minimum of zero. This can be seen on the 3rd line of the 1st code snippet.
Sirrocco wrote:
- I suspect that +% physical damage modifiers from gear are another independent multiplier, and that going from 0% extra physical damage to +100% extra physical damage will double your effective damage on a 0 armor enemy, but I don't know that for sure.
This is correct. It gets applied by the projector function, same as elemental damage bonuses.
Sirrocco wrote:
- I don't really know how crits fit into this.
There's a bunch of talents and effects that calculate your crit change, then it basically rolls against that to see if it happens (you must have already rolled to hit to get to this point - this a completely separate check after that). The crit damage is then calculated from the following. Basically 50% more damage unless you have special talents.
Code: Select all
if rng.percent(chance) then
dam = dam * (1.5 + (self.combat_critical_power or 0) / 100)
crit = true
end
return dam, crit
Sirrocco wrote:
- I believe that physical resistance is a straight multiplier - 50% physical resistance on a 0 armor enemy will cut your damage in half as compared to 0% resistance
This is correct. The multiplier is (100-resistance)/100.
I may try making a full example going through each line of code later tonight.