Making Character Stat variables communicate with each other?

a fancy way is to use objects as attributes. the objects can then bind to when their ‘parent’ attribute changes.

so Luck updates, calls an eventdispatcher, critchance is bound to that dispatcher and updates its ‘luckbonus’

this also lets each attribute have its own maxvalue and can clamp when edited.

slightly simpler is to use a struct for each attribute
(
value
maxvalue
additive bonus
multiplication bonus
)

2 Likes