2018-06-28 12:58:51 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_AICAST_H
|
|
|
|
#define GAME_MWMECHANICS_AICAST_H
|
|
|
|
|
2020-05-17 20:10:36 +00:00
|
|
|
#include "typedaipackage.hpp"
|
2018-06-28 12:58:51 +00:00
|
|
|
|
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-17 20:10:36 +00:00
|
|
|
class AiCast final : public TypedAiPackage<AiCast> {
|
2018-06-28 12:58:51 +00:00
|
|
|
public:
|
|
|
|
AiCast(const std::string& targetId, const std::string& spellId, bool manualSpell=false);
|
|
|
|
|
2020-10-22 21:57:53 +00:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override;
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-05-16 19:52:16 +00:00
|
|
|
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Cast; }
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-10-22 21:57:53 +00:00
|
|
|
MWWorld::Ptr getTarget() const override;
|
2018-06-28 12:58:51 +00:00
|
|
|
|
2020-05-16 19:08:39 +00:00
|
|
|
static constexpr Options makeDefaultOptions()
|
|
|
|
{
|
|
|
|
AiPackage::Options options;
|
|
|
|
options.mPriority = 3;
|
|
|
|
options.mCanCancel = false;
|
|
|
|
options.mShouldCancelPreviousAi = false;
|
|
|
|
return options;
|
|
|
|
}
|
2018-06-28 12:58:51 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-02 19:30:46 +00:00
|
|
|
const std::string mTargetId;
|
|
|
|
const std::string mSpellId;
|
2018-06-28 12:58:51 +00:00
|
|
|
bool mCasting;
|
2020-06-02 19:30:46 +00:00
|
|
|
const bool mManual;
|
|
|
|
const float mDistance;
|
2018-06-28 12:58:51 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|