openmw-tes3coop/apps/openmw/mwmechanics/aiescort.hpp

62 lines
2.2 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"
#include "pathfinding.hpp"
2012-11-15 21:15:20 +00:00
#include <string>
2012-11-14 17:42:04 +00:00
/* From CS:
Escort
Makes the actor escort another actor to a location or for a specified period of time. During this time the actor will also protect the actor it is escorting.
If you are not doing this package with the player as the target, youll want to also put a follow package on the target Actor, since escorting an actor makes the escorter wait for the other actor. If the Target does not know they are supposed to follow, the escorter will most likely just stand there.
Target: The ActorID to Escort. Remember that since all ActorIDs share the same AI packages, putting this on an Actor with multiple references will cause ALL references of that actor to attempt to escort the same actor. Thus, this type of AI should only be placed on specific or unique sets of Actors.
Duration: The duration the actor should escort for. Trumped by providing a location.
Escort to: Check this to use location data for the escort.
Cell: The Cell to escort to.
XYZ: Like Travel, specify the XYZ location to escort to.
View Location: A red X will appear in the render window that you can move around with the standard render window object controls. Place the X on the escort destination.
*/
2012-11-14 17:42:04 +00:00
namespace MWMechanics
{
class AiEscort : public AiPackage
{
public:
2012-11-16 19:28:20 +00:00
AiEscort(const std::string &actorId,int duration, float x, float y, float z);
2012-11-30 00:16:16 +00:00
///< \implement AiEscort
AiEscort(const std::string &actorId,const std::string &cellId,int duration, float x, float y, float z);
///< \implement AiEscortCell
2012-11-16 17:38:15 +00:00
virtual AiEscort *clone() const;
2012-11-14 17:42:04 +00:00
2012-11-16 17:38:15 +00:00
virtual bool execute (const MWWorld::Ptr& actor);
2012-11-16 19:28:20 +00:00
///< \return Package completed?
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
2012-11-16 17:38:15 +00:00
private:
2012-11-16 19:28:20 +00:00
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;
unsigned int mStartingSecond;
unsigned int mDuration;
PathFinder mPathFinder;
int cellX;
int cellY;
};
}
#endif