2014-05-03 12:23:22 +02:00
|
|
|
#ifndef GAME_MWMECHANICS_AIPURSUE_H
|
|
|
|
#define GAME_MWMECHANICS_AIPURSUE_H
|
2014-04-02 00:18:22 -04:00
|
|
|
|
2020-05-17 22:10:36 +02:00
|
|
|
#include "typedaipackage.hpp"
|
2014-05-13 00:05:30 +04:00
|
|
|
|
2014-06-12 23:27:04 +02:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
namespace AiSequence
|
|
|
|
{
|
|
|
|
struct AiPursue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-02 00:18:22 -04:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
2014-04-29 23:40:59 -04:00
|
|
|
/// \brief Makes the actor very closely follow the actor
|
2014-05-13 03:58:32 -04: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 22:10:36 +02:00
|
|
|
class AiPursue final : public TypedAiPackage<AiPursue>
|
2014-04-02 00:18:22 -04:00
|
|
|
{
|
|
|
|
public:
|
2014-04-29 23:40:59 -04:00
|
|
|
///Constructor
|
2014-05-15 03:01:48 +02:00
|
|
|
/** \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);
|
|
|
|
|
2020-10-22 23:57:53 +02:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override;
|
2020-05-16 21:08:39 +02:00
|
|
|
|
2020-05-16 21:52:16 +02:00
|
|
|
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Pursue; }
|
2020-05-16 21:08:39 +02:00
|
|
|
|
|
|
|
static constexpr Options makeDefaultOptions()
|
|
|
|
{
|
|
|
|
AiPackage::Options options;
|
|
|
|
options.mCanCancel = false;
|
|
|
|
options.mShouldCancelPreviousAi = false;
|
|
|
|
return options;
|
|
|
|
}
|
2014-04-02 00:18:22 -04:00
|
|
|
|
2020-10-22 23:57:53 +02:00
|
|
|
MWWorld::Ptr getTarget() const override;
|
2014-05-13 00:05:30 +04:00
|
|
|
|
2020-10-22 23:57:53 +02:00
|
|
|
void writeState (ESM::AiSequence::AiSequence& sequence) const override;
|
2014-04-02 00:18:22 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|