@dsh-agentic-roleplay/core 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/{notes-CJzbN_-E.js → activity-t7OBgHlc.js} +267 -47
- package/lib/authoring.js +295 -14
- package/lib/client.js +2599 -648
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +1 -1
- package/lib/{documents-BBq88wXP.js → documents-Bu5uYRZB.js} +54 -33
- package/lib/{gallery-CjG9_4Sz.js → gallery-DUeBMHQX.js} +2 -2
- package/lib/{generator-pxZS-pu-.js → generator-HPifO3Kk.js} +211 -15
- package/lib/images.js +3 -3
- package/lib/index.js +849 -20
- package/lib/{narration-tYy6Rkfr.js → narration-BRyHU0H2.js} +28 -5
- package/lib/orchestration.js +803 -233
- package/lib/packs-ByP1J-zj.js +1334 -0
- package/lib/{presenter-agent-DbZALurg.js → presenter-agent-G43ODV8I.js} +3 -3
- package/package.json +5 -3
- package/prompts/en/roleplay/ask-answerer.md +3 -0
- package/prompts/en/roleplay/ask-question.md +2 -0
- package/prompts/en/roleplay/character-decide.md +1 -1
- package/prompts/en/roleplay/character-lookup.md +1 -1
- package/prompts/en/roleplay/faction-strategist.md +5 -0
- package/prompts/en/roleplay/game-master.md +5 -1
- package/prompts/en/roleplay/ooc-empty.md +1 -1
- package/prompts/en/roleplay/trigger-judge.md +3 -0
- package/prompts/en/world/procedure.md +1 -1
- package/prompts/zh/roleplay/ask-answerer.md +3 -0
- package/prompts/zh/roleplay/ask-question.md +2 -0
- package/prompts/zh/roleplay/character-decide.md +1 -1
- package/prompts/zh/roleplay/character-lookup.md +1 -1
- package/prompts/zh/roleplay/faction-strategist.md +5 -0
- package/prompts/zh/roleplay/game-master.md +5 -1
- package/prompts/zh/roleplay/ooc-empty.md +1 -1
- package/prompts/zh/roleplay/trigger-judge.md +3 -0
- package/prompts/zh/world/procedure.md +1 -1
- package/starter-worlds/blackwater-observatory/characters/arthur-moore/character.json +65 -0
- package/starter-worlds/blackwater-observatory/characters/clara-whitlock/character.json +87 -0
- package/starter-worlds/blackwater-observatory/characters/eleanor-graves/character.json +80 -0
- package/starter-worlds/blackwater-observatory/characters/marcus-reed/character.json +73 -0
- package/starter-worlds/blackwater-observatory/items/anonymous-letter/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/brass-laboratory-key/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/claras-gossip-notebook/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/harlans-notebook/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/investigators-coat/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/investigators-notebook/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/locked-filing-cabinet/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/marcus-calibration-notes/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/mayors-administrative-seal/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/municipal-lockbox/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/pocket-revolver/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/room-7-cash-receipt/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/rusting-mine-cart/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/signal-recording-strip/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/silver-pocket-watch/item.json +9 -0
- package/starter-worlds/blackwater-observatory/items/survey-archive-cabinet/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/surveyors-map/item.json +10 -0
- package/starter-worlds/blackwater-observatory/items/unknown-visitors-note-fragment/item.json +10 -0
- package/starter-worlds/blackwater-observatory/locations/blackwater-ridge/location.json +5 -0
- package/starter-worlds/blackwater-observatory/locations/iron-stag-bar/location.json +30 -0
- package/starter-worlds/blackwater-observatory/locations/iron-stag-room-7/location.json +18 -0
- package/starter-worlds/blackwater-observatory/locations/north-forest-cabin/location.json +18 -0
- package/starter-worlds/blackwater-observatory/locations/observatory-directors-office/location.json +20 -0
- package/starter-worlds/blackwater-observatory/locations/observatory-telescope-chamber/location.json +25 -0
- package/starter-worlds/blackwater-observatory/locations/old-mine-entrance/location.json +27 -0
- package/starter-worlds/blackwater-observatory/locations/old-mine-main-tunnel/location.json +13 -0
- package/starter-worlds/blackwater-observatory/locations/town-hall-mayors-office/location.json +25 -0
- package/starter-worlds/blackwater-observatory/locations/town-hall-records-room/location.json +13 -0
- package/starter-worlds/blackwater-observatory/locations/town-square/location.json +30 -0
- package/starter-worlds/blackwater-observatory/triggers.json +20 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/map.html +12 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/map.js +40 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/notebook.html +29 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/notebook.js +45 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/pack.json +31 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/skin.css +16 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/strip.html +11 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/strip.js +12 -0
- package/starter-worlds/blackwater-observatory/ui/notebook/style.css +23 -0
- package/starter-worlds/blackwater-observatory/variables.json +39 -0
- package/starter-worlds/blackwater-observatory/world.json +27 -0
- package/lib/worlds-Bj-EGS_i.js +0 -478
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "room-7-cash-receipt",
|
|
3
|
+
"name": "Room 7 Cash Receipt",
|
|
4
|
+
"description": "A receipt for the unknown visitor's payment for Room 7. The name is believed to be false.",
|
|
5
|
+
"unique": true,
|
|
6
|
+
"owner": "clara-whitlock",
|
|
7
|
+
"held_by": "clara-whitlock",
|
|
8
|
+
"notable": true
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "rusting-mine-cart",
|
|
3
|
+
"name": "Rusting Mine Cart",
|
|
4
|
+
"description": "An old ore cart on warped rails, half-filled with stone fragments and rotting wood.",
|
|
5
|
+
"container": {
|
|
6
|
+
"state": "open"
|
|
7
|
+
},
|
|
8
|
+
"notable": true,
|
|
9
|
+
"location": "old-mine-main-tunnel"
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "signal-recording-strip",
|
|
3
|
+
"name": "Signal Recording Strip",
|
|
4
|
+
"description": "A paper strip marked with irregular signal patterns detected beneath Blackwater Ridge.",
|
|
5
|
+
"unique": true,
|
|
6
|
+
"owner": "marcus-reed",
|
|
7
|
+
"held_by": "marcus-reed",
|
|
8
|
+
"notable": true
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "survey-archive-cabinet",
|
|
3
|
+
"name": "Survey Archive Cabinet",
|
|
4
|
+
"description": "A cabinet containing older surveyor records and historical mine documentation.",
|
|
5
|
+
"container": {
|
|
6
|
+
"state": "closed"
|
|
7
|
+
},
|
|
8
|
+
"notable": true,
|
|
9
|
+
"location": "town-hall-records-room"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "surveyors-map",
|
|
3
|
+
"name": "Surveyor's Map",
|
|
4
|
+
"description": "An old surveyor's map showing a tunnel not present on official town records.",
|
|
5
|
+
"unique": true,
|
|
6
|
+
"quality": "aged",
|
|
7
|
+
"owner": "eleanor-graves",
|
|
8
|
+
"held_by": "eleanor-graves",
|
|
9
|
+
"notable": true
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "unknown-visitors-note-fragment",
|
|
3
|
+
"name": "Unknown Visitor's Note Fragment",
|
|
4
|
+
"description": "A torn paper fragment connected to the unknown visitor who rented Room 7.",
|
|
5
|
+
"unique": true,
|
|
6
|
+
"quality": "torn",
|
|
7
|
+
"location": "iron-stag-room-7",
|
|
8
|
+
"position": "inside the desk drawer",
|
|
9
|
+
"notable": true
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "iron-stag-bar",
|
|
3
|
+
"name": "Iron Stag Inn - Bar",
|
|
4
|
+
"description": "The busy ground-floor bar of the Iron Stag Inn. Locals gather here for drink, gossip, and festival talk.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "visitors-room-ledger",
|
|
9
|
+
"name": "Visitor's Room Ledger",
|
|
10
|
+
"description": "The inn's ledger of room usage, dates, names, and payments."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "notice-board",
|
|
14
|
+
"name": "Notice Board",
|
|
15
|
+
"description": "A cork board crowded with festival notices and handwritten messages."
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"exits": [
|
|
19
|
+
{
|
|
20
|
+
"to": "iron-stag-room-7",
|
|
21
|
+
"description": "a narrow stair to the guest rooms",
|
|
22
|
+
"travel_time_seconds": 30
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"to": "town-square",
|
|
26
|
+
"description": "the inn door onto the square",
|
|
27
|
+
"travel_time_seconds": 60
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "iron-stag-room-7",
|
|
3
|
+
"name": "Iron Stag Inn - Room 7",
|
|
4
|
+
"description": "A modest guest room on the upper floor with a writing desk and a window over the side alley.",
|
|
5
|
+
"parent": "iron-stag-bar",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "writing-desk",
|
|
9
|
+
"name": "Room 7 Writing Desk",
|
|
10
|
+
"description": "A small desk with a lamp and a blotter."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "guest-room-window",
|
|
14
|
+
"name": "Guest Room Window",
|
|
15
|
+
"description": "A narrow window over the side alley."
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "north-forest-cabin",
|
|
3
|
+
"name": "North Forest - Abandoned Cabin",
|
|
4
|
+
"description": "An abandoned cabin in the north forest.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "cabin-hearth",
|
|
9
|
+
"name": "Cabin Hearth",
|
|
10
|
+
"description": "A cold stone hearth."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "loose-floorboard",
|
|
14
|
+
"name": "Loose Floorboard",
|
|
15
|
+
"description": "A floorboard that does not sit flat."
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/starter-worlds/blackwater-observatory/locations/observatory-directors-office/location.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "observatory-directors-office",
|
|
3
|
+
"name": "Blackwater Observatory - Director's Office",
|
|
4
|
+
"description": "The private office of the missing Director Harlan. Tall windows face the mountains, while shelves of astronomical records, correspondence, and field notes line the walls.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "directors-desk",
|
|
9
|
+
"name": "Director's Desk",
|
|
10
|
+
"description": "A heavy oak desk used by Director Harlan. Its surface is neat and its drawers are closed."
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"exits": [
|
|
14
|
+
{
|
|
15
|
+
"to": "observatory-telescope-chamber",
|
|
16
|
+
"description": "a short corridor to the telescope chamber",
|
|
17
|
+
"travel_time_seconds": 30
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
package/starter-worlds/blackwater-observatory/locations/observatory-telescope-chamber/location.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "observatory-telescope-chamber",
|
|
3
|
+
"name": "Blackwater Observatory - Telescope Chamber",
|
|
4
|
+
"description": "The main chamber of the observatory, dominated by a large brass-and-steel telescope mounted beneath the rotating dome.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "main-telescope",
|
|
9
|
+
"name": "Main Telescope",
|
|
10
|
+
"description": "The observatory's primary telescope, functional but not set to its resting alignment."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "signal-recording-apparatus",
|
|
14
|
+
"name": "Signal Recording Apparatus",
|
|
15
|
+
"description": "Coils, receivers, and paper rolls used to record strange underground signal patterns."
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"exits": [
|
|
19
|
+
{
|
|
20
|
+
"to": "town-square",
|
|
21
|
+
"description": "the long switchback road down to the town",
|
|
22
|
+
"travel_time_seconds": 900
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "old-mine-entrance",
|
|
3
|
+
"name": "Old Mine - Mine Entrance",
|
|
4
|
+
"description": "The mouth of the old silver mine, with a boarded entrance and a faded warning sign.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "boarded-mine-entrance",
|
|
9
|
+
"name": "Boarded Mine Entrance",
|
|
10
|
+
"description": "Heavy boards nailed across the entrance."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "old-warning-sign",
|
|
14
|
+
"name": "Old Warning Sign",
|
|
15
|
+
"description": "A faded sign warning against entering."
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"exits": [
|
|
19
|
+
{
|
|
20
|
+
"to": "old-mine-main-tunnel",
|
|
21
|
+
"description": "boarded-up entrance into the mine",
|
|
22
|
+
"state": "blocked",
|
|
23
|
+
"note": "the entrance is boarded up",
|
|
24
|
+
"travel_time_seconds": 60
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "old-mine-main-tunnel",
|
|
3
|
+
"name": "Old Mine - Main Tunnel",
|
|
4
|
+
"description": "The main tunnel of the old mine.",
|
|
5
|
+
"parent": "old-mine-entrance",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "collapsed-side-passage",
|
|
9
|
+
"name": "Collapsed Side Passage",
|
|
10
|
+
"description": "A side passage choked with fallen rock."
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "town-hall-mayors-office",
|
|
3
|
+
"name": "Town Hall - Mayor's Office",
|
|
4
|
+
"description": "Eleanor Graves's formal, controlled, carefully arranged office inside Town Hall.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "mayors-desk",
|
|
9
|
+
"name": "Mayor's Desk",
|
|
10
|
+
"description": "A large, immaculate desk."
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"exits": [
|
|
14
|
+
{
|
|
15
|
+
"to": "town-hall-records-room",
|
|
16
|
+
"description": "a door to the records room",
|
|
17
|
+
"travel_time_seconds": 20
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"to": "town-square",
|
|
21
|
+
"description": "the Town Hall steps down to the square",
|
|
22
|
+
"travel_time_seconds": 60
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "town-hall-records-room",
|
|
3
|
+
"name": "Town Hall - Records Room",
|
|
4
|
+
"description": "A cramped archival room filled with deeds, survey papers, council minutes, and tax records.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "property-record-shelves",
|
|
9
|
+
"name": "Property Record Shelves",
|
|
10
|
+
"description": "Shelves of property and survey records."
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "town-square",
|
|
3
|
+
"name": "Town Square - Festival Monument",
|
|
4
|
+
"description": "The town square around the festival monument, where the annual festival is held.",
|
|
5
|
+
"parent": "blackwater-ridge",
|
|
6
|
+
"features": [
|
|
7
|
+
{
|
|
8
|
+
"id": "festival-monument",
|
|
9
|
+
"name": "Festival Monument",
|
|
10
|
+
"description": "A weathered stone monument."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "festival-stalls",
|
|
14
|
+
"name": "Festival Stalls",
|
|
15
|
+
"description": "Wooden stalls set up for the festival."
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"exits": [
|
|
19
|
+
{
|
|
20
|
+
"to": "old-mine-entrance",
|
|
21
|
+
"description": "the track up to the old mine",
|
|
22
|
+
"travel_time_seconds": 1200
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"to": "north-forest-cabin",
|
|
26
|
+
"description": "a path into the north forest",
|
|
27
|
+
"travel_time_seconds": 1800
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"key": "festival-band",
|
|
4
|
+
"name": "The festival band strikes up",
|
|
5
|
+
"when": { "type": "time", "from": "1912-09-21T19:31" },
|
|
6
|
+
"effects": [
|
|
7
|
+
{ "type": "beat", "text": "The festival band strikes up in the square outside, loud enough to be heard through the walls." },
|
|
8
|
+
{ "type": "cue", "audience": { "place": "iron-stag-bar" }, "text": "The band has started early; the bar will fill up soon." }
|
|
9
|
+
],
|
|
10
|
+
"announce": { "audience": "everyone", "text": "The Founder's Festival band plays on the square this evening.", "at": "1912-09-21T19:31" }
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"key": "mayors-announcement",
|
|
14
|
+
"name": "The mayor's announcement",
|
|
15
|
+
"when": { "type": "time", "from": "1912-09-22T12:00" },
|
|
16
|
+
"effects": [
|
|
17
|
+
{ "type": "edit", "edit": { "events": [{ "text": "Mayor Graves announced a curfew for the whole town.", "tags": ["curfew"], "importance": 4, "perceived_by": "everyone" }] } }
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<link rel="stylesheet" href="style.css">
|
|
6
|
+
</head>
|
|
7
|
+
<body style="height: 100vh">
|
|
8
|
+
<svg id="map" viewBox="0 0 400 400" role="img" aria-label="The places you know and the ways between them"></svg>
|
|
9
|
+
<p class="muted map-empty" id="empty" hidden>No places known yet.</p>
|
|
10
|
+
<script src="map.js"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const SVG = 'http://www.w3.org/2000/svg'
|
|
2
|
+
const CENTRE = 200
|
|
3
|
+
const RADIUS = 140
|
|
4
|
+
|
|
5
|
+
function element(name, attributes = {}, text) {
|
|
6
|
+
const node = document.createElementNS(SVG, name)
|
|
7
|
+
for (const [key, value] of Object.entries(attributes)) node.setAttribute(key, String(value))
|
|
8
|
+
if (text !== undefined) node.textContent = text
|
|
9
|
+
return node
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Where each known place is drawn: the one the player is in at the centre, the others around it. */
|
|
13
|
+
function layout(places) {
|
|
14
|
+
const others = places.filter(place => !place.here)
|
|
15
|
+
const spots = new Map(places.filter(place => place.here).map(place => [place.key, { x: CENTRE, y: CENTRE }]))
|
|
16
|
+
others.forEach((place, index) => {
|
|
17
|
+
const angle = (index / Math.max(1, others.length)) * Math.PI * 2 - Math.PI / 2
|
|
18
|
+
spots.set(place.key, { x: CENTRE + RADIUS * Math.cos(angle), y: CENTRE + RADIUS * Math.sin(angle) })
|
|
19
|
+
})
|
|
20
|
+
return spots
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
rp.watch((view) => {
|
|
24
|
+
const svg = document.getElementById('map')
|
|
25
|
+
document.getElementById('empty').hidden = view.map.places.length > 0
|
|
26
|
+
const spots = layout(view.map.places)
|
|
27
|
+
svg.replaceChildren(
|
|
28
|
+
...view.map.routes.flatMap((route) => {
|
|
29
|
+
const from = spots.get(route.from)
|
|
30
|
+
const to = spots.get(route.to)
|
|
31
|
+
return from && to ? [element('line', { class: 'edge', x1: from.x, y1: from.y, x2: to.x, y2: to.y })] : []
|
|
32
|
+
}),
|
|
33
|
+
...view.map.places.map((place) => {
|
|
34
|
+
const spot = spots.get(place.key)
|
|
35
|
+
const group = element('g', { class: place.here ? 'node here' : 'node', transform: `translate(${spot.x} ${spot.y})` })
|
|
36
|
+
group.append(element('circle', { r: place.here ? 11 : 8 }), element('text', { y: place.here ? 28 : 24 }, place.name))
|
|
37
|
+
return group
|
|
38
|
+
}),
|
|
39
|
+
)
|
|
40
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<link rel="stylesheet" href="style.css">
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div class="page">
|
|
9
|
+
<h2>Where you are</h2>
|
|
10
|
+
<p id="here"></p>
|
|
11
|
+
<ul id="exits"></ul>
|
|
12
|
+
<h2>People here</h2>
|
|
13
|
+
<ul id="people"></ul>
|
|
14
|
+
<h2>Places you know</h2>
|
|
15
|
+
<ul id="places"></ul>
|
|
16
|
+
<h2>What you carry</h2>
|
|
17
|
+
<ul id="carried"></ul>
|
|
18
|
+
<div id="ideas-box" hidden>
|
|
19
|
+
<h2>You might</h2>
|
|
20
|
+
<div id="ideas"></div>
|
|
21
|
+
</div>
|
|
22
|
+
<h2>The story so far</h2>
|
|
23
|
+
<ul id="story"></ul>
|
|
24
|
+
<h2>Your notes</h2>
|
|
25
|
+
<textarea id="notes" placeholder="Written here, kept with this story."></textarea>
|
|
26
|
+
</div>
|
|
27
|
+
<script src="notebook.js"></script>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const $ = id => document.getElementById(id)
|
|
2
|
+
|
|
3
|
+
function fill(list, items, empty) {
|
|
4
|
+
list.replaceChildren(...(items.length > 0 ? items : [empty]).map((item) => {
|
|
5
|
+
const entry = document.createElement('li')
|
|
6
|
+
if (typeof item === 'string') { entry.textContent = item; entry.className = 'muted' } else { entry.textContent = item.text; if (item.here) entry.className = 'here' }
|
|
7
|
+
return entry
|
|
8
|
+
}))
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
rp.watch((view) => {
|
|
12
|
+
const place = view.place
|
|
13
|
+
$('here').textContent = place ? `${place.name}. ${place.description}` : 'You are not anywhere the story has placed you.'
|
|
14
|
+
fill($('exits'), place ? place.exits.map(exit => ({ text: `${exit.open ? 'Way to' : 'Blocked way to'} ${exit.name}` })) : [], 'No way out that you know of.')
|
|
15
|
+
fill($('people'), place ? place.here.map(person => ({ text: person.publicState === '' ? person.name : `${person.name} — ${person.publicState}` })) : [], 'No one else.')
|
|
16
|
+
fill($('places'), view.map.places.map(entry => ({ text: entry.here ? `${entry.name} (you are here)` : entry.name, here: entry.here })), 'None yet.')
|
|
17
|
+
fill($('carried'), view.carried.map(item => ({ text: `${item.quantity > 1 ? `${item.quantity} × ` : ''}${item.name} — ${item.where}` })), 'Nothing.')
|
|
18
|
+
$('ideas-box').hidden = view.suggestions.length === 0
|
|
19
|
+
$('ideas').replaceChildren(...view.suggestions.map((idea, index) => {
|
|
20
|
+
const button = document.createElement('button')
|
|
21
|
+
button.type = 'button'
|
|
22
|
+
button.textContent = idea
|
|
23
|
+
button.addEventListener('click', () => { rp.choose(index).catch(error => console.warn(error)) })
|
|
24
|
+
return button
|
|
25
|
+
}))
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
function brief(turn) {
|
|
29
|
+
const told = turn.segments.find(segment => segment.type === 'narration') ?? turn.segments[0]
|
|
30
|
+
const text = told ? told.text : turn.note ?? ''
|
|
31
|
+
return { text: `${turn.turn}. ${turn.player} — ${text.length > 140 ? `${text.slice(0, 140)}…` : text}` }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function showStory() {
|
|
35
|
+
rp.history(6).then((turns) => { fill($('story'), turns.reverse().map(brief), 'Nothing has happened yet.') }, error => console.warn(error))
|
|
36
|
+
}
|
|
37
|
+
showStory()
|
|
38
|
+
rp.on('turn', showStory)
|
|
39
|
+
|
|
40
|
+
let saving
|
|
41
|
+
rp.storage.get('notes').then((saved) => { if (typeof saved === 'string') $('notes').value = saved })
|
|
42
|
+
$('notes').addEventListener('input', () => {
|
|
43
|
+
clearTimeout(saving)
|
|
44
|
+
saving = setTimeout(() => { rp.storage.set('notes', $('notes').value).catch(error => console.warn(error)) }, 600)
|
|
45
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Field notebook",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"description": "A status strip above the input box, a notebook tab, and a live map in the right sidebar.",
|
|
5
|
+
"api": 1,
|
|
6
|
+
"theme": {
|
|
7
|
+
"--dsw-alias-brand-primary": {
|
|
8
|
+
"light": "#8a3b12",
|
|
9
|
+
"dark": "#e0a36b"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"skin": "skin.css",
|
|
13
|
+
"actions": [
|
|
14
|
+
"choose",
|
|
15
|
+
"open"
|
|
16
|
+
],
|
|
17
|
+
"surfaces": {
|
|
18
|
+
"hud": {
|
|
19
|
+
"file": "strip.html",
|
|
20
|
+
"height": 40
|
|
21
|
+
},
|
|
22
|
+
"tab": {
|
|
23
|
+
"file": "notebook.html",
|
|
24
|
+
"title": "Notebook"
|
|
25
|
+
},
|
|
26
|
+
"sidebar": {
|
|
27
|
+
"file": "map.html",
|
|
28
|
+
"title": "Map"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[data-rp="utterance"] {
|
|
2
|
+
border-left: 2px solid var(--dsw-alias-brand-primary);
|
|
3
|
+
padding-left: 10px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
[data-rp="utterance"] [data-rp="words"] {
|
|
7
|
+
font-family: Georgia, "Times New Roman", serif;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-rp="speaker"] {
|
|
11
|
+
color: var(--dsw-alias-brand-primary);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
[data-rp="ooc"] {
|
|
15
|
+
font-style: italic;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<link rel="stylesheet" href="style.css">
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div class="strip"><span class="place" id="place"></span><span class="time" id="time"></span><span class="more" id="more"></span><button type="button" id="map" title="Show the map in the sidebar">Map</button></div>
|
|
9
|
+
<script src="strip.js"></script>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const text = (id, value) => { document.getElementById(id).textContent = value }
|
|
2
|
+
|
|
3
|
+
rp.watch((view) => {
|
|
4
|
+
text('place', view.place ? view.place.name : 'Nowhere in particular')
|
|
5
|
+
text('time', view.time ? view.time.text : '')
|
|
6
|
+
const here = view.place ? view.place.here.map(person => person.name) : []
|
|
7
|
+
const tracked = view.variables.filter(entry => entry.subject !== 'the world').map(entry => `${entry.subject}: ${entry.name} ${entry.value}`)
|
|
8
|
+
text('more', [here.length > 0 ? `with ${here.join(', ')}` : 'alone', ...tracked].join(' · '))
|
|
9
|
+
rp.resize(document.documentElement.scrollHeight)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
document.getElementById('map').addEventListener('click', () => { rp.open('sidebar').catch(error => console.warn(error)) })
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
:root { color-scheme: light dark; }
|
|
2
|
+
html, body { margin: 0; background: transparent; color: var(--dsw-alias-label-primary, CanvasText); font: 13px/20px system-ui, sans-serif; }
|
|
3
|
+
h2 { margin: 20px 0 6px; font-size: 14px; font-weight: 600; color: var(--dsw-alias-brand-primary, inherit); }
|
|
4
|
+
h2:first-child { margin-top: 0; }
|
|
5
|
+
ul { margin: 0; padding: 0; list-style: none; }
|
|
6
|
+
li { padding: 2px 0; }
|
|
7
|
+
.muted { color: var(--dsw-alias-label-tertiary, GrayText); }
|
|
8
|
+
.here { font-weight: 600; }
|
|
9
|
+
button { font: inherit; text-align: left; border: 1px solid var(--dsw-alias-border-l3, #8886); border-radius: var(--dsw-radius-sm, 8px); background: transparent; color: inherit; padding: 4px 10px; margin: 0 6px 6px 0; cursor: pointer; }
|
|
10
|
+
button:hover { border-color: var(--dsw-alias-brand-primary, currentColor); }
|
|
11
|
+
textarea { box-sizing: border-box; width: 100%; min-height: 140px; resize: vertical; font: inherit; padding: 8px 10px; border: 1px solid var(--dsw-alias-border-l3, #8886); border-radius: var(--dsw-radius-sm, 8px); background: var(--dsw-alias-bg-layer-1, transparent); color: inherit; }
|
|
12
|
+
.strip { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 8px 12px; border: 1px solid var(--dsw-alias-border-l3, #8886); border-radius: var(--dsw-radius-sm, 8px); background: var(--dsw-alias-bg-layer-1, transparent); }
|
|
13
|
+
.strip .place { font-weight: 600; color: var(--dsw-alias-brand-primary, inherit); }
|
|
14
|
+
.strip .time, .strip .more { color: var(--dsw-alias-label-secondary, inherit); }
|
|
15
|
+
.page { box-sizing: border-box; max-width: 720px; padding: 20px 24px 40px; }
|
|
16
|
+
.strip button { margin: 0 0 0 auto; padding: 0 8px; }
|
|
17
|
+
svg { display: block; width: 100%; height: 100%; }
|
|
18
|
+
.edge { stroke: var(--dsw-alias-border-l2, #8888); stroke-width: 1.5; }
|
|
19
|
+
.node circle { fill: var(--dsw-alias-bg-layer-2, #8882); stroke: var(--dsw-alias-border-l2, #888); stroke-width: 1.5; }
|
|
20
|
+
.node.here circle { fill: var(--dsw-alias-brand-primary, #a52); stroke: none; }
|
|
21
|
+
.node text { fill: var(--dsw-alias-label-secondary, currentColor); font-size: 11px; text-anchor: middle; }
|
|
22
|
+
.node.here text { fill: var(--dsw-alias-label-primary, currentColor); font-weight: 600; }
|
|
23
|
+
.map-empty { padding: 24px; }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"key": "town_unrest",
|
|
4
|
+
"name": "Unrest in the town",
|
|
5
|
+
"description": "How close Blackwater Ridge is to open trouble over the director's disappearance: 0 calm, 10 a riot.",
|
|
6
|
+
"kind": "number",
|
|
7
|
+
"subject": "world",
|
|
8
|
+
"min": 0,
|
|
9
|
+
"max": 10,
|
|
10
|
+
"integer": true,
|
|
11
|
+
"default": 2,
|
|
12
|
+
"visibility": "hidden",
|
|
13
|
+
"always": true,
|
|
14
|
+
"bands": [
|
|
15
|
+
{ "up_to": 2, "label": "calm" },
|
|
16
|
+
{ "up_to": 5, "label": "uneasy" },
|
|
17
|
+
{ "up_to": 8, "label": "tense" },
|
|
18
|
+
{ "up_to": 10, "label": "volatile" }
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "fatigue",
|
|
23
|
+
"name": "Fatigue",
|
|
24
|
+
"description": "How tired the character is: 0 rested, 10 exhausted.",
|
|
25
|
+
"kind": "number",
|
|
26
|
+
"subject": "character",
|
|
27
|
+
"min": 0,
|
|
28
|
+
"max": 10,
|
|
29
|
+
"integer": true,
|
|
30
|
+
"default": 0,
|
|
31
|
+
"visibility": "public",
|
|
32
|
+
"bands": [
|
|
33
|
+
{ "up_to": 2, "label": "rested" },
|
|
34
|
+
{ "up_to": 5, "label": "tired" },
|
|
35
|
+
{ "up_to": 8, "label": "weary" },
|
|
36
|
+
{ "up_to": 10, "label": "exhausted" }
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "51e09bac-6c9e-4ffd-a285-82fbc9c4399c",
|
|
3
|
+
"name": "The Blackwater Observatory",
|
|
4
|
+
"description": "The year is 1912. The isolated mountain town of Blackwater Ridge was built around an astronomical observatory that once conducted secret government-funded research.\n\nThree weeks ago, the observatory's director vanished. Officially, he left without notice. However, nobody believes that. The player arrives in town during the annual Founder's Festival, where tensions between residents are beginning to surface.",
|
|
5
|
+
"starting_time": "1912-09-21T19:30",
|
|
6
|
+
"time_zone": "UTC",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Firefox2100",
|
|
9
|
+
"url": "https://github.com/Firefox2100"
|
|
10
|
+
},
|
|
11
|
+
"metadata": {
|
|
12
|
+
"tags": [
|
|
13
|
+
"mystery",
|
|
14
|
+
"historical",
|
|
15
|
+
"1912",
|
|
16
|
+
"gothic",
|
|
17
|
+
"small town",
|
|
18
|
+
"conspiracy"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"rules": [
|
|
22
|
+
"There is no magic or supernatural power: nothing happens that could not happen in 1912.",
|
|
23
|
+
"Guns are rare in Blackwater Ridge."
|
|
24
|
+
],
|
|
25
|
+
"version": "1.0",
|
|
26
|
+
"opening_message": "Blackwater Ridge is loud tonight. Lanterns hang across the square for the Founder's Festival, and the band is warming up somewhere beyond the Iron Stag's fogged windows.\n\nYou sit at the bar with a glass you have barely touched. A letter without a signature brought you to this town; the director of the observatory has been missing for three weeks; and the woman behind the counter has been watching you since you sat down, polishing the same glass.\n\nSomeone in this room knows what happened on the hill. You have until the festival ends to find out who."
|
|
27
|
+
}
|