Doesnt wrote:Irradiate is even weirder than most crawl spells for damage. It determines a max amount of damage it can do, which is 30 + (Power/2). It then splits that across six dice and rolls 6dSomething, such that the max damage is what it determined earlier.
Rounding here is not handled by flooring as you'd expect, but by a special function that randomly chooses a direction to round to based on which value would be closer. Specifically, it rounds up if a random number between 0 and the denominator is less than the remainder, and rounds down otherwise.
Irradiate's max power is 200, at which point it aims for a max of 130 damage. This has a 1/3 chance of doing 6d21 damage, and a 2/3 chance of doing 6d22 damage.
It's not really that weird for crawl, both "figure out the max damage and divide that among dice" and "randomly round up or down with greater chances depending on how close you are to that value" are pretty standard crawl functions.
Of the "standard" attack spells defined in zap-data, 21 use the max-damage method, and 28 use a "determine the number of dice directly from power" method. (calcdice_calculator and dicedef_calculator respectively)
All of which use the "round with better chances of the one that's closer to the actual value" when doing the dividing, which is used in many places, not just damage.
The "round with better chances of the one that's closer to the actual value" is pretty readily observable when watching the time it takes to attack, for example.