mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-19 12:39:42 +00:00
Merge branch 'took_an_arrow_to_the_disposition_cap' into 'master'
Cap temporary disposition gain and compute permanent changes accordingly Closes #7224 See merge request OpenMW/openmw!2734
This commit is contained in:
commit
a0cea6569b
1 changed files with 20 additions and 18 deletions
|
@ -636,7 +636,7 @@ namespace MWMechanics
|
||||||
float playerRating1, playerRating2, playerRating3;
|
float playerRating1, playerRating2, playerRating3;
|
||||||
getPersuasionRatings(playerStats, playerRating1, playerRating2, playerRating3, true);
|
getPersuasionRatings(playerStats, playerRating1, playerRating2, playerRating3, true);
|
||||||
|
|
||||||
int currentDisposition = getDerivedDisposition(npc);
|
const int currentDisposition = getDerivedDisposition(npc);
|
||||||
|
|
||||||
float d = 1 - 0.02f * abs(currentDisposition - 50);
|
float d = 1 - 0.02f * abs(currentDisposition - 50);
|
||||||
float target1 = d * (playerRating1 - npcRating1 + 50);
|
float target1 = d * (playerRating1 - npcRating1 + 50);
|
||||||
|
@ -652,10 +652,10 @@ namespace MWMechanics
|
||||||
|
|
||||||
float target3 = d * (playerRating3 - npcRating3 + 50) + bribeMod;
|
float target3 = d * (playerRating3 - npcRating3 + 50) + bribeMod;
|
||||||
|
|
||||||
float iPerMinChance = floor(gmst.find("iPerMinChance")->mValue.getFloat());
|
const float iPerMinChance = gmst.find("iPerMinChance")->mValue.getFloat();
|
||||||
float iPerMinChange = floor(gmst.find("iPerMinChange")->mValue.getFloat());
|
const float iPerMinChange = gmst.find("iPerMinChange")->mValue.getFloat();
|
||||||
float fPerDieRollMult = gmst.find("fPerDieRollMult")->mValue.getFloat();
|
const float fPerDieRollMult = gmst.find("fPerDieRollMult")->mValue.getFloat();
|
||||||
float fPerTempMult = gmst.find("fPerTempMult")->mValue.getFloat();
|
const float fPerTempMult = gmst.find("fPerTempMult")->mValue.getFloat();
|
||||||
|
|
||||||
float x = 0;
|
float x = 0;
|
||||||
float y = 0;
|
float y = 0;
|
||||||
|
@ -748,21 +748,23 @@ namespace MWMechanics
|
||||||
x = success ? std::max(iPerMinChange, c) : c;
|
x = success ? std::max(iPerMinChange, c) : c;
|
||||||
}
|
}
|
||||||
|
|
||||||
tempChange = type == PT_Intimidate ? int(x) : int(x * fPerTempMult);
|
|
||||||
|
|
||||||
int cappedDispositionChange = tempChange;
|
|
||||||
if (currentDisposition + tempChange > 100)
|
|
||||||
cappedDispositionChange = 100 - currentDisposition;
|
|
||||||
if (currentDisposition + tempChange < 0)
|
|
||||||
{
|
|
||||||
cappedDispositionChange = -currentDisposition;
|
|
||||||
tempChange = cappedDispositionChange;
|
|
||||||
}
|
|
||||||
|
|
||||||
permChange = floor(cappedDispositionChange / fPerTempMult);
|
|
||||||
if (type == PT_Intimidate)
|
if (type == PT_Intimidate)
|
||||||
{
|
{
|
||||||
permChange = success ? -int(cappedDispositionChange / fPerTempMult) : int(y);
|
tempChange = int(x);
|
||||||
|
if (currentDisposition + tempChange > 100)
|
||||||
|
tempChange = 100 - currentDisposition;
|
||||||
|
else if (currentDisposition + tempChange < 0)
|
||||||
|
tempChange = -currentDisposition;
|
||||||
|
permChange = success ? -int(tempChange / fPerTempMult) : int(y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tempChange = int(x * fPerTempMult);
|
||||||
|
if (currentDisposition + tempChange > 100)
|
||||||
|
tempChange = 100 - currentDisposition;
|
||||||
|
else if (currentDisposition + tempChange < 0)
|
||||||
|
tempChange = -currentDisposition;
|
||||||
|
permChange = int(tempChange / fPerTempMult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue