Pokemon Ruby/Sapphire - PokeBlock Generator
PokeBlock Calculation Procedure
This is a textual explanation of the PokeBlock generation procedure. Whenever division occurs, round down unless noted otherwise.
Let RPM = Maximum RPM times 100 (e.g. 95.62 times 100 = 9562)
Let A = Total Spicy value of all berries
Let B = Total Dry value of all berries
Let C = Total Sweet value of all berries
Let D = Total Bitter value of all berries
Let E = Total Sour value of all berries
Let Spicy = A - B
Let Dry = B - C
Let Sweet = C - D
Let Bitter = D - E
Let Sour = E - A
Let Negatives = 0
Let Zeros = 0
For each variable from Spicy to Sour
if that variable is negative
set it to 0 and increase Negatives by 1.
end if
end for
For each variable from Spicy to Sour
if that variable is greater than 0
decrease it by Negatives, but not to less than 0 (i.e, a number
less than Negatives would still be 0)
end if
end for
Let Speed = (RPM/333)+100
For each variable from Spicy to Sour
Let A = (Speed * this variable) / 10
Let C = (A / 10) rounded to the nearest whole number
Set this variable to C
end for
Let Zeros = the number of zeros among variables from Spicy to Sour
If Zeros = 5 or Negatives > 3, create a Black Pokeblock
If there are two or more of the same type of Berry, create a Black Pokeblock
Let Flavors = the number of numbers greater than zero among variables from Spicy to Sour
After this, the color of the Pokeblock to create is figured out.
01: Red - Flavors = 1, Spicy > 0 02: Blue - Flavors = 1, Dry > 0 03: Pink - Flavors = 1, Sweet > 0 04: Green - Flavors = 1, Bitter > 0 05: Yellow - Flavors = 1, Sour > 0 06: Purple - Flavors = 2, Spicy is greater than the other flavor (i.e. is the primary flavor. If the two flavors are equal, the primary flavor is the first flavor in the order of Spicy, Dry, Sweet, Bitter, Sour.) 07: Indigo - Flavors = 2, Dry is the primary flavor. 08: Brown - Flavors = 2, Sweet is the primary flavor. 09: LiteBlue - Flavors = 2, Bitter is the primary flavor. 0A: Olive - Flavors = 2, Sour is the primary flavor. 0B: Gray - Flavors = 3 0C: Black - As determined above 0D: White - Flavors > 3 0E: Gold - Flavors = 1 or 2, at least one flavor is greater than 50
If a Black PokeBlock is created, it has three flavors that are randomly determined and that have an intensity of 2. Otherwise, the PokeBlock has the flavors calculated in the above formula. The feel of the PokeBlock equals (A/B)-B , where A is the sum of the smooth factors of all berries, and B is the number of berries. Feel has a minimum of 0 and a maximum of 255.