Repository navigation
feat(quests): gems ride on generated tray pieces, not pre-placed - #17
Merged
Merged
Conversation
User feedback: pre-placing every gem on the grid made stages swingy and kept goals small. Now gems spawn on generated tray pieces — assignGems attaches gems (~50% of pieces, big pieces sometimes two) drawing only colors still needed; a fully-collected color stops appearing; a placed gem is collected when a line through it clears; over-collecting is fine. - Model: GameState.trayGems (per-slot cell->color) + gemGoal; placement.stampWithGems; engine threads gems through place/refill; quest controller passes the goal. - Render: placed gems keep the piece color (pre-placed stay light); tray pieces show their gems (shared paintGemStar). - Validator: dropped the obsolete 'board must contain the gems' rule, added a gem-count range. All 20 gem stages stripped of board gems, goals raised (single 8 / two 6 / three 5). Tests: engine gem collection + needed-only refill + over-collect; assignGems needed-only/deterministic; trayGems/gemGoal save round-trip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
uhmin99
added a commit
that referenced
this pull request
Jul 15, 2026
#18) User feedback: pre-placing every gem on the grid made stages swingy and kept goals small. Now gems spawn on generated tray pieces — assignGems attaches gems (~50% of pieces, big pieces sometimes two) drawing only colors still needed; a fully-collected color stops appearing; a placed gem is collected when a line through it clears; over-collecting is fine. - Model: GameState.trayGems (per-slot cell->color) + gemGoal; placement.stampWithGems; engine threads gems through place/refill; quest controller passes the goal. - Render: placed gems keep the piece color (pre-placed stay light); tray pieces show their gems (shared paintGemStar). - Validator: dropped the obsolete 'board must contain the gems' rule, added a gem-count range. All 20 gem stages stripped of board gems, goals raised (single 8 / two 6 / three 5). Tests: engine gem collection + needed-only refill + over-collect; assignGems needed-only/deterministic; trayGems/gemGoal save round-trip. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Reworks gem-goal quest stages so gems appear on generated tray pieces
instead of being pre-placed on the board.
Why
Pre-placing all goal gems on the grid made some stages trivially easy and
others too hard, and capped how high a goal could be. Now gems spawn on
new pieces (0, 1, or 2 per piece), drawn only from colors still needed,
so goals can be large and multi-color, and a fully-collected color stops
spawning.
Model
GameState.trayGems(per-slot cell-index→gem, parallel totray) andGameState.gemGoal(target per color). Both round-trip through save JSON(emitted only when non-empty).
assignGems(tray, needed)in the piece generator: weighted by remainingneed,
gemSpawnChanceper piece,gemSecondChancefor ≥4-cell pieces.Deterministic from the RNG.
stampWithGemsplaces a piece carrying its gems; gems collect when aline through them clears. Over-collecting is fine (win is ≥ goal).
Render
paintGemStar.Content
stripped to plain blocks; goals raised (single 8, two 6 each, three 5
each). Checksums updated.
Docs & tests
over-collect exceeds goal, assignGems determinism, save round-trip.
89 tests pass, analyze clean.
🤖 Generated with Claude Code