GameplayAbilities and you

@KZJ So I’m having difficulty figuring out how to handle temporary shields through the AttributeSet and GameplayEffects.

My process:

  • Defined a separate Shield attribute.
  • I apply a GameplayEffect with an Additive Modifier to the Shield value (Duration Policy: Duration).
  • In my damage execution class, I calculate the damage, subtract any absorbed damage from the Shield attribute, then subtract any remaining damage from the Health attribute.

My problem:

  • GameplayEffects with a duration policy only changes the current attribute value, not the base. So when I apply my temporary Shield GameplayEffect, it looks like this:

Shield Current Value = 10
Shield Base Value = 0

I hit them with an ability that does 5 damage:

Shield Current Value = 5
Shield Base Value = -5

When the GameplayEffect’s duration ends:

Shield Current Value = -5
Shield Base Value = -5

What I want:

  • To be able to subtract from the current value of an attribute in my damage execution class, not the base value.

I know I could apply a GameplayEffect with an Instant or Infinite Duration Policy then remove the GameplayEffect after a desired amount of time, but that just feels wrong. Am I overlooking something here, or solving the shield problem in the wrong way?