Skip to content

feat(core): add achievement system with milestone unlocks and badge UI#27

Open
aiexkwan wants to merge 1 commit into
ntd4996:mainfrom
aiexkwan:feat/achievement-system
Open

feat(core): add achievement system with milestone unlocks and badge UI#27
aiexkwan wants to merge 1 commit into
ntd4996:mainfrom
aiexkwan:feat/achievement-system

Conversation

@aiexkwan

Copy link
Copy Markdown
Contributor

Summary

  • Add 14 achievements unlocked by real coding milestones: first meal, level-ups (5/10/20/35), token burns (1M/10M/50M), session counts (100/500), streaks (7/14/30 days), and night owl (midnight coding)
  • Achievement state stored per-pet in PetCareState.unlockedAchievements (backward-compatible Optional field)
  • Pure checkAchievements(state:hour:) function + unlockNewAchievements called automatically in feedTokens/recordMeal
  • Stats HUD: compact badge row with SF Symbol icons (unlocked = stage color, locked = dim)
  • Care tab: achievements section listing unlocked milestones
  • Celebrate animation triggers on each new unlock with achievement-specific message
  • 149 lines of tests covering all unlock conditions, no-double-unlock, and backward compatibility

Test plan

  • swift test — 202 tests pass, 0 failures
  • swift build — clean build
  • Manual: right-click pet → verify badge row appears in HUD
  • Manual: feed pet → verify achievement celebrate animation fires
  • Manual: check Care tab → achievements section visible

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