PlotModel.ts
2.59 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import { RichTextNode } from "./RichTextModel";
import { ConditionExpression } from "./ConditionModel";
import { DeepReadonly, DeepReadonlyArray } from "simba-utils";
import { Actions } from "./ActionModel";
export const enum SentenceType {
TEXT = 1,
AUDIO = 2,
VIDEO = 3,
IMAGE = 4,
SELECT = 5,
EMPTY = 6
}
export interface SentenceEmptyContent {
type: SentenceType.EMPTY;
}
export interface SentenceTextContent {
type: SentenceType.TEXT;
value: RichTextNode[];
}
export interface SentenceMediaContent {
type: SentenceType.AUDIO | SentenceType.VIDEO | SentenceType.IMAGE;
value: string;
}
export interface SentenceSelectContent {
type: SentenceType.SELECT;
value: SentenceOption[];
}
export interface SentenceOption {
summary: string;
content?: SentenceEmptyContent | SentenceTextContent | SentenceMediaContent;
enableCondition?: ConditionExpression;
}
export type SentenceContent = SentenceEmptyContent | SentenceTextContent | SentenceMediaContent | SentenceSelectContent;
export interface Sentence {
content?: SentenceContent;
roleId: number;
actions: Actions;
}
export const enum PlotJumpType {
Condition = 0,
Select = 1
}
interface ConditionPlotJump {
type: PlotJumpType.Condition;
conditionBranches?: { condition?: ConditionExpression, toPlot: number }[];
toPlot: number;
}
interface SelectPlotJump {
type: PlotJumpType.Select;
jumps: { id: string, toPlot: number }[];
}
export interface Plot {
id: number;
chapterId: number;
jump: ConditionPlotJump | SelectPlotJump;
plotSceneType: number;
plotSceneTypeId: number;
sentences: Sentence[];
customData?: any;
}
export type ReadonlyPlots = DeepReadonlyArray<Plot>;
export type ReadonlyPlot = DeepReadonly<Plot>
export interface Chapter {
id: number;
title: string;
children: number[];
}
export const enum SpecialPlotId {
End = -1,
ToBeContinued = -2,
CustomPlotStart = -100
}
export interface Props {
id: number, //道具id
type: number, //道具类型
name: string, //道具名称
icon: string, //道具路径
des: string, //道具描述
time: number, //恢复时间(秒)
nummax: number,//最大上限
value: number
}
export interface Language {
id: number,
value: string
}
export interface FontAssetBmp {
id: number,
value: string
}
export interface MemoCardModel {
id: number,
date: string,
firstPlot: number,
endPlot: number
}
// export function isChapter(v: Plot | Chapter): v is Chapter {
// return (v as Chapter).title !== undefined;
// }