Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- **Publishing tidies the shop catalogue.** When you publish a system, any catalogue line that is now exactly one of your items, same name, price and columns, is taken out of the file, since the item sells itself. That includes lines that ADD NEW LINES TO ITEMS turned into items. The builder's publish message says how many. Lines naming an item kept out of the shops stay, so they sell again if you switch it back on.
- **Catalogue lines can become items.** In SHOP_CATALOGUES, PREVIEW now offers ADD NEW LINES TO ITEMS, off to start. Switched on, it lists what it will add and how many items your system will hold. SAVE then makes each line that isn't one of your items yet into an item: of its section's type (a shelf's lines go to your DEFAULT type), with its columns, price and words, in the shops. They go into the builder's draft and are kept once you publish; until then the catalogue line sells them. If the builder is open, it takes them in, so its next save keeps them.
- **One-of-a-kind items sell back.** An item kept out of the shops is never on a shelf, but a player can still sell one to a shop that sells its type, at the item's own price times that shop's buyback rate. A ring sells at an Armorer, never at a Gun Shop.
- **The shop catalogue knows your items.** In a game whose items sell themselves, PREVIEW in SHOP_CATALOGUES now says how many of your items are also on sale, and which lines in your file overrule one ("Pistol: overrules the item, 200 → 260 in the shops"). A line that's exactly one of your items, same price and columns, is left out, since the item already sells itself. So is a line naming an item kept out of the shops. The preview says why for each line, and SAVE leaves out the same lines.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ CITY_NET/
│ │ ├── fonts.js # Font file upload/list/delete (.ttf .otf .woff .woff2); served as static under /uploads/fonts/
│ │ ├── me.js # The signed-in person's own settings, GET and PUT /api/me/settings (6c4b3a): anyone signed in, player or GM, reads and changes only their own, a known setting at a time
│ │ ├── player.js # Player auth (register, login, forgot, reset, registration status poll); the GM's RESET makes a temporary password from the secure random source, in letters and digits read aloud without mix-ups
│ │ ├── systems.js # Custom game systems: list, create (from a name, a whole definition, or a copy of a built-in example or genre starter), read, save a draft, preview what publishing would change (publishPreview.js), publish, rename, duplicate, delete (a hide, refused for the running system); export a published system as a .citysys file, preview a file, install it as new, an update or a second copy; upload a currency or condition icon (PNG, WebP or SVG, 0.25MB, stored by content hash, one route for both) and set or clear a currency's icon in the draft and running copy alike; the builder's previews, which change nothing (a draft's values from its sample, its sheet as drawn, an NPC tier rolled for a level, health tried on a pretend token); the examples and starters, listed and opened; a built-in game's own conditions replaced (PUT /table-conditions/:system); a draft's rest tried on a made-up character (POST /try-rest). Main admin only, reading included, except the two public reads every player needs: a published system's render copy, and the conditions a system offers (GET /conditions/:system, modifiers left out for anyone but the GM). GET and PUT /tour: whether the builder's first-time tour has been seen, one setting in global_settings. PUT /:id/house-rules: the GM or a granted editor switches a running system's house rules, any number at once, the game taking them straight away and every browser told. POST /test-dice: the DICE tab's TEST, a handful of a draft's own die thrown by the table's engine; test-roll: TEST ROLL, one of a draft's rolls made for its sample character by the table's own engine on the secure dice, under the draft's conditions asked for, changing and logging nothing; preview-values reads a ranked stat's sample as its step (7f1b); POST /import-items reads a file of items against a draft (8aL3a), changing nothing
│ │ ├── systems.js # Custom game systems: list, create (from a name, a whole definition, or a copy of a built-in example or genre starter), read, save a draft, preview what publishing would change (publishPreview.js), publish, rename, duplicate, delete (a hide, refused for the running system); export a published system as a .citysys file, preview a file, install it as new, an update or a second copy; upload a currency or condition icon (PNG, WebP or SVG, 0.25MB, stored by content hash, one route for both) and set or clear a currency's icon in the draft and running copy alike; the builder's previews, which change nothing (a draft's values from its sample, its sheet as drawn, an NPC tier rolled for a level, health tried on a pretend token); the examples and starters, listed and opened; a built-in game's own conditions replaced (PUT /table-conditions/:system); a draft's rest tried on a made-up character (POST /try-rest). Main admin only, reading included, except the two public reads every player needs: a published system's render copy, and the conditions a system offers (GET /conditions/:system, modifiers left out for anyone but the GM). GET and PUT /tour: whether the builder's first-time tour has been seen, one setting in global_settings. PUT /:id/house-rules: the GM or a granted editor switches a running system's house rules, any number at once, the game taking them straight away and every browser told. POST /test-dice: the DICE tab's TEST, a handful of a draft's own die thrown by the table's engine; test-roll: TEST ROLL, one of a draft's rolls made for its sample character by the table's own engine on the secure dice, under the draft's conditions asked for, changing and logging nothing; preview-values reads a ranked stat's sample as its step (7f1b); POST /import-items reads a file of items against a draft (8aL3a), changing nothing; PUBLISH takes out the catalogue lines now exactly one of the system's items and says how many (dropped), the running game's shops told (8a7a4b)
│ │ └── sheets.js # Character sheets — admin sheet access, NPC library, portraits, LUCK/Edge reset & grant, CWN's long rest (System Strain down 1), a custom system's rests listed and called or previewed (GET /rests, POST /rest, GM and granted editors), import preview; a friendly NPC's sheet, read-only, for the player the GM gave it to (GET /npcs/controlled/:location_id). The table-wide resets scan to decide who is affected and then work out each value as that sheet is written, rather than writing back a scan that has already gone stale; the GM's GET /user/:username carries the player's token for the vitals box (8s3d2)
│ ├── dice/
│ │ └── systemDice.js # Built-in dice manifest keyed by game system (ids namespaced `builtin:`); lives in code, not the DB, so app updates change definitions with no migration and nothing is mutable through the API
Expand Down Expand Up @@ -423,7 +423,7 @@ CITY_NET/
│ │ ├── catalogueParse.js # Reads a catalogue a GM pasted or uploaded: CSV, TSV or JSON, real RFC-4180 quoting, per-line problems rather than exceptions. The only reader - the preview is a round trip to it; a section per item type (8a7a1): [GUNS], [gun] or [MELEE WEAPONS] is lines of the system's own type, a type winning over a shelf of its name, each column read as it holds (numbers, PICK ONE's own word) and checked as the builder checks an item's, a row that doesn't fit left out and said, blanks kept and noted once a row; a section that is neither a type nor a shelf said, its rows not saved
│ │ ├── catalogueStore.js # Uploaded catalogues in memory, added on top of the built-in ones, never replacing them. Holds one system at a time, and consults the built-in book only when that system is CWN - every other game's shops carry only what their GM uploaded. Requires nothing, so priceOf stays synchronous and the lot stays importable from a frontend test
│ │ ├── ownItems.js # The game's own items on the shelves (8a7a3a; decided 2026-11-21): each priced and IN SHOPS a line of its type's catalogue, its values and words as fields; the names of those turned off. Pure, worked out once per definition. A catalogue file held against them (againstItems, 8a7a3c1): an exact copy of an item left out, one kept out of the shops left out, one of an item's name overruling it, and how many sell themselves besides; the items turned off with a price, bought back by a shop of their type (8a7a3c2). The running game's own items (8a7a3a, ownItems.js, set by the sockets) sit under the uploaded lines: a line uploaded with an item's name wins, an item turned off keeps a line of its name off the shelves
│ │ └── catalogueDb.js # The only piece that knows uploaded catalogues live in SQLite. A save replaces one catalogue wholesale, in a transaction, a hundred rows a statement (8n3: a 1500-line save took a round trip a row)
│ │ └── catalogueDb.js # The only piece that knows uploaded catalogues live in SQLite. A save replaces one catalogue wholesale, in a transaction, a hundred rows a statement (8n3: a 1500-line save took a round trip a row); on a publish, a system's lines now exactly one of its items taken out (dropItemCopies, 8a7a4b), lines naming an item kept out of the shops kept
│ ├── tokens/
│ │ ├── conditions.js # A token's conditions as stored ([{ id, left }]): read safely, checked against what the running system offers (one twice, an unknown one, rounds out of 1 to 99 refused by name; one that ends after rounds starting at its own), shown to everyone without the rounds left, a hidden one (a house rule off) kept as it was, and counted down a round at a time for a combat's tokens (tickCombat), coming off at none; `started` kept for one ending AT THE END OF ITS NEXT TURN, through an edit too (8a9a)
│ │ ├── poolHealth.js # One pool of hit points changed by an amount (8a9a): TEMP first, never below 0 nor past MAX; the HEALTH route and a condition's EACH TURN alike
Expand Down Expand Up @@ -606,7 +606,7 @@ CITY_NET/
│ ├── shop_sell.test.js # Selling a basket: a payout the client cannot talk up, the item really leaving the sheet, and nothing emptied when a basket fails part way
│ ├── shop_buy_sockets.test.js # Buying through the socket as a cart of one, the old buy handler's cases moved across whole
│ ├── shop_sell_sockets.test.js # Selling through the socket as a cart with nothing to buy, the old sell handler's cases moved across whole
│ ├── catalogue_into_items.test.js # ADD NEW LINES TO ITEMS (8a7a4a): new lines made items of their type, a shelf's of the DEFAULT, one already an item or named twice once, ids apart, too long or past 200 said; the preview says what it adds, the save writes the draft only
│ ├── catalogue_into_items.test.js # ADD NEW LINES TO ITEMS (8a7a4a): new lines made items of their type, a shelf's of the DEFAULT, one already an item or named twice once, ids apart, too long or past 200 said; the preview says what it adds, the save writes the draft only; PUBLISH takes out the lines now exactly an item, keeps a new line and one naming an item kept out, tells the running game's shops (8a7a4b)
│ ├── shop_items_on_sale.test.js # The game's own items on the shelves (8a7a3a): a price, its own or its type's PRICE column's; IN SHOPS, one saved before it by its price; checked and carried by the system file; the lines they make; under the uploads in the store (a line of an item's name wins, one turned off never sold); bought, sold back at the BUYBACK rate, not again in GIVE's type folders; a catalogue file held against them, its preview and its save (8a7a3c1)
│ ├── shop_stress.test.js # The shops under load (8n3): 200 items and a 1500-line catalogue previewed and saved, every catalogue sent to a player (its size said), a 100-line cart checked out and 300 lines sold back at once, each in time and each answer right
│ ├── shop_typed_lines.test.js # Lines of an item type sold and given (8a7a2): SOLD AT, the General Store unsaid, checked and carried by the system file; a typed line placed and stacked only onto the same thing untouched; bought at a shop that sells the type and refused at one that doesn't, sold back at exactly the app's 45%, given from GIVE
Expand Down Expand Up @@ -1241,7 +1241,7 @@ CITY_NET/
│ │ │ ├── modTargets.ts # What a modifier may point at, read off the sheet template rather than listed: the template already knows this system's stats and skills. Stats are found through the skills, since each names the stat it keys off — which works unchanged on CWN, whose skills key off a modifier field. Maximums and derived fields are excluded, both being values a modifier could never hold
│ │ │ ├── systemsApi.ts # The builder's requests to the server (routes/systems.js), each answering ok with a value or the server's own words for what went wrong; whether the tour has been seen, and marking it; a running system's house rules switched; testDice for the DICE tab's TEST; tableDice for COPY FROM THE TABLE'S DICE; importItems (8aL3b)
│ │ │ ├── systemsLibrary.ts # What MY SYSTEMS says about each system: its badges, version, facts, what an install offers (BRING IT BACK or START FRESH for one deleted here), and the messages after a rename, duplicate, delete or install
│ │ │ ├── builderSession.ts # The builder's saving as rules: autosave after a pause, SAVE now, whether leaving needs asking, what PUBLISH says, and its pages (HOUSE RULES between RESTS and TRY IT); ITEMS on the rail, after CHOICES (7e2b)
│ │ │ ├── builderSession.ts # The builder's saving as rules: autosave after a pause, SAVE now, whether leaving needs asking, what PUBLISH says, and its pages (HOUSE RULES between RESTS and TRY IT); ITEMS on the rail, after CHOICES (7e2b); the publish sentence says how many catalogue lines it took out (8a7a4b)
│ │ │ ├── setup.ts # SETUP as logic: the health models, advancement, dice and distance it offers, each model's starting shape, and the answers read from and written to a definition
│ │ │ ├── wordsFeatures.ts # WORDS and PARTS as logic: terms and their forms, parts and what turning one off greys, building types, catalogues and currencies written back to a definition; a part's house rule (ONLY WITH), kept when the part is switched
│ │ │ ├── dice.ts # The DICE tab as logic (6c2a): a system's own dice and symbols read and written back, three presets (dF, GOOD / GREAT / BAD, a d6 with a word), a die renamed, colored, its faces counted and each face a number and up to six symbols, symbols cancelling as a pair (old partners let go) and counting as another one step at a time (alsoChoices), removed off every face; COPY FROM THE TABLE'S DICE (numbers stay numbers, words become symbols); a face as the log writes it; a symbol's look set (withSymbolLook, a mark always kept for the log) and the pad's drawing a square at a time (withSquare, drawnAt, drawnSquares); more faces on a die numbered 1, 2, 3 carry its numbering on (6c3)
Expand Down
Loading
Loading