Skip to content

fix(companion): base a revealed Ditto's repeat boost on Ditto itself - #378

Merged
chattymin merged 1 commit into
chattymin:mainfrom
DyRize:fix/ditto-growth-boost
Oct 5, 2026
Merged

chattymin merged 1 commit into
chattymin:mainfrom
DyRize:fix/ditto-growth-boost

Conversation

@DyRize

@DyRize DyRize commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

A disguised Ditto hatches with the repeat growth boost of its disguise's line (#253), and the reveal kept that value. A player who had already graduated a Ditto therefore got no 2× growth on the next one, while a first Ditto disguised as an already graduated line kept 2× growth for its whole Ditto phase.

The reveal now recomputes hasGrowthBoost from Ditto's own base (hasCollectedFinal(forBaseID: 132)), the same predicate every other line uses at hatch:

Disguise boosted Ditto already graduated Revealed Ditto
no no standard growth (unchanged)
no yes 2× (was standard)
yes no standard (was 2×)
yes yes 2× (unchanged)

The disguise phase is unchanged: it keeps its line's boost so growth speed does not give the disguise away, and the reveal threshold is still halved when that line was already graduated. Levels never go down (advanceGrowth keeps the maximum), the carried-over usage is the same, and an already revealed Ditto in an existing save keeps its current flag. This matches the README: "A hatch from an evolution line you have already graduated grows 2× faster."

Note for review: testBoostedDisguiseRevealsAtTheHalvedThresholdAndKeepsTheBoost pinned the previous behavior. It is renamed to testBoostedDisguiseRevealsAtTheHalvedThresholdAndANewDittoDropsTheBoost and inverted, since carrying the disguise's boost into Ditto rewards a line the player graduated, not a repeat Ditto. testBoostedEasyDittoRetainsLevelAndIdentityAcrossReveal now covers the dropped boost and still checks that level and identity survive the reveal. testRevealingAnAlreadyGraduatedDittoGrantsTheRepeatBoost covers the repeat Ditto. Both new expectations fail on main. The repeat boost entry in docs/reference/defect-log.md records why the reveal tests missed it (they all seeded an empty collectedFinals).

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

Checklist

  • swift build and swift test pass locally (1385 tests, 0 failures, coverage gate passes)
  • PR title and description are written in English
  • UI changes are described above (before/after — images optional): none, Sources/PokeTokenBar/UI/ is untouched
  • No copyrighted assets, secrets, or private tooling references are committed (see CONTRIBUTING)
  • Tests were added or updated for this change

A disguised Ditto hatches with the repeat growth boost of its disguise's
line, and the reveal kept it: a repeat Ditto grew at the standard rate
while a first Ditto could keep 2x growth. The reveal now recomputes the
boost from Ditto's own base. The disguise phase is unchanged.
@chattymin
chattymin merged commit eb6ea0c into chattymin:main Oct 5, 2026
2 checks passed
@DyRize
DyRize deleted the fix/ditto-growth-boost branch October 5, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants