You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new onOtherSkillAdded(_skill) function to skill.nut
q.onOtherSkillAdded <- function( _skill )
{
}
Use hookTree on skill.nut in order to call onOtherSkillAdded when onAdded 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
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:
What to do about skills that do not stack and call 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.
Is a 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
The text was updated successfully, but these errors were encountered: