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

40 lines
3.7 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.

function generate(ctx) {
const { r, add, addPuzzle, motiveEvs, victim, killer, herring, startingFacts, lair } = ctx;
const motiveId = 'Одержимість';
const rep = ctx.witnessFrom(victim.workplace ? ctx.citizens.filter(c => c.workplace === victim.workplace) : ctx.citizens);
startingFacts.push(add({
id: 'sf_report', side: 'field', at: { type: 'start' },
title: 'Заява про зникнення', tag: 'жертва',
detail: `${rep.name} ${ctx.g(rep, 'заявив', 'заявила')}: ${victim.name} другий день не виходить на зв'язок, телефон вимкнений, двері зачинені. «Це не в ${ctx.g(victim, 'його', 'її')} стилі. І ще: останнім часом ${ctx.g(victim, 'він скаржився', 'вона скаржилася')}, що за ${ctx.g(victim, 'ним', 'нею')} хтось ходить.»`,
gives: { identity: true }
}));
motiveEvs.push(add({
id: 'mot_letters', side: 'field', at: { type: 'unit', unit: victim.home, slot: 'шафа' },
title: 'Пачка листів без підпису', tag: 'мотив',
detail: 'Десятки листів, однаковий почерк: «я бачу тебе щодня», «ти всміхаєшся не мені», «я вмію чекати». Останній інакший: «скоро ти зрозумієш, що нам ніхто не потрібен».',
gives: { motive: true }
}));
motiveEvs.push(add({
id: 'mot_complaint', side: 'analyst', at: { type: 'sys', sys: 'crim' }, q: { sys: 'crim', kind: 'archive', match: [victim.last, victim.name] },
title: 'Торішня заява зниклої особи', tag: 'мотив',
detail: `Заява про переслідування, руху не дали: «невідома особа стежить, лишає квіти під дверима». Прикмети: ${killer.coat}, зріст приблизно ${ctx.estRange(r, killer.height)} см.`,
gives: { filter: { attr: 'coat', val: killer.coat }, motive: true }
}));
motiveEvs.push(add({
id: 'mot_flowers', side: 'field', at: { type: 'person', cid: ctx.witnessFrom(ctx.citizens.filter(c => c.workplace === 'shop')).id }, requires: ['mot_complaint'],
title: 'Свідчення з мінімаркету', tag: 'мотив',
detail: `«Три гвоздики щоп'ятниці, завжди готівкою, завжди мовчки. Хто? Та ${killer.name} же. От, думаю собі, людина постійна.»`,
gives: { pointsTo: killer.id }
}));
add({
id: 'mot_lairclue', side: 'field', at: { type: 'unit', unit: killer.home, slot: 'шафа' },
title: 'План «нашого дому»', tag: 'місце',
detail: `На внутрішньому боці дверцят — фото ${victim.name}, зняті здалеку. І аркуш, накреслений від руки: матрац, лампа, засув. Підпис під планом: «${lair.label}». Усе обведено сердечком.`,
gives: { lair: true, motive: true }
});
const recapWhy = `Два роки листів, квітів і фото здалеку. Коли «я вмію чекати» скінчилось, ${killer.name} ${ctx.g(killer, 'вирішив', 'вирішила')}: якщо не разом — то під замком.`;
const herringLead = `«Хочете про дивних? ${herring.name} вічно сидить біля вікна з біноклем. Каже — «за птахами». Ага, за птахами.»`;
return { motiveId, recapWhy, herringLead };
}
module.exports = { generate };