-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathquests-config.ts
More file actions
47 lines (42 loc) · 1.45 KB
/
Copy pathquests-config.ts
File metadata and controls
47 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Static, Type } from '@sinclair/typebox';
export const ObjectiveDataSchema = Type.Object({
description: Type.String(),
succeededDescription: Type.Optional(Type.String()),
failedDescription: Type.Optional(Type.String()),
hidden: Type.Optional(Type.Boolean()),
});
export type ObjectiveData = Static<typeof ObjectiveDataSchema>;
export const QuestDataSchema = Type.Object({
title: Type.String(),
description: Type.String(),
succeededDescription: Type.Optional(Type.String()),
failedDescription: Type.Optional(Type.String()),
endings: Type.Optional(Type.Record(Type.String(), Type.Object({
success: Type.Boolean(),
description: Type.String(),
}))),
objectives: Type.Record(Type.String(), ObjectiveDataSchema),
category: Type.Optional(Type.String()),
});
export type QuestData = Static<typeof QuestDataSchema>;
export const QuestCategorySchema = Type.Object({
id: Type.String(),
title: Type.String(),
});
export type QuestCategory = Static<typeof QuestCategorySchema>;
export const QuestsListSchema = Type.Record(Type.String(), QuestDataSchema);
export type QuestsList = Static<typeof QuestsListSchema>;
export const QuestsConfigSchema = Type.Object({
quests: QuestsListSchema,
categories: Type.Array(QuestCategorySchema),
});
export type QuestsConfig = Static<typeof QuestsConfigSchema>;
export const defaultQuestsConfig: QuestsConfig = {
quests: {},
categories: [
{
id: 'default',
title: 'Quests',
},
],
};