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
|
|
|
|
|
|
|
#include "aipackage.hpp"
|
2014-05-13 00:05:30 +04:00
|
|
|
|
|
|
|
#include "../mwbase/world.hpp"
|
2014-04-02 00:18:22 -04:00
|
|
|
|
|
|
|
#include "pathfinding.hpp"
|
|
|
|
|
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). **/
|
2014-05-03 12:23:22 +02:00
|
|
|
class AiPursue : public AiPackage
|
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);
|
|
|
|
|
2014-05-03 12:23:22 +02:00
|
|
|
virtual AiPursue *clone() const;
|
2014-10-08 10:58:52 +02:00
|
|
|
virtual bool execute (const MWWorld::Ptr& actor, AiState& state, float duration);
|
2014-04-02 00:18:22 -04:00
|
|
|
virtual int getTypeId() const;
|
|
|
|
|
2014-05-17 19:20:57 +04:00
|
|
|
MWWorld::Ptr getTarget() const;
|
2014-05-13 00:05:30 +04:00
|
|
|
|
2014-06-12 23:27:04 +02:00
|
|
|
virtual void writeState (ESM::AiSequence::AiSequence& sequence) const;
|
|
|
|
|
2014-04-02 00:18:22 -04:00
|
|
|
private:
|
2014-05-13 00:05:30 +04:00
|
|
|
|
2014-05-17 19:20:57 +04:00
|
|
|
int mTargetActorId; // The actor to pursue
|
2014-04-02 00:18:22 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|