ProbablyManuel/requiem

Blocking attacks from an enchanted weapon doesn't always restore stamina

Opened this issue · 0 comments

Describe the bug

Blocking attacks from an enchanted weapon doesn't always restore stamina with Experienced Blocking.

To Reproduce

Steps to reproduce the behavior:

  1. Enable debug messages for all hits in REQ_PlayerImpactEffects, even ignored ones.
  2. Get hit by 000A6992 <REQ_Ench_Weapon_Steel_Greatsword_Frost3>.
  3. Receive three hit events:
    1. One by the weapon.
    2. One by the first effect of the enchantment which incorrectly receives the weapon rather than the enchantment as the source. Additionally, this event receives the projectile on the magic effect.
    3. One by the second effect of the enchantment which incorrectly receives the weapon rather than the enchantment as the source.
  4. Observe that only one of these three hit events is processed. If the processed event is not the weapon, stamina will not be restored due to the attack not being considered blocked.

Expected behavior

  • The weapon and enchantment hit events should both be processed.
  • The enchantment hit event should be processed as an enchantment.
  • Hit events from the same source should be processed only once for the entire source.

Additional context

A theoretical solution is to process all hit events except recurring concentration spells. This can be achieved by replacing the working state with a simple global flag that is set when a concentration spell begins processing and is unset when the current processing ends. All concentration spell hit events are ignored while the flag is set. To prevent multiple hit events from the same source all secondary magic effects should have the No Hit Event flag. To correctly identify enchantment hits as such all enchantment magic effects should be assigned a dummy projectile.