- new item: when planting tripwire roll (Item# 1640), a tripwire item is created, thereby making planting multiple wires much easier. Teipwires can be merged to create a roll

- new item tag: <buddyitem> connects items to other items. Connection specifics depend on items involved

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6455 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-09-29 17:06:37 +00:00
parent 2169fbd6a9
commit 3c01b5364e
4 changed files with 72 additions and 9 deletions
+8 -1
View File
@@ -275,7 +275,8 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "randomitem") == 0 ||
strcmp(name, "randomitemcoolnessmodificator") == 0 ||
strcmp(name, "FlashLightRange") == 0 ||
strcmp(name, "ItemChoiceTimeSetting") == 0 ))
strcmp(name, "ItemChoiceTimeSetting") == 0 ||
strcmp(name, "buddyitem") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
//DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("itemStartElementHandle: going into element, name = %s",name) );
@@ -1425,6 +1426,11 @@ itemEndElementHandle(void *userData, const XML_Char *name)
// no nonsense, only values between 0 and + 2
pData->curItem.usItemChoiceTimeSetting = min(2, max(0, (UINT8) atol(pData->szCharData) ) );
}
else if(strcmp(name, "buddyitem") == 0)
{
pData->curElement = ELEMENT;
pData->curItem.usBuddyItem = (UINT16) atol(pData->szCharData);
}
pData->maxReadDepth--;
}
@@ -2065,6 +2071,7 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<randomitemcoolnessmodificator>%d</randomitemcoolnessmodificator>\r\n", Item[cnt].randomitemcoolnessmodificator );
FilePrintf(hFile,"\t\t<FlashLightRange>%d</FlashLightRange>\r\n", Item[cnt].usFlashLightRange );
FilePrintf(hFile,"\t\t<ItemChoiceTimeSetting>%d</ItemChoiceTimeSetting>\r\n", Item[cnt].usItemChoiceTimeSetting );
FilePrintf(hFile,"\t\t<buddyitem>%d</buddyitem>\r\n", Item[cnt].usBuddyItem );
FilePrintf(hFile,"\t</ITEM>\r\n");
}