2019-10-29 10:19:25 +00:00
|
|
|
#ifndef CREATURELIB_ATTACKTURNCHOICE_HPP
|
|
|
|
#define CREATURELIB_ATTACKTURNCHOICE_HPP
|
|
|
|
|
2019-12-05 08:53:48 +00:00
|
|
|
#include "../Models/CreatureIndex.hpp"
|
2019-10-29 10:19:25 +00:00
|
|
|
#include "../Models/LearnedAttack.hpp"
|
2019-11-28 11:55:22 +00:00
|
|
|
#include "BaseTurnChoice.hpp"
|
2019-10-29 10:19:25 +00:00
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
namespace CreatureLib::Battling {
|
2019-10-29 10:19:25 +00:00
|
|
|
class AttackTurnChoice : public BaseTurnChoice {
|
|
|
|
LearnedAttack* _attack;
|
2019-12-05 08:53:48 +00:00
|
|
|
CreatureIndex _target;
|
2019-12-05 11:56:41 +00:00
|
|
|
Script* _attackScript = nullptr;
|
2019-11-28 11:55:22 +00:00
|
|
|
|
2019-10-29 10:19:25 +00:00
|
|
|
public:
|
2019-12-05 08:53:48 +00:00
|
|
|
AttackTurnChoice(Creature* user, LearnedAttack* attack, const CreatureIndex& target)
|
2019-11-28 11:55:22 +00:00
|
|
|
: BaseTurnChoice(user), _attack(attack), _target(target) {}
|
2019-10-29 10:19:25 +00:00
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
inline LearnedAttack* GetAttack() const { return _attack; }
|
2019-10-31 11:02:23 +00:00
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
TurnChoiceKind GetKind() const override { return TurnChoiceKind ::Attack; }
|
2019-10-31 11:31:31 +00:00
|
|
|
|
2019-11-28 11:55:22 +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; }
|
2019-11-10 13:32:05 +00:00
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
Script* GetAttackScript() { return _attackScript; }
|
2019-11-24 10:06:51 +00:00
|
|
|
|
2019-11-10 16:08:42 +00:00
|
|
|
protected:
|
2019-11-28 11:55:22 +00:00
|
|
|
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override {
|
2019-11-10 16:08:42 +00:00
|
|
|
scripts.emplace_back(&_attackScript);
|
|
|
|
GetUser()->GetActiveScripts(scripts);
|
2019-11-10 13:32:05 +00:00
|
|
|
}
|
2019-10-29 10:19:25 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-11-28 11:55:22 +00:00
|
|
|
#endif // CREATURELIB_ATTACKTURNCHOICE_HPP
|