Skip to content

Conversation

@FominArtmind
Copy link

@FominArtmind FominArtmind commented Feb 15, 2024

Motivation: there are several effects that on reaching 100%/1.0 or above value are leading to incorrect behavior.
What actually done:

  1. for the following effects
    MagicEffectType.AddPhysicalResistancePercentage,
    MagicEffectType.AddBluntResistancePercentage,
    MagicEffectType.AddSlashingResistancePercentage,
    MagicEffectType.AddPiercingResistancePercentage,
    MagicEffectType.AddChoppingResistancePercentage,
    MagicEffectType.AddFireResistancePercentage,
    MagicEffectType.AddFrostResistancePercentage,
    MagicEffectType.AddLightningResistancePercentage,
    MagicEffectType.AddPoisonResistancePercentage,
    MagicEffectType.AddSpiritResistancePercentage,
    MagicEffectType.AddElementalResistancePercentage,
    MagicEffectType.AvoidDamageTaken,
    MagicEffectType.AvoidDamageTakenLowHealth,
    MagicEffectType.ModifyAttackStaminaUse,
    MagicEffectType.ModifyBlockStaminaUse,
    MagicEffectType.ModifyJumpStaminaUse,
    MagicEffectType.ModifySprintStaminaUse,
    MagicEffectType.Slow
    the formula of their summing from different items changed. Each item value is capped at 0.9, then values are ordered from the max one to min one. Max is taken as sum, remaining ones applied as sum = sum + (1.0 - sum) * effect. For example, two effects with values 0.9 and 0.9 will sum not as 1.8 but as 0.9 + 0.1 * 0.9 = 0.99. Other example: effects with values 0.1 and 0.1 will sum not as 0.2 but as 0.1 + 0.9 * 0.1 = 0.19.
  2. Fixed ReduceWeight effect could reach values > 1.0.
  3. Updated visual hint for the effect total value.

Backward compatibility: affects all users, theoretically can change the experience of the users using custom items or effects achieving elemental immunity etc. However, for the ones using default values in configuration files (that are in general very low in comparison with threshold of 0.9), changes are minor.

… >= 1.0/100% leads to bugs/issues;

- Fixed reduce weight effect could reach value > 100%;
@FominArtmind
Copy link
Author

I'm trying to understand bugs happening with ModifyAttackSpeed effect, sometimes attack speed becomes very high and value change itself doesn't look consistent even without taking that into accont.
During the process I've found that I need to do some additional reworks related to this PR taking into account how "LowHealth" modifiers are applied.

@FominArtmind
Copy link
Author

Added fix for AvoidDamageTaken and AvoidDamageTakenLowHealth interaction, looks as the feature is set now.

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