- New feature: sector fortification allows to construct structures in sectors in a much easier way than by using amerc to build 'by hand'. Fortification nodes are in a subfolder in Profiles and can easily be altered and exchanged, even in an ongoing game.

Fully savegame compatible.
GameDir >= r2296 is recommended, but not required.
- Cleaned up cover display functions.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8094 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-03-06 12:44:57 +00:00
parent 7e7476a4ea
commit 12ae810316
36 changed files with 5175 additions and 3307 deletions
+31 -6
View File
@@ -51,7 +51,10 @@ structureconstructStartElementHandle(void *userData, const XML_Char *name, const
else if(pData->curElement == ELEMENT &&
(strcmp(name, "usCreationItem") == 0 ||
strcmp(name, "usItemStatusLoss") == 0 ||
strcmp(name, "szTileSetName") == 0 ||
strcmp(name, "szTileSetDisplayName") == 0 ||
strcmp(name, "szTileSetName" ) == 0 ||
strcmp(name, "dCreationCost" ) == 0 ||
strcmp(name, "fFortifyAdjacentAdjustment" ) == 0 ||
strcmp(name, "northfacingtile") == 0 ||
strcmp(name, "southfacingtile" ) == 0 ||
strcmp(name, "eastfacingtile" ) == 0 ||
@@ -107,7 +110,10 @@ structureconstructEndElementHandle(void *userData, const XML_Char *name)
// for now, copy over the content by hand
pData->curArray[structureconstructcnt].usCreationItem = pData->curFood.usCreationItem;
pData->curArray[structureconstructcnt].usItemStatusLoss= pData->curFood.usItemStatusLoss;
strncpy(pData->curArray[structureconstructcnt].szTileSetName, pData->curFood.szTileSetName, 20);
strncpy( pData->curArray[structureconstructcnt].szTileSetDisplayName, pData->curFood.szTileSetDisplayName, 20 );
strncpy( pData->curArray[structureconstructcnt].szTileSetName, pData->curFood.szTileSetName, 20 );
pData->curArray[structureconstructcnt].dCreationCost = pData->curFood.dCreationCost;
pData->curArray[structureconstructcnt].fFortifyAdjacentAdjustment = pData->curFood.fFortifyAdjacentAdjustment;
pData->curArray[structureconstructcnt].northtilevector = staticnorthtilevector;
pData->curArray[structureconstructcnt].southtilevector = staticsouthtilevector;
pData->curArray[structureconstructcnt].easttilevector = staticeasttilevector;
@@ -136,11 +142,27 @@ structureconstructEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curFood.usItemStatusLoss = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "szTileSetName") == 0)
else if(strcmp(name, "szTileSetDisplayName") == 0)
{
pData->curElement = ELEMENT;
strncpy(pData->curFood.szTileSetName, pData->szCharData, 20);
strncpy( pData->curFood.szTileSetDisplayName, pData->szCharData, 20 );
}
else if ( strcmp( name, "szTileSetName" ) == 0 )
{
pData->curElement = ELEMENT;
strncpy( pData->curFood.szTileSetName, pData->szCharData, 20 );
}
else if ( strcmp( name, "dCreationCost" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curFood.dCreationCost = (FLOAT)atof( pData->szCharData );
}
else if ( strcmp( name, "fFortifyAdjacentAdjustment" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curFood.fFortifyAdjacentAdjustment = (BOOLEAN)atol( pData->szCharData );
}
else if(strcmp(name, "northfacingtile") == 0)
{
@@ -251,8 +273,11 @@ BOOLEAN WriteStructureConstructStats()
FilePrintf(hFile,"\t\t<usCreationItem>%d</usCreationItem>\r\n", gStructureConstruct[cnt].usCreationItem );
FilePrintf(hFile,"\t\t<usItemStatusLoss>%d</usItemStatusLoss>\r\n", gStructureConstruct[cnt].usItemStatusLoss );
FilePrintf(hFile,"\t\t<szTileSetName>%s</szTileSetName>\r\n", gStructureConstruct[cnt].szTileSetName );
FilePrintf(hFile,"\t\t<szTileSetDisplayName>%s</szTileSetDisplayName>\r\n", gStructureConstruct[cnt].szTileSetDisplayName );
FilePrintf(hFile,"\t\t<szTileSetName>%s</szTileSetName>\r\n", gStructureConstruct[cnt].szTileSetName );
FilePrintf(hFile,"\t\t<dCreationCost>%d</dCreationCost>\r\n", gStructureConstruct[cnt].dCreationCost );
FilePrintf(hFile,"\t\t<fFortifyAdjacentAdjustment>%d</fFortifyAdjacentAdjustment>\r\n", gStructureConstruct[cnt].fFortifyAdjacentAdjustment );
FilePrintf(hFile,"\t</STRUCTURE>\r\n");
}
FilePrintf(hFile,"</STRUCTURESLIST>\r\n");