
06-12-2024, 12:58 AM
|
|
Fire Giant
Join Date: Jul 2010
Posts: 972
|
|
Quote:
Originally Posted by bcbrown
[You must be logged in to view images. Log in or Register.]
hit.damage_done = std::max(static_cast<int>(roll * static_cast<double>(hit.base_damage) + 0.5), 1);
So it takes the "base_damage", multiplies it by a number between 0.1 and 2.0, adds 0.5, converts to int (which rounds down iirc, so 3.9 becomes 3), then if it's below 1, sets it to 1.
|
This explains the 15 dmg magical cutoff for the lower bound, but also mean every X5 (25, 35, etc) bumps the lower bound by 1. Neat.
|
|
Last edited by Keebz; 06-12-2024 at 12:59 AM..
Reason: mangled quote formatting
|
|