2010-07-26 09:15:38 +00:00
|
|
|
|
2012-08-11 15:30:55 +00:00
|
|
|
#include "mechanicsmanagerimp.hpp"
|
2010-07-26 09:15:38 +00:00
|
|
|
|
2012-10-01 15:17:04 +00:00
|
|
|
#include "../mwworld/esmstore.hpp"
|
2010-07-26 09:15:38 +00:00
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
#include "../mwbase/environment.hpp"
|
2012-07-03 10:30:50 +00:00
|
|
|
#include "../mwbase/world.hpp"
|
2012-08-12 16:11:09 +00:00
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2010-08-03 09:49:12 +00:00
|
|
|
#include "../mwworld/class.hpp"
|
2011-01-04 14:58:22 +00:00
|
|
|
#include "../mwworld/player.hpp"
|
2010-08-03 09:49:12 +00:00
|
|
|
|
2010-07-26 09:15:38 +00:00
|
|
|
namespace MWMechanics
|
2010-07-28 16:48:01 +00:00
|
|
|
{
|
2010-09-15 11:31:26 +00:00
|
|
|
void MechanicsManager::buildPlayer()
|
|
|
|
{
|
2012-04-23 13:27:03 +00:00
|
|
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
2010-09-15 11:31:26 +00:00
|
|
|
|
|
|
|
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
2010-09-16 08:45:08 +00:00
|
|
|
MWMechanics::NpcStats& npcStats = MWWorld::Class::get (ptr).getNpcStats (ptr);
|
2010-09-15 11:31:26 +00:00
|
|
|
|
2012-11-05 12:07:59 +00:00
|
|
|
const ESM::NPC *player = ptr.get<ESM::NPC>()->mBase;
|
2010-09-15 11:31:26 +00:00
|
|
|
|
|
|
|
// reset
|
2012-09-17 07:37:50 +00:00
|
|
|
creatureStats.setLevel(player->mNpdt52.mLevel);
|
2012-07-22 14:29:54 +00:00
|
|
|
creatureStats.getSpells().clear();
|
|
|
|
creatureStats.setMagicEffects(MagicEffects());
|
2010-09-15 11:31:26 +00:00
|
|
|
|
2010-09-16 08:45:08 +00:00
|
|
|
for (int i=0; i<27; ++i)
|
2012-09-17 07:37:50 +00:00
|
|
|
npcStats.getSkill (i).setBase (player->mNpdt52.mSkills[i]);
|
2010-09-16 08:45:08 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
creatureStats.getAttribute(0).setBase (player->mNpdt52.mStrength);
|
|
|
|
creatureStats.getAttribute(1).setBase (player->mNpdt52.mIntelligence);
|
|
|
|
creatureStats.getAttribute(2).setBase (player->mNpdt52.mWillpower);
|
|
|
|
creatureStats.getAttribute(3).setBase (player->mNpdt52.mAgility);
|
|
|
|
creatureStats.getAttribute(4).setBase (player->mNpdt52.mSpeed);
|
|
|
|
creatureStats.getAttribute(5).setBase (player->mNpdt52.mEndurance);
|
|
|
|
creatureStats.getAttribute(6).setBase (player->mNpdt52.mPersonality);
|
|
|
|
creatureStats.getAttribute(7).setBase (player->mNpdt52.mLuck);
|
2012-05-28 09:37:56 +00:00
|
|
|
|
2010-09-15 11:31:26 +00:00
|
|
|
// race
|
2010-09-26 08:01:30 +00:00
|
|
|
if (mRaceSelected)
|
|
|
|
{
|
|
|
|
const ESM::Race *race =
|
2012-11-05 17:19:22 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find (
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().getRace()
|
|
|
|
);
|
2010-09-15 13:10:13 +00:00
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
bool male = MWBase::Environment::get().getWorld()->getPlayer().isMale();
|
2010-09-15 13:10:13 +00:00
|
|
|
|
2010-09-26 08:01:30 +00:00
|
|
|
for (int i=0; i<8; ++i)
|
2010-09-15 13:10:13 +00:00
|
|
|
{
|
2010-09-26 08:01:30 +00:00
|
|
|
const ESM::Race::MaleFemale *attribute = 0;
|
|
|
|
switch (i)
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
case 0: attribute = &race->mData.mStrength; break;
|
|
|
|
case 1: attribute = &race->mData.mIntelligence; break;
|
|
|
|
case 2: attribute = &race->mData.mWillpower; break;
|
|
|
|
case 3: attribute = &race->mData.mAgility; break;
|
|
|
|
case 4: attribute = &race->mData.mSpeed; break;
|
|
|
|
case 5: attribute = &race->mData.mEndurance; break;
|
|
|
|
case 6: attribute = &race->mData.mPersonality; break;
|
|
|
|
case 7: attribute = &race->mData.mLuck; break;
|
2010-09-26 08:01:30 +00:00
|
|
|
}
|
2010-09-15 13:10:13 +00:00
|
|
|
|
2012-07-22 14:29:54 +00:00
|
|
|
creatureStats.getAttribute(i).setBase (
|
2012-09-17 07:37:50 +00:00
|
|
|
static_cast<int> (male ? attribute->mMale : attribute->mFemale));
|
2010-09-26 08:01:30 +00:00
|
|
|
}
|
2010-09-16 08:45:08 +00:00
|
|
|
|
2012-08-16 13:42:37 +00:00
|
|
|
for (int i=0; i<27; ++i)
|
2010-09-16 08:45:08 +00:00
|
|
|
{
|
2012-08-16 13:42:37 +00:00
|
|
|
int bonus = 0;
|
|
|
|
|
|
|
|
for (int i2=0; i2<7; ++i2)
|
2012-09-17 07:37:50 +00:00
|
|
|
if (race->mData.mBonus[i2].mSkill==i)
|
2012-08-16 13:42:37 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
bonus = race->mData.mBonus[i2].mBonus;
|
2012-08-16 13:42:37 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
npcStats.getSkill (i).setBase (5 + bonus);
|
2010-09-16 08:45:08 +00:00
|
|
|
}
|
2010-09-26 08:01:30 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
for (std::vector<std::string>::const_iterator iter (race->mPowers.mList.begin());
|
|
|
|
iter!=race->mPowers.mList.end(); ++iter)
|
2010-09-30 12:28:01 +00:00
|
|
|
{
|
2012-07-22 14:29:54 +00:00
|
|
|
creatureStats.getSpells().add (*iter);
|
2010-09-30 12:28:01 +00:00
|
|
|
}
|
2010-09-16 08:45:08 +00:00
|
|
|
}
|
2010-09-15 13:10:13 +00:00
|
|
|
|
2010-09-15 11:31:26 +00:00
|
|
|
// birthsign
|
2012-04-23 13:27:03 +00:00
|
|
|
if (!MWBase::Environment::get().getWorld()->getPlayer().getBirthsign().empty())
|
2010-09-26 08:01:30 +00:00
|
|
|
{
|
2010-09-30 12:28:01 +00:00
|
|
|
const ESM::BirthSign *sign =
|
2012-11-05 17:19:22 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::BirthSign>().find (
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().getBirthsign());
|
2010-09-30 12:28:01 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
for (std::vector<std::string>::const_iterator iter (sign->mPowers.mList.begin());
|
|
|
|
iter!=sign->mPowers.mList.end(); ++iter)
|
2010-09-30 12:28:01 +00:00
|
|
|
{
|
2012-07-22 14:29:54 +00:00
|
|
|
creatureStats.getSpells().add (*iter);
|
2010-09-30 12:28:01 +00:00
|
|
|
}
|
2010-09-26 08:01:30 +00:00
|
|
|
}
|
2010-09-15 11:31:26 +00:00
|
|
|
|
|
|
|
// class
|
2010-09-26 08:01:30 +00:00
|
|
|
if (mClassSelected)
|
2010-09-15 13:23:38 +00:00
|
|
|
{
|
2012-04-23 13:27:03 +00:00
|
|
|
const ESM::Class& class_ = MWBase::Environment::get().getWorld()->getPlayer().getClass();
|
2010-09-26 08:01:30 +00:00
|
|
|
|
|
|
|
for (int i=0; i<2; ++i)
|
2010-09-15 13:23:38 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
int attribute = class_.mData.mAttribute[i];
|
2010-09-26 08:01:30 +00:00
|
|
|
if (attribute>=0 && attribute<8)
|
|
|
|
{
|
2012-07-22 14:29:54 +00:00
|
|
|
creatureStats.getAttribute(attribute).setBase (
|
|
|
|
creatureStats.getAttribute(attribute).getBase() + 10);
|
2010-09-26 08:01:30 +00:00
|
|
|
}
|
2010-09-15 13:23:38 +00:00
|
|
|
}
|
2010-09-26 07:55:00 +00:00
|
|
|
|
2010-09-26 08:01:30 +00:00
|
|
|
for (int i=0; i<2; ++i)
|
2010-09-26 07:55:00 +00:00
|
|
|
{
|
2010-09-26 08:01:30 +00:00
|
|
|
int bonus = i==0 ? 10 : 25;
|
2010-09-26 07:55:00 +00:00
|
|
|
|
2010-09-26 08:01:30 +00:00
|
|
|
for (int i2=0; i2<5; ++i2)
|
2010-09-26 07:55:00 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
int index = class_.mData.mSkills[i2][i];
|
2010-09-26 08:01:30 +00:00
|
|
|
|
|
|
|
if (index>=0 && index<27)
|
|
|
|
{
|
2012-07-06 16:23:48 +00:00
|
|
|
npcStats.getSkill (index).setBase (
|
|
|
|
npcStats.getSkill (index).getBase() + bonus);
|
2010-09-26 08:01:30 +00:00
|
|
|
}
|
2010-09-26 07:55:00 +00:00
|
|
|
}
|
|
|
|
}
|
2010-09-15 11:31:26 +00:00
|
|
|
|
2012-11-05 17:19:22 +00:00
|
|
|
const MWWorld::Store<ESM::Skill> &skills =
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Skill>();
|
2010-09-26 07:55:00 +00:00
|
|
|
|
2012-11-05 17:19:22 +00:00
|
|
|
MWWorld::Store<ESM::Skill>::iterator iter = skills.begin();
|
|
|
|
for (; iter != skills.end(); ++iter)
|
2010-09-26 07:55:00 +00:00
|
|
|
{
|
2012-11-05 17:19:22 +00:00
|
|
|
if (iter->mData.mSpecialization==class_.mData.mSpecialization)
|
2010-09-26 07:55:00 +00:00
|
|
|
{
|
2012-11-05 17:19:22 +00:00
|
|
|
int index = iter->mIndex;
|
2010-09-26 08:01:30 +00:00
|
|
|
|
|
|
|
if (index>=0 && index<27)
|
|
|
|
{
|
2012-07-06 16:23:48 +00:00
|
|
|
npcStats.getSkill (index).setBase (
|
|
|
|
npcStats.getSkill (index).getBase() + 5);
|
2010-09-26 08:01:30 +00:00
|
|
|
}
|
2010-09-26 07:55:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-05-18 11:54:07 +00:00
|
|
|
|
|
|
|
// forced update and current value adjustments
|
|
|
|
mActors.updateActor (ptr, 0);
|
|
|
|
|
2012-10-19 11:10:06 +00:00
|
|
|
for (int i=0; i<2; ++i)
|
|
|
|
{
|
|
|
|
DynamicStat<float> stat = creatureStats.getDynamic (i);
|
|
|
|
stat.setCurrent (stat.getModified());
|
|
|
|
creatureStats.setDynamic (i, stat);
|
|
|
|
}
|
2010-09-15 11:31:26 +00:00
|
|
|
}
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
MechanicsManager::MechanicsManager()
|
|
|
|
: mUpdatePlayer (true), mClassSelected (false),
|
|
|
|
mRaceSelected (false)
|
2010-07-26 09:15:38 +00:00
|
|
|
{
|
2010-09-15 11:31:26 +00:00
|
|
|
buildPlayer();
|
2010-07-26 09:15:38 +00:00
|
|
|
}
|
|
|
|
|
2010-07-27 12:05:05 +00:00
|
|
|
void MechanicsManager::addActor (const MWWorld::Ptr& ptr)
|
|
|
|
{
|
2012-03-30 14:18:58 +00:00
|
|
|
mActors.addActor (ptr);
|
2010-07-27 12:05:05 +00:00
|
|
|
}
|
2010-07-28 16:48:01 +00:00
|
|
|
|
2010-07-27 12:43:46 +00:00
|
|
|
void MechanicsManager::removeActor (const MWWorld::Ptr& ptr)
|
|
|
|
{
|
2011-02-10 09:38:45 +00:00
|
|
|
if (ptr==mWatched)
|
|
|
|
mWatched = MWWorld::Ptr();
|
|
|
|
|
2012-03-30 14:18:58 +00:00
|
|
|
mActors.removeActor (ptr);
|
2010-07-27 12:43:46 +00:00
|
|
|
}
|
2010-07-28 16:48:01 +00:00
|
|
|
|
2010-07-27 12:05:05 +00:00
|
|
|
void MechanicsManager::dropActors (const MWWorld::Ptr::CellStore *cellStore)
|
|
|
|
{
|
2011-02-10 09:38:45 +00:00
|
|
|
if (!mWatched.isEmpty() && mWatched.getCell()==cellStore)
|
|
|
|
mWatched = MWWorld::Ptr();
|
|
|
|
|
2012-03-30 14:18:58 +00:00
|
|
|
mActors.dropActors (cellStore);
|
2010-07-27 12:05:05 +00:00
|
|
|
}
|
2010-07-28 16:48:01 +00:00
|
|
|
|
2010-07-27 13:59:41 +00:00
|
|
|
void MechanicsManager::watchActor (const MWWorld::Ptr& ptr)
|
2010-07-27 12:46:05 +00:00
|
|
|
{
|
2010-07-27 13:59:41 +00:00
|
|
|
mWatched = ptr;
|
|
|
|
}
|
2010-07-28 16:48:01 +00:00
|
|
|
|
2012-03-30 15:01:55 +00:00
|
|
|
void MechanicsManager::update (std::vector<std::pair<std::string, Ogre::Vector3> >& movement,
|
|
|
|
float duration, bool paused)
|
2010-07-27 13:59:41 +00:00
|
|
|
{
|
|
|
|
if (!mWatched.isEmpty())
|
|
|
|
{
|
2010-08-03 09:49:12 +00:00
|
|
|
MWMechanics::CreatureStats& stats =
|
|
|
|
MWWorld::Class::get (mWatched).getCreatureStats (mWatched);
|
2010-07-28 16:48:01 +00:00
|
|
|
|
2010-09-21 15:42:07 +00:00
|
|
|
MWMechanics::NpcStats& npcStats =
|
|
|
|
MWWorld::Class::get (mWatched).getNpcStats (mWatched);
|
|
|
|
|
2010-07-27 13:59:41 +00:00
|
|
|
static const char *attributeNames[8] =
|
|
|
|
{
|
|
|
|
"AttribVal1", "AttribVal2", "AttribVal3", "AttribVal4", "AttribVal5",
|
|
|
|
"AttribVal6", "AttribVal7", "AttribVal8"
|
|
|
|
};
|
2010-07-28 16:48:01 +00:00
|
|
|
|
|
|
|
static const char *dynamicNames[3] =
|
|
|
|
{
|
|
|
|
"HBar", "MBar", "FBar"
|
|
|
|
};
|
|
|
|
|
2010-07-27 13:59:41 +00:00
|
|
|
for (int i=0; i<8; ++i)
|
|
|
|
{
|
2012-07-22 14:29:54 +00:00
|
|
|
if (stats.getAttribute(i)!=mWatchedCreature.getAttribute(i))
|
2010-07-27 13:59:41 +00:00
|
|
|
{
|
2012-07-22 14:29:54 +00:00
|
|
|
mWatchedCreature.setAttribute(i, stats.getAttribute(i));
|
2010-07-27 13:59:41 +00:00
|
|
|
|
2012-07-22 14:29:54 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->setValue (attributeNames[i], stats.getAttribute(i));
|
2010-07-27 13:59:41 +00:00
|
|
|
}
|
|
|
|
}
|
2010-07-28 16:48:01 +00:00
|
|
|
|
2012-07-22 14:29:54 +00:00
|
|
|
if (stats.getHealth() != mWatchedCreature.getHealth()) {
|
|
|
|
mWatchedCreature.setHealth(stats.getHealth());
|
|
|
|
MWBase::Environment::get().getWindowManager()->setValue(dynamicNames[0], stats.getHealth());
|
|
|
|
}
|
|
|
|
if (stats.getMagicka() != mWatchedCreature.getMagicka()) {
|
|
|
|
mWatchedCreature.setMagicka(stats.getMagicka());
|
|
|
|
MWBase::Environment::get().getWindowManager()->setValue(dynamicNames[1], stats.getMagicka());
|
|
|
|
}
|
|
|
|
if (stats.getFatigue() != mWatchedCreature.getFatigue()) {
|
|
|
|
mWatchedCreature.setFatigue(stats.getFatigue());
|
|
|
|
MWBase::Environment::get().getWindowManager()->setValue(dynamicNames[2], stats.getFatigue());
|
2010-07-28 16:48:01 +00:00
|
|
|
}
|
2010-09-15 13:32:35 +00:00
|
|
|
|
2010-09-21 15:42:07 +00:00
|
|
|
bool update = false;
|
|
|
|
|
2011-01-02 16:35:03 +00:00
|
|
|
//Loop over ESM::Skill::SkillEnum
|
|
|
|
for(int i = 0; i < 27; ++i)
|
2010-09-21 15:42:07 +00:00
|
|
|
{
|
2012-07-06 16:23:48 +00:00
|
|
|
if(npcStats.getSkill (i) != mWatchedNpc.getSkill (i))
|
2010-09-21 15:42:07 +00:00
|
|
|
{
|
|
|
|
update = true;
|
2012-07-06 16:23:48 +00:00
|
|
|
mWatchedNpc.getSkill (i) = npcStats.getSkill (i);
|
|
|
|
MWBase::Environment::get().getWindowManager()->setValue((ESM::Skill::SkillEnum)i, npcStats.getSkill (i));
|
2010-09-21 15:42:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (update)
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->updateSkillArea();
|
2010-09-21 15:42:07 +00:00
|
|
|
|
2012-07-22 14:29:54 +00:00
|
|
|
MWBase::Environment::get().getWindowManager()->setValue ("level", stats.getLevel());
|
2010-07-27 13:59:41 +00:00
|
|
|
}
|
2010-09-15 10:22:06 +00:00
|
|
|
|
2010-09-15 12:33:02 +00:00
|
|
|
if (mUpdatePlayer)
|
2010-09-15 10:22:06 +00:00
|
|
|
{
|
2010-09-15 12:33:02 +00:00
|
|
|
// basic player profile; should not change anymore after the creation phase is finished.
|
2012-11-05 17:19:22 +00:00
|
|
|
MWBase::WindowManager *winMgr =
|
|
|
|
MWBase::Environment::get().getWindowManager();
|
|
|
|
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
MWWorld::Player &player = world->getPlayer();
|
|
|
|
|
|
|
|
winMgr->setValue ("name", player.getName());
|
|
|
|
winMgr->setValue ("race", world->getStore().get<ESM::Race>().find (player.getRace())->mName);
|
|
|
|
winMgr->setValue ("class", player.getClass().mName);
|
|
|
|
|
2010-09-15 12:33:02 +00:00
|
|
|
mUpdatePlayer = false;
|
2010-09-21 15:42:07 +00:00
|
|
|
|
2012-08-12 16:11:09 +00:00
|
|
|
MWBase::WindowManager::SkillList majorSkills (5);
|
|
|
|
MWBase::WindowManager::SkillList minorSkills (5);
|
2010-09-21 15:42:07 +00:00
|
|
|
|
|
|
|
for (int i=0; i<5; ++i)
|
|
|
|
{
|
2012-11-05 17:19:22 +00:00
|
|
|
minorSkills[i] = player.getClass().mData.mSkills[i][0];
|
|
|
|
majorSkills[i] = player.getClass().mData.mSkills[i][1];
|
2010-09-21 15:42:07 +00:00
|
|
|
}
|
|
|
|
|
2012-11-05 17:19:22 +00:00
|
|
|
winMgr->configureSkills (majorSkills, minorSkills);
|
2010-09-15 10:22:06 +00:00
|
|
|
}
|
2011-02-03 10:43:29 +00:00
|
|
|
|
2012-03-30 15:01:55 +00:00
|
|
|
mActors.update (movement, duration, paused);
|
2010-07-27 12:46:05 +00:00
|
|
|
}
|
2010-09-13 20:59:28 +00:00
|
|
|
|
2012-09-21 15:53:16 +00:00
|
|
|
void MechanicsManager::restoreDynamicStats()
|
|
|
|
{
|
|
|
|
mActors.restoreDynamicStats ();
|
|
|
|
}
|
|
|
|
|
2010-09-13 20:59:28 +00:00
|
|
|
void MechanicsManager::setPlayerName (const std::string& name)
|
|
|
|
{
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setName (name);
|
2010-09-15 12:33:02 +00:00
|
|
|
mUpdatePlayer = true;
|
2010-09-13 20:59:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MechanicsManager::setPlayerRace (const std::string& race, bool male)
|
|
|
|
{
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setGender (male);
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setRace (race);
|
2010-09-26 08:01:30 +00:00
|
|
|
mRaceSelected = true;
|
2010-09-15 11:31:26 +00:00
|
|
|
buildPlayer();
|
2010-09-15 12:33:02 +00:00
|
|
|
mUpdatePlayer = true;
|
2010-09-13 20:59:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MechanicsManager::setPlayerBirthsign (const std::string& id)
|
|
|
|
{
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setBirthsign (id);
|
2010-09-15 11:31:26 +00:00
|
|
|
buildPlayer();
|
2010-10-22 23:28:30 +00:00
|
|
|
mUpdatePlayer = true;
|
2010-09-13 20:59:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MechanicsManager::setPlayerClass (const std::string& id)
|
|
|
|
{
|
2012-11-05 17:19:22 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setClass (
|
|
|
|
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find (id)
|
|
|
|
);
|
2010-09-26 08:01:30 +00:00
|
|
|
mClassSelected = true;
|
2010-09-15 11:31:26 +00:00
|
|
|
buildPlayer();
|
2010-09-15 12:33:02 +00:00
|
|
|
mUpdatePlayer = true;
|
2010-09-13 20:59:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MechanicsManager::setPlayerClass (const ESM::Class& class_)
|
|
|
|
{
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setClass (class_);
|
2010-09-26 08:01:30 +00:00
|
|
|
mClassSelected = true;
|
2010-09-15 11:31:26 +00:00
|
|
|
buildPlayer();
|
2010-09-15 12:33:02 +00:00
|
|
|
mUpdatePlayer = true;
|
2010-09-13 20:59:28 +00:00
|
|
|
}
|
2012-10-27 09:33:18 +00:00
|
|
|
|
|
|
|
int MechanicsManager::countDeaths (const std::string& id) const
|
|
|
|
{
|
|
|
|
return mActors.countDeaths (id);
|
|
|
|
}
|
2010-07-26 09:15:38 +00:00
|
|
|
}
|