implemented skill value handling during character creation (untested)

actorid
Marc Zinnschlag 14 years ago
parent bd983717de
commit be8f852663

@ -119,6 +119,9 @@ namespace MWClass
stats->mFactionRank[ref->base->faction] = 0;
}
for (int i=0; i<27; ++i)
stats->mSkill[i].setBase (ref->base->npdt52.skills[i]);
ptr.getRefData().getNpcStats() = stats;
}

@ -16,13 +16,16 @@ namespace MWMechanics
MWWorld::Ptr ptr = mEnvironment.mWorld->getPlayerPos().getPlayer();
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
// MWMechanics::NpcStats& npcStats = MWWorld::Class::get (ptr).getNpcStats (ptr);
MWMechanics::NpcStats& npcStats = MWWorld::Class::get (ptr).getNpcStats (ptr);
const ESM::NPC *player = ptr.get<ESM::NPC>()->base;
// reset
creatureStats.mLevel = player->npdt52.level;
for (int i=0; i<27; ++i)
npcStats.mSkill[i].setBase (player->npdt52.skills[i]);
// race
const ESM::Race *race =
mEnvironment.mWorld->getStore().races.find (mEnvironment.mWorld->getPlayerPos().getRace());
@ -48,6 +51,16 @@ namespace MWMechanics
static_cast<int> (male ? attribute->male : attribute->female));
}
for (int i=0; i<7; ++i)
{
int index = race->data.bonus[i].skill;
if (index>=0 && index<27)
{
npcStats.mSkill[i].setBase (
npcStats.mSkill[i].getBase() + race->data.bonus[i].bonus);
}
}
// birthsign
@ -66,6 +79,7 @@ namespace MWMechanics
}
// calculate dynamic stats
int strength = creatureStats.mAttributes[0].getBase();
int intelligence = creatureStats.mAttributes[1].getBase();

@ -3,6 +3,8 @@
#include <map>
#include "stat.hpp"
namespace MWMechanics
{
/// \brief Additional stats for NPCs
@ -14,6 +16,8 @@ namespace MWMechanics
// NPCs other than the player can only have one faction. But for the sake of consistency
// we use the same data structure for the PC and the NPCs.
std::map<std::string, int> mFactionRank;
Stat<float> mSkill[27];
};
}

Loading…
Cancel
Save