Skip to content

feat: Pokémon companion (Phase 3a) — evolution driven by token usage - #5

Merged
chattymin merged 5 commits into
mainfrom
feat/companion-phase-3-pokemon
Jun 25, 2026
Merged

chattymin merged 5 commits into
mainfrom
feat/companion-phase-3-pokemon

Conversation

@chattymin

Copy link
Copy Markdown
Owner

성장형 companion을 커스텀 캐릭터 → 포켓몬으로 전환(P3a). 포켓몬 데이터/스프라이트는 런타임에 PokéAPI에서 fetch, 레포/릴리스에 미번들.

핵심

  • PokeAPIClient: 종/진화체인 런타임 fetch + 파싱(진화 트리), capture_rate/is_legendary로 희귀도, 다국어 이름.
  • SpriteLoader: 스프라이트 런타임 fetch + 로컬 캐시(Application Support).
  • 토큰 경제(설치 이후만, backfill 없음): 졸업 총량 T는 같은 희귀도면 진화 단계 수와 무관하게 동일, 단계↑일수록 비용↑(T·i/(k(k+1)/2)), 희귀할수록 T↑. (common 750M ~ legendary 9B, 실측 253M/일 기준.)
  • CompanionStore: 설치 baseline → 진화 게이지, 트리 따라 진화, 분기는 미수집 최종체 우선(같은 base 재부화 시 다른 분기), 최종체 졸업 → 도감에 라인 전체(순서) 보존 + 새 알.
  • UI: 홈(현재 포켓몬 + 희귀도 + 단계 진행 + 진화 라인), 도감(라인 전체), 언어 설정 한/영/일(이름 API), 메뉴바 스프라이트 + bob.
  • 커스텀 CompanionRenderer/카탈로그/고양이 3종 제거.
  • README 비제휴 고지 + 귀속(런타임 fetch, MIT는 코드만 커버).

검증

  • swift test 28개 통과(경제 불변식, 설치 baseline, 진화→졸업 라인 전체, 무진화, 분기 다양성, 영속, 다국어 이름).
  • 라이브 PokéAPI 연동 확인: 실제 3단 라인(rare) 파싱 + en/ko/ja 이름 + Eevee 8분기. release 빌드 기동 무크래시.

IP

  • 에셋/데이터 미번들, 런타임 fetch + 로컬 캐시. 비제휴·비수익. (오픈소스 포켓몬 사용 법적 검토는 별도 보고서 기반.)

후속(P3b/c)

  • 메뉴바 GIF 애니메이션, 희귀도 가중 알 풀, 시즌 풀, 도감 UI 고도화.

🤖 Generated with Claude Code

chattymin and others added 5 commits June 25, 2026 15:41
Pivots the growth companion from custom code-drawn characters to Pokémon,
fetched at runtime from PokéAPI (no Pokémon assets/data bundled in the repo).

- PokeAPIClient: runtime fetch of species + evolution-chain, parsed into an
  evolution tree; rarity from capture_rate/is_legendary; multilingual names
- SpriteLoader: runtime sprite fetch + local cache (Application Support)
- Token economy (install-onward, no backfill): graduation total T is constant
  per rarity regardless of evolution count; per-stage cost increases
  (T·i / (k(k+1)/2)); rarer = larger T
- CompanionStore: install baseline, evolve through the tree at usage thresholds,
  branching prefers uncollected finals (re-hatching a base picks a different
  branch), graduate the final form to the Pokédex (full chain order) + new egg
- UI: Home shows current Pokémon + rarity + stage progress + evolution line;
  Pokédex shows full evolution lines; Language setting (KO/EN/JA, names via API);
  menu bar shows the current sprite with a light bob
- Remove custom CompanionRenderer / catalog / 3-cat roster (replaced)
- README: non-affiliation disclaimer + attribution (runtime fetch; MIT covers code only)
- Tests: economy invariants, install baseline, evolve→graduate (full chain),
  no-evolution, branch diversity, persistence, localized names (28 total green)

Deferred (P3b/c): animated menu-bar sprite, rarity-weighted egg pool,
seasonal pools, richer Pokédex UI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SpriteView reads an already-cached sprite from disk synchronously at init, so a
previously-seen Pokémon appears immediately instead of flashing egg → sprite
while the async .task reloads. Adds SpriteLoader.cachedImage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rare 3.75B→3B (~15→12일), legendary 9B→6B (~36→24일) @ 253M/day 기준.
common/uncommon 유지. 단조 증가 불변식 유지 — 테스트 영향 없음.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Language 설정 하나로 UI 전체 현지화. 기존엔 포켓몬 이름만 바뀜.
- 중앙 카탈로그 Localization.swift — L(lang).t(ko,en,ja), 뷰는 companion.l.<키>
  로 접근(@observable 자동 재렌더). 팝오버·설정·컴패니언·Codex 한도 라벨 적용.
- 알림은 UsageStore 에서 발화 → localizationLanguage 미러로 현지화.
  단일 소스는 CompanionStore.language, 설정 셋터에서 동기화.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
메뉴바가 항상 companion 캐릭터를 표시하게 되어 코인이 불필요해짐.
- MenuBarCoin.swift 삭제 (픽셀 코인 + 회전 프레임 시퀀스)
- spinEnabled / companionInMenuBar 설정 제거 (영속 키 포함)
- 메뉴바는 항상 스프라이트 렌더, 부화 전/로딩 중엔 🥚 알 글리프 폴백
- SpinTier→BurnTier, spinTier→burnTier 리네임 (companion burn 상태 판정 전용)
- README 메뉴바 섹션을 캐릭터 설명으로 교체

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chattymin
chattymin merged commit 031c448 into main Jun 25, 2026
@chattymin
chattymin deleted the feat/companion-phase-3-pokemon branch June 25, 2026 11:31
chattymin added a commit that referenced this pull request Aug 23, 2026
#185 made `L.t` five-argument at 14:45:33; #210 merged four-argument
Antigravity strings 104 seconds later. GitHub reported the merge as
clean because the two changes never touch the same lines, so `main`
landed with 24 "missing argument for parameter #5" errors.

Adds `fr` to the three Antigravity limit strings. No behaviour change.
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.

1 participant