New feature: Diseaes affect your mercenaries. They can be contracted in varíous ways and have varying effects.

For more info, see http://www.ja-galaxy-forum.com/ubbthreads.php/topics/334918#Post334918

Requires GameDir >= r2099.

Does not break savegame compatibility.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7384 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-08-10 13:45:11 +00:00
parent 09244c2369
commit 36e9d15edc
96 changed files with 5569 additions and 1573 deletions
+26 -1
View File
@@ -281,7 +281,9 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "SleepModifier") == 0 ||
strcmp(name, "usSpotting") == 0 ||
strcmp(name, "sBackpackWeightModifier") == 0 ||
strcmp(name, "fAllowClimbing") == 0))
strcmp(name, "fAllowClimbing") == 0 ||
strcmp(name, "diseaseprotectionface" ) == 0 ||
strcmp(name, "diseaseprotectionhand" ) == 0))
{
pData->curElement = ELEMENT_PROPERTY;
//DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("itemStartElementHandle: going into element, name = %s",name) );
@@ -1457,6 +1459,23 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.fAllowClimbing = (BOOLEAN)atol(pData->szCharData);
}
// Flugente: simple tags in the xml get translated into flags
else if ( strcmp( name, "diseaseprotectionface" ) == 0 )
{
pData->curElement = ELEMENT;
BOOLEAN val = (BOOLEAN)atol( pData->szCharData );
if ( val )
pData->curItem.usItemFlag |= DISEASEPROTECTION_FACE;
}
else if ( strcmp( name, "diseaseprotectionhand" ) == 0 )
{
pData->curElement = ELEMENT;
BOOLEAN val = (BOOLEAN)atol( pData->szCharData );
if ( val )
pData->curItem.usItemFlag |= DISEASEPROTECTION_HAND;
}
pData->maxReadDepth--;
}
@@ -2102,6 +2121,12 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<usSpotting>%d</usSpotting>\r\n", Item[cnt].usSpotting );
FilePrintf(hFile, "\t\t<sBackpackWeightModifier>%d</sBackpackWeightModifier>\r\n", Item[cnt].sBackpackWeightModifier);
FilePrintf(hFile, "\t\t<fAllowClimbing>%d</fAllowClimbing>\r\n", Item[cnt].fAllowClimbing);
if ( Item[cnt].usItemFlag & DISEASEPROTECTION_FACE )
FilePrintf( hFile, "\t\t<diseaseprotectionface>%d</diseaseprotectionface>\r\n", 1 );
if ( Item[cnt].usItemFlag & DISEASEPROTECTION_HAND )
FilePrintf( hFile, "\t\t<diseaseprotectionhand>%d</diseaseprotectionhand>\r\n", 1 );
FilePrintf(hFile,"\t</ITEM>\r\n");
}
FilePrintf(hFile,"</ITEMLIST>\r\n");