-
Notifications
You must be signed in to change notification settings - Fork 2
/
Data.cs
228 lines (222 loc) · 8.18 KB
/
Data.cs
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UmamusumeDeserializeDB5.Generator;
namespace UmamusumeDeserializeDB5
{
public static class Data
{
public static List<TextData> TextData;
public static Dictionary<string, long> NameToId;
public static List<SupportCardData> SupportCardData;
public static List<AvailableSkillSetTable> AvailableSkillSetTableList = new();
public static List<SkillUpgradeConditionTable> SkillUpgradeConditionTables = new();
public static List<SkillUpgradeDescriptionTable> SkillUpgradeDescriptionTable = new();
public static List<SkillUpgradeSpecialityTable> SkillUpgradeSpecialityTable = new();
static Data()
{
TextData = new List<TextData>();
using var conn = new SQLiteConnection(new SQLiteConnectionStringBuilder { DataSource = UmamusumeDeserializeDB5.UmamusumeDatabaseFilePath }.ToString());
conn.Open();
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = $"select * from text_data";
var reader = cmd.ExecuteReader();
while (reader.Read())
{
TextData.Add(new TextData
{
category = (long)reader["category"],
id = (long)reader["id"],
index = (long)reader["index"],
text = (string)reader["text"]
});
}
}
NameToId = TextData.Where(x => x.index != 9100101 && x.index != 9101101).Where(x => (x.id == 4 && x.category == 4) || (x.id == 6 && x.category == 6) || (x.id == 75 && x.category == 75)).ToDictionary(x => x.text, x => x.index);
NameToId.Add("系统", 1000);
SupportCardData = new();
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = $"select * from support_card_data";
var reader = cmd.ExecuteReader();
while (reader.Read())
{
var scd = new SupportCardData
{
id = (long)reader["id"],
chara_id = (long)reader["chara_id"],
rarity = (long)reader["rarity"],
effect_table_id = (long)reader["effect_table_id"],
unique_effect_id = (long)reader["unique_effect_id"],
command_type = (long)reader["command_type"],
command_id = (long)reader["command_id"],
support_card_type = (long)reader["support_card_type"]
};
SupportCardData.Add(scd);
}
}
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = $"select * from available_skill_set";
var reader = cmd.ExecuteReader();
while (reader.Read())
{
AvailableSkillSetTableList.Add(new AvailableSkillSetTable
{
available_skill_set_id = (long)reader["available_skill_set_id"],
skill_id = (long)reader["skill_id"],
need_rank = (long)reader["need_rank"]
});
}
}
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = $"select * from skill_upgrade_condition";
var reader = cmd.ExecuteReader();
while (reader.Read())
{
SkillUpgradeConditionTables.Add(new SkillUpgradeConditionTable
{
id = (long)reader["id"],
description_id = (long)reader["description_id"],
num = (long)reader["num"],
sub_num = (long)reader["sub_num"],
timing_type = (long)reader["timing_type"],
count_type = (long)reader["count_type"],
});
}
}
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = $"select * from skill_upgrade_description";
var reader = cmd.ExecuteReader();
while (reader.Read())
{
SkillUpgradeDescriptionTable.Add(new SkillUpgradeDescriptionTable
{
id = (long)reader["id"],
card_id = (long)reader["card_id"],
rank = (long)reader["rank"],
skill_id = (long)reader["skill_id"]
});
}
}
using (var cmd = conn.CreateCommand())
{
cmd.CommandText = $"select * from skill_upgrade_speciality";
var reader = cmd.ExecuteReader();
while (reader.Read())
{
SkillUpgradeSpecialityTable.Add(new SkillUpgradeSpecialityTable
{
id = (long)reader["id"],
scenario_id = (long)reader["scenario_id"],
base_skill_id = (long)reader["base_skill_id"],
skill_id = (long)reader["skill_id"]
});
}
}
}
}
public struct SupportCardData
{
public long id;
public long chara_id;
public long rarity;
public long effect_table_id;
public long unique_effect_id;
public long command_type;
public long command_id;
public long support_card_type;
}
public class TalentSkill
{
public long SkillId;
public long Rank;
public Dictionary<long, UpgradeCondition[]> UpgradeSkills = new();
}
public class UpgradeCondition
{
/// <summary>
/// 条件ID
/// </summary>
public long ConditionId;
/// <summary>
/// 条件类型
/// </summary>
public ConditionType Type;
/// <summary>
/// 条件所需内容,Type为Specific时为指定技能ID,为Proper时为指定技能适性类型,否则为所需技能数量
/// </summary>
public long Requirement;
/// <summary>
/// 条件所需额外内容,仅Type为Proper时需要,为对应适性技能的需求数量
/// </summary>
public long AdditionalRequirement;
public enum ConditionType
{
None,
/// <summary>
/// 需要学习指定适性(距离、场地、跑法)的技能
/// </summary>
Proper,
/// <summary>
/// 需要学习指定技能
/// </summary>
Specific,
/// <summary>
/// 需要学习速度技能
/// </summary>
Speed,
/// <summary>
/// 需要学习加速度技能
/// </summary>
Acceleration,
/// <summary>
/// 需要学习恢复技能
/// </summary>
Recovery,
/// <summary>
/// 需要学习走位技能
/// </summary>
Lane,
/// <summary>
/// 需要学习绿技能
/// </summary>
Stat
}
}
public class AvailableSkillSetTable
{
public long available_skill_set_id;
public long skill_id;
public long need_rank;
}
public class SkillUpgradeConditionTable
{
public long id;
public long description_id;
public long num;
public long sub_num;
public long timing_type;
public long count_type;
}
public class SkillUpgradeDescriptionTable
{
public long id;
public long card_id;
public long rank;
public long skill_id;
}
public class SkillUpgradeSpecialityTable
{
public long id;
public long scenario_id;
public long base_skill_id;
public long skill_id;
}
}