More handling of script hooks.

This commit is contained in:
2019-11-09 12:55:48 +01:00
parent ee14efe22e
commit 658672a246
4 changed files with 44 additions and 34 deletions

View File

@@ -7,7 +7,7 @@
#include "Creature.hpp"
namespace CreatureLib::Battling {
class ExecutingAttack {
class ExecutingAttack : public ScriptSource {
public:
class HitData{
bool _critical = false;
@@ -65,6 +65,7 @@ namespace CreatureLib::Battling {
std::unordered_map<Creature*, TargetData> _targets;
Creature* _user;
LearnedAttack* _attack;
Script* _script;
public:
TargetData& GetAttackDataForTarget(Creature* creature){
@@ -86,6 +87,10 @@ namespace CreatureLib::Battling {
LearnedAttack* GetAttack(){
return _attack;
}
void GetActiveScripts(ScriptAggregator &aggr) override {
aggr.Add(_script);
}
};
}