1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 09:32:45 +00:00

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.1 KiB
C++
Raw Normal View History

#ifndef GAME_MWMECHANICS_AICAST_H
#define GAME_MWMECHANICS_AICAST_H
#include "typedaipackage.hpp"
2019-02-19 01:10:55 +03:00
namespace MWWorld
{
class Ptr;
}
namespace MWMechanics
{
/// AiPackage which makes an actor to cast given spell.
class AiCast final : public TypedAiPackage<AiCast>
{
public:
AiCast(const std::string& targetId, const std::string& spellId, bool manualSpell = false);
2022-09-22 21:26:05 +03:00
bool execute(const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state,
float duration) override;
2022-09-22 21:26:05 +03:00
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Cast; }
2022-09-22 21:26:05 +03:00
MWWorld::Ptr getTarget() const override;
2022-09-22 21:26:05 +03:00
static constexpr Options makeDefaultOptions()
{
AiPackage::Options options;
options.mPriority = 3;
options.mCanCancel = false;
options.mShouldCancelPreviousAi = false;
return options;
}
2022-09-22 21:26:05 +03:00
private:
const std::string mTargetId;
const std::string mSpellId;
bool mCasting;
const bool mManual;
const float mDistance;
};
}
#endif