Repository navigation
S4a: Contract: the lamp switch - #377
Merged
Merged
Conversation
`lamp` switches the player's lamp on or off, `InteractableKind.PLUG` marks the plugs that charge it, and `Item.charge` and `Item.on` say how it drains, charges and goes out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 22, 2026
Merged
Contributor
Author
|
Reviewed against #375, S4 (#351) and the merged S1, S3, eating and salvage contracts. Checks:
Design: Change
For the lead, not this PR
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Re-reviewed at
The notes for the lead from my last comment still stand: S4's Owns, seen places across a reload, and the S8 and S9 contracts. |
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 contract S4 (#351) needs for the player to switch their lamp on and off and charge it. Nothing sends or handles any of it yet; S4 does.
Client → server
lamp:{"type": "lamp", "on": true}switches on the lamp the player carries, and"on": falseswitches it off. The server sends theplayer_statethat follows, and ignores alampif they carry no lamp, if it's already as asked, or for switching on a flat one.Schema
InteractableKind.PLUG,"plug": a socket that charges the player's lamp while they stand on one of itsstandtiles. S4 makes S3'smetro_plugone, rather than amachine(which S8's datajack uses), and adds plugs in the village.Item.chargeandItem.onnow say the battery runs down while the lamp is on, that at a plug it charges, on or off, and that a flat lamp goes off by itself.Additive only
lampis only added to the client union, andplugto the enum. Every existing message, the fixtures and saves dump exactly as before.Interactable.json,Item.json,Player.json,protocol.schema.jsonandprotocol.tsare regenerated.docs/protocol.mdhas thelampsection, the interactable kinds and how the lamp drains and charges.Choices
on, not a toggle. Setting the state the client shows is idempotent, so a repeated or late message can't flip the lamp the wrong way.lightlayer (S3) as the server does, since the maps are bundled, not sent.pluginplayer_state. Which plug the player stands at, and so whether the lamp is charging, follows from the maps' plugs and the player's position, which the client already has. That also keeps S4 out ofPlayerSync, which S6 is changing.Closes #375
🤖 Generated with Claude Code