five-on-it / packages/ai/src/stealth
packages/ai/src/stealth
The room's book of stealth (GAME_DESIGN §8), beside the sentries' own state (sentry.ts): the security cameras watching (each sweeps its cone on its plan; a player in it for CAMERA.spotSeconds is spotted, and every guard within its call comes, alert, told where), the bodies the guards have reported, the room's alert (the highest phase of its sentries on their feet: what a mission calls the compound's), and each player's counts for the missions' hooks: how often a guard or a camera came to see them (seen, from hidden to seen), how many alarms they caused (alerts: the room going to alert over them, or over a body they put down) and how many they killed (kills, anyone). The guards' alert is apart from the police's Heat: nothing here calls the police.
stealthBefore runs in aiSystem before the NPCs decide (the kills of the last step, the cameras), stealthAfter after them (who is seen, the room's alert). Deterministic, in entity and client order, and part of hashAiState.