You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3mp/apps/openmw/mwmechanics/aicombat.hpp

68 lines
1.8 KiB
C++

11 years ago
#ifndef GAME_MWMECHANICS_AICOMBAT_H
#define GAME_MWMECHANICS_AICOMBAT_H
#include "aipackage.hpp"
#include "pathfinding.hpp"
#include "movement.hpp"
#include "obstacle.hpp"
#include "../mwworld/cellstore.hpp" // for Doors
11 years ago
#include "../mwbase/world.hpp"
11 years ago
namespace MWMechanics
{
class AiCombat : public AiPackage
{
public:
AiCombat(const MWWorld::Ptr& actor);
11 years ago
virtual AiCombat *clone() const;
11 years ago
virtual bool execute (const MWWorld::Ptr& actor,float duration);
11 years ago
///< \return Package completed?
virtual int getTypeId() const;
virtual unsigned int getPriority() const;
const MWWorld::Ptr &getTarget() const;
11 years ago
private:
PathFinder mPathFinder;
// controls duration of the actual strike
float mTimerAttack;
float mTimerReact;
// controls duration of the sideway & forward moves
// when mCombatMove is true
float mTimerCombatMove;
// AiCombat states
bool mReadyToAttack, mAttack;
bool mFollowTarget;
bool mCombatMove;
bool mBackOffDoor;
bool mForceNoShortcut;
ESM::Position mShortcutFailPos;
ESM::Position mLastPos;
MWMechanics::Movement mMovement;
MWWorld::Ptr mTarget;
const MWWorld::CellStore* mCell;
ObstacleCheck mObstacleCheck;
float mDoorCheckDuration;
// TODO: for some reason mDoors.searchViaHandle() returns
// null pointers, workaround by keeping an iterator
MWWorld::CellRefList<ESM::Door>::List::iterator mDoorIter;
MWWorld::CellRefList<ESM::Door>& mDoors;
void buildNewPath(const MWWorld::Ptr& actor);
11 years ago
};
}
#endif