Merged revision(s) 6997-6998 from branches/ja2_source_official_2014:

- Campaign stats take spy actions and SAM sabotages into account
- spy encounters are not reproted if nothing of interest happened
- Fix: error in food system automatic canteen refill
- Fix: if min enemy group size is too high, the AI never replensishes garrisons, thereby severely dumbing down the game.
- Fix: enemy groups do not receive minimum size
- Fix: enemy groups sizes are cut down needlessly


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6999 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-03-01 01:48:43 +00:00
parent 618b1c1f8a
commit 3ae95a6c20
17 changed files with 156 additions and 37 deletions
+26 -2
View File
@@ -698,9 +698,19 @@ void RenderCampaignHistory_MostImportant()
if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X;
}
if ( incident.usIncidentFlags & INCIDENT_BUILDINGS_DAMAGED )
if ( incident.usIncidentFlags & INCIDENT_SAMSITE_SABOTAGED )
{
swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_BUILDINGDAMAGE], incident.usKills[CAMPAIGNHISTORY_SD_CIV], incident.usWounds[CAMPAIGNHISTORY_SD_CIV] );
swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_SAMSITESABOTAGED] );
usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0);
if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X;
}
else if ( incident.usIncidentFlags & INCIDENT_BUILDINGS_DAMAGED )
{
if ( incident.usKills[CAMPAIGNHISTORY_SD_CIV] + incident.usWounds[CAMPAIGNHISTORY_SD_CIV] > 0 )
swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_BUILDINGANDCIVDAMAGE], incident.usKills[CAMPAIGNHISTORY_SD_CIV], incident.usWounds[CAMPAIGNHISTORY_SD_CIV] );
else
swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_BUILDINGDAMAGE] );
usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0);
if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X;
}
@@ -758,6 +768,20 @@ void RenderCampaignHistory_MostImportant()
if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X;
}
if ( incident.usIncidentFlags & INCIDENT_SPYACTION_ENEMY )
{
swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_SPY_ENEMY] );
usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0);
if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X;
}
if ( incident.usIncidentFlags & INCIDENT_SPYACTION_PLAYERSIDE )
{
swprintf(sText, szCampaignHistoryDetail[TEXT_CAMPAIGNHISTORY_DETAIL_SPY_PLAYER] );
usPosY += DisplayWrappedString( usPosX, usPosY, LAPTOP_SCREEN_LR_X - usPosX, 2, CAMPHIS_FONT_SMALL, CAMPAIGN_HISTORY_FONT_COLOR_REGULAR,sText, FONT_MCOLOR_BLACK, FALSE, 0);
if ( picend < usPosY ) usPosX = LAPTOP_SCREEN_UL_X;
}
{
// team losses
UINT16 rebellosses = incident.usKills[CAMPAIGNHISTORY_SD_MERC] + incident.usKills[CAMPAIGNHISTORY_SD_MILITIA_GREEN] + incident.usKills[CAMPAIGNHISTORY_SD_MILITIA_REGULAR] + incident.usKills[CAMPAIGNHISTORY_SD_MILITIA_ELITE];
+28 -1
View File
@@ -87,7 +87,8 @@ Incident_Stats::CalcInterestRating()
if ( usIncidentFlags & INCIDENT_BUILDINGS_DAMAGED ) usInterestRating += 100;
if ( usIncidentFlags & INCIDENT_WIN ) usInterestRating += 100;
else usInterestRating += 200;
if ( usIncidentFlags & INCIDENT_SAMSITE_SABOTAGED ) usInterestRating += 1500;
if ( usOneTimeEventFlags & INCIDENT_ONETIMEEVENT_OMERTA ) usInterestRating += 1000;
if ( usOneTimeEventFlags & INCIDENT_ONETIMEEVENT_DEATH_KINGPIN ) usInterestRating += 500;
if ( usOneTimeEventFlags & (INCIDENT_ONETIMEEVENT_MASSACRE_HICKS|INCIDENT_ONETIMEEVENT_MASSACRE_BLOODCATS) ) usInterestRating += 800;
@@ -688,6 +689,32 @@ Campaign_Stats::AddConsumption(UINT8 aType, FLOAT aVal)
// add this incident to the campaign stats and then clear it
void FinishIncident(INT16 sX, INT16 sY, INT8 sZ)
{
// it is possible to enter a combat without any real fighting.
// For now, lets just assume this happens with undetected spies. If nothing of interest happened, don't add this incident (it would be boring to read anyway)
if ( gCurrentIncident.usIncidentFlags & (INCIDENT_SPYACTION_ENEMY|INCIDENT_SPYACTION_PLAYERSIDE) && !(gCurrentIncident.usIncidentFlags & INCIDENT_SPYACTION_UNCOVERED) )
{
// if noting of interest happened...
if ( !(gCurrentIncident.usIncidentFlags & INCIDENT_EVENT) && gCurrentIncident.usOneTimeEventFlags == 0 )
{
UINT16 i = 0;
// if nobody was harmed...
for (i = 0; i < CAMPAIGNHISTORY_SD_MAX; ++i)
{
if ( gCurrentIncident.usKills[i] || gCurrentIncident.usWounds[i] || gCurrentIncident.usPrisoners[i] )
break;
}
if ( i == CAMPAIGNHISTORY_SD_MAX )
{
// totally boring. Don't add this, just clean it an exit
gCurrentIncident.clear();
return;
}
}
}
// due to odd coding, we do not know when an incident starts
// (checking for entering combat isn't enough, as we do that multiple times per battle)
// we thus set the relevant data when finishing an incident
+7 -5
View File
@@ -45,15 +45,17 @@
#define INCIDENT_WIN 0x01000000 //16777216 // player won battle (otherwise he lost)
#define INCIDENT_OMERTA_LANDING 0x02000000 //33554432 // omerta landing
#define INCIDENT_FIRST_LIBERATION 0x04000000 //67108864 // first time we free a sector
/*#define PLAYER_NET_4_LVL_3 0x08000000 //134217728
#define INCIDENT_SAMSITE_SABOTAGED 0x08000000 //134217728 // SAM site controls were destroyed
#define PLAYER_NET_1_LVL_4 0x10000000 //268435456
#define PLAYER_NET_2_LVL_4 0x20000000 //536870912
#define WH40K_SOLDIER_ILLUSION 0x40000000 //1073741824 // Soldier is an Illusion
#define WH40K_SOLDIER_KILLTHISTURN 0x80000000 //2147483648 // Soldier is on a kill streak*/
#define INCIDENT_SPYACTION_ENEMY 0x10000000 //268435456 // side used spies. Depending on the other actions, this report might not even show up, as nobody knows there WAS any action...
#define INCIDENT_SPYACTION_PLAYERSIDE 0x20000000 //536870912
#define INCIDENT_SPYACTION_UNCOVERED 0x40000000 //1073741824 // a spy was uncovered
//#define WH40K_SOLDIER_KILLTHISTURN 0x80000000 //2147483648 // Soldier is on a kill streak
#define INCIDENT_PLAYER_ALLDIRS (INCIDENT_ATTACKDIR_NORTH|INCIDENT_ATTACKDIR_WEST|INCIDENT_ATTACKDIR_SOUTH|INCIDENT_ATTACKDIR_EAST)
#define INCIDENT_ENEMY_ALLDIRS (INCIDENT_ATTACKDIR_NORTH_ENEMY|INCIDENT_ATTACKDIR_WEST_ENEMY|INCIDENT_ATTACKDIR_SOUTH_ENEMY|INCIDENT_ATTACKDIR_EAST_ENEMY)
#define INCIDENT_EVENT 0x0E00FF3F // any interesting event that might have happened
// ----------------------------------------------------------------
// -------- added by Flugente: flags for one time events that commence an individual report --------