New feature: localized weather adds more weather types, different weather can happen in different sectors at the same time.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23094&#msg_345949

Requires GameDir >= r2325

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8253 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-06-18 20:57:03 +00:00
parent facadda6e8
commit 503523a9fa
40 changed files with 1059 additions and 522 deletions
+35 -2
View File
@@ -20,6 +20,7 @@
#include "DynamicDialogue.h"
#include <math.h>
#include "Drugs And Alcohol.h" // for DoesMercHaveDisability( ... )
#include "environment.h"
//GLOBALS
DISEASE Disease[NUM_DISEASES];
@@ -503,9 +504,11 @@ UINT16 GetSectorPopulation( INT16 sX, INT16 sY, BOOLEAN fWithMilitary )
}
// colour for a sector on the map
INT32 GetMapColour( INT16 sX, INT16 sY, BOOLEAN aDiseaseOn )
// aType = 0: disease
// aType = 1: weather
INT32 GetMapColour( INT16 sX, INT16 sY, UINT8 aType )
{
if ( aDiseaseOn )
if ( aType == 0 )
{
UINT16 population = GetSectorPopulation( sX, sY );
@@ -541,6 +544,36 @@ INT32 GetMapColour( INT16 sX, INT16 sY, BOOLEAN aDiseaseOn )
}
}
}
else if ( aType == 1 )
{
UINT8 sector = SECTOR( sX, sY );
SECTORINFO *pSectorInfo = &(SectorInfo[sector]);
// display sector information only if we know about infection there
if ( pSectorInfo )
{
switch ( pSectorInfo->usWeather )
{
case WEATHER_FORECAST_RAIN:
return MAP_SHADE_LT_CYAN;
break;
case WEATHER_FORECAST_THUNDERSHOWERS:
return MAP_SHADE_LT_BLUE;
break;
case WEATHER_FORECAST_SANDSTORM:
return MAP_SHADE_ORANGE;
break;
case WEATHER_FORECAST_SNOW:
return MAP_SHADE_LT_GREY;
break;
case WEATHER_FORECAST_NORMAL:
default:
return MAP_SHADE_BLACK;
break;
}
}
}
return MAP_SHADE_DK_GREY;
}