Thunderbrd
C2C War Dog
Further analysis and repair on these matters today.Ok, I figured out why I've never seen this. This is a line coming from an odds panel BUG option. I've never had it on so I've never seen it and didn't even know it was there.
There is obviously some mathematicaly reviewing that needs to be done for some of the combat help hover stuff but this is truly confusing. This is the code for that display:
I'm not sure if I've adjusted it or not but I'll have to go back to some pre-combat mod initial implementation code and see if it's been adjusted since then. As it stands, I'm not sure how the amount they are trying to total up is going to be the total defense modifier anyhow. The intent itself is a little mysterious.Code:if (iView & getBugOptionINT("ACO__ShowTotalDefenseModifier", 2, "ACO_SHOW_TOTAL_DEFENSE_MODIFIER")) { //szString.append(L' ');//XXX if (pDefender->maxCombatStr(pPlot,pAttacker)>pDefender->baseCombatStr()*100) // modifier is positive { szTempBuffer.Format(SETCOLR L"%d%%" ENDCOLR, TEXT_COLOR("COLOR_NEGATIVE_TEXT"),(((pDefender->maxCombatStr(pPlot,pAttacker)))/pDefender->baseCombatStr())-100); } else // modifier is negative { szTempBuffer.Format(SETCOLR L"%d%%" ENDCOLR, TEXT_COLOR("COLOR_POSITIVE_TEXT"),(100-((pDefender->baseCombatStr()*10000)/(pDefender->maxCombatStr(pPlot,pAttacker))))); } szString.append(gDLL->getText("TXT_ACO_TotalDefenseModifier")); szString.append(szTempBuffer.GetCString()); }
Some conclusions:
1) The above formula had a severe error in it. (100-((pDefender->baseCombatStr()*10000)/(pDefender->maxCombatStr(pPlot,pAttacker))) The 10000 was up by 2 digits. I can see why i adjusted it when I looked at the core coding:
Code:
if (iModifier > 0)
{
iCombat = (iBaseCombatStr * (iModifier + 100));
}
else
{
iCombat = ((iBaseCombatStr * 10000) / (100 - iModifier));
}
This is why when you total things up it doesn't always seem to make sense. If you apply the totals through this formula it will begin to look more accurate. However, I admit that the way the total modifier display was calculating was way off. After my next commit, it should be accurate now.
Is this the 'odds being way off' that people have been complaining about for a long time? If so it's nice to think that's finally resolved.
One neat discovery I made was to further explore the odds panel in the bug options and I found that I could get a one line attacker stats listed there too above the defender and that was incredibly handy for me as a player, particularly since sometimes this help page is getting a little overwhelmed now and then lately.