-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.js.flow
191 lines (171 loc) · 3.77 KB
/
index.js.flow
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
/**
* This file provides type definitions for use with the Flow type checker.
*
* @flow
*/
export type MoveType = 'Armored' | 'Cavalry' | 'Flying' | 'Infantry';
export type WeaponType =
| 'Blue Lance'
| 'Blue Tome'
| 'Blue Bow'
| 'Blue Breath'
| 'Green Axe'
| 'Green Tome'
| 'Green Bow'
| 'Green Breath'
| 'Red Sword'
| 'Red Tome'
| 'Red Bow'
| 'Red Breath'
| 'Colorless Bow'
| 'Colorless Dagger'
| 'Colorless Staff';
export type StatValue = number | '-';
export type SingleValueStats = {
+hp: StatValue,
+atk: StatValue,
+spd: StatValue,
+def: StatValue,
+res: StatValue,
};
export type MultiValueStats = {
+hp: Array<StatValue>,
+atk: Array<StatValue>,
+spd: Array<StatValue>,
+def: Array<StatValue>,
+res: Array<StatValue>,
};
export type Level1Stats = {
+'1'?: SingleValueStats,
+'2'?: SingleValueStats,
+'3'?: SingleValueStats,
+'4'?: SingleValueStats,
+'5'?: SingleValueStats,
};
export type Level40Stats = {
+'1'?: MultiValueStats,
+'2'?: MultiValueStats,
+'3'?: MultiValueStats,
+'4'?: MultiValueStats,
+'5'?: MultiValueStats,
};
export type StatsByLevel = {
+'1': Level1Stats,
+'40': Level40Stats,
};
export type GrowthPoints = {
+hp: number,
+atk: number,
+spd: number,
+def: number,
+res: number,
};
export type Assets = {
+portrait: {
+'75px': string,
+'113px': string,
+'150px': string,
},
};
export type Hero = {
+name: string,
+shortName?: string,
+title?: string,
+moveType: MoveType,
+weaponType: WeaponType,
+releaseDate: string,
+poolDate: string,
+origin?: string,
+rarities?: string,
+assets: Assets,
+growthPoints: GrowthPoints,
+stats: StatsByLevel,
+skills: Array<{
+name: string,
+default?: ?number,
+rarity: ?number | '-',
}>,
};
export type SkillType =
| 'WEAPON'
| 'ASSIST'
| 'SPECIAL'
| 'PASSIVE_A'
| 'PASSIVE_B'
| 'PASSIVE_C'
| 'SEAL';
export type WeaponSkill = {
+type: 'WEAPON',
+name: string,
+skillTier: number,
+spCost: number,
+'damage(mt)': number,
+'range(rng)': number,
+effect: string,
// Hero is Red Breath, weapon is Breath
+weaponType: WeaponType | 'Bow' | 'Breath',
+exclusive: boolean,
};
export type AssistSkill = {
+type: 'ASSIST',
+name: string,
+range: number,
+effect: string,
+exclusive: boolean,
+skillTier: number,
+spCost: number,
+movementRestriction: string[],
+weaponRestriction: string[],
};
export type SpecialSkill = {
+type: 'SPECIAL',
+name: string,
+cooldown: number,
+effect: string,
+exclusive: boolean,
+skillTier: number,
+spCost: number,
// The wiki no longer has trigger/target fields, but we likely want these in he future.
// +trigger: 'Assist (Staff)' | 'Attack' | 'Enemy Attack';
// +target: 'Ally' | 'Allies' | 'Enemies' | 'Self';
+movementRestriction: string[],
+weaponRestriction: string[],
};
export type PassiveSkill = {
+type: 'PASSIVE_A' | 'PASSIVE_B' | 'PASSIVE_C',
+name: string,
+effect: string,
+exclusive: boolean,
+skillTier: number,
+spCost: number,
+movementRestriction: string[],
+weaponRestriction: string[],
};
export type SealSkill = {
+type: 'SEAL',
+name: string,
+effect: string,
+skillTier: number,
+spCost: number,
+movementRestriction: string[],
+weaponRestriction: string[],
};
export type Skill =
| WeaponSkill
| AssistSkill
| SpecialSkill
| PassiveSkill
| SealSkill;
export type Stats = {
+heroes: Hero[],
+grand_battle_heroes: Hero[],
+skills: Skill[],
+getAllHeroes: () => Hero[],
+getAllSkills: () => Skill[],
+getEventHeroes: (all: boolean) => Hero[],
+getHero: (name: string) => Hero,
+getReleasedHeroes: () => Hero[],
+getSkillObject: (key: SkillType, name: string) => Skill,
+getSkillType: (name: string) => SkillType,
};
declare module.exports: Stats;