From 5b0cb097cfe4e464426e955498873b78f632780a Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 15 Sep 2010 13:41:39 +0200 Subject: [PATCH] calculate dynamic stats during character creation --- apps/openmw/mwmechanics/mechanicsmanager.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/openmw/mwmechanics/mechanicsmanager.cpp b/apps/openmw/mwmechanics/mechanicsmanager.cpp index 73457e2f2f..8352c6ab4c 100644 --- a/apps/openmw/mwmechanics/mechanicsmanager.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanager.cpp @@ -38,7 +38,19 @@ namespace MWMechanics // class // calculate dynamic stats + int strength = creatureStats.mAttributes[0].getBase(); + int intelligence = creatureStats.mAttributes[1].getBase(); + int willpower = creatureStats.mAttributes[2].getBase(); + int agility = creatureStats.mAttributes[3].getBase(); + int endurance = creatureStats.mAttributes[5].getBase(); + creatureStats.mDynamic[0].setBase (static_cast (0.5 * (strength + endurance))); + // TODO: calculate factor + creatureStats.mDynamic[1].setBase (static_cast (intelligence + 1 * intelligence)); + creatureStats.mDynamic[2].setBase (strength+willpower+agility+endurance); + + for (int i=0; i<3; ++i) + creatureStats.mDynamic[i].setCurrent (creatureStats.mDynamic[i].getModified()); } MechanicsManager::MechanicsManager (MWWorld::Environment& environment)