Armour and its attachements can now alter the fire damage received by setting a value in the <sFireResistance>-tag. This is affected by item status.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8664 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2019-02-10 20:42:39 +00:00
parent 0f558da7e4
commit de8bf8a7d6
14 changed files with 94 additions and 3 deletions
+8 -1
View File
@@ -296,7 +296,8 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "usRiotShieldStrength" ) == 0 ||
strcmp(name, "usRiotShieldGraphic" ) == 0 ||
strcmp(name, "bloodbag" ) == 0 ||
strcmp(name, "emptybloodbag" ) == 0))
strcmp(name, "emptybloodbag" ) == 0 ||
strcmp(name, "sFireResistance" ) == 0))
{
pData->curElement = ELEMENT_PROPERTY;
//DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("itemStartElementHandle: going into element, name = %s",name) );
@@ -1533,6 +1534,11 @@ itemEndElementHandle(void *userData, const XML_Char *name)
if ( (BOOLEAN)atol( pData->szCharData ) )
pData->curItem.usItemFlag |= EMPTY_BLOOD_BAG;
}
else if ( strcmp( name, "sFireResistance" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curItem.sFireResistance = min( 100, (INT16)atol( pData->szCharData ) );
}
--pData->maxReadDepth;
}
@@ -2173,6 +2179,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<usRiotShieldStrength>%d</usRiotShieldStrength>\r\n", Item[cnt].usRiotShieldStrength );
FilePrintf(hFile,"\t\t<usRiotShieldGraphic>%d</usRiotShieldGraphic>\r\n", Item[cnt].usRiotShieldGraphic );
FilePrintf(hFile,"\t\t<sFireResistance>%d</sFireResistance>\r\n", Item[cnt].sFireResistance );
FilePrintf(hFile,"\t</ITEM>\r\n");
}