mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-28 17:56:37 +00:00 
			
		
		
		
	Merge remote-tracking branch 'gohan/Gohan'
This commit is contained in:
		
						commit
						3dc013ceae
					
				
					 11 changed files with 320 additions and 1 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
							
								
								
									
										21
									
								
								apps/openmw/mwmechanics/aiactivate.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								apps/openmw/mwmechanics/aiactivate.cpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | |||
| #include "aiactivate.hpp" | ||||
| #include <iostream> | ||||
| 
 | ||||
| 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; | ||||
| } | ||||
							
								
								
									
										23
									
								
								apps/openmw/mwmechanics/aiactivate.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								apps/openmw/mwmechanics/aiactivate.hpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | |||
| #ifndef GAME_MWMECHANICS_AIACTIVATE_H | ||||
| #define GAME_MWMECHANICS_AIACTIVATE_H | ||||
| 
 | ||||
| #include "aipackage.hpp" | ||||
| #include <string> | ||||
| 
 | ||||
| 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
 | ||||
							
								
								
									
										45
									
								
								apps/openmw/mwmechanics/aiescort.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								apps/openmw/mwmechanics/aiescort.cpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,45 @@ | |||
| #include "aiescort.hpp" | ||||
| #include <iostream> | ||||
| 
 | ||||
| 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; | ||||
| } | ||||
							
								
								
									
										34
									
								
								apps/openmw/mwmechanics/aiescort.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								apps/openmw/mwmechanics/aiescort.hpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,34 @@ | |||
| #ifndef GAME_MWMECHANICS_AIESCORT_H | ||||
| #define GAME_MWMECHANICS_AIESCORT_H | ||||
| 
 | ||||
| #include "aipackage.hpp" | ||||
| #include <string> | ||||
| 
 | ||||
| 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 | ||||
							
								
								
									
										22
									
								
								apps/openmw/mwmechanics/aifollow.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								apps/openmw/mwmechanics/aifollow.cpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| #include "aifollow.hpp" | ||||
| #include <iostream> | ||||
| 
 | ||||
| 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; | ||||
| } | ||||
							
								
								
									
										27
									
								
								apps/openmw/mwmechanics/aifollow.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								apps/openmw/mwmechanics/aifollow.hpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,27 @@ | |||
| #ifndef GAME_MWMECHANICS_AIFALLOW_H | ||||
| #define GAME_MWMECHANICS_AIFALLOW_H | ||||
| 
 | ||||
| #include "aipackage.hpp" | ||||
| #include <string> | ||||
| 
 | ||||
| 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 | ||||
							
								
								
									
										39
									
								
								apps/openmw/mwmechanics/aitravel.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								apps/openmw/mwmechanics/aitravel.cpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,39 @@ | |||
| #include "aitravel.hpp" | ||||
| #include <iostream> | ||||
| 
 | ||||
| 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; | ||||
| } | ||||
| 
 | ||||
							
								
								
									
										31
									
								
								apps/openmw/mwmechanics/aitravel.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								apps/openmw/mwmechanics/aitravel.hpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -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 | ||||
							
								
								
									
										43
									
								
								apps/openmw/mwmechanics/aiwander.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								apps/openmw/mwmechanics/aiwander.cpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,43 @@ | |||
| #include "aiwander.hpp" | ||||
| #include <iostream> | ||||
| 
 | ||||
| MWMechanics::AiWander::AiWander(int distance, int duration, int timeOfDay,std::vector<int> 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); | ||||
| } | ||||
							
								
								
									
										34
									
								
								apps/openmw/mwmechanics/aiwander.hpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								apps/openmw/mwmechanics/aiwander.hpp
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,34 @@ | |||
| #ifndef GAME_MWMECHANICS_AIWANDER_H | ||||
| #define GAME_MWMECHANICS_AIWANDER_H | ||||
| 
 | ||||
| #include "aipackage.hpp" | ||||
| #include <vector> | ||||
| 
 | ||||
| namespace MWMechanics | ||||
| { | ||||
| 
 | ||||
|     class AiWander : public AiPackage | ||||
|     { | ||||
|     public: | ||||
| 
 | ||||
|         AiWander(int distance, int duration, int timeOfDay,std::vector<int> 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<int> mIdle; | ||||
|     }; | ||||
|     } | ||||
| 
 | ||||
| #endif // AIWANDER_H
 | ||||
		Loading…
	
		Reference in a new issue