2012-03-30 14:18:58 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_ACTORS_H
|
|
|
|
#define GAME_MWMECHANICS_ACTORS_H
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2012-10-27 09:15:52 +00:00
|
|
|
#include <map>
|
2012-03-30 14:18:58 +00:00
|
|
|
|
2013-01-12 15:12:12 +00:00
|
|
|
#include "character.hpp"
|
|
|
|
|
2012-03-30 14:18:58 +00:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Vector3;
|
|
|
|
}
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
class CellStore;
|
|
|
|
}
|
|
|
|
|
2012-03-30 14:18:58 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
class Actors
|
|
|
|
{
|
2013-01-12 15:12:12 +00:00
|
|
|
typedef std::map<MWWorld::Ptr,CharacterController> PtrControllerMap;
|
|
|
|
PtrControllerMap mActors;
|
|
|
|
float mDuration;
|
|
|
|
std::map<std::string, int> mDeathCount;
|
2012-03-30 15:01:55 +00:00
|
|
|
|
|
|
|
void updateNpc (const MWWorld::Ptr& ptr, float duration, bool paused);
|
2012-03-30 14:18:58 +00:00
|
|
|
|
2012-05-17 11:21:49 +00:00
|
|
|
void adjustMagicEffects (const MWWorld::Ptr& creature);
|
|
|
|
|
2012-07-17 10:18:43 +00:00
|
|
|
void calculateDynamicStats (const MWWorld::Ptr& ptr);
|
|
|
|
|
2012-07-17 13:49:37 +00:00
|
|
|
void calculateCreatureStatModifiers (const MWWorld::Ptr& ptr);
|
|
|
|
|
2012-09-21 15:53:16 +00:00
|
|
|
void calculateRestoration (const MWWorld::Ptr& ptr, float duration);
|
|
|
|
|
|
|
|
|
2012-03-30 14:18:58 +00:00
|
|
|
public:
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
Actors();
|
2012-03-30 14:18:58 +00:00
|
|
|
|
|
|
|
void addActor (const MWWorld::Ptr& ptr);
|
|
|
|
///< Register an actor for stats management
|
2012-10-20 08:49:48 +00:00
|
|
|
///
|
|
|
|
/// \note Dead actors are ignored.
|
2012-03-30 14:18:58 +00:00
|
|
|
|
|
|
|
void removeActor (const MWWorld::Ptr& ptr);
|
|
|
|
///< Deregister an actor for stats management
|
2012-05-24 11:21:52 +00:00
|
|
|
///
|
|
|
|
/// \note Ignored, if \a ptr is not a registered actor.
|
2012-03-30 14:18:58 +00:00
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
void dropActors (const MWWorld::CellStore *cellStore);
|
2012-03-30 14:18:58 +00:00
|
|
|
///< Deregister all actors in the given cell.
|
|
|
|
|
2013-01-16 16:22:38 +00:00
|
|
|
void update (float duration, bool paused);
|
2012-03-30 14:18:58 +00:00
|
|
|
///< Update actor stats and store desired velocity vectors in \a movement
|
2012-05-18 11:54:07 +00: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 15:53:16 +00:00
|
|
|
void restoreDynamicStats();
|
|
|
|
///< If the player is sleeping, this should be called every hour.
|
2012-10-27 09:33:18 +00:00
|
|
|
|
|
|
|
int countDeaths (const std::string& id) const;
|
|
|
|
///< Return the number of deaths for actors with the given ID.
|
2013-01-17 01:53:18 +00:00
|
|
|
|
|
|
|
void playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number);
|
|
|
|
void skipAnimation(const MWWorld::Ptr& ptr);
|
2012-03-30 14:18:58 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|