Something went wrong. Try again.
Starship Simulator Controls thoriumsim.com
Something went wrong. Try again.
1.2 kB · 47 lines
TSX
at develop
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import z from "zod";
export const effectOptions = z.union([ z.object({ type: z.literal("flash"), duration: z.number().optional(), }), z.object({ type: z.literal("spark"), duration: z.number().optional(), }), z.object({ type: z.literal("reload") }), z.object({ type: z.literal("speak"), message: z.string(), voice: z.string().optional(), }), z.object({ type: z.literal("message"), title: z.string(), body: z.string().optional(), duration: z.number().optional(),
action: z .union([ /** Change cards to the first card listed here which is present on the station */ z.object({ type: z.literal("cardChange"), cards: z.string().array() }), // Placeholder until another action is encoded here z.object({ type: z.literal("unknown") }), ]) .optional(), }),]);
// TODO November 29, 2021 - Make these effects only work// when the target client allows them. They should only// work on Electron clients anyway.// "shutdown"// "restart"// "sleep"// "quit"
export type EffectPayload = { effect: z.infer<typeof effectOptions>;} & ({ station?: string | null; shipId: number } | { clientId: string });
export const notBridgeStation = ["Viewscreen", "Blackout", "Flight Director"];