pokemon-showdown/data
Matthew Glazar df5988bacf Refactor some code to use randomChance
Mechanically refactor code which uses PRNG#random for booleans to use
PRNG#randomChance instead.

Take advantage of the following properties:

    random(x) < y        is equivalent to   randomChance(y, x)
    random(x) <= y       is equivalent to   random(x) < (y + 1), i.e. randomChance(y + 1, x)
    random(x) >= y       is equivalent to   !(random(x) < y), i.e. !randomChance(y, x)
    random(x) > y        is equivalent to   random(x) >= (y + 1), i.e. !randomChance(y + 1, x)
    random(x) === 0      is equivalent to   random(x) < 1, i.e. randomChance(1, x)
    !random(x)           is equivalent to   random(x) === 0, i.e. randomChance(1, x)
    Boolean(random(x))   is equivalent to   random(x) > 0, i.e. !randomChance(1, x)

This commit should not change behaviour. In particular, PRNG#next is
called the same number of times with the same number of parameter as
before this commit, and PRNG#next's results are interpreted in the same
way as before this commit.
2018-03-08 20:11:33 +09:00
..
abilities.js Refactor random booleans into randomChance function 2018-03-08 20:11:33 +09:00
aliases.js Add Furfrou Trims 2018-02-19 10:46:40 -05:00
bss-factory-sets.json BSSF: Fix Aron (#4344) 2018-01-16 16:17:15 +08:00
factory-sets.json Fix build 2018-03-02 14:47:57 +00:00
formats-data.js Tiers: Add March quick changes 2018-03-07 14:47:39 -05:00
gen-6-factory-sets.json Add Gen 7 Battle Factory (#4441) 2018-03-01 15:56:16 +08:00
items.js Refactor random booleans into randomChance function 2018-03-08 20:11:33 +09:00
learnsets.js Add new event Pokemon 2018-03-02 12:17:02 -05:00
moves.js Refactor random booleans into randomChance function 2018-03-08 20:11:33 +09:00
pokedex.js Add Furfrou Trims 2018-02-19 10:46:40 -05:00
random-teams.js Refactor some code to use randomChance 2018-03-08 20:11:33 +09:00
rulesets.js STABmons: Correctly restrict Wormadam (#4430) 2018-02-22 23:21:36 +09:00
scripts.js Refactor some code to use randomChance 2018-03-08 20:11:33 +09:00
statuses.js Refactor some code to use randomChance 2018-03-08 20:11:33 +09:00
typechart.js Enforce consistent key spacing 2017-12-01 08:16:23 -06:00