Trait EffectCb

Source
pub trait EffectCb {
    // Required methods
    fn on_apply(
        &mut self,
        sink: &mut dyn FightSink,
        effect: &EffectTpl,
        target: &Entity,
    ) -> Result<(), Error>;
    fn on_change(
        &mut self,
        sink: &mut dyn FightSink,
        effect: &EffectTpl,
        target: &Entity,
        new_stacks: i64,
        old_stacks: i64,
    ) -> Result<(), Error>;
}
Expand description

Invokes an effect’s on_apply / on_change reaction.

Required Methods§

Source

fn on_apply( &mut self, sink: &mut dyn FightSink, effect: &EffectTpl, target: &Entity, ) -> Result<(), Error>

Called after an effect’s duration is (re)applied, when the effect has an on_apply reaction.

Source

fn on_change( &mut self, sink: &mut dyn FightSink, effect: &EffectTpl, target: &Entity, new_stacks: i64, old_stacks: i64, ) -> Result<(), Error>

Called when an effect’s stack count changes, when the effect has an on_change reaction.

Implementors§