-externalized AP costs for attachments or an attachment-by-attachment basis

-added APCost to Attachments.xml

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@475 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2006-08-25 22:54:52 +00:00
parent ace3863569
commit d2c2963bfb
6 changed files with 37 additions and 8 deletions
+8 -1
View File
@@ -50,7 +50,7 @@ struct
INT8 szCharData[MAX_CHAR_DATA_LENGTH+1];
UINT16 curAttachment[2];
UINT16 curAttachment[3];
UINT32 maxArraySize;
UINT32 curIndex;
UINT32 currentDepth;
@@ -84,6 +84,7 @@ attachmentStartElementHandle(void *userData, const char *name, const char **atts
}
else if(pData->curElement == ELEMENT &&
(strcmp(name, "attachmentIndex") == 0 ||
strcmp(name, "APCost") == 0 ||
strcmp(name, "itemIndex") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
@@ -143,6 +144,11 @@ attachmentEndElementHandle(void *userData, const char *name)
pData->curElement = ELEMENT;
pData->curAttachment[1] = (UINT16) atol(pData->szCharData);
}
else if(strcmp(name, "APCost") == 0)
{
pData->curElement = ELEMENT;
pData->curAttachment[2] = (UINT16) atol(pData->szCharData);
}
pData->maxReadDepth--;
}
@@ -234,6 +240,7 @@ BOOLEAN WriteAttachmentStats()
FilePrintf(hFile,"\t\t<attachmentIndex>%d</attachmentIndex>\r\n", Attachment[cnt][0]);
FilePrintf(hFile,"\t\t<itemIndex>%d</itemIndex>\r\n", Attachment[cnt][1]);
FilePrintf(hFile,"\t\t<APCost>%d</APCost>\r\n", Attachment[cnt][2]);
FilePrintf(hFile,"\t</ATTACHMENT>\r\n");
}