- Adjustment: Now it is possible for merc to sleep only 3 hours (instead of 6) (by Buggler)

o e.g: Razor should sleep only 3 hours

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6357 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-09-04 16:56:10 +00:00
parent 3b8ba34ecf
commit db7b59f742
+13 -10
View File
@@ -4385,7 +4385,7 @@ void RestCharacter( SOLDIERTYPE *pSoldier )
INT8 bDivisor = 0;
// Determine how many hours a day this merc must sleep. Normally this would range between 6 and 12 hours.
// Injuries and/or martial arts trait can change the limits to between 4 and 18 hours a day.
// Injuries and/or martial arts trait can change the limits to between 3 and 18 hours a day.
bDivisor = CalcSoldierNeedForSleep( pSoldier );
// HEADROCK HAM 3.6:
@@ -4413,14 +4413,14 @@ void RestCharacter( SOLDIERTYPE *pSoldier )
// Re-enforce limits
bDivisor = __min(18, __max(4, bDivisor));
bDivisor = __min(18, __max(3, bDivisor));
bMaxBreathRegain = 50 / bDivisor;
// Limit so that characters can't regain faster than 4 hours, ever
if (bMaxBreathRegain > 12)
// Limit so that characters can't regain faster than 3 hours, ever
if (bMaxBreathRegain > 17)
{
bMaxBreathRegain = 12;
bMaxBreathRegain = 17;
}
// if breath max is below the "really tired" threshold
@@ -14188,10 +14188,10 @@ UINT8 CalcSoldierNeedForSleep( SOLDIERTYPE *pSoldier )
ubNeedForSleep = 12;
}
// Enforce a minimum of 6 hours, before night/day considerations.
if ( ubNeedForSleep < 6 )
// Enforce a minimum of 3 hours, before night/day considerations.
if ( ubNeedForSleep < 3 )
{
ubNeedForSleep = 6;
ubNeedForSleep = 3;
}
// HEADROCK HAM 3.5: WTF! This calculation is NOT correct!
//ubPercentHealth = pSoldier->stats.bLife / pSoldier->stats.bLifeMax;
@@ -14228,14 +14228,17 @@ UINT8 CalcSoldierNeedForSleep( SOLDIERTYPE *pSoldier )
if (HAS_SKILL_TRAIT( pSoldier, NIGHT_OPS_NT ))
ubNeedForSleep -= gSkillTraitValues.ubNONeedForSleepReduction;
if ( ubNeedForSleep < 4 )
ubNeedForSleep = 4;
if ( ubNeedForSleep < 3 )
ubNeedForSleep = 3;
}
else
{
// HEADROCK HAM 3.6: This is now split and applied depending on whether the merc is resting or working.
//ubNeedForSleep -= NUM_SKILL_TRAITS( pSoldier, NIGHTOPS );
ubNeedForSleep -= NUM_SKILL_TRAITS( pSoldier, MARTIALARTS_OT );
if ( ubNeedForSleep < 3 )
ubNeedForSleep = 3;
}
// Flugente: ubNeedForSleep can now be influenced by our food situation