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