The only purpose of your post was to twist what Ascender was saying so that you could insult them. I don't care to engage with that. But I suppose an "explanation of monster attack values" would indeed be useful.
Whenever a MonsterAttackComponent hits a champion in melee, this is how the damage dealt is determined:
- Start with the component's attack power, or 0 if its attack power is nil. I'll call it
X.
- Double X if the party is resting.
- Set X to a random integer between X/2 rounded down and X*1.5 rounded down, but not below 1.
- Multiply X by the difficulty damage multiplier (0.6 for Easy, 1 for Normal, 1.4 for Hard).
- Pick a random body part, and get the protection value for that body part as described in my first post; I'll call this
Y.
- Subtract the component's pierce from Y, or if its pierce is nil, leave Y unchanged. Yes, negative pierce will increase Y.
- If Y is at least 1000, set X to 0; the attack will do no damage.
- Otherwise, if Y is greater than 0, set X to the good old math.max(1,X-math.floor((math.random()+0.5)*Y)) that everyone thought protection worked like because I posted that formula somewhere without any context in like 2016
(this is the "0.5 to 1.5 of protection value" that the OP is talking about)
- Round X down. This can only have an effect on Easy and Hard, on Normal X will always already be an integer.
- If X is greater than 0 (i.e. the champion didn't have 1000+ protection), call the component's onDealDamage hook, and stop here if it returned false.
- Then apply conditions and wounds and camera shake and stuff, which don't have to do with damage, so luckily I don't have to try to explain them.
- Then finally actually damage the champion for X damage.
You can inspect much of this in-game by replacing functions like math.random() with versions that print their arguments for you:
Code: Select all
local orig = math.random
math.random = function(...) print(...) return orig(...) end
Of course,
lots of different things use these functions, so you'll definitely want to do this in a custom dungeon with few objects.
Whether the monster has "multi-attacks" is irrelevant. All that means is that there are multiple "attack" animation events defined for the animation being used by the MonsterAttackComponent. And the undead monster has four of them, not seven. This does not change anything about the attacks themselves, it doesn't affect the damage of the individual attacks and it certainly doesn't affect what protection does.
Pompidom wrote:The only question that remains:
What gets applied first, the pierce or the protection multiplier?
You keep saying this but I answered that question in my first post. Pierce is subtracted from the protection value for the targeted body part, prior to using that protection value (the "protection multiplier" as you call it).
Something is certainly going wrong with your test; one possibility is that your champion has wounds. If you have an item equipped on a wounded body part, 1/4th of that item's protection (including any bonus from armor skill) is subtracted from the protection value for ALL body parts.
edit: Here's an alternative way to calculate your "effective protection" for a body part that might be less confusing, or easier to do in your head:
- Start with the "Protection" value on your character sheet.
- Subtract the base protection values (do not include armor skill bonus) of the items on the other three body parts.
- Divide by 4.
- Add the protection value for the chosen body part.
This takes advantage of the character sheet protection value to "automatically" account for the effects of wounds and armor skill.