User talk:SnorlaxMonster/BerryBlending

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to: navigation, search

Calculating Pokéblock flavors

I wrote some parsers that can calculate the flavor of a Pokéblock from only its constituent Berries' flavors and the Berry Blender's max RPM, but I probably won't use them in this template. However, I figured I would include them here, in case anyone (including me) wants to use them in the future. (This is the kind of thing most wikis would use variables or Lua to do, if they have those installed.)

{{#iferror: {{#expr: ((1 + floor({{{RPM|100}}}*100/333)/100) * exp(ln(({{{berry1_spicy|0}}} + {{{berry2_spicy|0}}} + {{{berry3_spicy|0}}} + {{{berry4_spicy|0}}}) * 10 - (({{{berry1_spicy|0}}} + {{{berry2_spicy|0}}} + {{{berry3_spicy|0}}} + {{{berry4_spicy|0}}} < 0) + ({{{berry1_dry|0}}} + {{{berry2_dry|0}}} + {{{berry3_dry|0}}} + {{{berry4_dry|0}}} < 0) + ({{{berry1_sweet|0}}} + {{{berry2_sweet|0}}} + {{{berry3_sweet|0}}} + {{{berry4_sweet|0}}} < 0) + ({{{berry1_bitter|0}}} + {{{berry2_bitter|0}}} + {{{berry3_bitter|0}}} + {{{berry4_bitter|0}}} < 0) + ({{{berry1_sour|0}}} + {{{berry2_sour|0}}} + {{{berry3_sour|0}}} + {{{berry4_sour|0}}} < 0))))) round 0}} | 0}}

{{#iferror: {{#expr: ((1 + floor({{{RPM|100}}}*100/333)/100) * exp(ln(({{{berry1_dry|0}}} + {{{berry2_dry|0}}} + {{{berry3_dry|0}}} + {{{berry4_dry|0}}}) * 10 - (({{{berry1_spicy|0}}} + {{{berry2_spicy|0}}} + {{{berry3_spicy|0}}} + {{{berry4_spicy|0}}} < 0) + ({{{berry1_dry|0}}} + {{{berry2_dry|0}}} + {{{berry3_dry|0}}} + {{{berry4_dry|0}}} < 0) + ({{{berry1_sweet|0}}} + {{{berry2_sweet|0}}} + {{{berry3_sweet|0}}} + {{{berry4_sweet|0}}} < 0) + ({{{berry1_bitter|0}}} + {{{berry2_bitter|0}}} + {{{berry3_bitter|0}}} + {{{berry4_bitter|0}}} < 0) + ({{{berry1_sour|0}}} + {{{berry2_sour|0}}} + {{{berry3_sour|0}}} + {{{berry4_sour|0}}} < 0))))) round 0}} | 0}}

{{#iferror: {{#expr: ((1 + floor({{{RPM|100}}}*100/333)/100) * exp(ln(({{{berry1_sweet|0}}} + {{{berry2_sweet|0}}} + {{{berry3_sweet|0}}} + {{{berry4_sweet|0}}}) * 10 - (({{{berry1_spicy|0}}} + {{{berry2_spicy|0}}} + {{{berry3_spicy|0}}} + {{{berry4_spicy|0}}} < 0) + ({{{berry1_dry|0}}} + {{{berry2_dry|0}}} + {{{berry3_dry|0}}} + {{{berry4_dry|0}}} < 0) + ({{{berry1_sweet|0}}} + {{{berry2_sweet|0}}} + {{{berry3_sweet|0}}} + {{{berry4_sweet|0}}} < 0) + ({{{berry1_bitter|0}}} + {{{berry2_bitter|0}}} + {{{berry3_bitter|0}}} + {{{berry4_bitter|0}}} < 0) + ({{{berry1_sour|0}}} + {{{berry2_sour|0}}} + {{{berry3_sour|0}}} + {{{berry4_sour|0}}} < 0))))) round 0}} | 0}}

{{#iferror: {{#expr: ((1 + floor({{{RPM|100}}}*100/333)/100) * exp(ln(({{{berry1_bitter|0}}} + {{{berry2_bitter|0}}} + {{{berry3_bitter|0}}} + {{{berry4_bitter|0}}}) * 10 - (({{{berry1_spicy|0}}} + {{{berry2_spicy|0}}} + {{{berry3_spicy|0}}} + {{{berry4_spicy|0}}} < 0) + ({{{berry1_dry|0}}} + {{{berry2_dry|0}}} + {{{berry3_dry|0}}} + {{{berry4_dry|0}}} < 0) + ({{{berry1_sweet|0}}} + {{{berry2_sweet|0}}} + {{{berry3_sweet|0}}} + {{{berry4_sweet|0}}} < 0) + ({{{berry1_bitter|0}}} + {{{berry2_bitter|0}}} + {{{berry3_bitter|0}}} + {{{berry4_bitter|0}}} < 0) + ({{{berry1_sour|0}}} + {{{berry2_sour|0}}} + {{{berry3_sour|0}}} + {{{berry4_sour|0}}} < 0))))) round 0}} | 0}}

{{#iferror: {{#expr: ((1 + floor({{{RPM|100}}}*100/333)/100) * exp(ln(({{{berry1_sour|0}}} + {{{berry2_sour|0}}} + {{{berry3_sour|0}}} + {{{berry4_sour|0}}}) * 10 - (({{{berry1_spicy|0}}} + {{{berry2_spicy|0}}} + {{{berry3_spicy|0}}} + {{{berry4_spicy|0}}} < 0) + ({{{berry1_dry|0}}} + {{{berry2_dry|0}}} + {{{berry3_dry|0}}} + {{{berry4_dry|0}}} < 0) + ({{{berry1_sweet|0}}} + {{{berry2_sweet|0}}} + {{{berry3_sweet|0}}} + {{{berry4_sweet|0}}} < 0) + ({{{berry1_bitter|0}}} + {{{berry2_bitter|0}}} + {{{berry3_bitter|0}}} + {{{berry4_bitter|0}}} < 0) + ({{{berry1_sour|0}}} + {{{berry2_sour|0}}} + {{{berry3_sour|0}}} + {{{berry4_sour|0}}} < 0))))) round 0}} | 0}}

--SnorlaxMonster 15:28, 22 June 2019 (UTC)