@ -36,7 +36,7 @@ namespace
float getFightDispositionBias ( float disposition )
{
static const float fFightDispMult = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) . get < ESM : : GameSetting > ( ) . find (
" fFightDispMult " ) - > getFloat( ) ;
" fFightDispMult " ) - > mValue. getFloat( ) ;
return ( ( 50.f - disposition ) * fFightDispMult ) ;
}
@ -45,11 +45,11 @@ namespace
const MWWorld : : Store < ESM : : GameSetting > & gmst =
MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) . get < ESM : : GameSetting > ( ) ;
float persTerm = stats . getAttribute ( ESM : : Attribute : : Personality ) . getModified ( ) / gmst . find ( " fPersonalityMod " ) - > getFloat( ) ;
float luckTerm = stats . getAttribute ( ESM : : Attribute : : Luck ) . getModified ( ) / gmst . find ( " fLuckMod " ) - > getFloat( ) ;
float repTerm = stats . getReputation ( ) * gmst . find ( " fReputationMod " ) - > getFloat( ) ;
float persTerm = stats . getAttribute ( ESM : : Attribute : : Personality ) . getModified ( ) / gmst . find ( " fPersonalityMod " ) - > mValue. getFloat( ) ;
float luckTerm = stats . getAttribute ( ESM : : Attribute : : Luck ) . getModified ( ) / gmst . find ( " fLuckMod " ) - > mValue. getFloat( ) ;
float repTerm = stats . getReputation ( ) * gmst . find ( " fReputationMod " ) - > mValue. getFloat( ) ;
float fatigueTerm = stats . getFatigueTerm ( ) ;
float levelTerm = stats . getLevel ( ) * gmst . find ( " fLevelMod " ) - > getFloat( ) ;
float levelTerm = stats . getLevel ( ) * gmst . find ( " fLevelMod " ) - > mValue. getFloat( ) ;
rating1 = ( repTerm + luckTerm + persTerm + stats . getSkill ( ESM : : Skill : : Speechcraft ) . getModified ( ) ) * fatigueTerm ;
@ -342,7 +342,7 @@ namespace MWMechanics
if ( timeToDrown ! = mWatchedTimeToStartDrowning )
{
static const float fHoldBreathTime = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) . get < ESM : : GameSetting > ( )
. find ( " fHoldBreathTime " ) - > getFloat( ) ;
. find ( " fHoldBreathTime " ) - > mValue. getFloat( ) ;
mWatchedTimeToStartDrowning = timeToDrown ;
@ -543,12 +543,12 @@ namespace MWMechanics
const MWMechanics : : NpcStats & playerStats = playerPtr . getClass ( ) . getNpcStats ( playerPtr ) ;
const MWWorld : : Store < ESM : : GameSetting > & gmst = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) . get < ESM : : GameSetting > ( ) ;
static const float fDispRaceMod = gmst . find ( " fDispRaceMod " ) - > getFloat( ) ;
static const float fDispRaceMod = gmst . find ( " fDispRaceMod " ) - > mValue. getFloat( ) ;
if ( Misc : : StringUtils : : ciEqual ( npc - > mBase - > mRace , player - > mBase - > mRace ) )
x + = fDispRaceMod ;
static const float fDispPersonalityMult = gmst . find ( " fDispPersonalityMult " ) - > getFloat( ) ;
static const float fDispPersonalityBase = gmst . find ( " fDispPersonalityBase " ) - > getFloat( ) ;
static const float fDispPersonalityMult = gmst . find ( " fDispPersonalityMult " ) - > mValue. getFloat( ) ;
static const float fDispPersonalityBase = gmst . find ( " fDispPersonalityBase " ) - > mValue. getFloat( ) ;
x + = fDispPersonalityMult * ( playerStats . getAttribute ( ESM : : Attribute : : Personality ) . getModified ( ) - fDispPersonalityBase ) ;
float reaction = 0 ;
@ -592,20 +592,20 @@ namespace MWMechanics
rank = 0 ;
}
static const float fDispFactionRankMult = gmst . find ( " fDispFactionRankMult " ) - > getFloat( ) ;
static const float fDispFactionRankBase = gmst . find ( " fDispFactionRankBase " ) - > getFloat( ) ;
static const float fDispFactionMod = gmst . find ( " fDispFactionMod " ) - > getFloat( ) ;
static const float fDispFactionRankMult = gmst . find ( " fDispFactionRankMult " ) - > mValue. getFloat( ) ;
static const float fDispFactionRankBase = gmst . find ( " fDispFactionRankBase " ) - > mValue. getFloat( ) ;
static const float fDispFactionMod = gmst . find ( " fDispFactionMod " ) - > mValue. getFloat( ) ;
x + = ( fDispFactionRankMult * rank
+ fDispFactionRankBase )
* fDispFactionMod * reaction ;
static const float fDispCrimeMod = gmst . find ( " fDispCrimeMod " ) - > getFloat( ) ;
static const float fDispDiseaseMod = gmst . find ( " fDispDiseaseMod " ) - > getFloat( ) ;
static const float fDispCrimeMod = gmst . find ( " fDispCrimeMod " ) - > mValue. getFloat( ) ;
static const float fDispDiseaseMod = gmst . find ( " fDispDiseaseMod " ) - > mValue. getFloat( ) ;
x - = fDispCrimeMod * playerStats . getBounty ( ) ;
if ( playerStats . hasCommonDisease ( ) | | playerStats . hasBlightDisease ( ) )
x + = fDispDiseaseMod ;
static const float fDispWeaponDrawn = gmst . find ( " fDispWeaponDrawn " ) - > getFloat( ) ;
static const float fDispWeaponDrawn = gmst . find ( " fDispWeaponDrawn " ) - > mValue. getFloat( ) ;
if ( playerStats . getDrawState ( ) = = MWMechanics : : DrawState_Weapon )
x + = fDispWeaponDrawn ;
@ -673,16 +673,16 @@ namespace MWMechanics
float target2 = d * ( playerRating2 - npcRating2 + 50 ) ;
float bribeMod ;
if ( type = = PT_Bribe10 ) bribeMod = gmst . find ( " fBribe10Mod " ) - > getFloat( ) ;
else if ( type = = PT_Bribe100 ) bribeMod = gmst . find ( " fBribe100Mod " ) - > getFloat( ) ;
else bribeMod = gmst . find ( " fBribe1000Mod " ) - > getFloat( ) ;
if ( type = = PT_Bribe10 ) bribeMod = gmst . find ( " fBribe10Mod " ) - > mValue. getFloat( ) ;
else if ( type = = PT_Bribe100 ) bribeMod = gmst . find ( " fBribe100Mod " ) - > mValue. getFloat( ) ;
else bribeMod = gmst . find ( " fBribe1000Mod " ) - > mValue. getFloat( ) ;
float target3 = d * ( playerRating3 - npcRating3 + 50 ) + bribeMod ;
float iPerMinChance = floor ( gmst . find ( " iPerMinChance " ) - > getFloat( ) ) ;
float iPerMinChange = floor ( gmst . find ( " iPerMinChange " ) - > getFloat( ) ) ;
float fPerDieRollMult = gmst . find ( " fPerDieRollMult " ) - > getFloat( ) ;
float fPerTempMult = gmst . find ( " fPerTempMult " ) - > getFloat( ) ;
float iPerMinChance = floor ( gmst . find ( " iPerMinChance " ) - > mValue. getFloat( ) ) ;
float iPerMinChange = floor ( gmst . find ( " iPerMinChange " ) - > mValue. getFloat( ) ) ;
float fPerDieRollMult = gmst . find ( " fPerDieRollMult " ) - > mValue. getFloat( ) ;
float fPerTempMult = gmst . find ( " fPerTempMult " ) - > mValue. getFloat( ) ;
float x = 0 ;
float y = 0 ;
@ -867,7 +867,7 @@ namespace MWMechanics
continue ;
// All sMagicBound* GMST's should be of type string
std : : string currentGMSTValue = currentSetting . getString( ) ;
std : : string currentGMSTValue = currentSetting . mValue. getString( ) ;
Misc : : StringUtils : : lowerCaseInPlace ( currentGMSTValue ) ;
boundItemIDCache . insert ( currentGMSTValue ) ;
@ -1163,7 +1163,7 @@ namespace MWMechanics
osg : : Vec3f from ( player . getRefData ( ) . getPosition ( ) . asVec3 ( ) ) ;
const MWWorld : : ESMStore & esmStore = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ;
float radius = esmStore . get < ESM : : GameSetting > ( ) . find ( " fAlarmRadius " ) - > getFloat( ) ;
float radius = esmStore . get < ESM : : GameSetting > ( ) . find ( " fAlarmRadius " ) - > mValue. getFloat( ) ;
mActors . getObjectsInRange ( from , radius , neighbors ) ;
@ -1261,29 +1261,29 @@ namespace MWMechanics
float disp = 0.f , dispVictim = 0.f ;
if ( type = = OT_Trespassing | | type = = OT_SleepingInOwnedBed )
{
arg = store . find ( " iCrimeTresspass " ) - > getInt( ) ;
disp = dispVictim = store . find ( " iDispTresspass " ) - > getFloat( ) ;
arg = store . find ( " iCrimeTresspass " ) - > mValue. getInteger ( ) ;
disp = dispVictim = store . find ( " iDispTresspass " ) - > mValue. getFloat( ) ;
}
else if ( type = = OT_Pickpocket )
{
arg = store . find ( " iCrimePickPocket " ) - > getInt( ) ;
disp = dispVictim = store . find ( " fDispPickPocketMod " ) - > getFloat( ) ;
arg = store . find ( " iCrimePickPocket " ) - > mValue. getInteger ( ) ;
disp = dispVictim = store . find ( " fDispPickPocketMod " ) - > mValue. getFloat( ) ;
}
else if ( type = = OT_Assault )
{
arg = store . find ( " iCrimeAttack " ) - > getInt( ) ;
disp = store . find ( " iDispAttackMod " ) - > getFloat( ) ;
dispVictim = store . find ( " fDispAttacking " ) - > getFloat( ) ;
arg = store . find ( " iCrimeAttack " ) - > mValue. getInteger ( ) ;
disp = store . find ( " iDispAttackMod " ) - > mValue. getFloat( ) ;
dispVictim = store . find ( " fDispAttacking " ) - > mValue. getFloat( ) ;
}
else if ( type = = OT_Murder )
{
arg = store . find ( " iCrimeKilling " ) - > getInt( ) ;
disp = dispVictim = store . find ( " iDispKilling " ) - > getFloat( ) ;
arg = store . find ( " iCrimeKilling " ) - > mValue. getInteger ( ) ;
disp = dispVictim = store . find ( " iDispKilling " ) - > mValue. getFloat( ) ;
}
else if ( type = = OT_Theft )
{
disp = dispVictim = store . find ( " fDispStealing " ) - > getFloat( ) * arg ;
arg = static_cast < int > ( arg * store . find ( " fCrimeStealing " ) - > getFloat( ) ) ;
disp = dispVictim = store . find ( " fDispStealing " ) - > mValue. getFloat( ) * arg ;
arg = static_cast < int > ( arg * store . find ( " fCrimeStealing " ) - > mValue. getFloat( ) ) ;
arg = std : : max ( 1 , arg ) ; // Minimum bounty of 1, in case items with zero value are stolen
}
@ -1293,7 +1293,7 @@ namespace MWMechanics
const MWWorld : : ESMStore & esmStore = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) ;
osg : : Vec3f from ( player . getRefData ( ) . getPosition ( ) . asVec3 ( ) ) ;
float radius = esmStore . get < ESM : : GameSetting > ( ) . find ( " fAlarmRadius " ) - > getFloat( ) ;
float radius = esmStore . get < ESM : : GameSetting > ( ) . find ( " fAlarmRadius " ) - > mValue. getFloat( ) ;
mActors . getObjectsInRange ( from , radius , neighbors ) ;
@ -1307,21 +1307,21 @@ namespace MWMechanics
// Controls whether witnesses will engage combat with the criminal.
int fight = 0 , fightVictim = 0 ;
if ( type = = OT_Trespassing | | type = = OT_SleepingInOwnedBed )
fight = fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightTrespass " ) - > getInt( ) ;
fight = fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightTrespass " ) - > mValue. getInteger ( ) ;
else if ( type = = OT_Pickpocket )
{
fight = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightPickpocket " ) - > getInt( ) ;
fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightPickpocket " ) - > getInt( ) * 4 ; // *4 according to research wiki
fight = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightPickpocket " ) - > mValue. getInteger ( ) ;
fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightPickpocket " ) - > mValue. getInteger ( ) * 4 ; // *4 according to research wiki
}
else if ( type = = OT_Assault )
{
fight = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightAttacking " ) - > getInt( ) ;
fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightAttack " ) - > getInt( ) ;
fight = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightAttacking " ) - > mValue. getInteger ( ) ;
fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightAttack " ) - > mValue. getInteger ( ) ;
}
else if ( type = = OT_Murder )
fight = fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightKilling " ) - > getInt( ) ;
fight = fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " iFightKilling " ) - > mValue. getInteger ( ) ;
else if ( type = = OT_Theft )
fight = fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " fFightStealing " ) - > getInt( ) ;
fight = fightVictim = esmStore . get < ESM : : GameSetting > ( ) . find ( " fFightStealing " ) - > mValue. getInteger ( ) ;
bool reported = false ;
@ -1552,8 +1552,8 @@ namespace MWMechanics
& & ! MWBase : : Environment : : get ( ) . getWorld ( ) - > isSwimming ( ptr )
& & MWBase : : Environment : : get ( ) . getWorld ( ) - > isOnGround ( ptr ) )
{
static float fSneakSkillMult = store . find ( " fSneakSkillMult " ) - > getFloat( ) ;
static float fSneakBootMult = store . find ( " fSneakBootMult " ) - > getFloat( ) ;
static float fSneakSkillMult = store . find ( " fSneakSkillMult " ) - > mValue. getFloat( ) ;
static float fSneakBootMult = store . find ( " fSneakBootMult " ) - > mValue. getFloat( ) ;
float sneak = static_cast < float > ( ptr . getClass ( ) . getSkill ( ptr , ESM : : Skill : : Sneak ) ) ;
int agility = stats . getAttribute ( ESM : : Attribute : : Agility ) . getModified ( ) ;
int luck = stats . getAttribute ( ESM : : Attribute : : Luck ) . getModified ( ) ;
@ -1568,8 +1568,8 @@ namespace MWMechanics
sneakTerm = fSneakSkillMult * sneak + 0.2f * agility + 0.1f * luck + bootWeight * fSneakBootMult ;
}
static float fSneakDistBase = store . find ( " fSneakDistanceBase " ) - > getFloat( ) ;
static float fSneakDistMult = store . find ( " fSneakDistanceMultiplier " ) - > getFloat( ) ;
static float fSneakDistBase = store . find ( " fSneakDistanceBase " ) - > mValue. getFloat( ) ;
static float fSneakDistMult = store . find ( " fSneakDistanceMultiplier " ) - > mValue. getFloat( ) ;
osg : : Vec3f pos1 ( ptr . getRefData ( ) . getPosition ( ) . asVec3 ( ) ) ;
osg : : Vec3f pos2 ( observer . getRefData ( ) . getPosition ( ) . asVec3 ( ) ) ;
@ -1587,8 +1587,8 @@ namespace MWMechanics
float obsTerm = obsSneak + 0.2f * obsAgility + 0.1f * obsLuck - obsBlind ;
// is ptr behind the observer?
static float fSneakNoViewMult = store . find ( " fSneakNoViewMult " ) - > getFloat( ) ;
static float fSneakViewMult = store . find ( " fSneakViewMult " ) - > getFloat( ) ;
static float fSneakNoViewMult = store . find ( " fSneakNoViewMult " ) - > mValue. getFloat( ) ;
static float fSneakViewMult = store . find ( " fSneakViewMult " ) - > mValue. getFloat( ) ;
float y = 0 ;
osg : : Vec3f vec = pos1 - pos2 ;
if ( observer . getRefData ( ) . getBaseNode ( ) )
@ -1748,7 +1748,7 @@ namespace MWMechanics
MWBase : : Environment : : get ( ) . getWorld ( ) - > getGlobalInt ( " pcknownwerewolf " ) ) )
{
const ESM : : GameSetting * iWerewolfFightMod = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) . get < ESM : : GameSetting > ( ) . find ( " iWerewolfFightMod " ) ;
fight + = iWerewolfFightMod - > getInt( ) ;
fight + = iWerewolfFightMod - > mValue. getInteger ( ) ;
}
}
@ -1841,7 +1841,7 @@ namespace MWMechanics
// Witnesses of the player's transformation will make them a globally known werewolf
std : : vector < MWWorld : : Ptr > closeActors ;
const MWWorld : : Store < ESM : : GameSetting > & gmst = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) . get < ESM : : GameSetting > ( ) ;
getActorsInRange ( actor . getRefData ( ) . getPosition ( ) . asVec3 ( ) , gmst . find ( " fAlarmRadius " ) - > getFloat( ) , closeActors ) ;
getActorsInRange ( actor . getRefData ( ) . getPosition ( ) . asVec3 ( ) , gmst . find ( " fAlarmRadius " ) - > mValue. getFloat( ) , closeActors ) ;
bool detected = false , reported = false ;
for ( std : : vector < MWWorld : : Ptr > : : const_iterator it = closeActors . begin ( ) ; it ! = closeActors . end ( ) ; + + it )
@ -1866,7 +1866,7 @@ namespace MWMechanics
if ( reported )
{
npcStats . setBounty ( npcStats . getBounty ( ) +
gmst . find ( " iWereWolfBounty " ) - > getInt( ) ) ;
gmst . find ( " iWereWolfBounty " ) - > mValue. getInteger ( ) ) ;
windowManager - > messageBox ( " #{sCrimeMessage} " ) ;
}
}
@ -1878,7 +1878,7 @@ namespace MWMechanics
const MWWorld : : Store < ESM : : GameSetting > & gmst = MWBase : : Environment : : get ( ) . getWorld ( ) - > getStore ( ) . get < ESM : : GameSetting > ( ) ;
MWMechanics : : NpcStats & stats = actor . getClass ( ) . getNpcStats ( actor ) ;
stats . getSkill ( ESM : : Skill : : Acrobatics ) . setBase ( gmst . find ( " fWerewolfAcrobatics " ) - > getInt( ) ) ;
stats . getSkill ( ESM : : Skill : : Acrobatics ) . setBase ( gmst . find ( " fWerewolfAcrobatics " ) - > mValue. getInteger ( ) ) ;
}
void MechanicsManager : : cleanupSummonedCreature ( const MWWorld : : Ptr & caster , int creatureActorId )