2013-09-25 16:01:36 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_AICOMBAT_H
|
|
|
|
#define GAME_MWMECHANICS_AICOMBAT_H
|
|
|
|
|
|
|
|
#include "aipackage.hpp"
|
|
|
|
|
|
|
|
#include "pathfinding.hpp"
|
|
|
|
|
|
|
|
#include "movement.hpp"
|
2014-04-18 22:16:56 +00:00
|
|
|
#include "obstacle.hpp"
|
|
|
|
|
2014-06-08 16:59:26 +00:00
|
|
|
#include <OgreVector3.h>
|
|
|
|
|
2014-04-18 22:16:56 +00:00
|
|
|
#include "../mwworld/cellstore.hpp" // for Doors
|
2013-09-25 16:01:36 +00:00
|
|
|
|
2014-01-15 20:56:55 +00:00
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
|
2014-08-27 22:41:52 +00:00
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
2014-06-12 21:27:04 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
namespace AiSequence
|
|
|
|
{
|
|
|
|
struct AiCombat;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-25 16:01:36 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
2014-08-27 22:41:52 +00:00
|
|
|
class Action;
|
|
|
|
|
2014-04-30 03:40:59 +00:00
|
|
|
/// \brief Causes the actor to fight another actor
|
2013-09-25 16:01:36 +00:00
|
|
|
class AiCombat : public AiPackage
|
|
|
|
{
|
|
|
|
public:
|
2014-04-30 03:40:59 +00:00
|
|
|
///Constructor
|
|
|
|
/** \param actor Actor to fight **/
|
2014-01-15 20:56:55 +00:00
|
|
|
AiCombat(const MWWorld::Ptr& actor);
|
2013-09-25 16:01:36 +00:00
|
|
|
|
2014-06-12 21:27:04 +00:00
|
|
|
AiCombat (const ESM::AiSequence::AiCombat* combat);
|
|
|
|
|
|
|
|
void init();
|
|
|
|
|
2013-09-25 16:01:36 +00:00
|
|
|
virtual AiCombat *clone() const;
|
|
|
|
|
2014-10-08 08:58:52 +00:00
|
|
|
virtual bool execute (const MWWorld::Ptr& actor, AiState& state, float duration);
|
2013-09-25 16:01:36 +00:00
|
|
|
|
|
|
|
virtual int getTypeId() const;
|
|
|
|
|
2013-11-18 11:33:09 +00:00
|
|
|
virtual unsigned int getPriority() const;
|
|
|
|
|
2014-04-30 03:40:59 +00:00
|
|
|
///Returns target ID
|
2014-05-17 15:20:57 +00:00
|
|
|
MWWorld::Ptr getTarget() const;
|
2014-01-07 00:12:37 +00:00
|
|
|
|
2014-06-12 21:27:04 +00:00
|
|
|
virtual void writeState(ESM::AiSequence::AiSequence &sequence) const;
|
|
|
|
|
2013-09-25 16:01:36 +00:00
|
|
|
private:
|
2014-06-08 16:59:26 +00:00
|
|
|
|
2014-05-15 01:01:48 +00:00
|
|
|
int mTargetActorId;
|
2014-01-15 20:56:55 +00:00
|
|
|
|
2014-08-27 22:41:52 +00:00
|
|
|
|
2014-05-15 01:01:48 +00:00
|
|
|
void buildNewPath(const MWWorld::Ptr& actor, const MWWorld::Ptr& target);
|
2013-09-25 16:01:36 +00:00
|
|
|
};
|
2014-10-08 21:00:36 +00:00
|
|
|
|
2014-10-09 21:11:10 +00:00
|
|
|
|
2013-09-25 16:01:36 +00:00
|
|
|
}
|
|
|
|
|
2014-01-07 00:12:37 +00:00
|
|
|
#endif
|