Repository navigation
S7: The clinic - #382
Merged
Merged
S7: The clinic#382
Conversation
Adds what S7 needs for the clinic's doctor to buy a kidney and fit the bionics: `sell_part` sells a part of the player's body by its `Body` field, `fit` asks for a bionic in place of a part, and `player_state`'s `buyer` gains `parts`, what it pays for parts of the body, and `fittings`, the bionics it fits with their prices and the parts each can take. `BodyPart` names the six `Body` fields. The new fields are left out of dumps while empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # client/src/net/protocol.ts # docs/protocol.md # server/simile/protocol/messages.py # server/simile/protocol/protocol.schema.json # server/tests/protocol/test_messages.py
…s by BodyPart A Fitting rejects a part its bionic can't replace or a part named twice, a Buyer offers each bionic once, and Buyer.parts is keyed by BodyPart, so the schema gains propertyNames. The clinic's doctor buys one kidney, never the second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tunnel doctor, Annelie Joubert, runs the clinic in the metro's depot: an Npc with values, a whole-FLUX figure and a voice for her greetings, in content/npcs/tunnels/ so she's never a resident. She buys one kidney for 100 and fits the hydraulic legs (80), the datajack (150) and the infrared eye (200), each for money and the part it replaces, through E3's ledger. Prices and stock are in ClinicConfig, and she only voices them: her talk goes through L1 with the price list and what she'd do now. E at the clinic opens a panel of what she buys and fits, with talking to her first; selling a part or a fitting asks twice. The clinic adds its trade to the player's buyer through simile.player's keepers_of. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # client/src/ui/dialogue-scene.ts
Her manifest says "resident": false, which the dolls build writes for anyone outside the village, and the client's dollFor lends only residents' figures to anyone without one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # client/src/ui/README.md # client/src/ui/dialogue-scene.ts # client/src/ui/help.ts # client/src/world/README.md # client/src/world/reach.ts
Contributor
Author
|
Review: approved.
Notes, not blockers:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The clinic in the metro's depot, run by a tunnel doctor who buys a kidney for the player's first money and fits the three bionics, each for money and the part it replaces. Built on the contract in #381, which this branch includes until that merges.
Closes #354
What it does
The doctor, Annelie Joubert, a struck-off Apex surgeon, is
content/npcs/tunnels/annelie.json: anNpcwith values, a persona and a voice.load_npcsreads onlycontent/npcs/*.json, so she's no resident. She isn't inBehaviour, the economy's residents, gossip, reflection or the incident.simile.clinicputs her in every snapshot at the clinic'sclinic_doctorspot, by wrappinghub.snapshot, so the client draws and rings her like anyone else.What she trades (
Clinic) goes on the clinic'splayer_statebuyer aspartsandfittings, through a smallkeepers_of(app)hook insimile.player'sTrade.OUTSIDEthrough E3's ledger, and the part issold.OUTSIDEand puts the bionic in place of the part: the legs in the legs, the datajack in the vertebra, the eye in either eye.Economy.paynever raises.Prices and stock are sim facts in
ClinicConfig. She has one of each bionic, so what's in stock is the stock less what's fitted, and nothing more is saved.Talking to her (
DoctorTalk) goes through L1, at the player's priority, like a resident's reply. It runs outside B2's engine, which only knows residents, so nothing inconversation/changed.The clinic panel (
client/src/ui/clinic-panel.ts). While she'd buy or fit something, the corner says "Press E to see what the Clinic buys and fits", and E opens the panel. It lists:↑ ↓ and Enter or a click, and Esc or E closes it. Selling a part or a fitting takes a second Enter, since neither can be undone.
How E chooses: E at the clinic opens the panel, and the panel's first row talks. Enter still talks to the ringed resident, as everywhere. Once she'd buy and fit nothing more, E there sells salvage as at the stall, and with nothing to sell it talks to her. The stall is unchanged. As S13 has it, one press does one thing: the clinic is in reach where the buyer would be, at no distance, and E takes the nearest thing in reach, a pile first on a tie.
Pricing for S15's loop
S6's economy: about 50 a round of the metro's salvage (32 without the legs, since the servo motor is on the high ledge), back every sim day, and 65 in secrets once. Meals are 5 at the café and 10 at the noodle bar, and free at home; the sums below count two café meals a day.
So the kidney buys the legs with a little over, the datajack takes two days of rounds, and the eye takes about four and a half days of the metro alone. S9's sewers, behind the datajack, should bring that down to two or three.
test_the_prices_carry_s15s_loopchecks these sums against the configs.Please look at
Appearancehas no lab coat or scrubs, so she's in a pale blue t-shirt with a leather apron and glasses. She reads more as a kindly grandmother than a back-alley surgeon, and only a new accessory or a free-text look would change that.design_npcs.py, about 2 minutes) made it, but every one of its six attempts sounds American to the accent classifier, not South African. That's the same limit that led to every resident but Mirela getting a recorded voice. Her four greetings (simile greetings annelie, 35 s) are in that voice. A recording throughimport_voices.py, thensimile greetings annelie --force, would fix it.Notes
test_simulate's 24-hour day (from 08:00, seed 0, talk 3) on main (a0918e2, with S4) and on this branch. Both give 75,577EntityMovedevents with the same digest, and the same summary.simile.dbin a temp dir with the whole server andSIMILE_LLM=fake. The save predates the player, so it loaded the starting player, and the 11 residents plus the doctor were in the snapshot. In the clinic,buyerhad the kidney and the three fittings. I sold the kidney (100) and fitted the legs (−80). The save was written with the body, 20 money and both ledger entries, and reloaded with them.salvagefromOUTSIDEand a fitting as apurchasetoOUTSIDE, both atclinic. Their own kinds (organ,fitting) would be two lines ineconomy/ledger.py, outside this task's Owns.player_sayhandler doesn't know her. Her own handler answers.server/simile/player/(keepers_ofand akeepersargument toTrade), and the client's reach and hint code (world/reach.ts, a newworld/buyers.ts,ui/salvage.ts,ui/dialogue-scene.ts,ui/help.ts).dolls/build.py'speople()andpersonas(), which also mark her manifest"resident": false,voicing/cli.py,tests/voicing/test_greetings.py,voice-lab/npcs.py(which now also readscontent/npcs/tunnels/), andcontent/voices/greetings/lines.jsonandmade.json.content/voices/annelie.wavand.txt, and her seed incontent/voices/seeds.json.dollForlent anyone without a figure one of the residents', and that list would have taken in hers. It now skips any manifest with"resident": false, so a stranger never wears the doctor (dolls/manifest.ts,world/assets.ts, and their tests).tests/npc/test_cli.py, which read every entry incontent/npcs/as a file. It now reads every file under it, the tunnels' folder included.simile voice measuredoesn't know her either, so her lines are paced at the default rate.Follow-ups
🤖 Generated with Claude Code