Replace evolution with growth rates (#201)

This commit is contained in:
rftrdev
2023-08-09 18:36:44 -07:00
committed by GitHub
parent 43c6943399
commit aaeea9aac8
24 changed files with 685 additions and 161 deletions
+88 -6
View File
@@ -101,7 +101,19 @@ profileStartElementHandle(void *userData, const XML_Char *name, const XML_Char *
strcmp(name, "bMedical") == 0 ||
strcmp(name, "bMechanical") == 0 ||
strcmp(name, "bExpLevel") == 0 ||
strcmp(name, "bEvolution") == 0 ||
strcmp(name, "fRegresses") == 0 ||
// rftr: growth rates are intended to replace the <bEvolution> tag, letting each stat have its own growth modifier
strcmp(name, "bGrowthModifierLife") == 0 ||
strcmp(name, "bGrowthModifierStrength") == 0 ||
strcmp(name, "bGrowthModifierAgility") == 0 ||
strcmp(name, "bGrowthModifierDexterity") == 0 ||
strcmp(name, "bGrowthModifierWisdom") == 0 ||
strcmp(name, "bGrowthModifierMarksmanship") == 0 ||
strcmp(name, "bGrowthModifierExplosive") == 0 ||
strcmp(name, "bGrowthModifierLeadership") == 0 ||
strcmp(name, "bGrowthModifierMedical") == 0 ||
strcmp(name, "bGrowthModifierMechanical") == 0 ||
strcmp(name, "bGrowthModifierExpLevel") == 0 ||
// added by SANDRO
strcmp(name, "bOldSkillTrait") == 0 ||
strcmp(name, "bOldSkillTrait2") == 0 ||
@@ -280,7 +292,18 @@ profileEndElementHandle(void *userData, const XML_Char *name)
tempProfiles[pData->curIndex].bMechanical = pData->curProfile.bMechanical;
tempProfiles[pData->curIndex].bExpLevel = pData->curProfile.bExpLevel;
tempProfiles[pData->curIndex].bEvolution = pData->curProfile.bEvolution;
tempProfiles[pData->curIndex].fRegresses = pData->curProfile.fRegresses;
tempProfiles[pData->curIndex].bGrowthModifierLife = pData->curProfile.bGrowthModifierLife;
tempProfiles[pData->curIndex].bGrowthModifierStrength = pData->curProfile.bGrowthModifierStrength;
tempProfiles[pData->curIndex].bGrowthModifierAgility = pData->curProfile.bGrowthModifierAgility;
tempProfiles[pData->curIndex].bGrowthModifierDexterity = pData->curProfile.bGrowthModifierDexterity;
tempProfiles[pData->curIndex].bGrowthModifierWisdom = pData->curProfile.bGrowthModifierWisdom;
tempProfiles[pData->curIndex].bGrowthModifierMarksmanship = pData->curProfile.bGrowthModifierMarksmanship;
tempProfiles[pData->curIndex].bGrowthModifierExplosive = pData->curProfile.bGrowthModifierExplosive;
tempProfiles[pData->curIndex].bGrowthModifierLeadership = pData->curProfile.bGrowthModifierLeadership;
tempProfiles[pData->curIndex].bGrowthModifierMedical = pData->curProfile.bGrowthModifierMedical;
tempProfiles[pData->curIndex].bGrowthModifierMechanical = pData->curProfile.bGrowthModifierMechanical;
tempProfiles[pData->curIndex].bGrowthModifierExpLevel = pData->curProfile.bGrowthModifierExpLevel;
// added by SANDRO
tempProfiles[pData->curIndex].bOldSkillTrait = pData->curProfile.bOldSkillTrait;
tempProfiles[pData->curIndex].bOldSkillTrait2 = pData->curProfile.bOldSkillTrait2;
@@ -586,11 +609,70 @@ profileEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curProfile.bExpLevel = (UINT32) strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bEvolution") == 0)
else if(strcmp(name, "fRegresses") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bEvolution = (UINT32) strtoul(pData->szCharData, NULL, 0);
pData->curProfile.fRegresses = (BOOLEAN) strtoul(pData->szCharData, NULL, 0);
}
else if (strncmp(name, "bGrowthModifier", 11) == 0) // doing this to avoid C1061
{
if (strcmp(name, "bGrowthModifierLife") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierLife = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierStrength") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierStrength = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierAgility") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierAgility = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierDexterity") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierDexterity = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierWisdom") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierWisdom = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierMarksmanship") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierMarksmanship = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierExplosive") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierExplosive = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierLeadership") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierLeadership = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierMedical") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierMedical = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierMechanical") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierMechanical = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bGrowthModifierExpLevel") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bGrowthModifierExpLevel = (UINT32)strtoul(pData->szCharData, NULL, 0);
}
}
////////////////////////////////////////////////////////////////////////////
// SANDRO was here - messed this a bit
@@ -1600,7 +1682,7 @@ BOOLEAN WriteMercProfiles()
FilePrintf(hFile,"\t\t<bMedical>%d</bMedical>\r\n", gMercProfiles[ cnt ].bMedical);
FilePrintf(hFile,"\t\t<bMechanical>%d</bMechanical>\r\n", gMercProfiles[ cnt ].bMechanical);
FilePrintf(hFile,"\t\t<bExpLevel>%d</bExpLevel>\r\n", gMercProfiles[ cnt ].bExpLevel);
FilePrintf(hFile,"\t\t<bEvolution>%d</bEvolution>\r\n", gMercProfiles[ cnt ].bEvolution);
FilePrintf(hFile,"\t\t<fRegresses>%d</fRegresses>\r\n", gMercProfiles[ cnt ].fRegresses);
////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - old/new traits
if (gGameOptions.fNewTraitSystem)