Well, that's how it was designed.
The accuracy is reduced if you're hurt, but the stats are NOT really reduced, they are still the same.
The stats are only "displayed as reduced" (because it is a bit more visually understandable for the player, but even that is arguable since OG and OXC displayed them "incorrectly reduced" anyway).
This was one of my first changes in OXCE, see: https://github.com/MeridianOXC/OpenXcom/commit/66ee0523750d609cca4ff0e7efa7f3aaf37a5c4d
and https://www.ufopaedia.org/index.php?title=Accuracy_formula#Stat_Screen_Accuracy
I don't consider this a bug.
Yes, under the hood, the stats are static. However, that doesn't mean that in practice the stats aren't reduced. Think about it. Why would you show the player reduced stats, if it's not your intention for the player to think that that's what happens when a unit is hurt? I'm pretty sure that the original intention was for the unit's secondary stats to get reduced with damage, and consequently any formulae where the secondary stats are used are affected by how damaged the unit is.
Perhaps you assume that, because, for instance, "current firing skill" stat doesn't explicitly exist, that the stat is somehow not actually reduced. But why would it need to exist when it can be calculated on the fly? If such a stat existed, it would be redundant; it would just be wasting space in the sav file.
Let's for a moment assume that the current accuracy equation is:
Chance to hit = Weapon Accuracy * Firing Skill * Health Penalty * Wounds Penalty * OtherThe Current Firing Skill is already in there. If you want it to be explicit, all you need is a temporary variable:
Current Firing Skill = Firing Skill * Health Penalty * Wounds Penalty
Chance to hit = Weapon Accuracy * Current Firing Skill * Otherand the result is the same.
Well, I should note that the way accuracy penalty is currently applied is also a bit bugged. It works correctly when the attack accuracy is based purely on Firing/Throwing/Melee skill (like in the above simplified equation), where the reduction is linear. But nowadays you got mods with weapons with stuff like [50 + 0.01*Throwing²] -> accuracy equations which aren't linear. If a unit's throwing skill was reduced by 10% it would produce a different result than applying a flat 10% penalty.
Anyway, to me it seems logical that if a unit's arm has 9 holes in it, that using this arm for, for instance, punching, would result in lower damage than if the holes were not there.
>I do not think that "stats are reduced" is correct view of how wounds works, they are more final modifier after all other calculations.
Sure, it's a modifier. But the point where the modifier gets applied can be important. If, let's say, you have a homing missile launcher or a magic wand with guaranteed 100% accuracy (flatHundred: 1), then wounds shouldn't affect such a weapon because, logically, it doesn't make sense for wounds to affect a weapon that isn't skill-dependent.
>See `getAccuracyModifier` that is independent from rest of modifiers.
Based on what this function returns, it should be named getWoundsPenaltyModifier(). Also, the comment for this function says "Formula = accuracyStat * woundsPenalty(% health) * critWoundsPenalty (-10%/wound)". Which is funny, because that's almost the currect formula for the damage-reduced stats.
>Another thing is we could not by default alter damage calculations as base game have damage independent of unit stats and thus should
not be affected by units wounds.
Right. It's correct that base game weapon damage doesn't change with wounds, because that damage doesn't scale with stats. But for any damage bonus that does scale with stats, health damage and critical wounds should also be applied.
>One solution for now is create global script for bonus damage that will reduce current value bonuses after all other calcinations.
Why reduce damage after the calculations? Why not simply make it so that when a script reads unit's stats, it reads the penalized stats instead of the base stats?
>Question is what body parts wounds should apply penalty?
I'm not sure either. I guess the same way as it is for accuracy.