New issue 188 by jsharbour: Ship's armor integrity is based on class, not
damage %
http://code.google.com/p/starflighttlc/issues/detail?id=188
There's a problem project-wide with the way armor is handled, and probably
shields as well. When you have a class 1 armor, it shows the armor
integrity as 1/6 rather than a % of damage. Meaning, if you have class 6
armor, then you have full 100% armor, but class 1 armor is only like 15%
integrity. This is screwed up.
Every class of armor should have a full range of integrity, 0-100%. How
that class info is displayed in the gui is another matter.
I noticed this first in the docking port where the armor is permanently
damaged, even after repairing it. This needs to be fixed across the entire
game, in every module that deals with armor. Integrity is 0-100 no matter
what the class is. If we want heavier armor to last longer in a battle,
then address it in the encounter module appropriately.
I went through the code and found all percentage calculation for armor:
percentage = g_game->gameState->getShip().getArmorIntegrity() /
g_game->gameState->getShip().getMaxArmorIntegrity();
I replace each one with the following code:
percentage = g_game->gameState->getShip().getArmorIntegrity()/100.0f;
This allowed the total armor remaining percentage to be displayed correctly
in all modules except for ModuleAuxiliaryDisplay.cpp. In this module it was
using a different algorithm because it needed to fit both the armor and
shield integrity onto a 48 pixel tall box. The original algorithm was using
the engine class value to fill the box. So if you had class 1 engines the
box would only fill 1 * 8 pixels. I replaced the original code with this:
int armor = ship.getArmorIntegrity() * 0.48f;
Now the shield and armor display correctly while in the Interplanetary
Travel Module too.
Robert
Comment #3 on issue 188 by syntaxerror.unknown: Ship's armor integrity is
based on class, not damage %
http://code.google.com/p/starflighttlc/issues/detail?id=188
Issue fixed in revision: r238