OpenMW
|
#include <mechanicsmanagerimp.hpp>
Public Member Functions | |
void | buildPlayer () |
MechanicsManager () | |
virtual void | add (const MWWorld::Ptr &ptr) |
Register an object for management. | |
virtual void | remove (const MWWorld::Ptr &ptr) |
Deregister an object for management. | |
virtual void | updateCell (const MWWorld::Ptr &old, const MWWorld::Ptr &ptr) |
Moves an object to a new cell. | |
virtual void | drop (const MWWorld::CellStore *cellStore) |
Deregister all objects in the given cell. | |
virtual void | watchActor (const MWWorld::Ptr &ptr) |
virtual void | update (float duration, bool paused) |
virtual void | advanceTime (float duration) |
virtual void | setPlayerName (const std::string &name) |
Set player name. | |
virtual void | setPlayerRace (const std::string &id, bool male, const std::string &head, const std::string &hair) |
Set player race. | |
virtual void | setPlayerBirthsign (const std::string &id) |
Set player birthsign. | |
virtual void | setPlayerClass (const std::string &id) |
Set player class to stock class. | |
virtual void | setPlayerClass (const ESM::Class &class_) |
Set player class to custom class. | |
virtual void | restoreDynamicStats () |
If the player is sleeping, this should be called every hour. | |
virtual int | getBarterOffer (const MWWorld::Ptr &ptr, int basePrice, bool buying) |
This is used by every service to determine the price of objects given the trading skills of the player and NPC. | |
virtual int | getDerivedDisposition (const MWWorld::Ptr &ptr) |
Calculate the diposition of an NPC toward the player. | |
virtual int | countDeaths (const std::string &id) const |
Return the number of deaths for actors with the given ID. | |
virtual void | getPersuasionDispositionChange (const MWWorld::Ptr &npc, PersuasionType type, float currentTemporaryDispositionDelta, bool &success, float &tempChange, float &permChange) |
Perform a persuasion action on NPC. | |
void | toLower (std::string npcFaction) |
Perform a persuasion action on NPC. | |
virtual void | forceStateUpdate (const MWWorld::Ptr &ptr) |
Forces an object to refresh its animation state. | |
virtual void | playAnimationGroup (const MWWorld::Ptr &ptr, const std::string &groupName, int mode, int number) |
virtual void | skipAnimation (const MWWorld::Ptr &ptr) |
virtual bool | checkAnimationPlaying (const MWWorld::Ptr &ptr, const std::string &groupName) |
virtual void | updateMagicEffects (const MWWorld::Ptr &ptr) |
virtual void | toggleAI () |
virtual bool | isAIActive () |
Private Attributes | |
MWWorld::Ptr | mWatched |
NpcStats | mWatchedStats |
bool | mUpdatePlayer |
bool | mClassSelected |
bool | mRaceSelected |
bool | mAI |
is AI active? | |
Objects | mObjects |
Actors | mActors |
Reimplemented from MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::add | ( | const MWWorld::Ptr & | ptr | ) | [virtual] |
Register an object for management.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::advanceTime | ( | float | duration | ) | [virtual] |
Implements MWBase::MechanicsManager.
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.
bool MWMechanics::MechanicsManager::checkAnimationPlaying | ( | const MWWorld::Ptr & | ptr, |
const std::string & | groupName | ||
) | [virtual] |
Implements MWBase::MechanicsManager.
int MWMechanics::MechanicsManager::countDeaths | ( | const std::string & | id | ) | const [virtual] |
Return the number of deaths for actors with the given ID.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::drop | ( | const MWWorld::CellStore * | cellStore | ) | [virtual] |
Deregister all objects in the given cell.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::forceStateUpdate | ( | const MWWorld::Ptr & | ptr | ) | [virtual] |
Forces an object to refresh its animation state.
Implements MWBase::MechanicsManager.
int MWMechanics::MechanicsManager::getBarterOffer | ( | const MWWorld::Ptr & | ptr, |
int | basePrice, | ||
bool | buying | ||
) | [virtual] |
This is used by every service to determine the price of objects given the trading skills of the player and NPC.
Implements MWBase::MechanicsManager.
int MWMechanics::MechanicsManager::getDerivedDisposition | ( | const MWWorld::Ptr & | ptr | ) | [virtual] |
Calculate the diposition of an NPC toward the player.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::getPersuasionDispositionChange | ( | const MWWorld::Ptr & | npc, |
PersuasionType | type, | ||
float | currentTemporaryDispositionDelta, | ||
bool & | success, | ||
float & | tempChange, | ||
float & | permChange | ||
) | [virtual] |
Perform a persuasion action on NPC.
Implements MWBase::MechanicsManager.
bool MWMechanics::MechanicsManager::isAIActive | ( | ) | [virtual] |
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::playAnimationGroup | ( | const MWWorld::Ptr & | ptr, |
const std::string & | groupName, | ||
int | mode, | ||
int | number | ||
) | [virtual] |
Run animation for a MW-reference. Calls to this function for references that are currently not in the scene should be ignored.
mode | 0 normal, 1 immediate start, 2 immediate loop |
count | How many times the animation should be run |
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::remove | ( | const MWWorld::Ptr & | ptr | ) | [virtual] |
Deregister an object for management.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::restoreDynamicStats | ( | ) | [virtual] |
If the player is sleeping, this should be called every hour.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::setPlayerBirthsign | ( | const std::string & | id | ) | [virtual] |
Set player birthsign.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::setPlayerClass | ( | const std::string & | id | ) | [virtual] |
Set player class to stock class.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::setPlayerClass | ( | const ESM::Class & | class_ | ) | [virtual] |
Set player class to custom class.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::setPlayerName | ( | const std::string & | name | ) | [virtual] |
Set player name.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::setPlayerRace | ( | const std::string & | id, |
bool | male, | ||
const std::string & | head, | ||
const std::string & | hair | ||
) | [virtual] |
Set player race.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::skipAnimation | ( | const MWWorld::Ptr & | ptr | ) | [virtual] |
Skip the animation for the given MW-reference for one frame. Calls to this function for references that are currently not in the scene should be ignored.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::toggleAI | ( | ) | [virtual] |
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::toLower | ( | std::string | npcFaction | ) |
Perform a persuasion action on NPC.
void MWMechanics::MechanicsManager::update | ( | float | duration, |
bool | paused | ||
) | [virtual] |
Update objects
paused | In game type does not currently advance (this usually means some GUI component is up). |
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::updateCell | ( | const MWWorld::Ptr & | old, |
const MWWorld::Ptr & | ptr | ||
) | [virtual] |
Moves an object to a new cell.
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::updateMagicEffects | ( | const MWWorld::Ptr & | ptr | ) | [virtual] |
Update magic effects for an actor. Usually done automatically once per frame, but if we're currently paused we may want to do it manually (after equipping permanent enchantment)
Implements MWBase::MechanicsManager.
void MWMechanics::MechanicsManager::watchActor | ( | const MWWorld::Ptr & | ptr | ) | [virtual] |
On each update look for changes in a previously registered actor and update the GUI accordingly.
Implements MWBase::MechanicsManager.
Actors MWMechanics::MechanicsManager::mActors [private] |
bool MWMechanics::MechanicsManager::mAI [private] |
is AI active?
bool MWMechanics::MechanicsManager::mClassSelected [private] |
bool MWMechanics::MechanicsManager::mRaceSelected [private] |
bool MWMechanics::MechanicsManager::mUpdatePlayer [private] |