diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 57a417722e..4ca6e95812 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -63,7 +63,7 @@ add_openmw_dir (mwclass add_openmw_dir (mwmechanics mechanicsmanagerimp stat creaturestats magiceffects movement actors drawstate spells - activespells npcstats aipackage aisequence alchemy + activespells npcstats aipackage aisequence alchemy aiwander aitravel aifollow aiescort aiactivate ) add_openmw_dir (mwbase diff --git a/apps/openmw/mwmechanics/aiactivate.cpp b/apps/openmw/mwmechanics/aiactivate.cpp new file mode 100644 index 0000000000..464b30c7c6 --- /dev/null +++ b/apps/openmw/mwmechanics/aiactivate.cpp @@ -0,0 +1,21 @@ +#include "aiactivate.hpp" +#include + +MWMechanics::AiActivate::AiActivate(const std::string &objectID): +mObjectID(objectID) +{ +} +MWMechanics::AiActivate *MWMechanics::AiActivate::clone() const +{ + return new AiActivate(*this); +} +bool MWMechanics::AiActivate::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiActivate completed.\n"; + return true; +} + +int MWMechanics::AiActivate::getTypeId() const +{ + return 4; +} diff --git a/apps/openmw/mwmechanics/aiactivate.hpp b/apps/openmw/mwmechanics/aiactivate.hpp new file mode 100644 index 0000000000..5744cb25b3 --- /dev/null +++ b/apps/openmw/mwmechanics/aiactivate.hpp @@ -0,0 +1,23 @@ +#ifndef GAME_MWMECHANICS_AIACTIVATE_H +#define GAME_MWMECHANICS_AIACTIVATE_H + +#include "aipackage.hpp" +#include + +namespace MWMechanics +{ + + class AiActivate : AiPackage + { + public: + AiActivate(const std::string &objectID); + virtual AiActivate *clone() const; + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + virtual int getTypeId() const; + + private: + std::string mObjectID; + }; +} +#endif // GAME_MWMECHANICS_AIACTIVATE_H diff --git a/apps/openmw/mwmechanics/aiescort.cpp b/apps/openmw/mwmechanics/aiescort.cpp new file mode 100644 index 0000000000..9f170ef6eb --- /dev/null +++ b/apps/openmw/mwmechanics/aiescort.cpp @@ -0,0 +1,45 @@ +#include "aiescort.hpp" +#include + +MWMechanics::AiEscort::AiEscort(const std::string &actorID,int duration, float x, float y, float z): +mActorID(actorID), mDuration(duration), mX(x), mY(y), mZ(z) +{ +} +MWMechanics::AiEscort *MWMechanics::AiEscort::clone() const +{ + return new AiEscort(*this); +} + +bool MWMechanics::AiEscort::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiEscort completed. \n"; + return true; +} + +int MWMechanics::AiEscort::getTypeId() const +{ + return 2; +} + +float MWMechanics::AiEscort::getX() +{ + return mX; +} +float MWMechanics::AiEscort::getY() +{ + return mY; +} +float MWMechanics::AiEscort::getZ() +{ + return mZ; +} + +std::string MWMechanics::AiEscort::getActorID() +{ + return mActorID; +} + +int MWMechanics::AiEscort::getDuration() +{ + return mDuration; +} diff --git a/apps/openmw/mwmechanics/aiescort.hpp b/apps/openmw/mwmechanics/aiescort.hpp new file mode 100644 index 0000000000..4bd3f4b220 --- /dev/null +++ b/apps/openmw/mwmechanics/aiescort.hpp @@ -0,0 +1,34 @@ +#ifndef GAME_MWMECHANICS_AIESCORT_H +#define GAME_MWMECHANICS_AIESCORT_H + +#include "aipackage.hpp" +#include + +namespace MWMechanics +{ + class AiEscort : public AiPackage + { + public: + AiEscort(const std::string &actorID,int duration, float x, float y, float z); + virtual AiEscort *clone() const; + + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + + virtual int getTypeId() const; + float getX(); + float getY(); + float getZ(); + std::string getActorID(); + int getDuration(); + + private: + std::string mActorID; + float mX; + float mY; + float mZ; + int mDuration; + + }; +} +#endif diff --git a/apps/openmw/mwmechanics/aifollow.cpp b/apps/openmw/mwmechanics/aifollow.cpp new file mode 100644 index 0000000000..6478544bc1 --- /dev/null +++ b/apps/openmw/mwmechanics/aifollow.cpp @@ -0,0 +1,22 @@ +#include "aifollow.hpp" +#include + +MWMechanics::AiFollow::AiFollow(const std::string &actorID,float duration, float x, float y, float z): +mActorID(actorID), mDuration(duration), mX(x), mY(y), mZ(z) +{ +} +MWMechanics::AiFollow *MWMechanics::AiFollow::clone() const +{ + return new AiFollow(*this); +} + + bool MWMechanics::AiFollow::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiFollow completed.\n"; + return true; +} + + int MWMechanics::AiFollow::getTypeId() const +{ + return 3; +} diff --git a/apps/openmw/mwmechanics/aifollow.hpp b/apps/openmw/mwmechanics/aifollow.hpp new file mode 100644 index 0000000000..079c3c3810 --- /dev/null +++ b/apps/openmw/mwmechanics/aifollow.hpp @@ -0,0 +1,27 @@ +#ifndef GAME_MWMECHANICS_AIFALLOW_H +#define GAME_MWMECHANICS_AIFALLOW_H + +#include "aipackage.hpp" +#include + +namespace MWMechanics +{ + + class AiFollow : AiPackage + { + public: + AiFollow(const std::string &ActorID,float duration, float X, float Y, float Z); + virtual AiFollow *clone() const; + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + virtual int getTypeId() const; + + private: + float mDuration; + float mX; + float mY; + float mZ; + std::string mActorID; + }; +} +#endif diff --git a/apps/openmw/mwmechanics/aitravel.cpp b/apps/openmw/mwmechanics/aitravel.cpp new file mode 100644 index 0000000000..d07d302284 --- /dev/null +++ b/apps/openmw/mwmechanics/aitravel.cpp @@ -0,0 +1,39 @@ +#include "aitravel.hpp" +#include + +MWMechanics::AiTravel::AiTravel(float x, float y, float z): +mX(x),mY(y),mZ(z) +{ +} + +MWMechanics::AiTravel * MWMechanics::AiTravel::clone() const +{ + return new AiTravel(*this); +} + +bool MWMechanics::AiTravel::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiTravel completed.\n"; + return true; +} + +int MWMechanics::AiTravel::getTypeId() const +{ + return 1; +} + +float MWMechanics::AiTravel::getX() +{ + return mX; +} + +float MWMechanics::AiTravel::getY() +{ + return mY; +} + +float MWMechanics::AiTravel::getZ() +{ + return mZ; +} + diff --git a/apps/openmw/mwmechanics/aitravel.hpp b/apps/openmw/mwmechanics/aitravel.hpp new file mode 100644 index 0000000000..813ba81ebc --- /dev/null +++ b/apps/openmw/mwmechanics/aitravel.hpp @@ -0,0 +1,31 @@ +#ifndef GAME_MWMECHANICS_AITRAVEL_H +#define GAME_MWMECHANICS_AITRAVEL_H + +#include "aipackage.hpp" + +namespace MWMechanics +{ + class AiTravel : public AiPackage + { + public: + AiTravel(float x, float y, float z); + virtual AiTravel *clone() const; + + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + + virtual int getTypeId() const; + float getX(); + float getY(); + float getZ(); + + + private: + float mX; + float mY; + float mZ; + + }; +} + +#endif diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp new file mode 100644 index 0000000000..38d913f5fb --- /dev/null +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -0,0 +1,43 @@ +#include "aiwander.hpp" +#include + +MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector idle): + mDistance(distance), mDuration(duration), mTimeOfDay(timeOfDay), mIdle(idle) +{ +} + +int MWMechanics::AiWander::getDistance() const +{ + return mDistance; +} + +int MWMechanics::AiWander::getDuration() const +{ + return mDuration; +} + +int MWMechanics::AiWander::getTimeOfDay() const +{ + return mTimeOfDay; +} + +MWMechanics::AiPackage * MWMechanics::AiWander::clone() const +{ + return new AiWander(*this); +} + +bool MWMechanics::AiWander::execute (const MWWorld::Ptr& actor) +{ + std::cout << "AiWadner completed.\n"; + return true; +} + +int MWMechanics::AiWander::getTypeId() const +{ + return 0; +} + +int MWMechanics::AiWander::getIdle(int index) const +{ + return mIdle.at(index); +} diff --git a/apps/openmw/mwmechanics/aiwander.hpp b/apps/openmw/mwmechanics/aiwander.hpp new file mode 100644 index 0000000000..6b53390a1f --- /dev/null +++ b/apps/openmw/mwmechanics/aiwander.hpp @@ -0,0 +1,34 @@ +#ifndef GAME_MWMECHANICS_AIWANDER_H +#define GAME_MWMECHANICS_AIWANDER_H + +#include "aipackage.hpp" +#include + +namespace MWMechanics +{ + + class AiWander : public AiPackage + { + public: + + AiWander(int distance, int duration, int timeOfDay,std::vector idle); + virtual AiPackage *clone() const; + virtual bool execute (const MWWorld::Ptr& actor); + ///< \return Package completed? + virtual int getTypeId() const; + ///< 0: Wander + + int getDistance() const; + int getDuration()const; + int getTimeOfDay()const; + int getIdle(int index) const; + + private: + int mDistance; + int mDuration; + int mTimeOfDay; + std::vector mIdle; + }; + } + +#endif // AIWANDER_H