-
Notifications
You must be signed in to change notification settings - Fork 0
/
SystemClass.py
339 lines (285 loc) · 9.99 KB
/
SystemClass.py
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# all_skill = {
# "name": [["启程之誓", "启程之心", "启程之风"],
# ["破壁之心", "破魔之心"],
# ["伤口恶化", "精神创伤", "铁甲尖刺"],
# ["沸血之志", "波澜不惊", "飓风之力"]],
#
# "data": [["SHI", "XIN", "FENG"],
# ["BI", "MO"],
# ["SHANG", "SHEN", "CI"],
# ["FEI", "BO", "JU"]
# ]
# }
all_skill = {
"name": ["启程之誓", "启程之心", "启程之风",
"破壁之心", "破魔之心", "复合护盾", "鲜血渴望", "削骨之痛",
"伤口恶化", "精神创伤", "铁甲尖刺", "忍无可忍", "热血战魂",
"沸血之志", "波澜不惊", "飓风之力", "红蓝双刺", "绝对护盾", "后发制人"
],
"data": ["SHI", "XIN", "FENG",
"BI", "MO", "DUN", "XUE", "XIAO",
"SHANG", "SHEN", "CI", "REN", "RE",
"FEI", "BO", "JU", "HONG", "JUE", "HOU"
],
"cost": [10, 10, 10,
30, 30, 30, 30, 30,
50, 50, 50, 50, 50,
100, 100, 100, 100, 100, 100
]
}
def getSkillDataOfName(name):
for i in range(len(all_skill["name"])):
if all_skill["name"][i] == name:
return all_skill["data"][i]
def getSkillCostOfName(name):
for i in range(len(all_skill["name"])):
if all_skill["name"][i] == name:
return all_skill["cost"][i]
def getSkillIndexOfName(name):
for i in range(len(all_skill["name"])):
if all_skill["name"][i] == name:
return i
def getSkillIndexOfData(data):
for i in range(len(all_skill["data"])):
if all_skill["data"][i] == data:
return i
all_character = {
"name": ["琳", "默", "艾", "梦", "薇", "伊"],
"data": ["LIN", "MO", "AI", "MENG", "WEI", "YI"]
}
all_npc = {
"name": ["木人", "迅捷蛛", "魔灯", "食铁兽"],
"data": ["MU", "ZHU", "DENG", "SHOU"]
}
all_equip = {
"name": {
"weapon": ["剑", "短弓", "短杖", "荣誉之刃", "刺杀弓", "幽梦匕首", "光辉法杖", "荆棘剑盾", "陨铁重剑"],
"glove": ["手套", "手环", "秃鹫手套"],
"Armor": ["铁甲", "皮甲", "布甲", "灵光袍", "荆棘重甲"],
"helmet": ["头巾", "发饰", "天使缎带"],
},
"data": {
"weapon": ["SWORD", "BOW", "STAFF", "BLADE", "ASSBOW", "DAGGER", "WAND", "SHIELD", "CLAYMORE"],
"glove": ["GLOVES", "BRACELET", "VULTURE"],
"Armor": ["PLATE", "LEATHER", "CLOTH", "CLOAK", "THORN"],
"helmet": ["SCARF", "TIARA", "RIBBON"],
}
}
all_amulet = {
"name": [
"力量", "敏捷", "智力", "体魄", "精神", "意志", "物理攻击", "魔法攻击", "攻击速度", "回复效果", "最大生命", "最大护盾", "生命偷取", "伤害反弹", "暴击几率",
"技能几率", "物理防御", "魔法防御"
],
"data": [
"STR", "AGI", "INT", "VIT", "SPR", "MND", "PATK", "MATK", "SPD", "REC", "HP", "SLD", "LCH", "RFL", "CRT", "SKL",
"PDEF", "MDEF"
]
}
class cardAttr:
def __init__(self, mystr, myagi, myint, myvit, myspr, myres):
self.STR = mystr
self.AGI = myagi # 敏捷
self.INT = myint # 智力
self.VIT = myvit # 体魄
self.SPR = myspr # 精神
self.RES = myres # 意志
def tostring(self):
text = " STR:"
text += str(self.STR)
text += " AGI:"
text += str(self.AGI)
text += " INT:"
text += str(self.INT)
text += " VIT:"
text += str(self.VIT)
text += " SPR:"
text += str(self.SPR)
text += " RES:"
text += str(self.RES)
return text
def make_gu_text(self):
text = ''
text += str(self.STR)
text += " "
text += str(self.AGI)
text += " "
text += str(self.INT)
text += " "
text += str(self.VIT)
text += " "
text += str(self.SPR)
text += " "
text += str(self.RES)
return text
class equip:
def __init__(self, level, attr0, attr1, attr2, attr3, hasMystical, equipType):
self.level = level
self.attr0 = attr0
self.attr1 = attr1
self.attr2 = attr2
self.attr3 = attr3
self.hasMystical = hasMystical
self.equipType = equipType
def toString(self):
text = all_equip["name"][self.partsText][self.equipType - 1]
text += "\n"
text += " LV."
text += self.level
text += "\n"
text += self.attr0
text += "% "
text += self.attr1
text += "% "
text += self.attr2
text += "% "
text += self.attr3
text += "% "
text += "\n"
if self.hasMystical:
text += " 神秘"
return text
def toSimpleString(self):
text = all_equip["name"][self.partsText][self.equipType - 1]
text += " LV."
text += self.level
if self.hasMystical:
text += " 神秘"
return text
def make_gu_text(self):
text = ''
if self.equipType == 0:
text += "NONE"
return text
text += all_equip["data"][self.partsText][self.equipType - 1]
text += " "
text += self.level
text += " "
text += self.attr0
text += " "
text += self.attr1
text += " "
text += self.attr2
text += " "
text += self.attr3
text += " "
text += str(self.hasMystical)
return text
class weaponEquip(equip):
partsText = "weapon"
def __init__(self, level, attr0, attr1, attr2, attr3, hasMystical, weaponType):
super(weaponEquip, self).__init__(level, attr0, attr1, attr2, attr3, hasMystical, weaponType)
class gloveEquip(equip):
partsText = "glove"
def __init__(self, level, attr0, attr1, attr2, attr3, hasMystical, gloveType):
super(gloveEquip, self).__init__(level, attr0, attr1, attr2, attr3, hasMystical, gloveType)
class ArmorEquip(equip):
partsText = "Armor"
def __init__(self, level, attr0, attr1, attr2, attr3, hasMystical, ArmorType):
super(ArmorEquip, self).__init__(level, attr0, attr1, attr2, attr3, hasMystical, ArmorType)
class helmetEquip(equip):
partsText = "helmet"
def __init__(self, level, attr0, attr1, attr2, attr3, hasMystical, helmetType):
super(helmetEquip, self).__init__(level, attr0, attr1, attr2, attr3, hasMystical, helmetType)
class EQUIPSet:
def __init__(self, weapon=None, glove=None, Armor=None, helmet=None):
self.weapon = weapon
self.glove = glove
self.Armor = Armor
self.helmet = helmet
def make_gu_text(self):
text = ''
text += self.weapon.make_gu_text()
text += "\n"
text += self.glove.make_gu_text()
text += "\n"
text += self.Armor.make_gu_text()
text += "\n"
text += self.helmet.make_gu_text()
return text
class skill:
def __init__(self, data):
self.data = data
class SKILLSet:
def __init__(self, skill_1, skill_2, skill_3, skill_4):
self.skill_1 = skill_1
self.skill_2 = skill_2
self.skill_3 = skill_3
self.skill_4 = skill_4
def make_gu_text(self):
text = ""
num = 0
if self.skill_1.data != 0:
text += all_skill["data"][self.skill_1.data - 1]
text += " "
num += 1
if self.skill_2.data != 0:
text += all_skill["data"][self.skill_2.data - 1]
text += " "
num += 1
if self.skill_3.data != 0:
text += all_skill["data"][self.skill_3.data - 1]
text += " "
num += 1
if self.skill_4.data != 0:
text += all_skill["data"][self.skill_4.data - 1]
num += 1
text = str(num) + " " + text
return text
def make_gu_npc_text(self):
text = ""
if self.skill_1.data != 0:
text += "_"
text += all_skill["data"][self.skill_1.data - 1]
if self.skill_2.data != 0:
text += "_"
text += all_skill["data"][self.skill_2.data - 1]
if self.skill_3.data != 0:
text += "_"
text += all_skill["data"][self.skill_3.data - 1]
if self.skill_4.data == len(all_skill["name"]) + 1:
text += "_"
text += "RAND"
elif self.skill_4.data != 0:
text += "_"
text += all_skill["data"][self.skill_4.data - 1]
return text
def toString(self):
text = ""
if self.skill_1.data != 0:
text += "_"
text += all_skill["name"][self.skill_1.data - 1]
if self.skill_2.data != 0:
text += "_"
text += all_skill["name"][self.skill_2.data - 1]
if self.skill_3.data != 0:
text += "_"
text += all_skill["name"][self.skill_3.data - 1]
if self.skill_4.data != 0:
text += "_"
text += all_skill["name"][self.skill_4.data - 1]
return text
class WishSet:
def __init__(self, wishLevelList):
self.wishLevelList = wishLevelList
def make_gu_text(self):
text = "WISH "
for i in range(len(self.wishLevelList)):
text += str(self.wishLevelList[i]) + " "
return text
def getWishLevelList(self):
return self.wishLevelList.copy()
class amuletClass:
def __init__(self, amuletLevelList):
if len(amuletLevelList) != len(all_amulet["data"]):
self.amuletLevelList = [0] * len(all_amulet["data"])
else:
self.amuletLevelList = amuletLevelList
def make_gu_text(self):
text = "AMULET "
for i in range(len(self.amuletLevelList)):
if self.amuletLevelList[i] > 0:
name = all_amulet["data"][i]
text += name + " " + str(self.amuletLevelList[i]) + " "
return text + "ENDAMULET"
def getAmuletLevelList(self):
return self.amuletLevelList.copy()