aipursue.hpp 1.3 KB
Newer Older
scrawl's avatar
scrawl committed
1 2
#ifndef GAME_MWMECHANICS_AIPURSUE_H
#define GAME_MWMECHANICS_AIPURSUE_H
3 4

#include "aipackage.hpp"
5 6

#include "../mwbase/world.hpp"
7 8 9

#include "pathfinding.hpp"

scrawl's avatar
scrawl committed
10 11 12 13 14 15 16 17
namespace ESM
{
namespace AiSequence
{
    struct AiPursue;
}
}

18 19
namespace MWMechanics
{
20
    /// \brief Makes the actor very closely follow the actor
21 22 23
    /** 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). **/
scrawl's avatar
scrawl committed
24
    class AiPursue : public AiPackage
25 26
    {
        public:
27
            ///Constructor
28 29
            /** \param actor Actor to pursue **/
            AiPursue(const MWWorld::Ptr& actor);
30

scrawl's avatar
scrawl committed
31 32
            AiPursue(const ESM::AiSequence::AiPursue* pursue);

scrawl's avatar
scrawl committed
33
            virtual AiPursue *clone() const;
34
            virtual bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration);
35 36
            virtual int getTypeId() const;

37
            MWWorld::Ptr getTarget() const;
38

scrawl's avatar
scrawl committed
39 40
            virtual void writeState (ESM::AiSequence::AiSequence& sequence) const;

41 42
            virtual bool canCancel() const { return false; }
            virtual bool shouldCancelPreviousAi() const { return false; }
43 44 45
    };
}
#endif