2012-08-11 15:30:55 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_MECHANICSMANAGERIMP_H
|
|
|
|
#define GAME_MWMECHANICS_MECHANICSMANAGERIMP_H
|
2010-07-26 09:15:38 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
#include "../mwbase/mechanicsmanager.hpp"
|
2010-07-27 12:05:05 +00:00
|
|
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2010-07-27 13:59:41 +00:00
|
|
|
#include "creaturestats.hpp"
|
2010-09-21 15:42:07 +00:00
|
|
|
#include "npcstats.hpp"
|
2012-03-30 14:18:58 +00:00
|
|
|
#include "actors.hpp"
|
2010-07-27 13:59:41 +00:00
|
|
|
|
2011-02-01 09:11:41 +00:00
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Vector3;
|
|
|
|
}
|
|
|
|
|
2012-07-03 11:55:53 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class CellStore;
|
|
|
|
}
|
|
|
|
|
2010-07-26 09:15:38 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
2012-08-11 15:30:55 +00:00
|
|
|
class MechanicsManager : public MWBase::MechanicsManager
|
2010-07-26 09:15:38 +00:00
|
|
|
{
|
2010-07-27 13:59:41 +00:00
|
|
|
MWWorld::Ptr mWatched;
|
|
|
|
CreatureStats mWatchedCreature;
|
2010-09-21 15:42:07 +00:00
|
|
|
NpcStats mWatchedNpc;
|
2010-09-15 12:33:02 +00:00
|
|
|
bool mUpdatePlayer;
|
2010-09-26 08:01:30 +00:00
|
|
|
bool mClassSelected;
|
|
|
|
bool mRaceSelected;
|
2012-03-30 14:18:58 +00:00
|
|
|
Actors mActors;
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2010-09-15 11:31:26 +00:00
|
|
|
void buildPlayer();
|
|
|
|
///< build player according to stored class/race/birthsign information. Will
|
|
|
|
/// default to the values of the ESM::NPC object, if no explicit information is given.
|
|
|
|
|
2010-07-26 09:15:38 +00:00
|
|
|
public:
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
MechanicsManager();
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void addActor (const MWWorld::Ptr& ptr);
|
2010-07-27 12:05:05 +00:00
|
|
|
///< Register an actor for stats management
|
2010-07-27 12:43:46 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void removeActor (const MWWorld::Ptr& ptr);
|
2010-07-27 12:43:46 +00:00
|
|
|
///< Deregister an actor for stats management
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void dropActors (const MWWorld::CellStore *cellStore);
|
2010-07-27 12:05:05 +00:00
|
|
|
///< Deregister all actors in the given cell.
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void watchActor (const MWWorld::Ptr& ptr);
|
2010-07-27 13:59:41 +00:00
|
|
|
///< On each update look for changes in a previously registered actor and update the
|
|
|
|
/// GUI accordingly.
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2013-01-16 16:22:38 +00:00
|
|
|
virtual void update (float duration, bool paused);
|
2011-02-01 09:11:41 +00:00
|
|
|
///< Update actor stats and store desired velocity vectors in \a movement
|
2012-03-30 15:01:55 +00:00
|
|
|
///
|
|
|
|
/// \param paused In game type does not currently advance (this usually means some GUI
|
|
|
|
/// component is up).
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void setPlayerName (const std::string& name);
|
2010-09-13 20:59:28 +00:00
|
|
|
///< Set player name.
|
|
|
|
|
2012-11-10 07:41:12 +00:00
|
|
|
virtual void setPlayerRace (const std::string& id, bool male, const std::string &head, const std::string &hair);
|
2010-09-13 20:59:28 +00:00
|
|
|
///< Set player race.
|
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void setPlayerBirthsign (const std::string& id);
|
2010-09-13 20:59:28 +00:00
|
|
|
///< Set player birthsign.
|
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void setPlayerClass (const std::string& id);
|
2010-09-13 20:59:28 +00:00
|
|
|
///< Set player class to stock class.
|
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
virtual void setPlayerClass (const ESM::Class& class_);
|
2010-09-13 20:59:28 +00:00
|
|
|
///< Set player class to custom class.
|
2012-09-21 15:53:16 +00:00
|
|
|
|
|
|
|
virtual void restoreDynamicStats();
|
|
|
|
///< If the player is sleeping, this should be called every hour.
|
2012-11-05 10:07:43 +00:00
|
|
|
|
2012-11-09 13:42:09 +00:00
|
|
|
virtual int getBarterOffer(const MWWorld::Ptr& ptr,int basePrice, bool buying);
|
2012-11-05 10:07:43 +00:00
|
|
|
///< This is used by every service to determine the price of objects given the trading skills of the player and NPC.
|
|
|
|
|
2012-11-09 13:42:09 +00:00
|
|
|
virtual int getDerivedDisposition(const MWWorld::Ptr& ptr);
|
2012-11-05 10:07:43 +00:00
|
|
|
///< Calculate the diposition of an NPC toward the player.
|
2012-11-08 22:16:40 +00:00
|
|
|
|
2012-10-27 09:33:18 +00:00
|
|
|
virtual int countDeaths (const std::string& id) const;
|
|
|
|
///< Return the number of deaths for actors with the given ID.
|
|
|
|
|
2012-11-09 23:29:36 +00:00
|
|
|
virtual void getPersuasionDispositionChange (const MWWorld::Ptr& npc, PersuasionType type,
|
|
|
|
float currentTemporaryDispositionDelta, bool& success, float& tempChange, float& permChange);
|
2013-01-09 19:51:52 +00:00
|
|
|
void toLower(std::string npcFaction);
|
2012-11-09 23:29:36 +00:00
|
|
|
///< Perform a persuasion action on NPC
|
2013-01-17 01:53:18 +00:00
|
|
|
|
|
|
|
virtual void playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number);
|
|
|
|
virtual void skipAnimation(const MWWorld::Ptr& ptr);
|
2010-07-26 09:15:38 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|