eternaldensity / Sandcastle-Builder

xkcd: 1190: Time: The Game
Other
79 stars 65 forks source link

Strange behavior with ninja ritual/ninja tortoise. #1468

Closed diff-by-default closed 7 years ago

diff-by-default commented 8 years ago

Ninja ritual seems to be multiplying the Ninja Tortoise and Mutant Tortoise multiplies by 10...for apparently no reason. This is almost certainly caused by this chunk of code that I cannot understand (In the Molpy.NinjaRitual function)

var oldlvl = Molpy.Level('Ninja Ritual'); ... while (Molpy.Level('Ninja Ritual') <= oldlvl) { Molpy.Boosts['Ninja Ritual'].Level +=mult; mult*=10; }; ...

This loop seems entirely unnecessary, but either way, it's always going to increment the ritual level, and then multiply the multiplier by 10, which causes Ninja Tortoise and Mutant Tortoise to have values 10 times higher than what they should be.

Pikrass commented 8 years ago

It's not a bug, it's intended to allow progression past certain values. Because of the floating-point format, if a number is too high, incrementing it by too little won't in fact change the number at all. Look at the loop condition. What the algorithm does is "try to increment by mult ; if that didn't in fact increment the level, try to increment it by 10 times that and repeat".