Skip to content

fix Boss avoidance value (#452)#453

Open
jdelvare wants to merge 1 commit into
BreakBB:masterfrom
jdelvare:fix-issue-452
Open

fix Boss avoidance value (#452)#453
jdelvare wants to merge 1 commit into
BreakBB:masterfrom
jdelvare:fix-issue-452

Conversation

@jdelvare

Copy link
Copy Markdown

The avoidance is the sum of the chances to be missed by, to block, to parry or to dodge an attack from the enemy. Each of these possibilities receives a -0.2 % penalty for every level of the attacker above the player's level.

The code currently takes the level difference in consideration only for the misses. This results in the "Avoidance (Lvl +3)" displayed value to be incorrect, being shown at -0.6 % compared to same-level avoidance, while the difference should be -2.4 %.

Fix this by adding an enemyLevel parameter to the GetDodgeChance, GetParryChance and GetBlockChance methods and using it to properly take the level difference into account in the returned values.

The avoidance is the sum of the chances to be missed by, to block,
to parry or to dodge an attack from the enemy. Each of these
possibilities receives a -0.2 % penalty for every level of the
attacker above the player's level.

The code currently takes the level difference in consideration only
for the misses. This results in the "Avoidance (Lvl +3)" displayed
value to be incorrect, being shown at -0.6 % compared to same-level
avoidance, while the difference should be -2.4 %.

Fix this by adding an enemyLevel parameter to the GetDodgeChance,
GetParryChance and GetBlockChance methods and using it to properly
take the level difference into account in the returned values.

@BreakBB BreakBB left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jdelvare

Thanks for looking into ECS and open up a PR to fix this issue right away. You are absolutely right that the penalties for these stats are missing 🙈

Comment thread Modules/Data/Defense.lua
Comment on lines +161 to +165
-- In theory we should compare the player's base defense skill with
-- the attacker's weapon skill. Unfortunately there's no API function
-- to retrieve the former. The following formula leads to the same
-- results except when the player just gained a level and his/her
-- defense skill did not catch up yet.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn't Data:GetDefenseValue() suffice here? We use it for enemy miss chance as well 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately Data:GetDefenseValue() is based on UnitDefense() which takes talents into account. Specifically when testing on my level 70 paladin, this function returns 370 and not 350, because of talent Anticipation 5/5. However the parry chance penalty that should be applied must be computed by comparing the player's base Defense (without gear nor talents) with the attacker's base weapon skill.
I looked for an API function which would return the base Defense value, without talent modifiers, but could not find any. If you know of a way to obtain this value, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants