New tag <shotAnimation> in AmmoTypes.xml allows defining custom shot animation.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8800 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-05-13 06:31:11 +00:00
parent 42a85e96ba
commit d9c8a1c398
3 changed files with 79 additions and 3 deletions
+8 -3
View File
@@ -87,7 +87,8 @@ ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char
strcmp(name, "dDamageModifierTank" ) == 0 ||
strcmp(name, "dDamageModifierArmouredVehicle" ) == 0 ||
strcmp(name, "dDamageModifierCivilianVehicle" ) == 0 ||
strcmp(name, "dDamageModifierZombie") == 0 ))
strcmp(name, "dDamageModifierZombie") == 0 ||
strcmp(name, "shotAnimation") == 0))
{
pData->curElement = ELEMENT_PROPERTY;
@@ -340,6 +341,11 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
// reasonable values only
pData->curAmmoType.dDamageModifierZombie = min( 100.0f, max( 0.0f, pData->curAmmoType.dDamageModifierZombie ) );
}
else if (strcmp(name, "shotAnimation") == 0)
{
pData->curElement = ELEMENT;
strncpy(pData->curAmmoType.shotAnimation, pData->szCharData, MAX_ANIMATION_FILENAME_LEN);
}
pData->maxReadDepth--;
}
@@ -348,8 +354,6 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
}
BOOLEAN ReadInAmmoTypeStats(STR fileName)
{
HWFILE hFile;
@@ -464,6 +468,7 @@ BOOLEAN WriteAmmoTypeStats()
FilePrintf(hFile,"\t\t<dDamageModifierArmouredVehicle>%4.2f</dDamageModifierArmouredVehicle>\r\n", AmmoTypes[cnt].dDamageModifierArmouredVehicle );
FilePrintf(hFile,"\t\t<dDamageModifierCivilianVehicle>%4.2f</dDamageModifierCivilianVehicle>\r\n", AmmoTypes[cnt].dDamageModifierCivilianVehicle );
FilePrintf(hFile,"\t\t<dDamageModifierZombie>%4.2f</dDamageModifierZombie>\r\n", AmmoTypes[cnt].dDamageModifierZombie );
FilePrintf(hFile, "\t\t<shotAnimation>%s</shotAnimation>\r\n", AmmoTypes[cnt].shotAnimation);
FilePrintf(hFile,"\t</AMMOTYPE>\r\n");
}