Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong calculation from elemental damage for weapons #3187

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dudantas
Copy link
Member

Description

This PR fixes an issue with the calculation of elemental weapon damage. Previously, the damage calculation for elemental weapons duplicated the damage instead of distributing it as 60% elemental and 40% physical (or vice-versa). This resulted in incorrect damage values and an overpowered effect for certain weapons.

The corrected logic ensures that the total damage remains consistent, splitting appropriately based on the elemental and physical proportions while applying target resistances/weaknesses correctly.

Behaviour

Actual

Using elemental weapons caused the damage calculation to incorrectly duplicate the total damage, leading to inflated results that did not respect the intended 60/40% distribution.

Expected

Using elemental weapons distributes the total damage correctly as 60% elemental and 40% physical, with adjustments for the target's resistances or weaknesses to the specific element.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested

The fix has been tested thoroughly to verify the proper distribution of elemental and physical damage. Test cases include:

  • Attacking monsters with elemental weaknesses.
  • Attacking monsters with elemental resistances.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Font: https://forum.portaltibia.com.br/topic/36599-armas-dano-elemental/

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.

1 participant