OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aiescort.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWMECHANICS_AIESCORT_H
2 #define GAME_MWMECHANICS_AIESCORT_H
3 
4 #include "aipackage.hpp"
5 
6 #include <string>
7 
8 #include "pathfinding.hpp"
9 
10 namespace ESM
11 {
12 namespace AiSequence
13 {
14  struct AiEscort;
15 }
16 }
17 
18 namespace MWMechanics
19 {
21  class AiEscort : public AiPackage
22  {
23  public:
25 
27  AiEscort(const std::string &actorId,int duration, float x, float y, float z);
29 
31  AiEscort(const std::string &actorId,const std::string &cellId,int duration, float x, float y, float z);
32 
33  AiEscort(const ESM::AiSequence::AiEscort* escort);
34 
35  virtual AiEscort *clone() const;
36 
37  virtual bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration);
38 
39  virtual int getTypeId() const;
40 
41  MWWorld::Ptr getTarget() const;
42  virtual bool sideWithTarget() const { return true; }
43 
44  void writeState(ESM::AiSequence::AiSequence &sequence) const;
45 
46  void fastForward(const MWWorld::Ptr& actor, AiState& state);
47 
48  private:
49  std::string mActorId;
50  std::string mCellId;
51  float mX;
52  float mY;
53  float mZ;
54  float mMaxDist;
55  float mDuration; // In hours
56  float mRemainingDuration; // In hours
57 
58  int mCellX;
59  int mCellY;
60  };
61 }
62 #endif
virtual bool execute(const MWWorld::Ptr &actor, CharacterController &characterController, AiState &state, float duration)
Definition: aiescort.cpp:61
void writeState(ESM::AiSequence::AiSequence &sequence) const
Definition: aiescort.cpp:127
int mCellY
Definition: aiescort.hpp:59
virtual int getTypeId() const
Definition: aiescort.cpp:117
AiEscort(const std::string &actorId, int duration, float x, float y, float z)
Implementation of AiEscort.
Definition: aiescort.cpp:24
std::string mCellId
Definition: aiescort.hpp:50
virtual bool sideWithTarget() const
Return true if having this AiPackage makes the actor side with the target in fights (default false) ...
Definition: aiescort.hpp:42
float mZ
Definition: aiescort.hpp:53
AI Package to have an NPC lead the player to a specific point.
Definition: aiescort.hpp:21
Base class for AI packages.
Definition: aipackage.hpp:32
float mRemainingDuration
Definition: aiescort.hpp:56
float mDuration
Definition: aiescort.hpp:55
std::string mActorId
Definition: aiescort.hpp:49
Definition: character.hpp:145
float mX
Definition: aiescort.hpp:51
int mCellX
Definition: aiescort.hpp:58
float mMaxDist
Definition: aiescort.hpp:54
void fastForward(const MWWorld::Ptr &actor, AiState &state)
Simulates the passing of time.
Definition: aiescort.cpp:143
float mY
Definition: aiescort.hpp:52
Definition: aisequence.hpp:148
Definition: aisequence.hpp:88
MWWorld::Ptr getTarget() const
Get the target actor the AI is targeted at (not applicable to all AI packages, default return empty P...
Definition: aiescort.cpp:122
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual AiEscort * clone() const
Clones the package.
Definition: aiescort.cpp:56