ADD boss mutators - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces “boss round” mechanics and supporting infrastructure by adding boss mutators, a boss-round announcement screen in the shell UI, and a lightweight event bus. It also refactors scoring into a reusable ScoringPipeline and migrates gameplay scoring to use it.
Changes:
- Added
BossMutatorframework withColorBanandWhitePegBlind, and wired mutator selection intoRunState.new_round()for final-tier rounds. - Added a simple pub-sub
EventBusand publishedRoundStarted/ShopEnteredevents from the run/shop flow. - Added a
BossAnnouncementScreen+ renderer support to display boss round info before gameplay resumes.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mastermind-shell/src/mastermind_shell/screens/shop.py | Publishes ShopEntered and pushes BossAnnouncementScreen when leaving shop into a boss round. |
| packages/mastermind-shell/src/mastermind_shell/screens/boss_announcement.py | New screen to display boss round title + mutator description. |
| packages/mastermind-shell/src/mastermind_shell/engine/renderer.py | Extends Renderer protocol with render_boss_announcement. |
| packages/mastermind-shell/src/mastermind_shell/curses_backend/renderer.py | Implements boss announcement rendering in curses backend. |
| packages/mastermind-overlay/src/mastermind_overlay/scoring/pipeline.py | Introduces ScoringPipeline to run scoring stages sequentially. |
| packages/mastermind-overlay/src/mastermind_overlay/run/run_state.py | Adds EventBus, publishes RoundStarted, and selects boss mutators for final rounds. |
| packages/mastermind-overlay/src/mastermind_overlay/run/gamestate.py | Adds mutator support (allowed colors + feedback transform) and switches relic scoring to ScoringPipeline. |
| packages/mastermind-overlay/src/mastermind_overlay/events/bus.py | New EventBus implementation (subscribe/publish). |
| packages/mastermind-overlay/src/mastermind_overlay/events/catalog/shop_entered.py | New ShopEntered event type. |
| packages/mastermind-overlay/src/mastermind_overlay/events/catalog/round_started.py | New RoundStarted event type carrying RoundTier. |
| packages/mastermind-overlay/src/mastermind_overlay/boss_mutators/mutator.py | New base BossMutator API (description, feedback transform, allowed colors, round start hook). |
| packages/mastermind-overlay/src/mastermind_overlay/boss_mutators/catalog/color_ban.py | Implements color-banning mutator via allowed_colors(). |
| packages/mastermind-overlay/src/mastermind_overlay/boss_mutators/catalog/white_peg_blind.py | Implements white-peg hiding via transform_feedback(). |
| packages/mastermind-overlay/src/mastermind_overlay/boss_mutators/catalog/init.py | Registers available boss mutators in BOSS_MUTATORS. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+247
to
+259
| def render_boss_announcement(self, title: str, description: str) -> None: | ||
| self._stdscr.clear() | ||
| self._stdscr.addstr( | ||
| curses.LINES // 2, | ||
| (curses.COLS - len(title)) // 2, | ||
| title, | ||
| curses.A_STANDOUT) | ||
| self._stdscr.addstr( | ||
| curses.LINES // 2 + 1, | ||
| (curses.COLS - len(description)) // 2, | ||
| description, | ||
| curses.A_STANDOUT) | ||
| self._stdscr.refresh() |
Comment on lines
+69
to
+71
| mutator: BossMutator | None = self._pick_mutator() if self.tier.is_final else None | ||
| self._events.publish(RoundStarted(self.tier)) | ||
| return GameState(self._BASE_MAX_TURNS, target, self._relics, mutator) |
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
ScoringPipeline, migrateReliconto itEventBuswithRoundStarted/ShopEnterednotificationsBossMutatorbase class with two mutators:ColorBan(bans a color from player input, secret code unaffected) andWhitePegBlind(hides white-peg feedback from display only, scoring unaffected)RunState.new_round()forRoundTier.FINALrounds, and add aBossAnnouncementScreenshown before a boss round starts