2012-03-30 16:18:58 +02:00
|
|
|
#ifndef GAME_MWMECHANICS_ACTORS_H
|
|
|
|
#define GAME_MWMECHANICS_ACTORS_H
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2012-10-27 11:15:52 +02:00
|
|
|
#include <map>
|
2012-03-30 16:18:58 +02:00
|
|
|
|
2013-01-12 07:12:12 -08:00
|
|
|
#include "character.hpp"
|
2013-03-31 00:13:56 -07:00
|
|
|
#include "movement.hpp"
|
2013-02-05 11:03:39 -08:00
|
|
|
#include "../mwbase/world.hpp"
|
2013-01-12 07:12:12 -08:00
|
|
|
|
2012-03-30 16:18:58 +02:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Vector3;
|
|
|
|
}
|
|
|
|
|
2012-07-03 13:55:53 +02:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
class CellStore;
|
|
|
|
}
|
|
|
|
|
2012-03-30 16:18:58 +02:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
class Actors
|
|
|
|
{
|
2013-07-08 14:05:53 -07:00
|
|
|
typedef std::map<MWWorld::Ptr,CharacterController*> PtrControllerMap;
|
2013-01-12 07:12:12 -08:00
|
|
|
PtrControllerMap mActors;
|
2013-02-05 06:59:01 -08:00
|
|
|
|
2013-01-12 07:12:12 -08:00
|
|
|
std::map<std::string, int> mDeathCount;
|
2012-03-30 17:01:55 +02:00
|
|
|
|
2013-02-05 06:59:01 -08:00
|
|
|
float mDuration;
|
|
|
|
|
2013-08-08 00:09:29 -07:00
|
|
|
void updateNpc(const MWWorld::Ptr &ptr, float duration, bool paused);
|
2012-03-30 16:18:58 +02:00
|
|
|
|
2013-11-09 10:49:00 +01:00
|
|
|
|
|
|
|
|
2012-05-17 13:21:49 +02:00
|
|
|
void adjustMagicEffects (const MWWorld::Ptr& creature);
|
|
|
|
|
2012-07-17 12:18:43 +02:00
|
|
|
void calculateDynamicStats (const MWWorld::Ptr& ptr);
|
|
|
|
|
2013-11-16 03:16:21 +01:00
|
|
|
void calculateCreatureStatModifiers (const MWWorld::Ptr& ptr, float duration);
|
2013-11-09 10:49:00 +01:00
|
|
|
void calculateNpcStatModifiers (const MWWorld::Ptr& ptr);
|
2012-07-17 15:49:37 +02:00
|
|
|
|
2012-09-21 17:53:16 +02:00
|
|
|
void calculateRestoration (const MWWorld::Ptr& ptr, float duration);
|
|
|
|
|
2013-08-07 15:34:11 +02:00
|
|
|
void updateDrowning (const MWWorld::Ptr& ptr, float duration);
|
2012-09-21 17:53:16 +02:00
|
|
|
|
2013-10-15 15:23:42 -04:00
|
|
|
void updateEquippedLight (const MWWorld::Ptr& ptr, float duration);
|
|
|
|
|
2012-03-30 16:18:58 +02:00
|
|
|
public:
|
|
|
|
|
2012-04-23 15:27:03 +02:00
|
|
|
Actors();
|
2012-03-30 16:18:58 +02:00
|
|
|
|
|
|
|
void addActor (const MWWorld::Ptr& ptr);
|
|
|
|
///< Register an actor for stats management
|
2012-10-20 10:49:48 +02:00
|
|
|
///
|
|
|
|
/// \note Dead actors are ignored.
|
2012-03-30 16:18:58 +02:00
|
|
|
|
|
|
|
void removeActor (const MWWorld::Ptr& ptr);
|
|
|
|
///< Deregister an actor for stats management
|
2012-05-24 13:21:52 +02:00
|
|
|
///
|
|
|
|
/// \note Ignored, if \a ptr is not a registered actor.
|
2012-03-30 16:18:58 +02:00
|
|
|
|
2013-02-25 09:57:34 -08:00
|
|
|
void updateActor(const MWWorld::Ptr &old, const MWWorld::Ptr& ptr);
|
|
|
|
///< Updates an actor with a new Ptr
|
2013-01-29 00:19:24 -08:00
|
|
|
|
2012-07-03 13:55:53 +02:00
|
|
|
void dropActors (const MWWorld::CellStore *cellStore);
|
2012-03-30 16:18:58 +02:00
|
|
|
///< Deregister all actors in the given cell.
|
|
|
|
|
2013-01-16 08:22:38 -08:00
|
|
|
void update (float duration, bool paused);
|
2012-03-30 16:18:58 +02:00
|
|
|
///< Update actor stats and store desired velocity vectors in \a movement
|
2012-05-18 13:54:07 +02:00
|
|
|
|
|
|
|
void updateActor (const MWWorld::Ptr& ptr, float duration);
|
|
|
|
///< This function is normally called automatically during the update process, but it can
|
|
|
|
/// also be called explicitly at any time to force an update.
|
|
|
|
|
2012-09-21 17:53:16 +02:00
|
|
|
void restoreDynamicStats();
|
|
|
|
///< If the player is sleeping, this should be called every hour.
|
2012-10-27 11:33:18 +02:00
|
|
|
|
|
|
|
int countDeaths (const std::string& id) const;
|
|
|
|
///< Return the number of deaths for actors with the given ID.
|
2013-01-16 17:53:18 -08:00
|
|
|
|
2013-04-25 07:08:11 -07:00
|
|
|
void forceStateUpdate(const MWWorld::Ptr &ptr);
|
|
|
|
|
2013-01-16 17:53:18 -08:00
|
|
|
void playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number);
|
|
|
|
void skipAnimation(const MWWorld::Ptr& ptr);
|
2013-05-24 20:10:07 -07:00
|
|
|
bool checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string& groupName);
|
2012-03-30 16:18:58 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|