CreatureLib/src/Battling/TurnChoices/AttackTurnChoice.hpp

40 lines
1.2 KiB
C++
Raw Normal View History

#ifndef CREATURELIB_ATTACKTURNCHOICE_HPP
#define CREATURELIB_ATTACKTURNCHOICE_HPP
2019-12-05 08:53:48 +00:00
#include "../Models/CreatureIndex.hpp"
#include "../Models/LearnedAttack.hpp"
#include "BaseTurnChoice.hpp"
namespace CreatureLib::Battling {
class AttackTurnChoice : public BaseTurnChoice {
LearnedAttack* _attack;
2019-12-05 08:53:48 +00:00
CreatureIndex _target;
Script* _attackScript = nullptr;
public:
2019-12-05 08:53:48 +00:00
AttackTurnChoice(Creature* user, LearnedAttack* attack, const CreatureIndex& target)
: BaseTurnChoice(user), _attack(attack), _target(target) {}
inline LearnedAttack* GetAttack() const { return _attack; }
TurnChoiceKind GetKind() const override { return TurnChoiceKind ::Attack; }
2019-10-31 11:31:31 +00:00
int8_t GetPriority() const {
// HOOK: Change priority
2019-10-31 11:31:31 +00:00
return _attack->GetAttack()->GetPriority();
}
2019-11-02 12:57:43 +00:00
2019-12-05 08:53:48 +00:00
const CreatureIndex& GetTarget() const { return _target; }
Script* GetAttackScript() { return _attackScript; }
2019-11-24 10:06:51 +00:00
protected:
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override {
scripts.emplace_back(&_attackScript);
GetUser()->GetActiveScripts(scripts);
}
};
}
#endif // CREATURELIB_ATTACKTURNCHOICE_HPP