Fixed mixed upgrades and boosts of EP and HP regeneration

This commit is contained in:
titiger 2021-09-13 22:33:47 +02:00
parent 680c868aa9
commit f344fa7fbd
1 changed files with 28 additions and 2 deletions

View File

@ -1189,7 +1189,20 @@ void TotalUpgrade::sum(const UpgradeTypeBase *ut, const Unit *unit, bool boostMo
}
}
maxHpRegeneration+= ut->getMaxHpRegeneration();
{
int upgradeValue;
if (ut->getMaxEpIsMultiplier() == true) {
upgradeValue = ((double) unit->getType()->getHpRegeneration() * ((double) ut->getMaxHpRegeneration() / (double) 100));
} else {
upgradeValue = ut->getMaxHpRegeneration();
}
if (boostMode) {
//ignore! no boost for MaxEP. This makes no sense. Just upgrades allowed
maxHpRegeneration=upgradeValue;
} else {
maxHpRegeneration += upgradeValue;
}
}
{
int upgradeValue;
@ -1206,7 +1219,20 @@ void TotalUpgrade::sum(const UpgradeTypeBase *ut, const Unit *unit, bool boostMo
}
}
maxEpRegeneration+= ut->getMaxEpRegeneration();
{
int upgradeValue;
if (ut->getMaxEpIsMultiplier() == true) {
upgradeValue = ((double) unit->getType()->getEpRegeneration() * ((double) ut->getMaxEpRegeneration() / (double) 100));
} else {
upgradeValue = ut->getMaxEpRegeneration();
}
if (boostMode) {
//ignore! no boost for MaxEP. This makes no sense. Just upgrades allowed
maxEpRegeneration=upgradeValue;
} else {
maxEpRegeneration += upgradeValue;
}
}
{
int upgradeValue;