fix: damage reflection calculations for secondary combat type#671
Open
Sh3Ns wants to merge 1 commit intozimbadev:mainfrom
Open
fix: damage reflection calculations for secondary combat type#671Sh3Ns wants to merge 1 commit intozimbadev:mainfrom
Sh3Ns wants to merge 1 commit intozimbadev:mainfrom
Conversation
Fix three bugs in the secondary damage reflection block inside Game::combatBlockHit: - Bug 1: reflectPercent used damage.primary.value instead of damage.secondary.value - Bug 2: damageReflectedParams.combatType set to primary.type instead of secondary.type - Bug 3: reflected value written to damageReflected.primary.value (overwriting primary reflect) instead of secondary.value, and formula used broken nested std::max instead of flat + percent with 1% health cap. Co-Authored-By: Jattartajjar <207260357+jattartajjar@users.noreply.github.com> Co-Authored-By: Kakeriel <73860497+iloveshaders@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes three bugs in the secondary damage reflection block inside
Game::combatBlockHit.Related to #653
Bugs Fixed
Bug 1 — Wrong source value in
!canReflectbranchreflectPercentwas computed usingdamage.primary.valueinstead ofdamage.secondary.value, causing the secondary reflect to be based on the wrong damage number.Bug 2 — Wrong
combatTypein params (!canReflectbranch)damageReflectedParams.combatTypewas set todamage.primary.typeinstead ofdamage.secondary.type, dispatching the reflected secondary damage as the wrong combat type.Bug 3 — Wrong target field and broken formula (
canReflectbranch)The secondary reflected value was written to
damageReflected.primary.value(overwriting the primary reflect) instead ofdamageReflected.secondary.value. The formula also used a broken nestedstd::maxinstead of applying flat + percent additively with the proper 1% health cap.Credits
Thanks to @Jattartajjar and @iloveShaders for identifying and reporting these issues.