New Feature: Militia Volunteer Pool limits the number of militia we can train. Turned off by default.

GameDir >= r2210 is recommended.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7746 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-02-22 18:52:41 +00:00
parent caf482614a
commit c7c085b04f
17 changed files with 165 additions and 6 deletions
+10 -1
View File
@@ -28,6 +28,7 @@
// HEADROCK HAM 3.6: Added for facility string printing...
#include "PopUpBox.h"
#include "CampaignStats.h" // added by Flugente
#include "Town Militia.h" // added by Flugente
#endif
#include "postalservice.h"
@@ -391,10 +392,18 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
//if ( ubTraverseType == )
if ( GetTownIdForSector( sMapX, sMapY ) != BLANK_SECTOR )
UINT8 townid = GetTownIdForSector( sMapX, sMapY );
if ( townid != BLANK_SECTOR )
{
// first liberation of a town sector -> special texts
gCurrentIncident.usIncidentFlags |= INCIDENT_FIRST_LIBERATION;
// liberating a town sector for the first time grants us an initial wave of volunteers
UINT16 population = GetSectorPopulation( sMapX, sMapY );
FLOAT loyalpopulation = gTownLoyalty[townid].ubRating * population / 100;
AddVolunteers( loyalpopulation * gGameExternalOptions.dMilitiaVolunteerGainFactorLiberation );
}
}