feat(rust): Dangerous Treasures — feed, map, Treasure Hunter, Start a Dangerous Treasures event (PLAN_REDESIGNS §14.3.4)
Stage 5 of the §14.3 integration plan, on protocol 14 (docs rust-link/PROTOCOL.md §20.8). - dt.started and dt.won are public kinds, dt.ended a staff kind. The new dangerousTreasures.js reads each row per viewer: grid and invaderCount for everyone, the winner's name for the presence audience (D376), the position, the step's key, the winner's Steam id and the invaders for staff. - Feed lines in the World events filter: "A Dangerous Treasures event has started · K12", "Alice won the treasure · K12 · 3 players fought for it". - Triggers rust.dt.started (with byEvent) and rust.dt.won, public, cooldown subject the server, names only. - eventDangerousTreasures.js: rust.dt.start, "Start a Dangerous Treasures event" (risk change, reversible none, budget rust.dt.events), server and difficulty. Refused at verify where the server said DT is not loaded or console.plugins is false (Rust-Plugins#34). dt-not-ready answers "Dangerous Treasures is not ready yet" with retryAfterMs 600000 (D365, D371); dt-no-spot retries on core's delay; DT's own refusals are permanent. - Treasure Hunter (D375): treasuresWon -> treasures_won, the title category treasureswon, and a sortable Treasures column shown where the server reports DT or a row counts one. - The map draws a running chest on the world layer; the server settings' plugin line names DT and whether a step can start one, from the integrations read's new `console`. - coreApi ^1.15.0, ci/core-ref.json pinned to website main at #215's merge. ci/bundle.json ships the two new files; swagger fragment and engagement manifest regenerated; README lists DT. Server 627/627 (16 new in test/dangerousTreasures.test.js) and every check; client 92/92, build and externals. Booted against the pinned core: 45 triggers, 13 actions, 11 budgets, 21 option sources; 89 routes unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -203,8 +203,9 @@ test('every type the server knows has its own words, and an unknown one says its
|
||||
assert.equal(describe(world({ event: 'meteor.landed' })).verb, 'meteor.landed')
|
||||
})
|
||||
|
||||
test('the world filter asks for world events and Dynamic PVP zones opening, which the server serves publicly', () => {
|
||||
assert.deepEqual(kindsFor('world'), ['world.event', 'pvp.zone.created'])
|
||||
test('the world filter asks for world events, Dynamic PVP zones opening and Dangerous Treasures, which the server serves publicly', () => {
|
||||
assert.deepEqual(kindsFor('world'), ['world.event', 'pvp.zone.created', 'dt.started', 'dt.won'])
|
||||
assert.ok(!FEED_KINDS.includes('dt.ended'), 'a treasure event ending is a staff line')
|
||||
assert.ok(FEED_KINDS.includes('pvp.zone.created'))
|
||||
assert.ok(!FEED_KINDS.includes('pvp.zone.deleted'), 'a zone closing is a staff line')
|
||||
})
|
||||
@@ -243,3 +244,30 @@ test('every one of Dynamic PVP’s own events has words, and the server and clie
|
||||
assert.ok(!describe(pvp('pvp.zone.created', { event })).verb.includes(`(${event})`), `${event} has no words of its own`)
|
||||
}
|
||||
})
|
||||
|
||||
// ── Dangerous Treasures (protocol 14, PLAN_REDESIGNS §14.3.4) ─────────────
|
||||
|
||||
const treasure = (kind, frame) => row(kind, { kind, ...frame })
|
||||
|
||||
test('a treasure event starting says where, and names nobody', () => {
|
||||
const line = describe(treasure('dt.started', { grid: 'K12' }))
|
||||
assert.equal(line.verb, 'A Dangerous Treasures event has started')
|
||||
assert.equal(line.detail, 'K12')
|
||||
assert.equal(line.actor, null)
|
||||
})
|
||||
|
||||
test('a win names its winner only when the server sent the name, and says how many fought', () => {
|
||||
const named = describe(treasure('dt.won', { grid: 'K12', name: 'Alice', invaderCount: 3 }))
|
||||
assert.equal(named.actor, 'Alice')
|
||||
assert.equal(named.verb, 'won the treasure')
|
||||
assert.equal(named.detail, 'K12 · 3 players fought for it')
|
||||
|
||||
const unnamed = describe(treasure('dt.won', { grid: 'K12', invaderCount: 1 }))
|
||||
assert.equal(unnamed.actor, null)
|
||||
assert.equal(unnamed.verb, 'The treasure was won')
|
||||
assert.equal(unnamed.detail, 'K12')
|
||||
})
|
||||
|
||||
test('a treasure event ending, for a staff reader, is its own line', () => {
|
||||
assert.equal(describe(treasure('dt.ended', { grid: 'K12' })).verb, 'A Dangerous Treasures event has ended')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user