Skip to content

five-on-it / packages/missions/src/schema / WhenRule

Variable: WhenRule ​

const WhenRule: ZodObject<{ do: ZodArray<ZodUnion<readonly [ZodObject<{ showText: ZodString; }, $strict>, ZodObject<{ sendMessage: ZodObject<{ from: ZodString; id: ZodOptional<ZodString>; text: ZodString; }, $strict>; }, $strict>, ZodObject<{ setFlag: ZodString; }, $strict>, ZodObject<{ clearFlag: ZodString; }, $strict>, ZodObject<{ startTimer: ZodObject<{ id: ZodString; seconds: ZodNumber; }, $strict>; }, $strict>, ZodObject<{ stopTimer: ZodString; }, $strict>, ZodObject<{ add: ZodObject<{ counter: ZodString; value: ZodUnion<readonly [..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...]>; }, $strict>; }, $strict>, ZodObject<{ set: ZodObject<{ counter: ZodString; value: ZodUnion<readonly [..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...]>; }, $strict>; }, $strict>, ZodObject<{ spawn: ZodObject<{ at: ZodOptional<ZodString>; count: ZodOptional<ZodNumber>; group: ZodString; }, $strict>; }, $strict>, ZodObject<{ setWanted: ZodNumber; }, $strict>, ZodObject<{ give: ZodObject<{ count: ZodDefault<ZodNumber>; item: ZodString; }, $strict>; }, $strict>, ZodObject<{ take: ZodObject<{ count: ZodOptional<ZodNumber>; tag: ZodString; }, $strict>; }, $strict>, ZodObject<{ lock: ZodObject<{ door: ZodString; }, $strict>; }, $strict>, ZodObject<{ unlock: ZodObject<{ door: ZodString; }, $strict>; }, $strict>, ZodObject<{ lockVehicle: ZodString; }, $strict>, ZodObject<{ unlockVehicle: ZodString; }, $strict>, ZodObject<{ giveKey: ZodString; }, $strict>, ZodObject<{ spawnItem: ZodObject<{ at: ZodString; count: ZodDefault<ZodNumber>; item: ZodString; }, $strict>; }, $strict>, ZodObject<{ alert: ZodObject<{ npc: ZodOptional<ZodString>; }, $strict>; }, $strict>, ZodObject<{ calm: ZodObject<{ npc: ZodOptional<ZodString>; }, $strict>; }, $strict>, ZodObject<{ cameraOff: ZodObject<{ camera: ZodString; }, $strict>; }, $strict>, ZodObject<{ cameraOn: ZodObject<{ camera: ZodString; }, $strict>; }, $strict>, ZodObject<{ reward: ZodObject<{ cash: ZodDefault<ZodNumber>; rep: ZodDefault<ZodNumber>; }, $strict>; }, $strict>, ZodObject<{ complete: ZodLiteral<true>; }, $strict>, ZodObject<{ fail: ZodUnion<readonly [ZodLiteral<true>, ZodObject<{ text: ...; }, $strict>]>; }, $strict>, ZodObject<{ win: ZodString; }, $strict>, ZodObject<{ message: ZodObject<{ choices: ZodOptional<ZodArray<...>>; from: ZodString; id: ZodOptional<ZodString>; text: ZodString; }, $strict>; }, $strict>, ZodObject<{ call: ZodObject<{ dialogue: ZodString; from: ZodString; }, $strict>; }, $strict>, ZodObject<{ addContact: ZodObject<{ contact: ZodString; dialogue: ZodOptional<ZodString>; }, $strict>; }, $strict>, ZodObject<{ removeContact: ZodString; }, $strict>, ZodObject<{ installApp: ZodString; }, $strict>, ZodObject<{ removeApp: ZodString; }, $strict>, ZodObject<{ waypoint: ZodString; }, $strict>, ZodObject<{ clearWaypoint: ZodLiteral<true>; }, $strict>, ZodObject<{ setClock: ZodString; }, $strict>, ZodObject<{ setPace: ZodNumber; }, $strict>, ZodObject<{ setWeather: ZodObject<{ intensity: ZodDefault<ZodNumber>; kind: ZodEnum<{ clear: ...; fog: ...; overcast: ...; rain: ...; snow: ...; storm: ...; }>; minutes: ZodOptional<ZodNumber>; over: ZodDefault<ZodNumber>; }, $strict>; }, $strict>, ZodObject<{ skipTime: ZodObject<{ hours: ZodNumber; text: ZodOptional<ZodString>; }, $strict>; }, $strict>, ZodObject<{ setSignal: ZodObject<{ group: ZodOptional<ZodEnum<...>>; junction: ZodString; seconds: ZodOptional<ZodNumber>; state: ZodEnum<{ auto: ...; flashing: ...; green: ...; red: ...; }>; }, $strict>; }, $strict>]>>; if: ZodOptional<ZodType<Condition, unknown, $ZodTypeInternals<Condition, unknown>>>; repeat: ZodDefault<ZodBoolean>; when: ZodString; }, $strict>

Defined in: packages/missions/src/schema.ts:1346

When an event happens and a condition holds, do the actions: once, or every time with repeat.