2PlayerGame/detective-game/casegen/motives/mistaken.js
2026-08-15 14:07:39 +03:00

33 lines
3.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { ri, b64 } = require('../rng');
function generate(ctx) {
const { r, add, addPuzzle, motiveEvs, victim, killer, herring, tTarget, district } = ctx;
const motiveId = 'Помилкова ціль';
const accName = 'night_owl_' + ri(r, 100, 999);
const b64Puzzle = addPuzzle({
id: 'pz_b64', kind: 'b64', prompt: 'Експорт бази месенджера: поле власника акаунта — беззмістовний рядок символів.',
payload: b64(`owner=${killer.name}; phone=${killer.phone}`), answer: `owner=${killer.name}; phone=${killer.phone}`, hint: 'Це не шифр, а кодування Base64 — розкодуйте.'
});
motiveEvs.push(add({
id: 'mot_lookalike', side: 'field', at: { type: 'person', cid: ctx.witnessFrom(ctx.citizens.filter(c => ctx.unitBuilding(c.home) === ctx.unitBuilding(victim.home) && c.home !== victim.home)).id }, needsIdentity: true,
title: 'Свідчення сусідів', tag: 'мотив',
detail: `«${victim.first}? Царство небесне… Знаєте, ${victim.first} і ${tTarget.first} — їх вічно плутали: той самий одяг, той самий зріст, той самий під'їзд. Навіть листоноша плутав.»`
}));
motiveEvs.push(add({
id: 'mot_target', side: 'field', at: { type: 'person', cid: tTarget.id }, requires: ['mot_lookalike'],
title: `Розмова: ${tTarget.name}`, tag: 'мотив',
detail: `Блідне. «Це мені писали. Місяць погроз з анонімного акаунта „${accName}": „поверни, або пошкодуєш". Я нікому не ${ctx.g(tTarget, 'винен', 'винна')}! Ось, дивіться самі» — і простягає телефон.`,
gives: { motive: true }
}));
motiveEvs.push(add({
id: 'mot_account', side: 'analyst', at: { type: 'sys', sys: 'phone' }, requires: ['mot_target'], puzzle: b64Puzzle,
title: `Деанон акаунта «${accName}»`, tag: 'мотив',
detail: `Запит до платформи повернув експорт. Розкодоване поле власника: ${killer.name}, номер ${killer.phone}. Погрози на адресу ${tTarget.name} писа${ctx.g(killer, 'в', 'ла')} саме ${ctx.g(killer, 'він', 'вона')} — через давній борг за розбите в ДТП авто.`,
gives: { pointsTo: killer.id, motive: true }
}));
const recapWhy = `Справжня ціль — ${tTarget.name}: місяці погроз через давній борг, і автор погроз — ${killer.name}. У темряві ${ctx.g(killer, 'вбивця сплутав', 'вбивця сплутала')} жертву з ціллю: той самий одяг, той самий зріст, той самий під'їзд.`;
const herringLead = `А ще сусіди шепочуться: «${herring.name} з ${victim.first} давно на ножах — через паркування, через сміття, через усе».`;
return { motiveId, recapWhy, herringLead };
}
module.exports = { generate };