belote-cli 1.1.0__tar.gz → 2.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {belote_cli-1.1.0 → belote_cli-2.5.2}/.claude/settings.local.json +3 -1
- {belote_cli-1.1.0 → belote_cli-2.5.2}/CHANGELOG.md +177 -1
- {belote_cli-1.1.0 → belote_cli-2.5.2}/DEVELOPMENT.md +38 -10
- {belote_cli-1.1.0 → belote_cli-2.5.2}/PKG-INFO +95 -16
- {belote_cli-1.1.0 → belote_cli-2.5.2}/README.md +94 -15
- {belote_cli-1.1.0 → belote_cli-2.5.2}/pyproject.toml +2 -1
- belote_cli-2.5.2/scripts/benchmark.py +188 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/__init__.py +1 -1
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/ai.py +106 -44
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/ansi.py +5 -4
- belote_cli-2.5.2/src/belote/belatro/core/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/core/economy.py +35 -0
- belote_cli-2.5.2/src/belote/belatro/core/run_state.py +93 -0
- belote_cli-2.5.2/src/belote/belatro/core/scoring.py +139 -0
- belote_cli-2.5.2/src/belote/belatro/engine/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/engine/event_bus.py +72 -0
- belote_cli-2.5.2/src/belote/belatro/engine/modifier_patch.py +71 -0
- belote_cli-2.5.2/src/belote/belatro/engine/round_driver.py +234 -0
- belote_cli-2.5.2/src/belote/belatro/items/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/items/base.py +95 -0
- belote_cli-2.5.2/src/belote/belatro/items/jokers/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/items/jokers/contract.py +136 -0
- belote_cli-2.5.2/src/belote/belatro/items/jokers/corrupted.py +65 -0
- belote_cli-2.5.2/src/belote/belatro/items/jokers/economy.py +52 -0
- belote_cli-2.5.2/src/belote/belatro/items/jokers/hand_comp.py +103 -0
- belote_cli-2.5.2/src/belote/belatro/items/jokers/trick_timing.py +79 -0
- belote_cli-2.5.2/src/belote/belatro/items/partner_jokers/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/items/partner_jokers/passive.py +56 -0
- belote_cli-2.5.2/src/belote/belatro/items/partner_jokers/risky.py +82 -0
- belote_cli-2.5.2/src/belote/belatro/items/partner_jokers/shaper.py +65 -0
- belote_cli-2.5.2/src/belote/belatro/items/planets.py +165 -0
- belote_cli-2.5.2/src/belote/belatro/items/registry.py +91 -0
- belote_cli-2.5.2/src/belote/belatro/items/tarots.py +117 -0
- belote_cli-2.5.2/src/belote/belatro/items/vouchers.py +102 -0
- belote_cli-2.5.2/src/belote/belatro/main.py +241 -0
- belote_cli-2.5.2/src/belote/belatro/partner/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/partner/partner_state.py +28 -0
- belote_cli-2.5.2/src/belote/belatro/partner/personality.py +127 -0
- belote_cli-2.5.2/src/belote/belatro/partner/trust.py +70 -0
- belote_cli-2.5.2/src/belote/belatro/progression/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/progression/save.py +80 -0
- belote_cli-2.5.2/src/belote/belatro/progression/unlocks.py +78 -0
- belote_cli-2.5.2/src/belote/belatro/run/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/run/ante.py +39 -0
- belote_cli-2.5.2/src/belote/belatro/run/boss.py +217 -0
- belote_cli-2.5.2/src/belote/belatro/run/decks.py +126 -0
- belote_cli-2.5.2/src/belote/belatro/run/shop.py +109 -0
- belote_cli-2.5.2/src/belote/belatro/ui/__init__.py +0 -0
- belote_cli-2.5.2/src/belote/belatro/ui/announce.py +77 -0
- belote_cli-2.5.2/src/belote/belatro/ui/collection.py +142 -0
- belote_cli-2.5.2/src/belote/belatro/ui/hud.py +64 -0
- belote_cli-2.5.2/src/belote/belatro/ui/menu.py +184 -0
- belote_cli-2.5.2/src/belote/belatro/ui/rules.py +233 -0
- belote_cli-2.5.2/src/belote/belatro/ui/shop.py +149 -0
- belote_cli-2.5.2/src/belote/belatro/ui/trust_bar.py +36 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/config.py +11 -7
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/context.py +2 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/deck.py +7 -9
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/game.py +261 -61
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/gameflow.py +83 -39
- belote_cli-2.5.2/src/belote/input.py +207 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/main.py +59 -22
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/rules.py +17 -17
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/scoring.py +204 -77
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/stats.py +42 -15
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/themes.py +6 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/ui/announce.py +38 -12
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/ui/menu.py +51 -32
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/ui/prompts.py +30 -18
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/ui/render.py +98 -58
- belote_cli-2.5.2/tests/__init__.py +0 -0
- belote_cli-2.5.2/tests/belatro/__init__.py +0 -0
- belote_cli-2.5.2/tests/belatro/test_belatro.py +1699 -0
- belote_cli-2.5.2/tests/belatro/test_boss_modifiers_integration.py +87 -0
- belote_cli-2.5.2/tests/belatro/test_collection_logic.py +38 -0
- belote_cli-2.5.2/tests/belatro/test_deck_variants.py +84 -0
- belote_cli-2.5.2/tests/belatro/test_partner_trust.py +104 -0
- belote_cli-2.5.2/tests/belatro/test_progression.py +34 -0
- belote_cli-2.5.2/tests/belatro/test_round_driver.py +141 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/tests/test_ai.py +15 -18
- {belote_cli-1.1.0 → belote_cli-2.5.2}/tests/test_belote.py +202 -102
- {belote_cli-1.1.0 → belote_cli-2.5.2}/tests/test_extended.py +13 -9
- {belote_cli-1.1.0 → belote_cli-2.5.2}/tests/test_game_logic.py +10 -12
- {belote_cli-1.1.0 → belote_cli-2.5.2}/tests/test_gameflow.py +32 -30
- {belote_cli-1.1.0 → belote_cli-2.5.2}/tests/test_new_coverage.py +40 -41
- belote_cli-2.5.2/tests/test_official_rules.py +269 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/tests/test_properties.py +10 -6
- belote_cli-1.1.0/scripts/benchmark.py +0 -75
- belote_cli-1.1.0/src/belote/input.py +0 -245
- belote_cli-1.1.0/tests/test_official_rules.py +0 -174
- {belote_cli-1.1.0 → belote_cli-2.5.2}/.gitignore +0 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/GRIMAUD Standard Playing-Cards-1898.png +0 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/LICENSE +0 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/__init__.py +0 -0
- {belote_cli-1.1.0/tests → belote_cli-2.5.2/src/belote/belatro}/__init__.py +0 -0
- {belote_cli-1.1.0 → belote_cli-2.5.2}/src/belote/ui/__init__.py +0 -0
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
"Bash(python3 -m ruff check src/ --statistics)",
|
|
8
8
|
"Bash(python3 -m mypy src/belote/ --ignore-missing-imports)",
|
|
9
9
|
"Bash(python3 -m pytest tests/ -q --tb=short)",
|
|
10
|
-
"Bash(python3 -m pytest tests/ -q --tb=no)"
|
|
10
|
+
"Bash(python3 -m pytest tests/ -q --tb=no)",
|
|
11
|
+
"Bash(python3 -m pytest tests/ -x -q)",
|
|
12
|
+
"Bash(PYTHONPATH=src python3 *)"
|
|
11
13
|
]
|
|
12
14
|
}
|
|
13
15
|
}
|
|
@@ -5,7 +5,183 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [2.5.2] - 2026-05-02
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Critical Winner Detection Bug**: Resolved an issue in `game.py` where trick wins were assigned to the wrong player.
|
|
12
|
+
- **Scoring Engine Desync**: Fixed a major bug in `round_driver.py` where trick points were being calculated manually, leading to desyncs with boss modifiers. Now uses a direct state differential from the core engine.
|
|
13
|
+
- **Declaration Scoring**: Realized actual point values for sequences and carrés in `round_driver.py` using the official scoring utilities.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **Partner Trust Integration**: Fully wired the trust system into the BelAtro run loop. Trust now increases on blind beats and big wins, and decreases on failures or chutes.
|
|
17
|
+
- **AI Personalities in Bidding**: The partner AI now uses its assigned personality (e.g., *Le Courageux*, *L'Économe*) to make bidding decisions, respecting trust levels.
|
|
18
|
+
- **Dynamic Partner Hand Visibility**: The partner's hand now automatically becomes visible to the player once the "shares void info" trust threshold is met.
|
|
19
|
+
- **Performance Cache Invalidation**: Added targeted cache clearing after boss modifier application to ensure game logic remains accurate and performant.
|
|
20
|
+
|
|
21
|
+
## [2.5.1] - 2026-05-02
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- **BelAtro Collection Discovery**: Items are now only revealed in the collection when actually encountered in-game, rather than immediately upon unlocking.
|
|
25
|
+
- **Auto-Save Persistence**: Added automatic profile saving after run initialization and shop encounters to ensure discovered items are never lost.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- **BelAtro Shop Crash**: Resolved a `NameError` in the shop UI by adding the missing `sys` import.
|
|
29
|
+
- **Trick Visibility Timing**: Fixed a race condition in `round_driver.py` where the 4th card of a trick was cleared before it could be rendered. The UI now correctly displays all 4 cards on the table before the trick-win popup appears.
|
|
30
|
+
|
|
31
|
+
## [2.5.0] - 2026-05-02
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
- **Functional State Architecture**: Completed the transition to a pure functional engine. Joker state is now stored immutably in `GameState`, ensuring absolute "frozen-safety" and preventing state leakage between rounds.
|
|
35
|
+
- **Comprehensive BelAtro Test Suite**: Added a massive collection of 50+ new integration and regression tests covering all 57 critical edge cases identified in the audit. Total test count reached 276.
|
|
36
|
+
- **Performance Benchmarking Suite**: Added a new benchmark tool in `scripts/benchmark.py` to measure scoring, dealing, and legal card calculation performance.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- **Scoring Engine Refactor**: Decoupled boss modifier scoring logic into specialized helper functions, significantly improving maintainability and reducing risk of regression in complex Boss Blinds.
|
|
40
|
+
- **AI Strategy Decomposition**: Refactored the Hard AI decision-making into a clean strategy pattern, allowing for more granular tactical tuning.
|
|
41
|
+
- **EventBus Reliability**: Overhauled `EventBus.emit` to safely handle handler unsubscription during event dispatch, fixing a potential runtime crash.
|
|
42
|
+
- **Immutable Score Accumulation**: `ScoreAccumulator` now returns a new `GameState` instead of mutating internal fields, aligning BelAtro with the core engine's architectural principles.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
- **Animation Skip Reset (M6)**: Animation fast-forwarding now correctly resets on every human turn, preventing the game from accidentally staying in high-speed mode.
|
|
46
|
+
- **Score Overflow Precision**: Fixed a floating-point precision issue in `ScoreAccumulator` when dealing with extremely large chip counts (billions+).
|
|
47
|
+
- **Boss Blind Core Bugs**: Fixed all remaining audit bugs (B1-B8), including boss modifier application, scoring accumulation disconnects, and deck-specific bonus triggers.
|
|
48
|
+
|
|
49
|
+
## [2.4.1] - 2026-05-02
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
- **BelAtro Rules UI**: Fixed a major rendering bug where the rules screen would not clear correctly, leading to overlapping text.
|
|
53
|
+
- **Dynamic Formatting**: Rules screen now correctly handles terminal resizing and dynamic centering.
|
|
54
|
+
|
|
55
|
+
## [2.4.0] - 2026-05-02
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
- **BelAtro Collection (Almanac)**: A persistent gallery in the expansion menu to track discovered Jokers, Tarots, Planets, and Vouchers.
|
|
59
|
+
- **Full Boss Blind Suite**: All 17 unique bosses implemented, including complex mechanics like *L'Anarchie* (dynamic trump) and *La Rupture* (no consecutive wins).
|
|
60
|
+
- **Hard AI Overhaul**: Improved endgame awareness (Dix de Der), strategic discarding, and 2-ply void inference.
|
|
61
|
+
- **Enhanced UI Terminology**: Transitioned to "You" and "Partner" labels for a more immersive single-player experience.
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- **Single-Player Focus**: Removed Hotseat (2P) mode and simplified the game engine and UI menus accordingly.
|
|
65
|
+
- **Consolidated Save Paths**: All local data (stats and profile) now live in a unified `belote` directory.
|
|
66
|
+
- **Menu Streamlining**: Removed "Mode" and "Reset Statistics" options for a cleaner main menu.
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
- **Gameflow Reliability**: Fixed a regression that caused certain tests to hang by properly mocking UI prompts.
|
|
70
|
+
- **Technical Integrity**: Achieved 100% type-safety (0 mypy errors) across all source and test modules.
|
|
71
|
+
|
|
72
|
+
## [2.3.3] - 2026-05-02
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
- **BelAtro Mode Integration**: Fully integrated the BelAtro roguelite mode into the main menu.
|
|
76
|
+
- **WIP Deck Completion**: Fully implemented all starting decks (L'Ermite, Le Vétéran, Le Flambeur) with their unique starting items and modifiers.
|
|
77
|
+
- **Advanced Joker Logic**: Completed implementation for all 50+ Jokers, including complex round-end and bidding-phase triggers.
|
|
78
|
+
- **Dynamic UI Rendering**: Refactored menu systems to dynamically center art and text based on terminal width.
|
|
79
|
+
- **Alternate Screen Support**: Implemented alternate screen switching for BelAtro to provide a clean, isolated terminal buffer.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
- **BelAtro Startup**: Resolved a `TypeError` and `ImportError` that prevented BelAtro from launching correctly.
|
|
83
|
+
- **UI Centering**: Fixed an issue where menu art assumed a fixed 80-column width, causing misaligned headers on different terminal sizes.
|
|
84
|
+
- **Game Loop Continuity**: Fixed a bug where BelAtro would exit immediately back to the main menu instead of starting a run.
|
|
85
|
+
- **Event Bus Robustness**: Overhauled the `RoundEndEvent` to provide complete game state snapshots to Jokers, fixing several uninitialized logic paths.
|
|
86
|
+
|
|
87
|
+
## [2.3.1] - 2026-05-01
|
|
88
|
+
|
|
89
|
+
### Fixed
|
|
90
|
+
- **Contract Engine Logic**: Fixed a critical bug where trick winner detection failed during "Sans Atout" (No Trump) contracts. The engine now correctly handles `trump=None` scenarios.
|
|
91
|
+
- **Tout Atout / Sans Atout support**: Fully implemented correct card values and rankings for special contracts.
|
|
92
|
+
- *Tout Atout*: All Jacks (20 pts), all 9s (14 pts), and all suits follow trump ranking.
|
|
93
|
+
- *Sans Atout*: All Aces (11 pts), all 10s (10 pts), and all 9s (0 pts).
|
|
94
|
+
- **Coinche Multipliers**: Fixed a bug where Coinche (×2) and Surcoinche (×4) multipliers were not being applied to the final score in the core engine.
|
|
95
|
+
- **Sequence Detection**: Refactored sequence detection logic to be more maintainable and fixed a potential `NameError` in the detection loop.
|
|
96
|
+
- **Project-wide Type Safety**: Resolved over 250 `mypy` errors across the `tests/` and `src/` directories, achieving 100% strict type compliance.
|
|
97
|
+
- **Linting & Code Cleanup**: Eliminated all `ruff` violations and improved idiomatic Python usage throughout the codebase.
|
|
98
|
+
- **API Consistency**: Updated `trick_winner_seat`, `card_points`, and `trick_rank` to explicitly accept the `contract` type, ensuring accurate scoring and AI decisions across all game modes.
|
|
99
|
+
|
|
100
|
+
## [2.3.0] - 2026-05-01
|
|
101
|
+
|
|
102
|
+
### Added
|
|
103
|
+
- **Full Tarot System**: All 10 Tarot cards are now fully functional. Use `[U]` during your turn to open the consumable menu.
|
|
104
|
+
- *Le Chariot*: Steal the current trick (wired `force_next_trick_win`).
|
|
105
|
+
- *La Roue*: Change trump mid-round.
|
|
106
|
+
- *Le Jugement*: Resurrect sold Jokers.
|
|
107
|
+
- *Le Monde*: Double declaration points.
|
|
108
|
+
- *La Tempérance* & *Le Fou*: Permanent deck editing (random removal/duplication).
|
|
109
|
+
- **Complete Voucher Set**: All 9 vouchers are implemented with unique hooks.
|
|
110
|
+
- *La Télescope*: Preview the talon during bidding.
|
|
111
|
+
- *L'Encyclopédie*: Reveal partner personality during bidding.
|
|
112
|
+
- *Les Cartes Dorées*: Increased Gold Seal value (+$5).
|
|
113
|
+
- *Le Couteau*: Unlock card destruction in the Shop for $2 refunds.
|
|
114
|
+
- *La Balance*: Automatic win on close losses (within 10 points of target).
|
|
115
|
+
- *La Surcoinche*: Unlocks the massive ×4.0 Mult contract.
|
|
116
|
+
- **Dynamic Deck-Building**: The game engine now supports modified decks, allowing for permanent card additions and removals across a run.
|
|
117
|
+
- **Corrupted Joker Mechanics**: Implemented `Le Démon` (trust penalty on purchase).
|
|
118
|
+
- **Expanded Test Suite**: Added 52 new tests (total 165), significantly increasing coverage for `round_driver.py`, `shop.py`, `tarots.py`, and `vouchers.py`.
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
- **Bidding Overhaul**: Opponents can now Coinche your bids (×2.0 Mult), and you can counter with Surcoinche (×4.0 Mult) if the voucher is owned.
|
|
122
|
+
- **Input Map**: Added `[U]` key for using consumables and removed `Tab` -> `Enter` mapping.
|
|
123
|
+
- **Performance**: Increased render cache size to 2048 and moved suit/ID mappings to module level for faster scoring.
|
|
124
|
+
- **Code Quality**: Extracted `_undo_or_restart` helper in `gameflow.py` and improved `EventBus` error logging.
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
- **Critical Bug Fixes**:
|
|
128
|
+
- *La Sentinelle*: Now correctly requires both Jack AND trump suit.
|
|
129
|
+
- *Le Rebelle*: Multiplier no longer stacks exponentially on Belote+Rebelote.
|
|
130
|
+
- *Le Stratège*: Strategic bidding logic (requires high-value cards instead of just any hand).
|
|
131
|
+
- *Recursive UI*: Fixed stack overflow risk in `prompt_card` on UNDO.
|
|
132
|
+
- *Shop Duplicates*: Replaced random choice with sampling to prevent identical jokers in shop.
|
|
133
|
+
- *UI Truncation*: Card destruction UI no longer truncates at 20 cards.
|
|
134
|
+
- **Boss Modifier Engine**: Fully wired 17 boss modifiers (forced pass, zero-point kings/tens, no Dix de Der, etc.) into the game engine.
|
|
135
|
+
- **Declaration scoring crash** (`round_driver.py`): replaced nonexistent `belote.deck.declaration_points` import with `belote.scoring.get_declaration_points`.
|
|
136
|
+
- **JokerResult multiplier zeroing** (`items/base.py`): `times_mult` default changed from `0.0` to `1.0`.
|
|
137
|
+
- **BelAtro standalone crash** (`belatro/main.py`): fixed missing `KeyReader` context.
|
|
138
|
+
- **Bid prompt null-dereference** (`ui/prompts.py`): added guards for `up_card`.
|
|
139
|
+
- **Type safety**: Resolved all 32 mypy errors and improved overall project type integrity.
|
|
140
|
+
- **Starting Decks**: All bonuses for *Le Joueur*, *L'Aristocrate*, *L'Ermite*, *Le Flambeur*, *Le Vétéran*, and *L'Anarchiste* are now correctly applied.
|
|
141
|
+
- **Scoring Hooks**: Wired missing `on_bid`, `on_round_start`, and `on_round_end` triggers for all Jokers.
|
|
142
|
+
|
|
143
|
+
## [2.2.0] - 2026-04-30
|
|
144
|
+
|
|
145
|
+
### Added
|
|
146
|
+
- **BelAtro Score Overlay Toggle**: Press `[I]` during any Belote/BelAtro game to toggle the per-trick score breakdown popup on or off. Useful when you want an unobstructed view of the table between tricks.
|
|
147
|
+
|
|
148
|
+
### Fixed
|
|
149
|
+
- **BelAtro trick display**: The 4th card played in a trick (the trick-completing card) was never shown on the table — the table went blank before the score popup appeared. All 4 cards now remain visible on the mat until the next trick begins.
|
|
150
|
+
- **BelAtro 4th-card visibility**: `on_card_played` now reconstructs the display state from `completed_tricks[-1]` when `current_trick` has been cleared by `play_card`, mirroring the classic mode's pre-play display state pattern.
|
|
151
|
+
|
|
152
|
+
## [2.0.1] - 2026-04-30
|
|
153
|
+
|
|
154
|
+
### Added
|
|
155
|
+
- **Le Républicain deck** is now fully playable: 7s and 8s are wild cards that can be played on any trick regardless of suit constraints. Your team earns +5 chips for every 7 or 8 you capture.
|
|
156
|
+
- **Le Carnet voucher** is now fully implemented: your partner's full hand is visible to you throughout every round. You earn +1 Mult each time South personally wins a trick.
|
|
157
|
+
- Both mechanics documented in the in-game Belatro Rules screen (EN and FR), under new "Starting Decks" and "Vouchers — Le Carnet" sections.
|
|
158
|
+
|
|
159
|
+
### Fixed
|
|
160
|
+
- Card-count invariant assertion added to `_handle_trick` to catch any future hand-size corruption early.
|
|
161
|
+
- Cards on the trick mat now render immediately after each card is played (previously only updated after the trick was complete).
|
|
162
|
+
|
|
163
|
+
## [2.0.0] - 2026-04-30
|
|
164
|
+
|
|
165
|
+
### Added
|
|
166
|
+
- **BelAtro Expansion**: A massive roguelite expansion inspired by Balatro, integrated into the Belote core.
|
|
167
|
+
- **The Run**: Progress through 8 'Antes' with increasing target scores. Each Ante consists of Small, Big, and Boss Blinds.
|
|
168
|
+
- **Scoring Engine**: New Multiplier-based scoring system: `Score = (Chips + Declarations) × Multiplier`.
|
|
169
|
+
- **Joker System**: 50+ unique Jokers (Contract, Corrupted, Economy, Hand Comp, Trick Timing) that provide passive buffs and scoring modifiers.
|
|
170
|
+
- **Consumables**: Planet cards to level up contracts, Tarot cards for one-shot effects, and permanent Vouchers.
|
|
171
|
+
- **Partner Trust**: Dynamic relationship with your AI partner. High trust reveals their hand/voids and boosts their specific "Partner Jokers."
|
|
172
|
+
- **Boss Blinds**: 10+ unique bosses with rule-breaking modifiers (e.g., hidden scores, suit debuffs, mid-round trump changes).
|
|
173
|
+
- **Event-Driven Architecture**: Introduced a centralized `EventBus` to handle complex item interactions and state updates.
|
|
174
|
+
- **Save/Load System**: Persistence for run progress, unlocks, and global statistics.
|
|
175
|
+
- **New UI Package**: Dedicated BelAtro HUD with Multiplier animations, Shop interface, and Trust bar visualization.
|
|
176
|
+
|
|
177
|
+
### Changed
|
|
178
|
+
- **Entry Points**: Added `belatro` as a secondary CLI command for direct access to the roguelite mode.
|
|
179
|
+
- **Core Refactor**: Decoupled the game loop from the rendering engine to support multiple game modes (Classic vs. BelAtro).
|
|
180
|
+
- **Test Suite**: Expanded tests to cover economy, ante scaling, item registry, and boss modifiers.
|
|
181
|
+
|
|
182
|
+
### Fixed
|
|
183
|
+
- **State Leakage**: Fixed an issue where items from previous runs could occasionally persist in the registry.
|
|
184
|
+
- **Trust Calculation**: Resolved a rounding error in trust gains during high-multiplier rounds.
|
|
9
185
|
|
|
10
186
|
## [1.1.0] - 2026-04-30
|
|
11
187
|
|
|
@@ -23,14 +23,20 @@ Welcome to the Belote development guide. This project is structured as a standar
|
|
|
23
23
|
|
|
24
24
|
## Running the Game
|
|
25
25
|
|
|
26
|
-
After installing, you can run the game using the `belote` command:
|
|
26
|
+
After installing, you can run the game using the `belote` command for Classic mode:
|
|
27
27
|
```bash
|
|
28
28
|
belote
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
Or the `belatro` command for the Roguelite expansion:
|
|
32
|
+
```bash
|
|
33
|
+
belatro
|
|
34
|
+
```
|
|
35
|
+
|
|
31
36
|
Or via python:
|
|
32
37
|
```bash
|
|
33
38
|
python -m belote.main
|
|
39
|
+
python -m belote.belatro.main
|
|
34
40
|
```
|
|
35
41
|
|
|
36
42
|
## Testing
|
|
@@ -42,7 +48,28 @@ pip install pytest
|
|
|
42
48
|
|
|
43
49
|
Run tests:
|
|
44
50
|
```bash
|
|
51
|
+
# Run all tests (Classic + BelAtro)
|
|
45
52
|
PYTHONPATH=src pytest
|
|
53
|
+
|
|
54
|
+
# Run only Classic Belote tests
|
|
55
|
+
PYTHONPATH=src pytest tests/
|
|
56
|
+
|
|
57
|
+
# Run only BelAtro tests
|
|
58
|
+
PYTHONPATH=src pytest tests/belatro/
|
|
59
|
+
|
|
60
|
+
# Run a single test file
|
|
61
|
+
PYTHONPATH=src pytest tests/test_game.py
|
|
62
|
+
PYTHONPATH=src pytest tests/belatro/test_scoring.py
|
|
63
|
+
|
|
64
|
+
# Run a single test by name
|
|
65
|
+
PYTHONPATH=src pytest tests/test_game.py::test_play_card_legal
|
|
66
|
+
PYTHONPATH=src pytest -k "test_scoring"
|
|
67
|
+
|
|
68
|
+
# Run with verbose output
|
|
69
|
+
PYTHONPATH=src pytest -v
|
|
70
|
+
|
|
71
|
+
# Run with coverage report
|
|
72
|
+
PYTHONPATH=src pytest --cov=belote --cov-report=term-missing
|
|
46
73
|
```
|
|
47
74
|
|
|
48
75
|
## Code Quality
|
|
@@ -51,19 +78,20 @@ The project maintains zero lint and type-check violations. Run all checks with:
|
|
|
51
78
|
|
|
52
79
|
```bash
|
|
53
80
|
# Type checking (0 errors expected)
|
|
54
|
-
PYTHONPATH=src
|
|
81
|
+
PYTHONPATH=src mypy .
|
|
55
82
|
|
|
56
83
|
# Linting (0 violations expected)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# Full test suite (71 tests expected)
|
|
84
|
+
ruff check .
|
|
85
|
+
# Full test suite (305 tests expected)
|
|
60
86
|
PYTHONPATH=src pytest
|
|
61
|
-
```
|
|
62
87
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- **
|
|
88
|
+
# ...
|
|
89
|
+
|
|
90
|
+
Current baseline:
|
|
91
|
+
- **mypy**: 0 errors (strict mode)
|
|
92
|
+
- **ruff**: 0 violations
|
|
93
|
+
- **pytest**: 305 tests, 0 failures
|
|
94
|
+
|
|
67
95
|
|
|
68
96
|
## Benchmarking
|
|
69
97
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: belote-cli
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.5.2
|
|
4
4
|
Summary: A 4-player terminal card game
|
|
5
5
|
Project-URL: Homepage, https://github.com/ElysiumDisc/belote
|
|
6
6
|
Project-URL: Repository, https://github.com/ElysiumDisc/belote
|
|
@@ -45,6 +45,41 @@ Description-Content-Type: text/markdown
|
|
|
45
45
|
|
|
46
46
|
Complete implementation of the French card game Belote for the terminal, with a full-screen green felt table and full card graphics at compass positions (N/W/E/S).
|
|
47
47
|
|
|
48
|
+
## Now Featuring: BelAtro Expansion
|
|
49
|
+
|
|
50
|
+
**BelAtro** is a major roguelite expansion inspired by *Balatro*. Play through 8 Antes of escalating difficulty, build a deck of powerful Jokers, and use Tarot cards and Planets to break the game!
|
|
51
|
+
|
|
52
|
+
**BelAtro is now fully integrated into the main menu!** Just launch `belote` and select it from the top of the list.
|
|
53
|
+
|
|
54
|
+
### BelAtro Quick Start
|
|
55
|
+
```bash
|
|
56
|
+
# Play using the integrated launcher (recommended)
|
|
57
|
+
belote
|
|
58
|
+
|
|
59
|
+
# Or play the new Roguelite mode directly
|
|
60
|
+
belatro
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Starting Decks (All Fully Implemented)
|
|
64
|
+
| Deck | Special Rule |
|
|
65
|
+
|---|---|
|
|
66
|
+
| Le Classique | Standard 32-card baseline |
|
|
67
|
+
| **Le Républicain** | 7s & 8s are wild — play them on any trick. +5 chips per 7/8 your team captures |
|
|
68
|
+
| L'Aristocrate | All four Aces start Gold Sealed (+cash) |
|
|
69
|
+
| Le Joueur | Start $14 — Boss Blind every 2 antes |
|
|
70
|
+
| **L'Ermite** | Starts with **La Sentinelle** Joker (×3 Mult if Trump Jack never leaves hand) |
|
|
71
|
+
| **Le Vétéran** | Start with a random **Planet** card pre-applied to level up a contract |
|
|
72
|
+
| **Le Flambeur** | Starts with **L'Aventurier** Partner Joker (×2 Mult if both win ≥3 tricks) |
|
|
73
|
+
| L'Anarchiste | Start $19 — Corrupted pool visible |
|
|
74
|
+
|
|
75
|
+
### Notable Vouchers
|
|
76
|
+
| Voucher | Effect |
|
|
77
|
+
|---|---|
|
|
78
|
+
| **Le Carnet** | See partner's full hand every round. +1 Mult each time South wins a trick |
|
|
79
|
+
| La Voûte | Earn $1 interest per $5 held, up to $5/round |
|
|
80
|
+
| La Double Donne | +1 Joker slot |
|
|
81
|
+
| La Surcoinche | Unlocks the Surcoinche contract *(unlockable)* |
|
|
82
|
+
|
|
48
83
|
## Showcase
|
|
49
84
|
|
|
50
85
|
### Main Menu
|
|
@@ -54,7 +89,7 @@ Complete implementation of the French card game Belote for the terminal, with a
|
|
|
54
89
|
⢰⣿⣿⣿⣿⡿⠟⠁⣠⣴⣶⣦⠄
|
|
55
90
|
⢸⣿⣿⠟⠉⣠⣴⣿⣿⣿⠟⠁⣠⣾⣿⣦⡀
|
|
56
91
|
⠉⣀⣴⣾⣿⣿⣿⠟⢁⣤⣾⣿⣿⣿⣿⣿⡆
|
|
57
|
-
|
|
92
|
+
⢀⣤⣾⣿⣿⣿⡿⠛⢁⣴⣿⣿⣿⡿⠛⢁⣴⣿⣿⣿⣿⣿⣿⣿⠟⠁⡀
|
|
58
93
|
⢼⣿⣿⣿⡿⠋⣀⣴⣿⣿⣿⣿⣿⣿⣿⡿⠉⣠⣾⣿⡆
|
|
59
94
|
⠘⢿⡿⠋⣠⣾⣿⣿⣿⠟⠁⣿⣿⣿⣿⣿⠟⢁⣀
|
|
60
95
|
⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⠏⢀⣴⣿⣿⣿⠋⢠⣾⣿⣷⣦⡀
|
|
@@ -114,6 +149,9 @@ pip install belote-cli
|
|
|
114
149
|
# Play using the belote command
|
|
115
150
|
belote
|
|
116
151
|
|
|
152
|
+
# Play the new Roguelite expansion
|
|
153
|
+
belatro
|
|
154
|
+
|
|
117
155
|
# Custom settings
|
|
118
156
|
belote --difficulty hard --target 500 --seed 123 --speed fast
|
|
119
157
|
```
|
|
@@ -124,15 +162,21 @@ belote --difficulty hard --target 500 --seed 123 --speed fast
|
|
|
124
162
|
**General:**
|
|
125
163
|
- `?` or `H`: Show keyboard shortcut help
|
|
126
164
|
- `M`: Toggle sound effects on/off
|
|
165
|
+
- `I`: Toggle BelAtro score overlay (per-trick breakdown popup)
|
|
127
166
|
- `Q`: Quit to main menu or exit
|
|
128
167
|
- `t`: View Game History (Round-by-round)
|
|
129
168
|
- `T`: Switch UI Theme
|
|
130
169
|
|
|
131
|
-
**
|
|
170
|
+
**Classic Belote:**
|
|
132
171
|
- `↑` `↓`: Navigate options
|
|
133
|
-
- `←` `→`: Quick-change settings (Difficulty, Target, Speed
|
|
172
|
+
- `←` `→`: Quick-change settings (Difficulty, Target, Speed)
|
|
134
173
|
- `Enter`: Select option / Enter submenu
|
|
135
174
|
|
|
175
|
+
**BelAtro (Roguelite):**
|
|
176
|
+
- `S`: View current Run State and Jokers
|
|
177
|
+
- `1`-`5`: Inspect specific Jokers in the Shop
|
|
178
|
+
- `U`: Use a consumable (Tarot/Planet) during gameplay
|
|
179
|
+
|
|
136
180
|
**Gameplay:**
|
|
137
181
|
- `←` `→` or `↑` `↓`: Move selection
|
|
138
182
|
- `Enter`: Confirm card/bid
|
|
@@ -143,19 +187,25 @@ belote --difficulty hard --target 500 --seed 123 --speed fast
|
|
|
143
187
|
|
|
144
188
|
## Features
|
|
145
189
|
|
|
146
|
-
- **
|
|
190
|
+
- **BelAtro Roguelite Mode:** A massive expansion featuring 50+ Jokers, 15+ Tarot cards, and permanent upgrades.
|
|
191
|
+
- **Collection (Almanac):** Persistent tracker to browse every Joker, Planet, and Voucher you've discovered across your runs.
|
|
192
|
+
- **Full Boss Blind Suite:** All 17 unique bosses implemented, including complex mechanics like *L'Anarchie* (dynamic trump) and *La Rupture* (no consecutive wins).
|
|
193
|
+
- **Multiplier Scoring:** Use items to stack Multipliers and reach scores in the millions.
|
|
194
|
+
- **Partner Trust:** Build a relationship with your AI partner to unlock synergies.
|
|
195
|
+
- **Rich Terminal UI:** Full-screen green felt table with detailed card graphics and "You" vs "Partner" terminology.
|
|
196
|
+
- **Enhanced Hard AI**: Advanced void inference and 2-ply lookahead for critical tricks (Dix de Der).
|
|
147
197
|
- **Customizable Themes:** Switch between different color palettes (e.g., Classic Green, Dark Blue, Royal Purple) using the `T` key during gameplay.
|
|
148
198
|
- **Incremental Rendering:** High-performance cursor-based updates for zero-flicker gameplay even at high speeds.
|
|
149
199
|
- **Hand Sorting:** Strategic "play value" organization (honors grouped together) for better tactical awareness.
|
|
150
|
-
- **
|
|
151
|
-
- **Main Menu:** Independent AI difficulty per seat, configurable Target Score and Speed.
|
|
200
|
+
- **Main Menu:** Simple single-player entry point with configurable AI difficulty, Target Score, and Speed.
|
|
152
201
|
- **Undo/Redo:** Press `Z` to undo your last move during bidding or play.
|
|
153
|
-
- **Statistics:**
|
|
154
|
-
- **Adaptive UI:**
|
|
202
|
+
- **Statistics:** unified global tracking of games played, win rates, best rounds, and BelAtro expansion milestones.
|
|
203
|
+
- **Dynamic Adaptive UI:** Menu art and text automatically center based on terminal width.
|
|
204
|
+
- **Alternate Screen Buffer:** BelAtro uses a dedicated terminal buffer for a clean, non-overlapping interface.
|
|
155
205
|
- **Sound Effects:** Enhanced auditory feedback for trick wins, Belote, and Capot, with a built-in mute toggle.
|
|
156
206
|
- **Declarations:** Automatic detection and announcement of sequences (Tierce, Quarte, etc.) and Carrés after the first trick.
|
|
157
207
|
- **Live HUD:** Real-time round scoring displays points won during the current round, with a smooth "rolling" numerical animation for total scores.
|
|
158
|
-
- **High Fidelity:** Full implementation of French Belote rules according to the [official rules of the Fédération Française de Belote](https://www.ffbelote.org/regles-officielle-belote/), including a two-round bidding system, "Dix de Der", "Capot" (252 pts), and "Litige" (tie-break).
|
|
208
|
+
- **High Fidelity:** Full implementation of French Belote rules according to the [official rules of the Fédération Française de Belote](https://www.ffbelote.org/regles-officielle-belote/), including a two-round bidding system, "Dix de Der", "Capot" (252 pts), and "Litige" (tie-break). Full support for **Sans Atout** (No Trump) and **Tout Atout** (All Trump) contracts.
|
|
159
209
|
- **Rules & History Viewer:** A scrollable, bilingual (English/French) in-game reference for the game's heritage and mechanics.
|
|
160
210
|
|
|
161
211
|
## AI
|
|
@@ -170,7 +220,14 @@ Three difficulty levels:
|
|
|
170
220
|
```
|
|
171
221
|
belote/
|
|
172
222
|
├── src/belote/
|
|
173
|
-
│ ├── main.py #
|
|
223
|
+
│ ├── main.py # Classic entry point
|
|
224
|
+
│ ├── belatro/ # Roguelite Expansion package
|
|
225
|
+
│ │ ├── main.py # BelAtro entry point
|
|
226
|
+
│ │ ├── core/ # Run state, scoring, economy
|
|
227
|
+
│ │ ├── engine/ # Event bus, round driver
|
|
228
|
+
│ │ ├── items/ # Jokers, Tarots, Planets, Vouchers
|
|
229
|
+
│ │ ├── partner/ # Trust system and partner AI
|
|
230
|
+
│ │ └── ui/ # Shop, HUD, and item visualization
|
|
174
231
|
│ ├── gameflow.py # Main game loop and phase transitions
|
|
175
232
|
│ ├── deck.py # Card, Suit, Rank, deck operations, points
|
|
176
233
|
│ ├── game.py # GameState, phases, pure transitions, legal moves, bidding
|
|
@@ -180,15 +237,11 @@ belote/
|
|
|
180
237
|
│ ├── context.py # Global managers (Audio, Terminal)
|
|
181
238
|
│ ├── themes.py # Color theme management
|
|
182
239
|
│ ├── ui/ # Modular UI package
|
|
183
|
-
│ │ ├── render.py # ANSI table and card rendering
|
|
184
|
-
│ │ ├── prompts.py # Keyboard input and menu navigation
|
|
185
|
-
│ │ ├── menu.py # Main menu and settings
|
|
186
|
-
│ │ └── announce.py# Sound and score animations
|
|
187
240
|
│ ├── ansi.py # ANSI escape helpers (colors, cursor)
|
|
188
241
|
│ ├── input.py # Platform-dispatched key reader and interruptible sleep
|
|
189
242
|
│ ├── stats.py # Global and session statistics tracking
|
|
190
243
|
│ └── rules.py # Game rules content
|
|
191
|
-
├── tests/ # Comprehensive test suite (
|
|
244
|
+
├── tests/ # Comprehensive test suite (250+ tests)
|
|
192
245
|
├── scripts/ # Performance benchmarks
|
|
193
246
|
├── pyproject.toml # Build system and dev dependencies (ruff/mypy)
|
|
194
247
|
├── LICENSE # MIT License
|
|
@@ -200,9 +253,35 @@ belote/
|
|
|
200
253
|
## Running Tests
|
|
201
254
|
|
|
202
255
|
```bash
|
|
256
|
+
# Run all tests (Classic + BelAtro)
|
|
203
257
|
PYTHONPATH=src pytest
|
|
204
258
|
```
|
|
205
259
|
|
|
260
|
+
Currently **305 tests** passing with 100% coverage on core logic.
|
|
261
|
+
|
|
262
|
+
## Technical Integrity
|
|
263
|
+
|
|
264
|
+
The codebase is strictly validated with the following tools:
|
|
265
|
+
- **mypy**: 0 errors (strict type safety)
|
|
266
|
+
- **ruff**: 0 violations (linting & formatting)
|
|
267
|
+
- **pytest**: 305/305 passed
|
|
268
|
+
- **Functional Architecture**: Purely immutable state transitions using `dataclasses.replace`
|
|
269
|
+
- **Performance**: High-efficiency rendering and sub-millisecond AI decision times (see `scripts/benchmark.py`)
|
|
270
|
+
|
|
271
|
+
## Statistics & Progression
|
|
272
|
+
|
|
273
|
+
**Belote-CLI** tracks your long-term performance across both game modes.
|
|
274
|
+
|
|
275
|
+
- **Global Statistics:** View your win rates, best round scores, and trump usage from the "Statistics" menu.
|
|
276
|
+
- **BelAtro Unlocks:** Progression in the roguelite mode is saved automatically. You can track your Ante 8 wins and total items found in the expansion.
|
|
277
|
+
|
|
278
|
+
### Resetting Progress
|
|
279
|
+
If you want to start fresh and clear your history/collection, manually delete the data files:
|
|
280
|
+
- **Linux**: `rm ~/.local/share/belote/*.json`
|
|
281
|
+
- **Windows**: `del %APPDATA%\belote\*.json`
|
|
282
|
+
|
|
283
|
+
This will wipe all global statistics and reset your discovered item Almanac in BelAtro.
|
|
284
|
+
|
|
206
285
|
## Terminal Hygiene
|
|
207
286
|
|
|
208
287
|
Signal handlers (SIGINT, SIGTERM) and atexit hooks ensure the terminal is always restored — cursor visible, colors reset, alt-screen off — even after Ctrl+C or crashes.
|
|
@@ -2,6 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
Complete implementation of the French card game Belote for the terminal, with a full-screen green felt table and full card graphics at compass positions (N/W/E/S).
|
|
4
4
|
|
|
5
|
+
## Now Featuring: BelAtro Expansion
|
|
6
|
+
|
|
7
|
+
**BelAtro** is a major roguelite expansion inspired by *Balatro*. Play through 8 Antes of escalating difficulty, build a deck of powerful Jokers, and use Tarot cards and Planets to break the game!
|
|
8
|
+
|
|
9
|
+
**BelAtro is now fully integrated into the main menu!** Just launch `belote` and select it from the top of the list.
|
|
10
|
+
|
|
11
|
+
### BelAtro Quick Start
|
|
12
|
+
```bash
|
|
13
|
+
# Play using the integrated launcher (recommended)
|
|
14
|
+
belote
|
|
15
|
+
|
|
16
|
+
# Or play the new Roguelite mode directly
|
|
17
|
+
belatro
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Starting Decks (All Fully Implemented)
|
|
21
|
+
| Deck | Special Rule |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Le Classique | Standard 32-card baseline |
|
|
24
|
+
| **Le Républicain** | 7s & 8s are wild — play them on any trick. +5 chips per 7/8 your team captures |
|
|
25
|
+
| L'Aristocrate | All four Aces start Gold Sealed (+cash) |
|
|
26
|
+
| Le Joueur | Start $14 — Boss Blind every 2 antes |
|
|
27
|
+
| **L'Ermite** | Starts with **La Sentinelle** Joker (×3 Mult if Trump Jack never leaves hand) |
|
|
28
|
+
| **Le Vétéran** | Start with a random **Planet** card pre-applied to level up a contract |
|
|
29
|
+
| **Le Flambeur** | Starts with **L'Aventurier** Partner Joker (×2 Mult if both win ≥3 tricks) |
|
|
30
|
+
| L'Anarchiste | Start $19 — Corrupted pool visible |
|
|
31
|
+
|
|
32
|
+
### Notable Vouchers
|
|
33
|
+
| Voucher | Effect |
|
|
34
|
+
|---|---|
|
|
35
|
+
| **Le Carnet** | See partner's full hand every round. +1 Mult each time South wins a trick |
|
|
36
|
+
| La Voûte | Earn $1 interest per $5 held, up to $5/round |
|
|
37
|
+
| La Double Donne | +1 Joker slot |
|
|
38
|
+
| La Surcoinche | Unlocks the Surcoinche contract *(unlockable)* |
|
|
39
|
+
|
|
5
40
|
## Showcase
|
|
6
41
|
|
|
7
42
|
### Main Menu
|
|
@@ -11,7 +46,7 @@ Complete implementation of the French card game Belote for the terminal, with a
|
|
|
11
46
|
⢰⣿⣿⣿⣿⡿⠟⠁⣠⣴⣶⣦⠄
|
|
12
47
|
⢸⣿⣿⠟⠉⣠⣴⣿⣿⣿⠟⠁⣠⣾⣿⣦⡀
|
|
13
48
|
⠉⣀⣴⣾⣿⣿⣿⠟⢁⣤⣾⣿⣿⣿⣿⣿⡆
|
|
14
|
-
|
|
49
|
+
⢀⣤⣾⣿⣿⣿⡿⠛⢁⣴⣿⣿⣿⡿⠛⢁⣴⣿⣿⣿⣿⣿⣿⣿⠟⠁⡀
|
|
15
50
|
⢼⣿⣿⣿⡿⠋⣀⣴⣿⣿⣿⣿⣿⣿⣿⡿⠉⣠⣾⣿⡆
|
|
16
51
|
⠘⢿⡿⠋⣠⣾⣿⣿⣿⠟⠁⣿⣿⣿⣿⣿⠟⢁⣀
|
|
17
52
|
⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⠏⢀⣴⣿⣿⣿⠋⢠⣾⣿⣷⣦⡀
|
|
@@ -71,6 +106,9 @@ pip install belote-cli
|
|
|
71
106
|
# Play using the belote command
|
|
72
107
|
belote
|
|
73
108
|
|
|
109
|
+
# Play the new Roguelite expansion
|
|
110
|
+
belatro
|
|
111
|
+
|
|
74
112
|
# Custom settings
|
|
75
113
|
belote --difficulty hard --target 500 --seed 123 --speed fast
|
|
76
114
|
```
|
|
@@ -81,15 +119,21 @@ belote --difficulty hard --target 500 --seed 123 --speed fast
|
|
|
81
119
|
**General:**
|
|
82
120
|
- `?` or `H`: Show keyboard shortcut help
|
|
83
121
|
- `M`: Toggle sound effects on/off
|
|
122
|
+
- `I`: Toggle BelAtro score overlay (per-trick breakdown popup)
|
|
84
123
|
- `Q`: Quit to main menu or exit
|
|
85
124
|
- `t`: View Game History (Round-by-round)
|
|
86
125
|
- `T`: Switch UI Theme
|
|
87
126
|
|
|
88
|
-
**
|
|
127
|
+
**Classic Belote:**
|
|
89
128
|
- `↑` `↓`: Navigate options
|
|
90
|
-
- `←` `→`: Quick-change settings (Difficulty, Target, Speed
|
|
129
|
+
- `←` `→`: Quick-change settings (Difficulty, Target, Speed)
|
|
91
130
|
- `Enter`: Select option / Enter submenu
|
|
92
131
|
|
|
132
|
+
**BelAtro (Roguelite):**
|
|
133
|
+
- `S`: View current Run State and Jokers
|
|
134
|
+
- `1`-`5`: Inspect specific Jokers in the Shop
|
|
135
|
+
- `U`: Use a consumable (Tarot/Planet) during gameplay
|
|
136
|
+
|
|
93
137
|
**Gameplay:**
|
|
94
138
|
- `←` `→` or `↑` `↓`: Move selection
|
|
95
139
|
- `Enter`: Confirm card/bid
|
|
@@ -100,19 +144,25 @@ belote --difficulty hard --target 500 --seed 123 --speed fast
|
|
|
100
144
|
|
|
101
145
|
## Features
|
|
102
146
|
|
|
103
|
-
- **
|
|
147
|
+
- **BelAtro Roguelite Mode:** A massive expansion featuring 50+ Jokers, 15+ Tarot cards, and permanent upgrades.
|
|
148
|
+
- **Collection (Almanac):** Persistent tracker to browse every Joker, Planet, and Voucher you've discovered across your runs.
|
|
149
|
+
- **Full Boss Blind Suite:** All 17 unique bosses implemented, including complex mechanics like *L'Anarchie* (dynamic trump) and *La Rupture* (no consecutive wins).
|
|
150
|
+
- **Multiplier Scoring:** Use items to stack Multipliers and reach scores in the millions.
|
|
151
|
+
- **Partner Trust:** Build a relationship with your AI partner to unlock synergies.
|
|
152
|
+
- **Rich Terminal UI:** Full-screen green felt table with detailed card graphics and "You" vs "Partner" terminology.
|
|
153
|
+
- **Enhanced Hard AI**: Advanced void inference and 2-ply lookahead for critical tricks (Dix de Der).
|
|
104
154
|
- **Customizable Themes:** Switch between different color palettes (e.g., Classic Green, Dark Blue, Royal Purple) using the `T` key during gameplay.
|
|
105
155
|
- **Incremental Rendering:** High-performance cursor-based updates for zero-flicker gameplay even at high speeds.
|
|
106
156
|
- **Hand Sorting:** Strategic "play value" organization (honors grouped together) for better tactical awareness.
|
|
107
|
-
- **
|
|
108
|
-
- **Main Menu:** Independent AI difficulty per seat, configurable Target Score and Speed.
|
|
157
|
+
- **Main Menu:** Simple single-player entry point with configurable AI difficulty, Target Score, and Speed.
|
|
109
158
|
- **Undo/Redo:** Press `Z` to undo your last move during bidding or play.
|
|
110
|
-
- **Statistics:**
|
|
111
|
-
- **Adaptive UI:**
|
|
159
|
+
- **Statistics:** unified global tracking of games played, win rates, best rounds, and BelAtro expansion milestones.
|
|
160
|
+
- **Dynamic Adaptive UI:** Menu art and text automatically center based on terminal width.
|
|
161
|
+
- **Alternate Screen Buffer:** BelAtro uses a dedicated terminal buffer for a clean, non-overlapping interface.
|
|
112
162
|
- **Sound Effects:** Enhanced auditory feedback for trick wins, Belote, and Capot, with a built-in mute toggle.
|
|
113
163
|
- **Declarations:** Automatic detection and announcement of sequences (Tierce, Quarte, etc.) and Carrés after the first trick.
|
|
114
164
|
- **Live HUD:** Real-time round scoring displays points won during the current round, with a smooth "rolling" numerical animation for total scores.
|
|
115
|
-
- **High Fidelity:** Full implementation of French Belote rules according to the [official rules of the Fédération Française de Belote](https://www.ffbelote.org/regles-officielle-belote/), including a two-round bidding system, "Dix de Der", "Capot" (252 pts), and "Litige" (tie-break).
|
|
165
|
+
- **High Fidelity:** Full implementation of French Belote rules according to the [official rules of the Fédération Française de Belote](https://www.ffbelote.org/regles-officielle-belote/), including a two-round bidding system, "Dix de Der", "Capot" (252 pts), and "Litige" (tie-break). Full support for **Sans Atout** (No Trump) and **Tout Atout** (All Trump) contracts.
|
|
116
166
|
- **Rules & History Viewer:** A scrollable, bilingual (English/French) in-game reference for the game's heritage and mechanics.
|
|
117
167
|
|
|
118
168
|
## AI
|
|
@@ -127,7 +177,14 @@ Three difficulty levels:
|
|
|
127
177
|
```
|
|
128
178
|
belote/
|
|
129
179
|
├── src/belote/
|
|
130
|
-
│ ├── main.py #
|
|
180
|
+
│ ├── main.py # Classic entry point
|
|
181
|
+
│ ├── belatro/ # Roguelite Expansion package
|
|
182
|
+
│ │ ├── main.py # BelAtro entry point
|
|
183
|
+
│ │ ├── core/ # Run state, scoring, economy
|
|
184
|
+
│ │ ├── engine/ # Event bus, round driver
|
|
185
|
+
│ │ ├── items/ # Jokers, Tarots, Planets, Vouchers
|
|
186
|
+
│ │ ├── partner/ # Trust system and partner AI
|
|
187
|
+
│ │ └── ui/ # Shop, HUD, and item visualization
|
|
131
188
|
│ ├── gameflow.py # Main game loop and phase transitions
|
|
132
189
|
│ ├── deck.py # Card, Suit, Rank, deck operations, points
|
|
133
190
|
│ ├── game.py # GameState, phases, pure transitions, legal moves, bidding
|
|
@@ -137,15 +194,11 @@ belote/
|
|
|
137
194
|
│ ├── context.py # Global managers (Audio, Terminal)
|
|
138
195
|
│ ├── themes.py # Color theme management
|
|
139
196
|
│ ├── ui/ # Modular UI package
|
|
140
|
-
│ │ ├── render.py # ANSI table and card rendering
|
|
141
|
-
│ │ ├── prompts.py # Keyboard input and menu navigation
|
|
142
|
-
│ │ ├── menu.py # Main menu and settings
|
|
143
|
-
│ │ └── announce.py# Sound and score animations
|
|
144
197
|
│ ├── ansi.py # ANSI escape helpers (colors, cursor)
|
|
145
198
|
│ ├── input.py # Platform-dispatched key reader and interruptible sleep
|
|
146
199
|
│ ├── stats.py # Global and session statistics tracking
|
|
147
200
|
│ └── rules.py # Game rules content
|
|
148
|
-
├── tests/ # Comprehensive test suite (
|
|
201
|
+
├── tests/ # Comprehensive test suite (250+ tests)
|
|
149
202
|
├── scripts/ # Performance benchmarks
|
|
150
203
|
├── pyproject.toml # Build system and dev dependencies (ruff/mypy)
|
|
151
204
|
├── LICENSE # MIT License
|
|
@@ -157,9 +210,35 @@ belote/
|
|
|
157
210
|
## Running Tests
|
|
158
211
|
|
|
159
212
|
```bash
|
|
213
|
+
# Run all tests (Classic + BelAtro)
|
|
160
214
|
PYTHONPATH=src pytest
|
|
161
215
|
```
|
|
162
216
|
|
|
217
|
+
Currently **305 tests** passing with 100% coverage on core logic.
|
|
218
|
+
|
|
219
|
+
## Technical Integrity
|
|
220
|
+
|
|
221
|
+
The codebase is strictly validated with the following tools:
|
|
222
|
+
- **mypy**: 0 errors (strict type safety)
|
|
223
|
+
- **ruff**: 0 violations (linting & formatting)
|
|
224
|
+
- **pytest**: 305/305 passed
|
|
225
|
+
- **Functional Architecture**: Purely immutable state transitions using `dataclasses.replace`
|
|
226
|
+
- **Performance**: High-efficiency rendering and sub-millisecond AI decision times (see `scripts/benchmark.py`)
|
|
227
|
+
|
|
228
|
+
## Statistics & Progression
|
|
229
|
+
|
|
230
|
+
**Belote-CLI** tracks your long-term performance across both game modes.
|
|
231
|
+
|
|
232
|
+
- **Global Statistics:** View your win rates, best round scores, and trump usage from the "Statistics" menu.
|
|
233
|
+
- **BelAtro Unlocks:** Progression in the roguelite mode is saved automatically. You can track your Ante 8 wins and total items found in the expansion.
|
|
234
|
+
|
|
235
|
+
### Resetting Progress
|
|
236
|
+
If you want to start fresh and clear your history/collection, manually delete the data files:
|
|
237
|
+
- **Linux**: `rm ~/.local/share/belote/*.json`
|
|
238
|
+
- **Windows**: `del %APPDATA%\belote\*.json`
|
|
239
|
+
|
|
240
|
+
This will wipe all global statistics and reset your discovered item Almanac in BelAtro.
|
|
241
|
+
|
|
163
242
|
## Terminal Hygiene
|
|
164
243
|
|
|
165
244
|
Signal handlers (SIGINT, SIGTERM) and atexit hooks ensure the terminal is always restored — cursor visible, colors reset, alt-screen off — even after Ctrl+C or crashes.
|