1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/apps/openmw/mwmechanics/aiescort.hpp

63 lines
1.9 KiB
C++
Raw Normal View History

2012-11-15 21:15:20 +00:00
#ifndef GAME_MWMECHANICS_AIESCORT_H
#define GAME_MWMECHANICS_AIESCORT_H
2012-11-14 17:42:04 +00:00
2012-11-15 21:15:20 +00:00
#include "aipackage.hpp"
2016-06-17 14:07:16 +00:00
2012-11-15 21:15:20 +00:00
#include <string>
2012-11-14 17:42:04 +00:00
#include "pathfinding.hpp"
2014-06-12 21:27:04 +00:00
namespace ESM
{
namespace AiSequence
{
struct AiEscort;
}
}
2012-11-14 17:42:04 +00:00
namespace MWMechanics
{
/// \brief AI Package to have an NPC lead the player to a specific point
class AiEscort : public AiPackage
{
public:
/// Implementation of AiEscort
/** The Actor will escort the specified actor to the world position x, y, z until they reach their position, or they run out of time
\implement AiEscort **/
AiEscort(const std::string &actorId,int duration, float x, float y, float z);
/// Implementation of AiEscortCell
/** The Actor will escort the specified actor to the cell position x, y, z until they reach their position, or they run out of time
\implement AiEscortCell **/
AiEscort(const std::string &actorId,const std::string &cellId,int duration, float x, float y, float z);
2012-11-30 00:16:16 +00:00
2014-06-12 21:27:04 +00:00
AiEscort(const ESM::AiSequence::AiEscort* escort);
2012-11-16 17:38:15 +00:00
virtual AiEscort *clone() const;
2012-11-14 17:42:04 +00:00
virtual bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration);
2012-11-14 17:42:04 +00:00
2012-11-16 17:38:15 +00:00
virtual int getTypeId() const;
2012-11-14 17:42:04 +00:00
2016-02-16 18:17:04 +00:00
MWWorld::Ptr getTarget() const;
virtual bool sideWithTarget() const { return true; }
2014-06-12 21:27:04 +00:00
void writeState(ESM::AiSequence::AiSequence &sequence) const;
2016-06-11 13:34:49 +00:00
void fastForward(const MWWorld::Ptr& actor, AiState& state);
2012-11-16 17:38:15 +00:00
private:
std::string mActorId;
2012-11-30 00:16:16 +00:00
std::string mCellId;
2012-11-16 17:38:15 +00:00
float mX;
float mY;
float mZ;
2013-05-09 03:02:24 +00:00
float mMaxDist;
2016-06-11 13:34:49 +00:00
float mDuration; // In hours
float mRemainingDuration; // In hours
2014-01-12 21:47:22 +00:00
int mCellX;
int mCellY;
};
}
#endif