Open Darxo opened 1 month ago
I've many times run into situations where I would've liked the existence of such a function - this is definitely a useful feature. There are two points to discuss about how to approach this problem:
onRefresh()
instead of onAdded()
e.g. overwhelmed_effect. onAdded()
is also only called when the skill actually moves from SkillsToAdd
to Skills
inside skill_container during collectGarbage
and add
functions.hookTree
on onAdded
the correct approach? Or would it be better to overwrite the vanilla collectGarbage
and add
functions and manually call the event from there?
Is your feature request related to a problem? Please describe. A skill currently can't react to another skill being added directly. For example:
Instead those changes currently have to either be done in the code of the respective effects or in something like the onUpdate loop.
Describe the solution you'd like Add a new
onOtherSkillAdded(_skill)
function toskill_container.nut
Add a new
onOtherSkillAdded(_skill)
function toskill.nut
Use hookTree on
skill.nut
in order to callonOtherSkillAdded
whenonAdded
is called. HookTree is needed because the base function onAdded is generally overriden by skills.Additional context This Event is especially useful when designing perks or traits which buff certain existing combat effects. As perks and traits are only added outside of battle and combat effects are only added inside of battle, it is as simple as doing something like this