2018-06-28 12:58:51 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_AICAST_H
|
|
|
|
#define GAME_MWMECHANICS_AICAST_H
|
|
|
|
|
|
|
|
#include "aipackage.hpp"
|
|
|
|
|
2019-02-18 22:10:55 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
}
|
|
|
|
|
2018-06-28 12:58:51 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
/// AiPackage which makes an actor to cast given spell.
|
2020-05-16 16:56:02 +00:00
|
|
|
class AiCast final : public AiPackage {
|
2018-06-28 12:58:51 +00:00
|
|
|
public:
|
|
|
|
AiCast(const std::string& targetId, const std::string& spellId, bool manualSpell=false);
|
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
AiPackage *clone() const final;
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final;
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
int getTypeId() const final;
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
MWWorld::Ptr getTarget() const final;
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
unsigned int getPriority() const final;
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-05-16 16:56:02 +00:00
|
|
|
bool canCancel() const final { return false; }
|
|
|
|
bool shouldCancelPreviousAi() const final { return false; }
|
2018-06-28 12:58:51 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::string mTargetId;
|
|
|
|
std::string mSpellId;
|
|
|
|
bool mCasting;
|
|
|
|
bool mManual;
|
|
|
|
float mDistance;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|