Passing a multiplier to change health effect

In the “Effect Strategies” lecture it is mentioned that in the next lecture they would discuss how to pass a multiplier through to change the health effect value instead of needing to create a new health effect for every value. The next lecture (“Grouping Parameters Into A Class”) doesn’t mention this at all.

Any suggestions on how to implement passing a multiplier through? Should the AbilityData class have a field for the multiplier that is set by the Ability? It seems out of place for the AbilityData class to have a field that is used for one specific effect, but maybe that’s okay since the multiplier field is a convenience assuming the health effect is very common?

Here’s what I did:
In the Ability class itself, I made a field

[SerializeField] effectMultiplier=1.0f;

Then I added a similar field with Getters and Setters to AbilityData.
This acts as sort of a catch-all parameter, useful for damage or health effecs, etc.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms