1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 21:32:42 +00:00
OpenMW/apps/openmw/mwmechanics/aipursue.hpp

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

48 lines
1.4 KiB
C++
Raw Normal View History

2014-05-03 12:23:22 +02:00
#ifndef GAME_MWMECHANICS_AIPURSUE_H
#define GAME_MWMECHANICS_AIPURSUE_H
#include "typedaipackage.hpp"
2014-06-12 23:27:04 +02:00
namespace ESM
{
namespace AiSequence
{
struct AiPursue;
}
}
namespace MWMechanics
{
/// \brief Makes the actor very closely follow the actor
/** Used for arresting players. Causes the actor to run to the pursued actor and activate them, to arrest them.
2023-05-09 20:07:08 -04:00
Note that while very similar to AiActivate, it will ONLY activate when very close to target (Not also when the
path is completed). **/
class AiPursue final : public TypedAiPackage<AiPursue>
{
public:
/// Constructor
/** \param actor Actor to pursue **/
AiPursue(const MWWorld::Ptr& actor);
2014-05-17 19:20:57 +04:00
2014-06-12 23:27:04 +02:00
AiPursue(const ESM::AiSequence::AiPursue* pursue);
bool execute(const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state,
float duration) override;
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Pursue; }
static constexpr Options makeDefaultOptions()
{
AiPackage::Options options;
options.mCanCancel = false;
options.mShouldCancelPreviousAi = false;
return options;
}
MWWorld::Ptr getTarget() const override;
void writeState(ESM::AiSequence::AiSequence& sequence) const override;
};
}
#endif