2011-09-15, 12:58 AM
It makes absolutely no sense for there to be a code segment like the one you gave.
There would be a single try_scroll() routine which accepts the scroll's chance of success (in %) and returns pass or fail.
It would have to be in % because there are scrolls (clean slate) with 1% chance of success.
Such a routine (often a macro, actually) typically looks like:
So, no, not too likely they're doing 4/5 or anything of the sort.
There would be a single try_scroll() routine which accepts the scroll's chance of success (in %) and returns pass or fail.
It would have to be in % because there are scrolls (clean slate) with 1% chance of success.
Such a routine (often a macro, actually) typically looks like:
Code:
boolean try_scroll(int success_rate)
{
return (random_int(100) < success_rate);
}
/* random_int, in typical C style, will return a number between 0 and 99 */So, no, not too likely they're doing 4/5 or anything of the sort.

