PokeAPI / PokeAPI/pokeapi

Max chance not calculated correctly when accounting for dual slot

Open
#694 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.4k
Forks
1.2k
Avg merge
2d 5h
Merged PRs (30d)
21

Description

In Generation IV, diamond pearl and platinum, you can boost the encounter rate of certain Pokemon by using the dual slot method: https://bulbapedia.bulbagarden.net/wiki/Dual-slot_mode

Obviously, one cannot have multiple pokemon in the dual slot. However, the entry for Diglett lists its max_chance as if dual slots are mutually compatible. Its true best odds is 5% - 4% for anything other than LeafGreen, and 1% when not using the PokeRadar. It is listed as 21%.

My current project uses this API to calculate which games are required for which Pokemon. If this feature were not added, then I would have to manually calculate max_chance, including a dictionary of exclusive conditions and adding the one with the best %.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Diglett encounter endpoint at /api/v2/pokemon/50/encounters and trace how encounter conditions are combined into max_chance. Review the Dual-slot mode rules and compare the generated value with the stated 5%, 4%, and 1% cases. Done means mutually exclusive conditions no longer produce an inflated maximum.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.