Feature improvement: tripwire, tripwire mines and directional eplosives can now be planted with the map editor.

- The action item system has been repaired for this. It has never worked correctly prior to this, but the errors never occured.
- New items from GameDir 1538 are required for this to work. They are direct copies of existing items, except for a new tag, <usActionItemFlag>.
- The name of the new action items should clarify in the editor what an item does.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5565 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-09-15 02:28:18 +00:00
parent 3cc8153a61
commit 3d6bc97289
5 changed files with 290 additions and 46 deletions
+11 -3
View File
@@ -276,7 +276,8 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "LockPickModifier") == 0 ||
strcmp(name, "CrowbarModifier") == 0 ||
strcmp(name, "DisarmModifier") == 0 ||
strcmp(name, "RepairModifier") == 0 ))
strcmp(name, "RepairModifier") == 0 ||
strcmp(name, "usActionItemFlag") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
//DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("itemStartElementHandle: going into element, name = %s",name) );
@@ -1387,7 +1388,12 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.dirtIncreaseFactor = (FLOAT) atof(pData->szCharData);
}
else if(strcmp(name, "usActionItemFlag") == 0)
{
pData->curElement = ELEMENT;
pData->curItem.usActionItemFlag = (UINT32) atol(pData->szCharData);
}
pData->maxReadDepth--;
}
@@ -2019,7 +2025,9 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t<DamageChance>%d</DamageChance>\r\n", Item[cnt].usDamageChance );
FilePrintf(hFile,"\t\t<DirtIncreaseFactor>%4.2f</DirtIncreaseFactor>\r\n", Item[cnt].dirtIncreaseFactor );
FilePrintf(hFile,"\t\t<usActionItemFlag>%d</usActionItemFlag>\r\n", Item[cnt].usActionItemFlag );
FilePrintf(hFile,"\t</ITEM>\r\n");
}
FilePrintf(hFile,"</ITEMLIST>\r\n");