Skip to content

Commit ef817f1

Browse files
committed
feat: drastically simplify the templates
1 parent 80e9d9a commit ef817f1

2 files changed

Lines changed: 132 additions & 632 deletions

File tree

Lines changed: 63 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,54 @@
11
# Game State
22

33
## Current Situation
4-
- **Game Phase**: {{ state_name }}
4+
- **Phase**: {{ state_name }}
55
{% if game -%}
6-
- **Round**: {{ game.round }}
7-
- **Ante**: Level {{ (game.round + 2) // 3 }}
8-
{% endif %}
9-
10-
{% if consumables and consumables.cards and (consumables.cards | length) > 0 %}
11-
### Consumables ({{ consumables.cards | length }})
12-
{% for c in consumables.cards -%}
13-
- {{ loop.index0 }}: {{ c.label }} ({{ c.config.center_key }}) | Cost: {{ c.cost | default('N/A') }}
14-
{% endfor %}
15-
{% endif %}
16-
17-
{% if game %}
18-
## Resources
19-
- **Money**: ${{ game.dollars }}
20-
- **Chips**: {{ game.chips }}
6+
- **Round**: {{ game.round }} | **Ante**: {{ (game.round + 2) // 3 }}
7+
- **Money**: ${{ game.dollars }}{% if game.dollars >= 25 %} ✓ (earning max interest){% elif game.dollars >= 5 %} (earning ${{ (game.dollars // 5) }} interest){% endif %}
218
{% if game.current_round -%}
22-
- **Hands Remaining**: {{ game.current_round.hands_left | default(0) }}
23-
- **Discards Remaining**: {{ game.current_round.discards_left | default(0) }}
9+
- **Hands**: {{ game.current_round.hands_left | default(0) }} | **Discards**: {{ game.current_round.discards_left | default(0) }}
2410
{% endif -%}
25-
{% if game.skips > 0 -%}
26-
- **Skips Available**: {{ game.skips }}
2711
{% endif %}
2812

29-
{% if game.blind_on_deck %}
13+
{% if game and game.blind_on_deck %}
3014
## Current Challenge
3115
- **Blind**: {{ game.blind_on_deck }}
32-
{# Blind target values may not be provided in game_state #}
33-
{% endif %}
34-
35-
## Game Constraints
36-
- **Hands Played This Run**: {{ game.hands_played }}
37-
{% if jokers and jokers.config and jokers.config.card_limit -%}
38-
- **Joker Slots**: {{ jokers.cards | length }}/{{ jokers.config.card_limit }}
39-
{% endif -%}
40-
{% if game.discount_percent > 0 -%}
41-
- **Shop Discount**: {{ game.discount_percent }}%
42-
{% endif -%}
43-
{% if game.bankrupt_at > 0 -%}
44-
- **Bankruptcy Threshold**: ${{ game.bankrupt_at }}
45-
{% endif %}
4616
{% endif %}
4717

48-
## Player Assets
49-
50-
### Hand
5118
{% if hand and hand.cards -%}
52-
{%- set value_map = {
53-
"Ace": "A", "King": "K", "Queen": "Q", "Jack": "J", "10": "T",
54-
"9": "9", "8": "8", "7": "7", "6": "6", "5": "5", "4": "4", "3": "3", "2": "2"
55-
} -%}
56-
{%- set suit_map = {"Spades": "s", "Hearts": "h", "Diamonds": "d", "Clubs": "c"} -%}
57-
Cards:
19+
## Hand ({{ hand.cards | length }} cards)
20+
{%- set value_map = {"Ace": "A", "King": "K", "Queen": "Q", "Jack": "J", "10": "T", "9": "9", "8": "8", "7": "7", "6": "6", "5": "5", "4": "4", "3": "3", "2": "2"} -%}
21+
{%- set suit_map = {"Spades": "♠", "Hearts": "♥", "Diamonds": "♦", "Clubs": "♣"} -%}
5822
{% for card in hand.cards -%}
5923
{%- set card_config = card.config.card -%}
6024
{%- set short_value = value_map.get(card_config.value, "?") -%}
6125
{%- set short_suit = suit_map.get(card_config.suit, "?") -%}
62-
{{ loop.index0 }}: {{ short_value }}{{ short_suit }} ({{ card_config.value }} of {{ card_config.suit }})
63-
{% endfor %}
64-
Available Indices: {{ range(hand.cards | length) | list }}
26+
{{ loop.index0 }}: {{ short_value }}{{ short_suit }}{% if not loop.last %} | {% endif %}
27+
{%- endfor %}
6528
{% else -%}
66-
No cards in hand
29+
## Hand
30+
Empty
6731
{% endif %}
6832

6933
{% if jokers and jokers.cards %}
70-
### Jokers ({{ jokers.cards | length }})
34+
## Jokers ({{ jokers.cards | length }}{% if jokers.config and jokers.config.card_limit %}/{{ jokers.config.card_limit }}{% endif %})
7135
{% for joker in jokers.cards -%}
72-
- **{{ joker.label | default('Joker ' ~ loop.index) }}** (key: {{ joker.config.center_key | default('unknown') }})
73-
- Cost: {{ joker.cost | default('N/A') }} | Debuff: {{ joker.debuff | default(false) }}
36+
{{ loop.index0 }}: **{{ joker.label | default('Unknown Joker') }}**{% if joker.sell_cost %} (${{ joker.sell_cost }} sell){% endif %}{% if joker.debuff %} [DEBUFFED]{% endif %}
7437
{% endfor %}
7538
{% else %}
76-
### Jokers
77-
No jokers
39+
## Jokers
40+
None
7841
{% endif %}
79-
{% if reasoning_history %}
80-
81-
## Previous Plays
8242

83-
{% for reasoning in reasoning_history[-3:] -%}
84-
{{ loop.index }}. {{ reasoning }}
43+
{% if consumables and consumables.cards and (consumables.cards | length) > 0 %}
44+
## Consumables ({{ consumables.cards | length }})
45+
{% for c in consumables.cards -%}
46+
{{ loop.index0 }}: {{ c.label }}{% if c.sell_cost %} (${{ c.sell_cost }} sell){% endif %}
8547
{% endfor %}
86-
{% elif responses %}
87-
88-
## Previous Plays
48+
{% endif %}
8949

50+
{% if responses and responses[-3:] %}
51+
## Recent Actions
9052
{% for response in responses[-3:] -%}
9153
{%- if response.choices and response.choices[0].message.tool_calls -%}
9254
{%- set tool_call = response.choices[0].message.tool_calls[0] -%}
@@ -99,71 +61,62 @@
9961
{% endfor %}
10062
{% endif %}
10163

102-
## Decision Required
64+
## Available Actions
10365

10466
{% if state_name == "BLIND_SELECT" -%}
105-
You need to decide whether to **select** or **skip** the current blind.
106-
107-
### Available Actions:
67+
**PRIMARY**: Use `skip_or_select_blind` to choose:
68+
- **select** (recommended): Play the blind to earn money and progress
69+
- **skip**: Only if blind is impossible or you desperately need a tag
10870

109-
- **select**: Play against this blind to earn chips and money
110-
- **skip**: Skip this blind to get a tag reward but no chips
71+
**SECONDARY**: If needed for preparation:
72+
- `sell_joker` / `sell_consumable`: Generate money for crucial purchases
73+
- `use_consumable`: Strengthen your deck before the blind
11174

112-
### Strategy:
113-
114-
- Consider your current hand strength and jokers
115-
- Evaluate if you can beat the blind's chip requirement
116-
- Skipping gives you a tag but no progress toward winning
11775
{% elif state_name == "SELECTING_HAND" -%}
118-
You need to decide whether to **play cards** to form a poker hand or **discard cards** to try for better combinations.
119-
120-
### Available Actions:
121-
122-
- **play_hand**: Play selected cards as a poker hand to score chips
123-
- **discard**: Discard selected cards to draw new ones (uses a discard)
124-
125-
### Strategy:
126-
127-
- Look for the strongest poker hand you can make
128-
- Consider remaining hands and discards
129-
- Balance between playing weak hands vs. using discards to improve
130-
- Remember: higher poker hands score more points
76+
**PRIMARY**: Use `play_hand_or_discard`:
77+
- **play**: Submit your best poker hand (select card indices)
78+
- **discard**: Improve weak hands (select cards to replace)
13179

132-
### Card Selection:
80+
**SECONDARY**:
81+
- `sell_joker` / `sell_consumable`: Generate emergency funds
82+
- `use_consumable`: Enhance cards or hand types strategically
13383

134-
- Use 0-based indices from the "Available indices" list above
135-
- You can select 1-5 cards for either action
136-
- Example: [0, 2, 4] selects the 1st, 3rd, and 5th cards
13784
{% elif state_name == "SHOP" -%}
138-
You are in the shop and need to decide what to do.
139-
140-
### Available Actions:
141-
142-
- **next_round**: End shopping and proceed to next blind
143-
- **reroll**: Spend money to refresh shop items
144-
- **buy_card (index)**: Purchase a card from the shop_jokers area by 0-based index
145-
- **redeem_voucher (index)**: Redeem a voucher from the shop_vouchers area by 0-based index
146-
147-
### Strategy:
148-
149-
- Consider your current money and what you need
150-
- Jokers can provide powerful ongoing effects
151-
- Vouchers give permanent upgrades
152-
- Don't overspend - you need money for future rounds
153-
154-
### Shop Items
85+
**PRIMARY**: Use `shop` with these actions:
86+
- **next_round**: Leave shop and proceed (do this when done shopping)
87+
- **buy_card**: Purchase jokers/consumables that synergize with your build
88+
- **reroll**: Refresh shop items (costs ${{ game.current_round.reroll_cost | default('5') }}, increases each time)
89+
- **redeem_voucher**: Buy permanent upgrades
15590

15691
{% if shop_jokers and shop_jokers.cards and (shop_jokers.cards | length) > 0 -%}
157-
Jokers / Cards:
92+
### Shop Items
15893
{% for card in shop_jokers.cards -%}
159-
- {{ loop.index0 }}: {{ card.label }} ({{ card.ability.set }}) — ${{ card.cost }}
94+
{{ loop.index0 }}: **{{ card.label }}** - ${{ card.cost }}
16095
{% endfor %}
16196
{% endif -%}
16297

16398
{% if shop_vouchers and shop_vouchers.cards and (shop_vouchers.cards | length) > 0 -%}
164-
Vouchers:
99+
### Vouchers
165100
{% for card in shop_vouchers.cards -%}
166-
- {{ loop.index0 }}: {{ card.label }} — ${{ card.cost }}
101+
{{ loop.index0 }}: **{{ card.label }}** - ${{ card.cost }}
102+
{% endfor %}
103+
{% endif -%}
104+
105+
{% if shop_booster and shop_booster.cards and (shop_booster.cards | length) > 0 -%}
106+
### Boosters
107+
{% for card in shop_booster.cards -%}
108+
{{ loop.index0 }}: **{{ card.label }}** - ${{ card.cost }}
167109
{% endfor %}
168110
{% endif -%}
111+
112+
**REMEMBER**: Only buy what clearly improves your strategy. Keep money for interest ($25+ ideal) and future rounds.
113+
114+
{% elif state_name == "ROUND_EVAL" -%}
115+
**PRIMARY**: Use `cash_out` to proceed to shop
116+
117+
**OPTIONAL**: Before cashing out:
118+
- `use_consumable`: Use Planet cards to upgrade hand types you just played successfully
119+
- `sell_joker` / `sell_consumable`: Generate money for the upcoming shop
169120
{% endif %}
121+
122+
**Strategic Reminder**: Selling items gives approximately **half** their original cost. Avoid unnecessary buy/sell cycles that drain your money.

0 commit comments

Comments
 (0)