Rework buff callbacks

The first implementation was way too complicated and prone to bugs.
This is much more simple flexible; first off, std::function is now used
instead of a raw function pointer, so lambdas and binds are fair game
which is great for scripting. Second, callbacks for all stacks are
executed. It is up to the callback target to ensure correct behavior.
This commit is contained in:
gsemaj
2022-07-18 08:53:53 -07:00
parent 15b6cd2fb4
commit afc48b7676
6 changed files with 88 additions and 82 deletions

View File

@@ -90,7 +90,7 @@ struct Player : public Entity, public ICombatant {
virtual void disappearFromViewOf(CNSocket *sock) override;
virtual void addBuff(BuffStack* buff) override;
virtual BuffStack* getBuff(int buffId) override;
virtual Buff* getBuff(int buffId) override;
virtual void removeBuff(int buffId) override;
virtual bool hasBuff(int buffId) override;
virtual int getCompositeCondition() override;