253
Issue Archive / Random Number Generator
« on: December 15, 2009, 10:10:05 pm »In all the code, there are 43 calls to the (good) actionscript random and 53 to Zanzarino's rand()
Deck shuffling uses the Fisher–Yates algorithm with actionscript random.
Wikipedia says it's a good idea:
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
Spinners use Math.random() from actionscript too, so no problem there either.
After a quick check, Zanzarino's (flawed) rand() is used by:
* mutations (creature's appearance, skill, skill cost, attack & life bonus)
* chances to freeze target with Ice Bolt/Ice Shield
* quantums gained with Quantum Pillars/Towers
* quantums lost with Dissipation Field
* quantums absorbed by Devourers
* quantums changed by Scramble effect
* effect from Chaos Seed/Chaos Power
* chances to miss with Fog Shield/Dusk Mantle