feat: add daily streak growth multiplier (#260) - #342
Open
justinjeong5 wants to merge 2 commits into
Open
justinjeong5 wants to merge 2 commits into
justinjeong5 wants to merge 2 commits into
Conversation
- Track consecutive active days in CompanionState.streak (StreakState) - Multiplier tiers: 3d (1.10x), 7d (1.25x), 14d (1.35x), 30d (1.50x) - Apply morning tolerance so yesterday's streak is active today before first token - Scale egg hatch and stage thresholds by growthDifficulty / streakMultiplier - Multiplicatively compose with repeat boost (2x) and difficulty settings - Bootstrap streak on first launch from monthDailyTotals - Preserve and sanitize streak state during SaveTransfer - Display header flame badge with localized tooltips across 7 languages - Add comprehensive unit tests in StreakMultiplierTests (1169 total tests pass)
…nd optimize tick updates (chattymin#260) - Decouple difficulty clamping from streak multiplier so lowest difficulty (0.1) receives full streak acceleration - Guard against west-bound timezone travel (todayDate <= lastDay) in effectiveDays and recordActiveDay - Only compute monthDailyTotals in updateCompanion when needsStreakBootstrap is true - Immediately persist CompanionState when active day advances streak - Early return 0 for identical dates in dayDifference without DateFormatter allocations - Unify streak multiplier formatting to consistent 2 decimals (1.10x, 1.25x, 1.35x, 1.50x) - Polish Korean, Japanese, and German localized streak tooltips - Add lineLimit(1) and tail truncation to stage text in CompanionHeader - Add 5 new test cases in StreakMultiplierTests covering extreme difficulties, timezone travel, multi-provider updates, threshold clamping, and formatting (1174 tests pass)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Point 1 of #260 by introducing a Daily Streak Multiplier that rewards consistent daily coding with accelerated Pokémon incubation and evolution growth.
Key features:
10Mtokens by default, configurable) inCompanionState.streak(StreakState).monthDailyTotalshistory.1.10×(+10% speed)1.25×(+25% speed)1.35×(+35% speed)1.50×(+50% speed)growthDifficulty / streakMultiplier(decoupled from difficulty clamping so even lowest 0.1 difficulty receives the full bonus), compounding multiplicatively with existing repeat growth boost (2.0×).🔥 1d,🔥 7d (1.25×)) inCompanionHeadernext to the stage & nature row for active companions and next to incubation status for eggs.1.10×,1.25×,1.35×,1.50×).en,ko,ja,es,fr,pt,de).monthDailyTotalson initial bootstrap, skipping heavy snapshot transformations during normal 10-second refresh ticks.CompanionState.streakis classified under progress transfer and preserved across Mac backups.[0, 3650]during import sanitization.Type of change
UI changes
🔥 1dor🔥 7d (1.25×)) next to the stage & nature row when active (≥ 1 day, with growth boost kicking in at 3 days). Hovering displays a detailed tooltip with current boost percentage. Incubating eggs also display the active streak badge.Checklist
swift buildandswift testpass locally🤖 Generated with Antigravity 2.0 (AGY 2.0)