Commit graph

11 commits

Author SHA1 Message Date
ef1dc846d1 Adjust later rolls: Never below / Never above on ranged cards
RollTable.roll_floor and roll_ceiling (numbers or values) limit a ranged
roll's total after its modifier (RollRange.limit). An earlier result's
change (e.g. @atmo_min = 7) can thereby raise or cap a later card's roll.
The inspector's Limits rows take a number or a value; the Why trace says
'raised to 7 (never below Atmo min)'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 19:15:09 -06:00
f00f36b598 Deck mode: faded drawn results, Wait for Shuffle with an Empty result
Deck-mode cards fade the results already drawn until the deck is shuffled.
The inspector gets a Deck mode section (Draw without repeats; when empty,
Shuffle by itself or Wait for Shuffle; the Empty result's text, saved as
deck_empty_text). A waiting empty deck gives its Empty result in normal
ink, not as an error. Reshuffle reads Shuffle everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:43:16 -06:00
d85a6018ce Resizable cards: drag the corner grip for width and list height
The grip in each card's bottom-right corner sets RollTable.width and
list_height (saved as "w" and "list_h"); with a height the results
list scrolls. Double-click the grip for the automatic size again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:32:09 -06:00
f9aa66d74d Beaded card frames and per-card / per-thread colours
CardFrame draws the user's frame_corner/frame_border art around each card,
tiling the bead strip so it fits any size; a small shader recolours the art
to the theme's trim (or the card's own colour). Themes choose the border
(Tarot: beaded, Felt: plain). Cards (RollTable.color) and threads
(TableEntry.pipe_color, JSON "color") can have their own colour from the
inspector's Colour row (presets, Theme, or any colour).

tools/run_tests.sh imports first and prints at most 8 lines per failing suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:20:46 -06:00
33913889da Roll modifiers and resizable tray/inspector
- Ranged roll tables take a modifier (dice_mod, e.g. @luck). Ranges may run
  past the dice (-3 to 24 on a d20); totals past the ends use the end result.
- Range and chance code moved from RollTable into RollRange; chances follow
  the modifier's current value; plain wording and Why lines name it.
- ModifierEditor builds modifiers in plain words for roll and check cards;
  the inspector's roll section is now InspectorRoll.
- The Earlier tab scrolls; the tray and inspector resize with drag handles
  (PanelSplitter), sizes kept in local settings.
- Demo Room check uses 2d6 + Luck with a luck-only vault; new test_modifier
  suite; docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:01:10 -06:00
6f583ea4f5 Plain Build engine: Describe, Builder, checks, inputs, collections, why trace
Implements docs/PLAIN.md sections 1-5 (the engine half of the usability pass):

- core/describe.gd (Describe): rules in plain words, labelled from variable
  cards, collections and card inputs, falling back to the original text.
- core/builder.gd (Builder): effect and condition models that round-trip
  with the rule text, a rule tokenizer, and known_values(board).
- Collections: variable cards with var_type "collection" label their
  members and don't declare their stem.
- Check cards (kind "check"): dice + modifier vs target, Success/Failure,
  chain values nat/total/effect, node "check" info, lint and static checks.
- Card inputs and pipe "with" values, scoped over the pipe's subtree on the
  explicit work stack (OP_RESTORE frames), with defaults and snapshot
  evaluation.
- nat on every roll-table roll; dice faces recorded through ctx.faces.
- Why trace: facts on nodes and steps (input, roll, check, case, show_if,
  options_where, effect, when, otherwise).
- StateStore rules_view setting; JSON for the new keys; LOGIC.md and
  PLAIN.md updated (deviations in PLAIN.md 5a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 21:01:24 -06:00
86d1b214c3 Dynamic pick options, show_if and indirect @[expr] names
Pick choice cards can take their options from variables (options_from:
@prefix_* or a @list, filtered by options_where with option, option_label
and option_value bound). A Chosen entry runs for whichever dynamic option
is picked; fixed entries stay as extras, listed first. Random weighs each
dynamic option as the Chosen entry and fixed ones by weight. Any pick
option can have show_if, which hides it from the pop-up and from Random;
with nothing offered the node stops with "No options available".

@[expr] reads or writes the variable named by expr in expressions,
effects (including reset) and text ({@[expr]}); bad computed names are
effect errors. JSON round trip, lint_options in lint_pipes, choice
pop-up value badges and previews, card and settings UI, docs, demo board
(Spend a find) and tests/test_options.gd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:55:38 -06:00
dbbb9750eb Conditional pipes and router cards
Pipes can carry "when" (Only if) and "otherwise". When an entry is
chosen, its effects run, its text expands, then every pipe condition and
count is evaluated once as a snapshot before any pipe runs; when pipes
run if true, otherwise pipes if no when pipe was true, plain pipes
always. Condition errors count as false and show as error lines.

New router card (kind "router"): its entries are cases with an
entry-level "when"; the first true case is chosen (empty = Otherwise),
and "No case matched" stops the node. One action. JSON round trip for
entry/pipe when and pipe otherwise, including JsonIO.canonical and
edge labels. Roller.lint_pipes() and Roller.lint_router() for board
checks. A pick choice's save_as is now stored before the snapshot.

UI: Only if / Otherwise in the pipe popover with live validation, pipe
labels ("if @str >= 8", "otherwise") and a source-end diamond on
conditional pipes, router card with fork icon, per-case condition rows,
case editing / reordering in Build, router settings, "+ Table" entry,
router cases in table previews. Logic demo now routes through a router.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:53:00 -06:00
85b8a99ef5 Logic cards engine: expressions, effects, choice/loop/variable/sheet cards, coroutine roller
- Expr: @vars, chain vars, dice tokens, dm/has/count, lone = as ==, errors as values, parse cache
- Effects: = += -= *= /= and reset (with prefix), number vs list semantics, logs, validation
- RollTable kinds and per-kind fields with factories; expression dice with end clamping
- TableEntry effects and expression pipe counts; JSON round trip through JsonIO
- TextExpander: {@prefix_*}, {= expr}, number display, expand_async and live render()
- Roller: coroutine with an explicit work stack, prompts for choice cards, loops,
  10,000-action limit, partial tree on ctx.root, iterative flatten/collect_lit
- Variables keep numbers as numbers through StateStore
- Main: awaits the roll with a default (headless) prompt hook, iterative playback,
  long chains show at once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:38:42 -06:00
388759f5b6 Add weights, dice expressions, pipe options, card mode and cycle check to the model
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:11:43 -06:00
60c2d03147 Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.

- core/: data model (RollTable, TableEntry, TowerBoard), sample board
  with a d100 table of 100 trinkets and a weighted d100 range table,
  and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
  cards, result tray with earlier rolls, undo toasts, and a Collapse all
  / Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00