New feature: food system requires mercs to eat and drink in order to survive

- food and water levels are lowered every hour, eat food to survive
- not doing so leads to various penalties and ultimately death
- added food items for that purpose. Food can degrade over time. Rotten food poisons.
- Mercs automatically consume food if hungry/thirsty and food is in their inventories
- for more info, see http://www.bears-pit.com/board/ubbthreads.php/topics/307396/Re_Mercs_need_food_and_water_t.html#Post307396
- this feature requires new STI files from the GameDir trunk.

- added a bunch of filler variable to the soldier type, so hopefully savegame compatibility can be maintained easier in the future.

WARNING: This will break savegame compatibility

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5411 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-07-21 16:41:04 +00:00
parent b95d001812
commit f6bf6bf4aa
54 changed files with 2660 additions and 144 deletions
+26 -1
View File
@@ -19,6 +19,9 @@
// Four different sector names, used at different times.
extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH];
// Flugente: To determine wether a sector has water in it.
extern UINT8 gSectorWaterType[256][4];
// moved to lua
//extern CHAR16 gzSectorUndergroundNames1[256][4][MAX_SECTOR_NAME_LENGTH];
//extern CHAR16 gzSectorUndergroundNames2[256][4][MAX_SECTOR_NAME_LENGTH];
@@ -42,6 +45,7 @@ typedef struct
CHAR16 szCurDetailedUnexploredName[MAX_SECTOR_NAME_LENGTH];
CHAR16 szCurExploredName[MAX_SECTOR_NAME_LENGTH];
CHAR16 szCurDetailedExploredName[MAX_SECTOR_NAME_LENGTH];
UINT8 sWaterType;
UINT32 currentDepth;
UINT32 maxReadDepth;
} SectorNameParseData;
@@ -66,6 +70,10 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char **
// Initiate Array by setting first character to 0.
for (UINT16 x = 0; x < 256; x++)
{
gSectorWaterType[x][0] = 0;
gSectorWaterType[x][1] = 0;
gSectorWaterType[x][2] = 0;
gSectorWaterType[x][3] = 0;
if (Sector_Level == 0 )
{
@@ -112,7 +120,8 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char **
strcmp(name, "szUnexploredName") == 0 ||
strcmp(name, "szDetailedUnexploredName") == 0 ||
strcmp(name, "szExploredName") == 0 ||
strcmp(name, "szDetailedExploredName") == 0 ))
strcmp(name, "szDetailedExploredName") == 0 ||
strcmp(name, "sWaterType") == 0 ))
{
pData->curElement = SECTORNAME_ELEMENT;
@@ -164,6 +173,11 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
wcscpy(gzSectorNames[ubSectorId][1], pData->szCurDetailedUnexploredName);
wcscpy(gzSectorNames[ubSectorId][2], pData->szCurExploredName);
wcscpy(gzSectorNames[ubSectorId][3], pData->szCurDetailedExploredName);
gSectorWaterType[ubSectorId][0] = pData->sWaterType;
gSectorWaterType[ubSectorId][1] = pData->sWaterType;
gSectorWaterType[ubSectorId][2] = pData->sWaterType;
gSectorWaterType[ubSectorId][3] = pData->sWaterType;
}
// moved to lua
//else if (Sector_Level == 1 )
@@ -196,6 +210,11 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
wcscpy(gzSectorNames[ubSectorId][1], pData->szCurDetailedUnexploredName);
wcscpy(gzSectorNames[ubSectorId][2], pData->szCurExploredName);
wcscpy(gzSectorNames[ubSectorId][3], pData->szCurDetailedExploredName);
gSectorWaterType[ubSectorId][0] = pData->sWaterType;
gSectorWaterType[ubSectorId][1] = pData->sWaterType;
gSectorWaterType[ubSectorId][2] = pData->sWaterType;
gSectorWaterType[ubSectorId][3] = pData->sWaterType;
}
// moved to lua
//else if (Sector_Level == 1 )
@@ -268,6 +287,12 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
pData->szCurDetailedExploredName[sizeof(pData->szCurDetailedExploredName)/sizeof(pData->szCurDetailedExploredName[0]) - 1] = '\0';
}
else if(strcmp(name, "sWaterType") == 0)
{
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
pData->sWaterType = (UINT8) atol(pData->szCharData);
}
pData->maxReadDepth--;
}