TableTower/examples/logic_demo.json

173 lines
5.4 KiB
JSON
Raw Normal View History

Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray - ChoiceDialog: card-styled pop-up for pick (option rows with details, Random, 1-9 / R keys), number (spin box with min/max/default, Enter) and text. Cancel, Esc, freeing the dialog, a new roll or a collection switch all answer null through a separate Reply object, so a roll never hangs. - Main: real prompt hook; the steps so far light on the board and in the tray before each question; a roll with questions shows the rest at once; a new roll cancels an open question cleanly; refresh_live() re-renders variable, sheet and question text only after rolls and edits. - TableCard: "?" badge and question for choice cards, loop icon, rule chip and Each time / Afterwards rows, compact live variable cards (reset in Build), live sheet cards with one outlet, expression-dice subtitles, effect chips in Play and a validated effects editor in Build. - Build: "+ Table" menu for every kind; kind-specific settings (choice type, question, save as, min/max; loop mode and rule; variable name, type, starting value; sheet template) checked with Expr.check; expression pipe counts in the pipe popover and on pipe labels. - Tray: effect lines under chips, last 12 steps behind "+N earlier steps", sheet headline, Cancelled / action-limit pill, capped indents and Earlier rows; Variables tab lists every board variable with Reset all. - RichText: error markers in red; previews show {@x_*} and {= expr}. - examples/logic_demo.json and tests/test_logic_ui.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
{
"format_version": 2,
"id": "logic-demo",
"name": "Logic demo",
"tables": [
{
"id": "start",
"name": "Start a delve",
"x": 40,
"y": 40,
"details": "Click the die to send a new delver down the stairs. It resets the variables, then asks two questions.",
"entries": [
{
"id": "e1",
"text": "A new delver steps up",
"effects": "reset @hp; reset @gold; reset @luck; reset @loot",
"pipes": ["name_q"]
}
]
},
{
"id": "v_hp",
"name": "Hit points",
"kind": "variable",
"x": 40,
"y": 640,
"details": "Traps and fights take these away.",
"var_name": "hp",
"initial": "10",
"entries": []
},
{
"id": "v_gold",
"name": "Gold",
"kind": "variable",
"x": 360,
"y": 640,
"var_name": "gold",
"initial": "0",
"entries": []
},
{
"id": "v_luck",
"name": "Luck",
"kind": "variable",
"x": 680,
"y": 640,
"details": "Added to every room check.",
"var_name": "luck",
"initial": "0",
"entries": []
},
{
"id": "v_loot",
"name": "Loot",
"kind": "variable",
"x": 1000,
"y": 640,
"var_name": "loot",
"var_type": "list",
"entries": []
},
{
"id": "name_q",
"name": "Name your delver",
"kind": "choice",
"choice": "text",
"prompt": "Who goes down the stairs?",
"save_as": "@name",
"x": 360,
"y": 40,
"entries": [
{ "id": "e1", "text": "Answer", "pipes": ["rooms_q"] }
]
},
{
"id": "rooms_q",
"name": "How many rooms?",
"kind": "choice",
"choice": "number",
"prompt": "[b]{@name}[/b] studies the map. How many rooms will they try?",
"save_as": "@rooms",
"min": "1",
"max": "5",
"x": 360,
"y": 270,
"entries": [
{ "id": "e1", "text": "Answer", "pipes": ["explore"] }
]
},
{
"id": "explore",
"name": "Explore",
"kind": "loop",
"loop_expr": "@rooms",
"x": 680,
"y": 40,
"details": "One room check per room the player chose, then the way out.",
"entries": [
{ "id": "e1", "text": "Room {i}", "pipes": ["room_check"] },
{ "id": "e2", "text": "Head back up", "pipes": ["climb"] }
Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray - ChoiceDialog: card-styled pop-up for pick (option rows with details, Random, 1-9 / R keys), number (spin box with min/max/default, Enter) and text. Cancel, Esc, freeing the dialog, a new roll or a collection switch all answer null through a separate Reply object, so a roll never hangs. - Main: real prompt hook; the steps so far light on the board and in the tray before each question; a roll with questions shows the rest at once; a new roll cancels an open question cleanly; refresh_live() re-renders variable, sheet and question text only after rolls and edits. - TableCard: "?" badge and question for choice cards, loop icon, rule chip and Each time / Afterwards rows, compact live variable cards (reset in Build), live sheet cards with one outlet, expression-dice subtitles, effect chips in Play and a validated effects editor in Build. - Build: "+ Table" menu for every kind; kind-specific settings (choice type, question, save as, min/max; loop mode and rule; variable name, type, starting value; sheet template) checked with Expr.check; expression pipe counts in the pipe popover and on pipe labels. - Tray: effect lines under chips, last 12 steps behind "+N earlier steps", sheet headline, Cancelled / action-limit pill, capped indents and Earlier rows; Variables tab lists every board variable with Reset all. - RichText: error markers in red; previews show {@x_*} and {= expr}. - examples/logic_demo.json and tests/test_logic_ui.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
]
},
{
"id": "room_check",
"name": "Room check",
"x": 1000,
"y": 40,
"dice": "2d6 + @luck",
"details": "2d6 plus Luck. Low rolls hurt, high rolls pay.",
"entries": [
{ "id": "e1", "text": "A trap snaps shut", "effects": "@hp -= 2", "range": [2, 6] },
{ "id": "e2", "text": "Dust and echoes", "range": [7, 9] },
{ "id": "e3", "text": "A glinting cache", "effects": "@gold += 2d6\n@loot += if(1d6 <= 3, \"gem\", if(1d6 <= 3, \"silver idol\", \"old map\"))", "range": [10, 12] }
Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray - ChoiceDialog: card-styled pop-up for pick (option rows with details, Random, 1-9 / R keys), number (spin box with min/max/default, Enter) and text. Cancel, Esc, freeing the dialog, a new roll or a collection switch all answer null through a separate Reply object, so a roll never hangs. - Main: real prompt hook; the steps so far light on the board and in the tray before each question; a roll with questions shows the rest at once; a new roll cancels an open question cleanly; refresh_live() re-renders variable, sheet and question text only after rolls and edits. - TableCard: "?" badge and question for choice cards, loop icon, rule chip and Each time / Afterwards rows, compact live variable cards (reset in Build), live sheet cards with one outlet, expression-dice subtitles, effect chips in Play and a validated effects editor in Build. - Build: "+ Table" menu for every kind; kind-specific settings (choice type, question, save as, min/max; loop mode and rule; variable name, type, starting value; sheet template) checked with Expr.check; expression pipe counts in the pipe popover and on pipe labels. - Tray: effect lines under chips, last 12 steps behind "+N earlier steps", sheet headline, Cancelled / action-limit pill, capped indents and Earlier rows; Variables tab lists every board variable with Reset all. - RichText: error markers in red; previews show {@x_*} and {= expr}. - examples/logic_demo.json and tests/test_logic_ui.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
]
},
{
"id": "climb",
"name": "On the way up",
"kind": "router",
"x": 680,
"y": 330,
"details": "Checks the delver's state once, top to bottom: the first case that's true is the one that happens.",
"entries": [
{ "id": "e1", "text": "Carried up by a passing patrol", "when": "@hp <= 0", "effects": "@hp = 1", "pipes": ["report"] },
{ "id": "e2", "text": "Pockets heavy with gold", "when": "@gold >= 12", "details": "The guard at the top has noticed.", "pipes": ["way_out"] },
{ "id": "e3", "text": "Up the stairs", "pipes": [{ "table": "spend_find", "when": "@loot != \"\"" }, { "table": "way_out", "otherwise": true }] }
]
},
{
"id": "spend_find",
"name": "Spend a find",
"kind": "choice",
"prompt": "A shrine at the foot of the stairs. Leave one of your finds for luck?",
"options_from": "@loot",
"x": 1320,
"y": 640,
"details": "One option per item in Loot, plus two fixed ones. The last is only offered to a wounded delver.",
"entries": [
{ "id": "e1", "text": "Left the {option} at the shrine", "details": "Luck grows by one.", "effects": "@loot -= option\n@luck += 1", "pipes": ["way_out"] },
{ "id": "e2", "text": "Keep everything", "pipes": ["way_out"] },
{ "id": "e3", "text": "Trade it all for a healing draught", "show_if": "@hp <= 6", "details": "Only offered when HP is 6 or less.", "effects": "reset @loot\n@hp += 4", "pipes": ["way_out"] }
]
},
Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray - ChoiceDialog: card-styled pop-up for pick (option rows with details, Random, 1-9 / R keys), number (spin box with min/max/default, Enter) and text. Cancel, Esc, freeing the dialog, a new roll or a collection switch all answer null through a separate Reply object, so a roll never hangs. - Main: real prompt hook; the steps so far light on the board and in the tray before each question; a roll with questions shows the rest at once; a new roll cancels an open question cleanly; refresh_live() re-renders variable, sheet and question text only after rolls and edits. - TableCard: "?" badge and question for choice cards, loop icon, rule chip and Each time / Afterwards rows, compact live variable cards (reset in Build), live sheet cards with one outlet, expression-dice subtitles, effect chips in Play and a validated effects editor in Build. - Build: "+ Table" menu for every kind; kind-specific settings (choice type, question, save as, min/max; loop mode and rule; variable name, type, starting value; sheet template) checked with Expr.check; expression pipe counts in the pipe popover and on pipe labels. - Tray: effect lines under chips, last 12 steps behind "+N earlier steps", sheet headline, Cancelled / action-limit pill, capped indents and Earlier rows; Variables tab lists every board variable with Reset all. - RichText: error markers in red; previews show {@x_*} and {= expr}. - examples/logic_demo.json and tests/test_logic_ui.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
{
"id": "way_out",
"name": "Way out",
"kind": "choice",
"prompt": "{@name} has {@gold} gold and {@hp} HP left. How do they leave?",
"x": 1000,
Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray - ChoiceDialog: card-styled pop-up for pick (option rows with details, Random, 1-9 / R keys), number (spin box with min/max/default, Enter) and text. Cancel, Esc, freeing the dialog, a new roll or a collection switch all answer null through a separate Reply object, so a roll never hangs. - Main: real prompt hook; the steps so far light on the board and in the tray before each question; a roll with questions shows the rest at once; a new roll cancels an open question cleanly; refresh_live() re-renders variable, sheet and question text only after rolls and edits. - TableCard: "?" badge and question for choice cards, loop icon, rule chip and Each time / Afterwards rows, compact live variable cards (reset in Build), live sheet cards with one outlet, expression-dice subtitles, effect chips in Play and a validated effects editor in Build. - Build: "+ Table" menu for every kind; kind-specific settings (choice type, question, save as, min/max; loop mode and rule; variable name, type, starting value; sheet template) checked with Expr.check; expression pipe counts in the pipe popover and on pipe labels. - Tray: effect lines under chips, last 12 steps behind "+N earlier steps", sheet headline, Cancelled / action-limit pill, capped indents and Earlier rows; Variables tab lists every board variable with Reset all. - RichText: error markers in red; previews show {@x_*} and {= expr}. - examples/logic_demo.json and tests/test_logic_ui.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
"y": 330,
"entries": [
{ "id": "e1", "text": "Sneak past the guard", "details": "Quiet and slow. Luck grows.", "effects": "@luck += 1", "pipes": ["report"] },
{ "id": "e2", "text": "Fight through", "details": "Costs some blood.", "effects": "@hp -= 1d3", "pipes": ["report"] },
{ "id": "e3", "text": "Pay the toll", "details": "Ten gold, if they have it.", "effects": "@gold -= min(@gold, 10)", "pipes": ["report"] }
]
},
{
"id": "report",
"name": "Delve report",
"kind": "sheet",
"x": 1320,
Logic cards UI: choice pop-up, card kinds, Build creation and settings, tray - ChoiceDialog: card-styled pop-up for pick (option rows with details, Random, 1-9 / R keys), number (spin box with min/max/default, Enter) and text. Cancel, Esc, freeing the dialog, a new roll or a collection switch all answer null through a separate Reply object, so a roll never hangs. - Main: real prompt hook; the steps so far light on the board and in the tray before each question; a roll with questions shows the rest at once; a new roll cancels an open question cleanly; refresh_live() re-renders variable, sheet and question text only after rolls and edits. - TableCard: "?" badge and question for choice cards, loop icon, rule chip and Each time / Afterwards rows, compact live variable cards (reset in Build), live sheet cards with one outlet, expression-dice subtitles, effect chips in Play and a validated effects editor in Build. - Build: "+ Table" menu for every kind; kind-specific settings (choice type, question, save as, min/max; loop mode and rule; variable name, type, starting value; sheet template) checked with Expr.check; expression pipe counts in the pipe popover and on pipe labels. - Tray: effect lines under chips, last 12 steps behind "+N earlier steps", sheet headline, Cancelled / action-limit pill, capped indents and Earlier rows; Variables tab lists every board variable with Reset all. - RichText: error markers in red; previews show {@x_*} and {= expr}. - examples/logic_demo.json and tests/test_logic_ui.gd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:07:57 -06:00
"y": 330,
"entries": [
{
"id": "e1",
"text": "[b]{@name}[/b] the delver\nRooms tried: {@rooms}\nHP {@hp} · Gold {@gold} · Luck {@luck}\nLoot: {@loot}\nScore: {= @gold + @hp * 5}"
}
]
}
]
}