diff --git a/docs/user/modifier-profiles.md b/docs/user/modifier-profiles.md index ee591ea..cd2f30c 100644 --- a/docs/user/modifier-profiles.md +++ b/docs/user/modifier-profiles.md @@ -92,14 +92,65 @@ Values: 0 (no resistance) to 1 (full immunity). --- +## Editor Features + +### Undo / Redo + +- **Cmd/Ctrl+Z** to undo, **Cmd/Ctrl+Shift+Z** to redo. +- Toolbar buttons in the editor header (↶ / ↷) with the same behaviour. +- History is capped at 50 actions per editing session. +- The stack is cleared when you **Save** or **Cancel** — the saved state + becomes the new baseline, so there is no undo across sessions. + +### Copy / Paste + +- **Per-instance**: select a square that already has modifiers, click **Copy**, + then select another square and click **Paste**. Pasted modifiers replace any + same-kind modifier already present on the target (so you won't end up with + two HP-Bonus entries on the same piece). +- **Per-type**: each row has a **Copy** button. Use **Paste** at the top of the + panel to apply the copied entry to a different piece type / color. +- The clipboard is editor-local (in-memory) and does **not** use your OS + clipboard — copying modifiers cannot clobber anything you already copied + outside the app. + +### Conflict Resolution + +When the editor detects a problem — a king carrying the `CANNOT_BE_CAPTURED` +flag, a per-instance entry pointing at an empty square, an attribute-limit +overflow — a panel appears at the top of the editor listing every issue. + +- Each issue has a **Fix** button that auto-resolves it where possible + (e.g. drop the illegal flag, remove the orphan entry). +- Some issues (missing kings for a layout, attribute-limit overflow that + requires a real decision) can't be fixed automatically; the Fix button is + advisory and the panel directs you to the specific row that needs manual + attention. +- Save is blocked while any hard error remains; warnings (orphan per-instance + entries) don't block save but surface in the panel so they aren't silently + ignored. + +--- + ## Hot-Swap -Profiles can be changed mid-game by the host (creator of the room). Click the -rules drawer while in a game and select a new profile. Changes take effect after -the current interaction. +Modifier profiles can be changed mid-game. The flow: -*Note*: Two-player consent model is planned for T2. In T1, the host can change -profiles unilaterally. +1. **Solo mode**: Open the editor, change the profile, save. The new profile + applies after the next move. +2. **Multiplayer**: Either player can propose a profile change. The opponent + receives a notification with a 60-second window to approve or reject. If + approved, the new profile applies after the next move; if rejected or timed + out, no change occurs. + +Profile changes always take effect at a **turn boundary** (after the next +completed move), never mid-move. This guarantees both players' moves resolve +under the same rule set they were planned with — the state at turn N is fully +determined by the profile active at turn N plus moves 1..N. + +In a multiplayer room, rapid successive proposals follow a last-write-wins +rule: if you propose a swap and then send a second proposal before the opponent +decides, the first is superseded and the opponent sees the new candidate. --- @@ -117,16 +168,50 @@ profiles unilaterally. **Hover** any piece on the board to see a tooltip listing active modifiers. -**Click** a piece to pin a side panel with the full modifier breakdown, including -the source of each modifier (per-type, per-instance, or from an active preset). -The panel stays pinned across turns until you dismiss it (×) or click another piece. +**Click** a piece to pin a side panel with the full modifier breakdown. The +panel stays pinned across turns until you dismiss it (×) or click another +piece. + +The pinned panel shows the **source** of each modifier so you can trace where +a value comes from at a glance: + +- **per-instance: {square}** — attached to this specific board position + (survives captures of other pieces, but vanishes if this piece is captured). +- **per-type: all {color} {type}s** — applies to every piece matching this + type + color combination. +- **from {preset name}** — the modifier comes from an active rule preset + (e.g. a first-blood ruleset granting kings extra HP). +- **default** — the engine's baseline value with no modifier applied. + +When multiple sources touch the same attribute, the panel lists each source +and shows how they combine (HP additive, damage-resistance multiplicative, +direction-additions unioned). --- -## Known Limitations (T1) +## Board Indicators + +Pieces with one or more active modifiers display a small **fuchsia dot** in +the top-right corner of their square. The dot is visible without hover, so +you can tell at a glance which pieces are running on modified rules. + +- Hover the piece to see a tooltip with modifier details. +- Click to pin the inspection panel (see above). +- The dot stays visible across moves and updates live when a profile is + hot-swapped at the next turn boundary. + +--- + +## Known Limitations -- Only the host can swap profiles mid-game. Two-player consent coming in T2. - Maximum 20 profiles in the local library per browser. - Profiles larger than 8 KB cannot be URL-shared. - CANNOT_BE_CAPTURED cannot be applied to kings. - Deadlock detection (all legal moves blocked) not yet implemented. + +### Coming in T3 + +- Custom modifier authoring (defining new modifier categories from scratch). +- Cross-piece aura effects (e.g. "all pieces within 2 squares of this priest + get +1 HP"). +- Multi-profile stacking (combining two profiles in one game).