Skip to content

Commit 845799c

Browse files
committed
feat: reroll_shop docs
1 parent 0e533ae commit 845799c

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

docs/logging-systems.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The system hooks into these game functions:
1616
- `skip_or_select_blind`: blind selection actions
1717
- `play_hand_or_discard`: card play actions
1818
- `cash_out`: end blind and collect rewards
19-
- `shop`: shop interactions
19+
- `shop`: shop interactions (`next_round`, `buy_card`, `reroll`)
2020
- `go_to_menu`: return to main menu
2121

2222
The JSONL files are automatically created when:
@@ -59,8 +59,8 @@ Each log entry follows this structure:
5959

6060
- **`timestamp_ms`**: Unix timestamp in milliseconds when the action occurred
6161
- **`function`**: The game function that was called
62-
- `name`: Function name (e.g., "start_run", "play_hand_or_discard", "cash_out")
63-
- `arguments`: Arguments passed to the function
62+
- `name`: Function name (e.g., "start_run", "play_hand_or_discard", "cash_out")
63+
- `arguments`: Arguments passed to the function
6464
- **`game_state`**: Complete game state **before** the function execution
6565

6666
## Python SDK Logging

docs/protocol-api.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ The BalatroBot API provides core functions that correspond to the main game acti
109109

110110
### Overview
111111

112-
| Name | Description |
113-
| ---------------------- | ------------------------------------------------------------------------------------------- |
114-
| `get_game_state` | Retrieves the current complete game state |
115-
| `go_to_menu` | Returns to the main menu from any game state |
116-
| `start_run` | Starts a new game run with specified configuration |
117-
| `skip_or_select_blind` | Handles blind selection - either select the current blind to play or skip it |
118-
| `play_hand_or_discard` | Plays selected cards or discards them |
119-
| `rearrange_hand` | Reorders the current hand according to the supplied index list |
120-
| `cash_out` | Proceeds from round completion to the shop phase |
121-
| `shop` | Performs shop actions: proceed to next round (`next_round`) or purchase a card (`buy_card`) |
112+
| Name | Description |
113+
| ---------------------- | -------------------------------------------------------------------------------------------------------------------- |
114+
| `get_game_state` | Retrieves the current complete game state |
115+
| `go_to_menu` | Returns to the main menu from any game state |
116+
| `start_run` | Starts a new game run with specified configuration |
117+
| `skip_or_select_blind` | Handles blind selection - either select the current blind to play or skip it |
118+
| `play_hand_or_discard` | Plays selected cards or discards them |
119+
| `rearrange_hand` | Reorders the current hand according to the supplied index list |
120+
| `cash_out` | Proceeds from round completion to the shop phase |
121+
| `shop` | Performs shop actions: proceed to next round (`next_round`), purchase a card (`buy_card`), or reroll shop (`reroll`) |
122122

123123
### Parameters
124124

@@ -130,7 +130,20 @@ The following table details the parameters required for each function. Note that
130130
| `skip_or_select_blind` | `action` (string): Either "select" or "skip" |
131131
| `play_hand_or_discard` | `action` (string): Either "play_hand" or "discard"<br>`cards` (array): Card indices (0-indexed, 1-5 cards) |
132132
| `rearrange_hand` | `cards` (array): Card indices (0-indexed, exactly `hand_size` elements) |
133-
| `shop` | `action` (string): Shop action ("next_round" or "buy_card")<br>`index` (number, required when `action` = "buy_card"): 0-based card index to purchase |
133+
| `shop` | `action` (string): Shop action ("next_round", "buy_card", or "reroll")<br>`index` (number, required when `action` = "buy_card"): 0-based card index to purchase |
134+
135+
### Shop Actions
136+
137+
The `shop` function supports multiple in-shop actions. Use the `action` field inside the `arguments` object to specify which of these to execute.
138+
139+
| Action | Description | Additional Parameters |
140+
| ------------ | ------------------------------------------------------------- | -------------------------------------------------------- |
141+
| `next_round` | Leave the shop and proceed to the next blind selection. ||
142+
| `buy_card` | Purchase the card at the supplied `index` in `shop_jokers`. | `index` _(number)_ – 0-based position of the card to buy |
143+
| `reroll` | Spend dollars to refresh the shop offer (cost shown in-game). ||
144+
145+
!!! note "Future actions"
146+
Additional shop actions such as `buy_and_use_card`, `open_pack`, and `redeem_voucher` will be added in a future release.
134147

135148
### Errors
136149

0 commit comments

Comments
 (0)