feat: Charge Up system — 8-hour free forge timer with capped rarity - #354
Draft
driver727-pixel wants to merge 2 commits into
Draft
feat: Charge Up system — 8-hour free forge timer with capped rarity#354driver727-pixel wants to merge 2 commits into
driver727-pixel wants to merge 2 commits into
Conversation
…ture flags, server stubs, Firestore rule stubs - docs/DATA_MODEL.md: audit of all existing Firestore collections with document shapes - docs/AGENT_STATUS.md: daily sync artifact for Gamma/Charlie coordination - src/lib/sharedTypes.ts: append-only shared contract file (DailyStreak, Mission, BattlePassState, Crew, RankedSeason, RankedEntry, ShareLink) - src/lib/featureFlags.ts: central feature-flag registry (all default false) - server/battlePass.js, server/ranked.js, server/crews.js, server/dailyRewards.js: no-op handler stubs - firestore.rules: read-only stub rules for dailyStreaks, missions, battlePass, crews, rankedSeasons, shareLinks Co-authored-by: SP Digital <driver727@gmail.com>
- src/lib/chargeUp.ts: core timer logic (8h interval, localStorage persistence, rarity clamping to Apprentice max)
- src/hooks/useChargeUp.ts: React hook with live countdown ticker
- src/components/ChargeUpIndicator.tsx: UI indicator showing timer/ready state
- TierContext: extended canForge to include chargeUp.available
- useForgeGeneration: detects charge forge, clamps rarity, consumes charge
- CardForge.tsx: mounts ChargeUpIndicator below quick actions
- featureFlags.ts: added CHARGE_UP flag (default false)
- sharedTypes.ts: added ChargeUpState interface
- firestore.rules: added chargeUps/{uid} read-only stub
- index.css: charge-up-indicator styles with pulse animation
Co-authored-by: SP Digital <driver727@gmail.com>
11 tasks
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 the "Charge Up" mechanic — every 8 hours players earn one free forge attempt, capped at Apprentice rarity. This is the first cadence hook in the Daily → Weekly → Seasonal engagement loop, designed to bring players back 2–3x/day.
How It Works
ChargeUpIndicatorshows "Charge Up Ready" with a lightning bolt and pulse animationlocalStorageand is independent of tier/creditsIntegration Points
canForgeextended:TierContextnow considerschargeUp.available— players who are out of credits AND have used their free card can still forge if a charge is readyclampToChargeRarity()ensures the generated card is at most Apprentice rarityFiles Changed
src/lib/chargeUp.tslocalStoragepersistencesrc/hooks/useChargeUp.tssrc/components/ChargeUpIndicator.tsxsrc/context/TierContext.tsxcanForgeto include charge availabilitysrc/pages/cardForge/useForgeGeneration.tssrc/pages/cardForge/useCardForgeController.tschargeUpthrough controllersrc/pages/CardForge.tsxChargeUpIndicatorbelow quick actionssrc/lib/featureFlags.tsCHARGE_UPflag (defaultfalse)src/lib/sharedTypes.tsChargeUpStateinterface for Firestore persistencefirestore.ruleschargeUps/{uid}read-only stub rulesrc/index.cssFeature Flag
Ships behind
VITE_FF_CHARGE_UP. Set totrueto enable. Defaultfalsein production until QA.Testing
tsc --noEmitpasses clean