Skip to content

ADD boss mutators - #1

Merged
TheLeBerton merged 6 commits into
masterfrom
feat/boss-mutators
Aug 29, 2026
Merged

ADD boss mutators#1
TheLeBerton merged 6 commits into
masterfrom
feat/boss-mutators

Conversation

@TheLeBerton

Copy link
Copy Markdown
Contributor

Summary

  • Extract scoring into a ScoringPipeline, migrate Relic onto it
  • Add a pub-sub EventBus with RoundStarted/ShopEntered notifications
  • Add BossMutator base class with two mutators: ColorBan (bans a color from player input, secret code unaffected) and WhitePegBlind (hides white-peg feedback from display only, scoring unaffected)
  • Wire mutator selection into RunState.new_round() for RoundTier.FINAL rounds, and add a BossAnnouncementScreen shown before a boss round starts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BossMutator framework with ColorBan and WhitePegBlind, and wired mutator selection into RunState.new_round() for final-tier rounds.
  • Added a simple pub-sub EventBus and published RoundStarted/ShopEntered events 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)
@TheLeBerton
TheLeBerton merged commit 3d498a2 into master Aug 29, 2026
1 check passed
@TheLeBerton
TheLeBerton deleted the feat/boss-mutators branch August 29, 2026 09:58
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.

2 participants