Fix Shield Wall damage reduction (&update tests) #3940
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the looks of things seems that Shield Wall damage reduction % is broken currently.
Shield Wall should reduce damage by 60% without glyph (0.4 damage taken coeff) and by 40% with glyph (0.6 damage taken coeff).
This part of the code is invalid in my opinion currently (despite the comment!):
//This is the inverse of the tooltip since it is a damage TAKEN coefficient
damageTaken := core.TernaryFloat64(hasGlyph, 0.4, 0.6)
Currently it works like this: If Glyph is enabled, take 0.4 damange coeff, so 60% damage reduction. Otherwise (no Glyph) take 0.6 damage taken coeff. This patch changes it to be other way around (correct).
Incorrect behaviour can be observed for example with this profile:
https://wowsims.github.io/wotlk/protection_warrior/#eJztVm9sU1UU7zmv7V6v+3N7Ke71ZZulicsYNLw/lKwk5haNCQnELBKNmn3AkKFTxLH6QRpjFgnCBoloihuLDlhM2IxxghFnIjA3omIkNqsxMGMgBMY0bo51xboPzNs+Xkf8CwG/efLuyzm/c3+/c/JO7+sjtTJSVFDD9dCMrQAfAJ4B2ImQRRgHmALMAiYRWxHuL6cQwCi8CDsBegEOIJzPpWElUmBYB2rC8wq46zc9ubWxRXZRjzoGpIwmd0nKT5VB9zvDOPQJEg+d3SUFpY+FW0w790jK7io7OpZGZW+FFZXRhMhlBU+QckAJ/VAItVcFnSJyiPBNkU/YIaPbdkvK6xVBj9i+f3/uEhIdYsukkLhsSZTRz4TEAX8B8NDjdi8eOmK7TvppmyTuveJeTI8I3e5Ci30i6pdtymxCUESpoJfKikuT6qXHpPWu/PPpwQySQXT8b7dlTLtVRpzJoGAAOgEGwDUI8CXgu+AmDlX8dNuhxgxrhibMMENmSAubZlg3jHAO0I2woWumpuumaegXQJEPppBeuoRKTwoD21NYsyOF2o/J4nFwTkFRF3i8XftydooP4XlUpOBdbB4iXuJWnQQVb7CIuIgU0mOMqTReSiQjEmNFqsDk/kYbCxewy262SL0nXkmKxL6ldZE8jZTKb60IzNkGrEqtiKtEioRjbIHqJWXy0W14Y36ZGoovIT5Diy1dLtYKserE0jXNJnT1SDcSytWF8QXzNWXVbR0Edrfqi7P5hNXknI/51fL4QkJ0UcAQKdNObfflmiO0tlR2M2xx5IQIGpoqE7c8Oi1Gw5wqrnQwouaLyK1pLPjnhqWCn52cx9vTOAAwCtWe/JDX/hD1mnlL8cXW3Ke433YCri50nL1+9qqjwfclizXYEPVaoC/qt+cUsZAkX7Qxb99x4xo2Z97GOFvbtOHpwJqmzU8FalY3tjzftGFxYJ0i1/7Hp7qmLXonZFpPnfwXnXX/lJ8509G56k708VeWf+byBVi1D95ouPbA7MQwv14ry8V/0MP5V+cL3c1fl8x+z62xXOUNsS/uPdgxx2+3ePqlmV+PD5zgVz8qefybHT/zBxO+i8tfO8fbv+0MLSse4c/0H535Knmab35v7yN7Lo7/bT2pcuTViTVDhXzfobH6Kw9l+Gh10JU5McE7n9viibSc5lf0+17etDHN66f7uh1bfrnl/ifbDv/26PQY9y/JHHs2MnjTfKZ9vjpzsnfrxE0znvjTy9Y6JGf/oDBViMVHA/wOmU9YDg==
This is P4 Prot Warrior BIS. Fight lasts 115 seconds, so with or without Glyph Shield Wall can be used only once. Still unequipping SW glyph increases DTPS and p(death). It should be other way around, because without glyph equippedm shield wall should be 60% dmg reduction not 40%, therefore DTPS should be lower.