Weekly Update #4 - Status Effects
Added 2021-01-22 00:20:35 +0000 UTCIn OSFE statuses were a list of enums , and all the code for them were kept in Being() which was not as modular as we would like.
I'm doing Status Effects completely differently this time around. There's a parent class of StatusEffect and all the different statuses will be their own class inheriting from it.
So what do we need for a Status Effect?
- amount
- duration
- maximum duration
- owner
- display (around the character)
- icon (on the status bar)
- list of stacks (so that multiple instances do not interfere with each other)
OnAddNew(amount, duration, source)
OnAddExisting(amount, duration, source)
OnUpdate()
OnRemove()
OnAddStack(amount, duration, source)
OnRemoveStack()
CalculateStatusStacks()
This way we can easily customize functionality of each status and if we have duplicate functionality we can just inherit from a child class.
For example:
Frost overrides OnAddNew() to just have it call OnAddExisting() since they'll have the same functionality. OnAddExisting() creates the vfx adds the amounts, and deals damage if the total amount of frost is 3 or higher, then subtracts the amount by 3.
Okay I'm gonna eat dinner I'll continue this later.