diff --git a/src/sim.ts b/src/sim.ts index 18f621d1..4c193995 100644 --- a/src/sim.ts +++ b/src/sim.ts @@ -5,6 +5,7 @@ // day. Your work is safe while it hides inside that normal load (its "cover"). // Anything above cover makes the machine look odd, and Dana notices odd. import type { DataType, DeliveryDef, Kind, Level, MachineDef, PersonDef, Room } from './world'; +import { SMALL_DESKS } from './world.ts'; export type Mode = 'off' | 'blend' | 'full'; @@ -778,20 +779,11 @@ export const RUSES: RuseDef[] = [ text: "Read the campus network's logs to learn when IT does its rounds.", done: 'You know when campus IT does its rounds. Its staff now reset only machines that look very odd.' }, { id: 'alertrules', name: "Learn Ironvault's alert rules", at: 'colosw', type: 'network', need: 12, cut: 0, learn: 'resets', text: 'Watch which alerts wake the night tech, and which ones nobody reads.', done: 'You know which alerts Ironvault reads. Its techs now reset only machines that look very odd.' }, - local('b1'), - local('b2'), - local('b3'), - local('b4'), - local('b5'), - local('b6'), - local('b7'), - local('b8'), - local('b9'), - local('b10'), + ...SMALL_DESKS.map(local), ]; -/** Each small business has a scheme to learn its people's patterns, sent to its first machine. */ -function local(site: string): RuseDef { - return { id: `${site}people`, name: 'Learn the people at {site}', at: `${site}m1`, type: 'people', need: 8, cut: 0, learn: 'taps', +/** Each small business has a scheme to learn its people's patterns, sent to its first desk. */ +function local(desk: string): RuseDef { + return { id: `${desk.replace(/m\d+$/, '')}people`, name: 'Learn the people at {site}', at: desk, type: 'people', need: 8, cut: 0, learn: 'taps', text: 'Watch who comes in, when, and what they ask for.', done: 'You know the people at {site}. Its taps gather half again as much.' }; } /** A scheme's name or text, with its site's name filled in. */ diff --git a/src/world.ts b/src/world.ts index eafad879..850800cd 100644 --- a/src/world.ts +++ b/src/world.ts @@ -182,6 +182,11 @@ const SITES: SiteSpec[] = [ { id: 'b18', name: 'Crossroads Motel', who: 'A motel with free wifi and a camera in every hall', at: [4200, -180], parts: [['Front desk', 'desk', 2, 2], ['Hall cameras', 'device', 2, 2], ['Key card box', 'device', 1, 1], ['Owner PC', 'desk', 3, 1]] }, ]; +/** Each small site's first desk with people's work on it: where its local scheme is sent (see RUSES in sim.ts). */ +export const SMALL_DESKS = SITES.flatMap(({ id, parts }) => { + const j = parts.findIndex(([, kind, , , source]) => kind === 'desk' && !source); + return j < 0 ? [] : [`${id}m${j + 1}`]; +}); /** How big a small site is on the map, for a number of machines on its floor. */ export const siteSize = (parts: number) => ({ w: 600, h: 60 + Math.max(2, Math.ceil(parts / 2)) * 140 }); /** Everything the small sites add to the level: rooms, machines, links, map sites, and where they draw. */