OpenXcom Forum
Modding => Work In Progress => Topic started by: The Reaver of Darkness on June 30, 2017, 09:42:38 am
-
I have seen this several times now, a weapon with 100% chance to hit misses its target when it's well within range.
Is there some modifier on the UFOs that further affects chance to hit? I've been noticing that smaller UFOs seem to get hit less, but it's difficult to collect a lot of data on this due to how short interceptions are.
-
I have seen this several times now, a weapon with 100% chance to hit misses its target when it's well within range.
Is there some modifier on the UFOs that further affects chance to hit? I've been noticing that smaller UFOs seem to get hit less, but it's difficult to collect a lot of data on this due to how short interceptions are.
if (RNG::percent((p->getAccuracy() * (100 + 300 / (5 - _ufoSize)) + 100) / 200))
{
// UFO hit.
...
}
else
{
// Missed.
...
}
_ufoSize is between 0 and 4
-
Aha, thanks!
I'm no expert on this form of math, but I came up with the following hit chance values for a 100% accuracy weapon:
Very Large: 200%
Large: 125%
Medium: 100%
Small: 87.5%
Very Small: 80%
Can anyone confirm my math?
edit 24 July 2018: The original equation: (100 + 300 / (5 - _ufoSize)) + 100) / 200))
I came up with a simpler equation which achieves the same result: (150 / (5 - _ufoSize)) + 50
-
Small is 88%, the rest is correct.