chopinsc
Greenhorn
While testing out damage calculations on a Floor 96 slime infestation (where the red slimes have 0 Defence) my numbers didn't entirely match the expected ranges of ((base+rings%)+food)*Fighter*Brute, only falling within rounding distance. The closest results I've been able to get are by taking the ceiling of the final result after rounding at each step, i.e.
This then matches the maximum values without any errors, though it still gives me lower-than-recorded minimum rolls on more than one of the tested configurations, two of which are 2 points off. Is the actual rounding behaviour known to be responsible for these discrepancies (examples below), or is there a source of damage increase (or defence reduction) that I might be missing?
For example, with no rounding anywhere in the calculation:
(all of these include Fighter and Brute)
- base Galaxy Sword, no rings, no food | expected range 75.9 - 101.2 | recorded range 76 - 102
- +0 Infinity Blade, no rings, Magic Rock Candy | expected range 120.175 - 145.475 | recorded range 121 - 147
- +0 Infinity Blade, two Iridium Bands, Magic Rock Candy | expected range 140.415 - 170.775 | recorded range 143 - 172
Code:
ceiling(round(round((base+rings%)+food)*1.1)*1.25)
For example, with no rounding anywhere in the calculation:
(all of these include Fighter and Brute)
- base Galaxy Sword, no rings, no food | expected range 75.9 - 101.2 | recorded range 76 - 102
- +0 Infinity Blade, no rings, Magic Rock Candy | expected range 120.175 - 145.475 | recorded range 121 - 147
- +0 Infinity Blade, two Iridium Bands, Magic Rock Candy | expected range 140.415 - 170.775 | recorded range 143 - 172