From 7b00af164bf81c50a57471ff3a0ba8f7b52d093a Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 25 Jul 2017 20:46:28 +0000 Subject: [PATCH] - mercs are now used as prison guards regardless of sleep state - volunteers are now gained with a logarithmic rate, as otherwise the volunteer feature becomes pointless lategame For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=22559&goto=350394&#msg_350394 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8431 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 7 ++++--- Strategic/Town Militia.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 830431114..9a2b22264 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -3140,8 +3140,9 @@ UINT32 CalculatePrisonGuardValue(SOLDIERTYPE *pSoldier ) // this is not an assignment. Simply being in the sector will allow us to be counted as guards UINT32 usValue = 0; - if ( pSoldier->flags.fMercAsleep ) - return 0; + // for simplicity, ignore sleep status (forcing the player to finetune sleeping is annoying) + /*if ( psoldier->flags.fMercAsleep ) + return 0;*/ // anv: undercover snitches don't count as guards as they don't guard in traditional sense if ( pSoldier->bAssignment == FACILITY_PRISON_SNITCH ) @@ -3214,7 +3215,7 @@ UINT32 CalculateAllGuardsValueInPrison( INT16 sMapX, INT16 sMapY, INT8 bZ ) UINT32 lastid = gTacticalStatus.Team[ OUR_TEAM ].bLastID; for ( uiCnt = firstid, pSoldier = MercPtrs[ uiCnt ]; uiCnt <= lastid; ++uiCnt, ++pSoldier) { - if( pSoldier->bActive && ( pSoldier->sSectorX == sMapX ) && ( pSoldier->sSectorY == sMapY ) && ( pSoldier->bSectorZ == bZ) && !pSoldier->flags.fMercAsleep ) + if( pSoldier->bActive && ( pSoldier->sSectorX == sMapX ) && ( pSoldier->sSectorY == sMapY ) && ( pSoldier->bSectorZ == bZ) ) { prisonguardvalue += CalculatePrisonGuardValue(pSoldier ); } diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp index e8562ed09..a172e25ec 100644 --- a/Strategic/Town Militia.cpp +++ b/Strategic/Town Militia.cpp @@ -2598,14 +2598,14 @@ FLOAT CalcHourlyVolunteerGain() UINT8 ubTownID = StrategicMap[CALCULATE_STRATEGIC_INDEX( sX, sY )].bNameId; if ( ubTownID != BLANK_SECTOR ) { - UINT16 population = GetSectorPopulation( sX, sY ); + UINT16 population = GetSectorPopulation( sX, sY, FALSE ); loyalpopulation += gTownLoyalty[ubTownID].ubRating * population / 100; } } } - FLOAT hourlygain = loyalpopulation * populationmodifier * gGameExternalOptions.dMilitiaVolunteerGainFactorHourly; + FLOAT hourlygain = log( 1.0 + loyalpopulation * populationmodifier * gGameExternalOptions.dMilitiaVolunteerGainFactorHourly); return hourlygain; }