mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
New feature: quest & intel map overlay
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23742&goto=353499&#msg_353499 Requires GameDir >= r2424 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8560 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -503,81 +503,6 @@ UINT16 GetSectorPopulation( INT16 sX, INT16 sY, BOOLEAN fWithMilitary )
|
||||
return population;
|
||||
}
|
||||
|
||||
// colour for a sector on the map
|
||||
// aType = 0: disease
|
||||
// aType = 1: weather
|
||||
INT32 GetMapColour( INT16 sX, INT16 sY, UINT8 aType )
|
||||
{
|
||||
if ( aType == 0 )
|
||||
{
|
||||
UINT16 population = GetSectorPopulation( sX, sY );
|
||||
|
||||
if ( population )
|
||||
{
|
||||
UINT8 sector = SECTOR( sX, sY );
|
||||
|
||||
SECTORINFO *pSectorInfo = &(SectorInfo[sector]);
|
||||
|
||||
// display sector information only if we know about infection there
|
||||
if ( pSectorInfo && ((pSectorInfo->usInfectionFlag & SECTORDISEASE_DIAGNOSED_PLAYER) || (gubFact[FACT_DISEASE_WHODATA_ACCESS] && pSectorInfo->usInfectionFlag & SECTORDISEASE_DIAGNOSED_WHO)) )
|
||||
{
|
||||
FLOAT infectedpercentage = (FLOAT)pSectorInfo->usInfected / (FLOAT)(population);
|
||||
|
||||
if ( infectedpercentage < 0.2f )
|
||||
return MAP_SHADE_DK_GREEN;
|
||||
else if ( infectedpercentage < 0.3f )
|
||||
return MAP_SHADE_MD_GREEN;
|
||||
else if ( infectedpercentage < 0.4f )
|
||||
return MAP_SHADE_LT_GREEN;
|
||||
else if ( infectedpercentage < 0.5f )
|
||||
return MAP_SHADE_DK_YELLOW;
|
||||
else if ( infectedpercentage < 0.6f )
|
||||
return MAP_SHADE_MD_YELLOW;
|
||||
else if ( infectedpercentage < 0.7f )
|
||||
return MAP_SHADE_LT_YELLOW;
|
||||
else if ( infectedpercentage < 0.8f )
|
||||
return MAP_SHADE_DK_RED;
|
||||
else if ( infectedpercentage < 0.9f )
|
||||
return MAP_SHADE_MD_RED;
|
||||
else
|
||||
return MAP_SHADE_LT_RED;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
// handle infection redistribution if people move from A to B (set sXB and sYB to negative values to simply remove infected people in A)
|
||||
void PopulationMove( INT16 sXA, INT16 sYA, INT16 sXB, INT16 sYB, UINT16 usAmount )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user