Taking a closer look at the funtion reveals that right before the game determines whether the spell will succeed or fail, Math.seedrandom(Game.seed+'/'+M.spellsCastTotal), is called with those parameters, or, if my interpretation is correct, the seed for the next number is set to the value of Game.seed (which i'm not sure what it is) plus the value of / when read as a char, plus the number of spells you've cast in your current legacy.
edit: Game.seed is determined when you start your run, and is only ever affected by ascending. It is a string 5 chars long, and is determined as follows(note that ther actually isn't a space in between the ' ' it's just that without the space it would be interpreted as italic text):
{
var chars='abcdefghijklmnopqrstuvwxyz'.split(' ');
var str=' ';
for (var i=0;i<5;i++){str+=choose(chars);}
return str;
}
Also, immediately after determining whether the spell will succeed or fail, the game does Math.seedrandom(); which I'm not sure what it does with no given parameters.