-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot_prcdCampaignCategory.py
131 lines (103 loc) · 3.24 KB
/
bot_prcdCampaignCategory.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
# 活动名称分析基本从 ShizuruNotes 里抄来的
# https://github.com/MalitsPlus/ShizuruNotes/tree/master/app/src/main/java/com/github/malitsplus/shizurunotes/data/CampaignType.kt
# https://github.com/MalitsPlus/ShizuruNotes/tree/master/app/src/main/res/values/strings.xml
from enum import IntEnum, auto
from functools import lru_cache
from typing import Union
class PcrdCampaignCategory(IntEnum):
none = 0
halfStaminaNormal = 11
halfStaminaHard = auto()
halfStaminaBoth = auto()
halfStaminaShrine = auto()
halfStaminaTemple = auto()
halfStaminaVeryHard = auto()
dropRareNormal = 21
dropRareHard = auto()
dropRareBoth = auto()
dropRareVeryHard = auto()
dropAmountNormal = 31
dropAmountHard = auto()
dropAmountBoth = auto()
dropAmountExploration = auto()
dropAmountDungeon = auto()
dropAmountCoop = auto()
dropAmountShrine = auto()
dropAmountTemple = auto()
dropAmountVeryHard = auto()
manaNormal = 41
manaHard = auto()
manaBoth = auto()
manaExploration = auto()
manaDungeon = auto()
manaCoop = auto()
manaTemple = 48
manaVeryHard = auto()
coinDungeon = 51
cooltimeArena = 61
cooltimeGrandArena = auto()
masterCoin = 90
masterCoinNormal = auto()
masterCoinHard = auto()
masterCoinVeryHard = auto()
masterCoinShrine = auto()
masterCoinTemple = auto()
masterCoinEventNormal = auto()
masterCoinEventHard = auto()
masterCoinRevivalEventNormal = auto()
masterCoinRevivalEventHard = auto()
halfStaminaEventNormal = 111
halfStaminaEventHard = auto()
halfStaminaEventBoth = auto()
dropRareEventNormal = 121
dropRareEventHard = auto()
dropRareEventBoth = auto()
dropAmountEventNormal = 131
dropAmountEventHard = auto()
dropAmountEventBoth = auto()
manaEventNormal = 141
manaEventHard = auto()
manaEventBoth = auto()
expEventNormal = 151
expEventHard = auto()
expEventBoth = auto()
halfStaminaRevivalEventNormal = 211
halfStaminaRevivalEventHard = auto()
dropRareRevivalEventNormal = 221
dropRareRevivalEventHard = auto()
dropAmountRevivalEventNormal = 231
dropAmountRevivalEventHard = auto()
manaRevivalEventNormal = 241
manaRevivalEventHard = auto()
expRevivalEventNormal = 251
expRevivalEventHard = auto()
halfStaminaSideStoryNormal = 311
halfStaminaSideStoryHard = auto()
dropRareSideStoryNormal = 321
dropRareSideStoryHard = auto()
dropAmountSideStoryNormal = 331
dropAmountSideStoryHard = auto()
manaSideStoryNormal = 341
manaSideStoryHard = auto()
expSideStoryNormal = 351
expSideStoryHard = auto()
short_name = {
'manaDungeon': '地下城',
'masterCoinNormal': '大师币',
'dropAmountNormal': 'N图',
'dropAmountHard': 'H图',
'dropAmountEventNormal': '活动N图',
'dropAmountEventHard': '活动H图',
'dropAmountShrine': '圣迹',
'dropAmountTemple': '神殿',
'manaExploration': '探索',
'dropAmountVeryHard': 'VH图',
}
@lru_cache(maxsize=128)
def parse_campaign(cata: int) -> Union[int, None]:
try:
c = PcrdCampaignCategory(cata)
except ValueError:
return None
name = short_name.get(c.name)
return name