XaiJu
thomasmoonkang
thomasmoonkang

patreon


Weekly Update #4 - Status Effects

In 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?

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.


More Creators