├── .gitignore ├── README.md ├── cht_convert.py ├── convert.sh ├── qurious_entry_monte_carlo.py └── restore-old-data.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | **/.DS_Store 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 关于本 repo 2 | 3 | 这个 repo 主要用于堆放[游猫网配装器](https://gamecat.fun/e)的各类文档。 4 | 5 | - 怪异炼化词条填充使用说明:https://github.com/applepi-icpc/qurious-filling-introduction/wiki/%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E 6 | - 恢复 HTTPS 迁移前的旧数据:https://github.com/applepi-icpc/qurious-filling-introduction/blob/master/restore-old-data.md 7 | -------------------------------------------------------------------------------- /cht_convert.py: -------------------------------------------------------------------------------- 1 | # Requirements: 2 | # opencc 3 | 4 | import opencc 5 | import argparse 6 | 7 | PHRASES = { 8 | "怪物猎人": "魔物猎人", 9 | "怪异炼化": "傀異鍊成", 10 | } 11 | 12 | PHRASES_T = { 13 | "遠端": "遠程", 14 | "煉化": "鍊成", 15 | "移動裝置": "行動裝置", 16 | "單擊": "點擊", 17 | } 18 | 19 | def main(): 20 | parser = argparse.ArgumentParser() 21 | parser.add_argument('input', type=str, help="Input file") 22 | parser.add_argument('output', type=str, help="Output file") 23 | args = parser.parse_args() 24 | 25 | with open(args.input) as f: 26 | content = f.read() 27 | 28 | converter = opencc.OpenCC('s2twp.json') 29 | p = content.replace('“', '「').replace('”', '」') 30 | while True: 31 | ended = True 32 | for k, v in PHRASES.items(): 33 | if k in p: 34 | p = p.replace(k, v) 35 | ended = False 36 | if ended: 37 | break 38 | pp = converter.convert(p) 39 | while True: 40 | ended = True 41 | for k, v in PHRASES_T.items(): 42 | if k in pp: 43 | pp = pp.replace(k, v) 44 | ended = False 45 | if ended: 46 | break 47 | 48 | with open(args.output, "w") as f: 49 | f.write(pp) 50 | 51 | 52 | if __name__ == '__main__': 53 | main() 54 | -------------------------------------------------------------------------------- /convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python3 cht_convert.py ../qurious-filling-introduction.wiki/使用说明.md ../qurious-filling-introduction.wiki/使用說明.md 4 | 5 | -------------------------------------------------------------------------------- /qurious_entry_monte_carlo.py: -------------------------------------------------------------------------------- 1 | import typing as T 2 | import random 3 | from tqdm import tqdm 4 | from tabulate import tabulate 5 | from multiprocessing import Pool 6 | import functools 7 | 8 | # Parameters 9 | N_MONTE_CARLO_LOOP = 100000000 10 | FLAG_CONSIDER_DROP_SKILL = True 11 | 12 | N_PROCESS = 6 13 | N_IMAP_CHUNK_SIZE = 1 14 | N_PART_SIZE = 10000 15 | 16 | _NOTHING = -1 17 | _DROP_SKILL = -2 18 | _SKILL_1 = 0 19 | _SKILL_2 = 1 20 | _SKILL_3 = 2 21 | _SKILL_4 = 3 22 | _SKILL_5 = 4 23 | _DECO_1 = 5 24 | _DECO_2 = 6 25 | _DECO_3 = 7 26 | _DECO_4 = 8 27 | 28 | ARR_WORDS = ['SKILL_1', 'SKILL_2', 'SKILL_3', 'SKILL_4', 'SKILL_5', 'DECO_1', 'DECO_2', 'DECO_3', 'DECO_4+'] 29 | ARR_MULS = [1/32, 1/26, 1/18, 1/13, 1/12, 1, 1, 1, 1] 30 | 31 | ENTRIES_1 = [ 32 | # EFFECT, COST, PROBABILITY * 1000 33 | (_NOTHING, 1, 80), # 0, Defense 34 | (_NOTHING, 5, 80), # 1, Defense 35 | (_NOTHING, 10, 80), # 2, Defense 36 | (_NOTHING, 15, 40), # 3, Defense 37 | (_NOTHING, 20, 40), # 4, Defense 38 | (_NOTHING, -3, 40), # 5, Defense 39 | (_NOTHING, -5, 40), # 6, Defense 40 | (_NOTHING, 2, 150), # 7, Elem-Defense 41 | (_NOTHING, -2, 90), # 8, Elem-Defense 42 | (_NOTHING, -3, 60), # 9, Elem-Defense 43 | (_SKILL_1, 3, 60), # 10, Skill 44 | (_SKILL_2, 6, 40), # 11, Skill 45 | (_SKILL_3, 9, 36), # 12, Skill 46 | (_SKILL_4, 12, 28), # 13, Skill 47 | (_SKILL_5, 15, 16), # 14, Skill 48 | (_DROP_SKILL, -10, 20), # 15, Skill 49 | (_DECO_1, 6, 70), # 16, Deco 50 | (_DECO_2, 12, 25), # 17, Deco 51 | (_DECO_3, 18, 5), # 18, Deco 52 | ] 53 | 54 | ENTRIES_2 = [ 55 | # EFFECT, COST, PROBABILITY * 1000 56 | (_NOTHING, 1, 80), # 0, Defense 57 | (_NOTHING, 5, 80), # 1, Defense 58 | (_NOTHING, 10, 80), # 2, Defense 59 | (_NOTHING, 14, 40), # 3, Defense 60 | (_NOTHING, 18, 40), # 4, Defense 61 | (_NOTHING, -3, 40), # 5, Defense 62 | (_NOTHING, -5, 40), # 6, Defense 63 | (_NOTHING, 2, 150), # 7, Elem-Defense 64 | (_NOTHING, -2, 90), # 8, Elem-Defense 65 | (_NOTHING, -3, 60), # 9, Elem-Defense 66 | (_SKILL_1, 3, 60), # 10, Skill 67 | (_SKILL_2, 6, 40), # 11, Skill 68 | (_SKILL_3, 9, 36), # 12, Skill 69 | (_SKILL_4, 12, 28), # 13, Skill 70 | (_SKILL_5, 15, 16), # 14, Skill 71 | (_DROP_SKILL, -10, 20), # 15, Skill 72 | (_DECO_1, 6, 70), # 16, Deco 73 | (_DECO_2, 12, 25), # 17, Deco 74 | (_DECO_3, 18, 5), # 18, Deco 75 | ] 76 | 77 | ENTRIES_3 = [ 78 | # EFFECT, COST, PROBABILITY * 1000 79 | (_NOTHING, 1, 80), # 0, Defense 80 | (_NOTHING, 5, 80), # 1, Defense 81 | (_NOTHING, 8, 80), # 2, Defense 82 | (_NOTHING, 12, 40), # 3, Defense 83 | (_NOTHING, 16, 40), # 4, Defense 84 | (_NOTHING, -3, 40), # 5, Defense 85 | (_NOTHING, -5, 40), # 6, Defense 86 | (_NOTHING, 2, 150), # 7, Elem-Defense 87 | (_NOTHING, -2, 90), # 8, Elem-Defense 88 | (_NOTHING, -3, 60), # 9, Elem-Defense 89 | (_SKILL_1, 3, 60), # 10, Skill 90 | (_SKILL_2, 6, 40), # 11, Skill 91 | (_SKILL_3, 9, 36), # 12, Skill 92 | (_SKILL_4, 12, 28), # 13, Skill 93 | (_SKILL_5, 15, 16), # 14, Skill 94 | (_DROP_SKILL, -10, 20), # 15, Skill 95 | (_DECO_1, 6, 70), # 16, Deco 96 | (_DECO_2, 12, 25), # 17, Deco 97 | (_DECO_3, 18, 5), # 18, Deco 98 | ] 99 | 100 | ENTRIES_4 = [ 101 | # EFFECT, COST, PROBABILITY * 1000 102 | (_NOTHING, 1, 80), # 0, Defense 103 | (_NOTHING, 5, 80), # 1, Defense 104 | (_NOTHING, 7, 80), # 2, Defense 105 | (_NOTHING, 10, 40), # 3, Defense 106 | (_NOTHING, 14, 40), # 4, Defense 107 | (_NOTHING, -3, 40), # 5, Defense 108 | (_NOTHING, -5, 40), # 6, Defense 109 | (_NOTHING, 2, 150), # 7, Elem-Defense 110 | (_NOTHING, -2, 90), # 8, Elem-Defense 111 | (_NOTHING, -3, 60), # 9, Elem-Defense 112 | (_SKILL_1, 3, 60), # 10, Skill 113 | (_SKILL_2, 6, 40), # 11, Skill 114 | (_SKILL_3, 9, 36), # 12, Skill 115 | (_SKILL_4, 12, 28), # 13, Skill 116 | (_SKILL_5, 15, 16), # 14, Skill 117 | (_DROP_SKILL, -10, 20), # 15, Skill 118 | (_DECO_1, 6, 70), # 16, Deco 119 | (_DECO_2, 12, 25), # 17, Deco 120 | (_DECO_3, 18, 5), # 18, Deco 121 | ] 122 | 123 | ENTRIES_5 = [ 124 | # EFFECT, COST, PROBABILITY * 1000 125 | (_NOTHING, 1, 80), # 0, Defense 126 | (_NOTHING, 5, 80), # 1, Defense 127 | (_NOTHING, 6, 80), # 2, Defense 128 | (_NOTHING, 9, 40), # 3, Defense 129 | (_NOTHING, 12, 40), # 4, Defense 130 | (_NOTHING, -3, 40), # 5, Defense 131 | (_NOTHING, -5, 40), # 6, Defense 132 | (_NOTHING, 2, 150), # 7, Elem-Defense 133 | (_NOTHING, -2, 90), # 8, Elem-Defense 134 | (_NOTHING, -3, 60), # 9, Elem-Defense 135 | (_SKILL_1, 3, 60), # 10, Skill 136 | (_SKILL_2, 6, 40), # 11, Skill 137 | (_SKILL_3, 9, 36), # 12, Skill 138 | (_SKILL_4, 12, 28), # 13, Skill 139 | (_SKILL_5, 15, 16), # 14, Skill 140 | (_DROP_SKILL, -10, 20), # 15, Skill 141 | (_DECO_1, 6, 70), # 16, Deco 142 | (_DECO_2, 12, 25), # 17, Deco 143 | (_DECO_3, 18, 5), # 18, Deco 144 | ] 145 | 146 | ENTRIES_6 = [ 147 | # EFFECT, COST, PROBABILITY * 1000 148 | (_NOTHING, 1, 80), # 0, Defense 149 | (_NOTHING, 3, 80), # 1, Defense 150 | (_NOTHING, 5, 80), # 2, Defense 151 | (_NOTHING, 7, 40), # 3, Defense 152 | (_NOTHING, 10, 40), # 4, Defense 153 | (_NOTHING, -3, 40), # 5, Defense 154 | (_NOTHING, -5, 40), # 6, Defense 155 | (_NOTHING, 2, 150), # 7, Elem-Defense 156 | (_NOTHING, -2, 90), # 8, Elem-Defense 157 | (_NOTHING, -3, 60), # 9, Elem-Defense 158 | (_SKILL_1, 3, 60), # 10, Skill 159 | (_SKILL_2, 6, 40), # 11, Skill 160 | (_SKILL_3, 9, 36), # 12, Skill 161 | (_SKILL_4, 12, 28), # 13, Skill 162 | (_SKILL_5, 15, 16), # 14, Skill 163 | (_DROP_SKILL, -10, 20), # 15, Skill 164 | (_DECO_1, 6, 70), # 16, Deco 165 | (_DECO_2, 12, 25), # 17, Deco 166 | (_DECO_3, 18, 5), # 18, Deco 167 | ] 168 | 169 | ENTRIES = [ENTRIES_1, ENTRIES_2, ENTRIES_3, ENTRIES_4, ENTRIES_5, ENTRIES_6] 170 | START_COSTS = [20, 18, 16, 14, 12, 10] 171 | 172 | def random_select_in(entries): 173 | total_p = 0 174 | for entry in entries: 175 | total_p += entry[2] 176 | r = random.randrange(total_p) 177 | for entry in entries: 178 | if r < entry[2]: 179 | return entry 180 | r -= entry[2] 181 | assert False, "random_select_in fault" 182 | 183 | def single_emu(cost, entries): 184 | ret = [] 185 | 186 | def test(ent): 187 | nonlocal ret, cost 188 | if cost - ent[1] > 0: 189 | ret.append(ent) 190 | cost -= ent[1] 191 | 192 | # Stage 1 193 | test(random_select_in(entries[0:7])) # Defense 194 | if (cost == 0): 195 | return ret 196 | test(random_select_in(entries[10:16])) # Skill 197 | if (cost == 0): 198 | return ret 199 | 200 | # Stage 2 201 | for i in range(50): 202 | push_count = 6 - len(ret) 203 | for j in range(push_count): 204 | test(random_select_in(entries)) 205 | if (cost == 0): 206 | return ret 207 | if len(ret) == 6: 208 | break 209 | 210 | return ret 211 | 212 | def proc_emu_result(ret): 213 | cur = [0] * len(ARR_WORDS) 214 | deco = 0 215 | for entry in ret: 216 | if entry[0] == _DECO_1: 217 | deco += 1 218 | elif entry[0] == _DECO_2: 219 | deco += 2 220 | elif entry[0] == _DECO_3: 221 | deco += 3 222 | elif entry[0] == _DROP_SKILL: 223 | if FLAG_CONSIDER_DROP_SKILL: 224 | # give up 225 | return [0] * len(ARR_WORDS) 226 | elif entry[0] != _NOTHING: 227 | cur[entry[0]] = 1 228 | if deco == 1: 229 | cur[_DECO_1] = 1 230 | elif deco == 2: 231 | cur[_DECO_2] = 1 232 | elif deco == 3: 233 | cur[_DECO_3] = 1 234 | elif deco >= 4: 235 | cur[_DECO_4] = 1 236 | return cur 237 | 238 | 239 | def _do(start_cost, entries, _): 240 | length = len(ARR_WORDS) 241 | s = [0] * length 242 | for _ in range(N_PART_SIZE): 243 | ret = single_emu(start_cost, entries) 244 | cur = proc_emu_result(ret) 245 | for k in range(length): 246 | s[k] += cur[k] 247 | return s 248 | 249 | def main(): 250 | title = ['COST'] + ARR_WORDS 251 | content = [] 252 | 253 | for (entries, start_cost) in zip(ENTRIES, START_COSTS): 254 | arr_size = (N_MONTE_CARLO_LOOP + N_PART_SIZE - 1) // N_PART_SIZE 255 | actual_attempts = arr_size * N_PART_SIZE 256 | 257 | with Pool(N_PROCESS) as pool: 258 | curs = list( 259 | tqdm(pool.imap_unordered( 260 | functools.partial(_do, start_cost, entries), 261 | range(arr_size), chunksize=N_IMAP_CHUNK_SIZE), 262 | total=arr_size)) 263 | 264 | count = functools.reduce( 265 | lambda arr1, arr2: [x + y for (x, y) in zip(arr1, arr2)], curs) 266 | 267 | row = [start_cost] + ["{:.6f} % ({})".format(count[i] / actual_attempts * 100 * ARR_MULS[i], count[i]) for i in range(len(ARR_WORDS))] 268 | content.append(row) 269 | 270 | print(tabulate(content, title, "github")) 271 | 272 | if __name__ == '__main__': 273 | main() -------------------------------------------------------------------------------- /restore-old-data.md: -------------------------------------------------------------------------------- 1 | ## 恢复旧版游猫网配装器中储存的数据 2 | 3 | 游猫网全站近日完成了从 HTTP 到 HTTPS 的升级。然而,这一升级将会导致您的浏览器中储存的数据不能访问(因为 https://gamecat.fun 和 http://gamecat.fun 是不同的 HOST,由于同源策略的限制,浏览器将阻止程序访问旧数据)。 4 | 5 | 为了让您能读取并恢复您的旧数据,我们开发了一个小工具。如果您有需要,请按照下列步骤操作。 6 | 7 | 对此带来的不便,我们深感歉意!有任何问题,请联系 gamecat@aliyun.com 询问。 8 | 9 | ### 目录 10 | 11 | - [恢复旧版游猫网配装器中储存的数据](#恢复旧版游猫网配装器中储存的数据) 12 | - [目录](#目录) 13 | - [Windows 系统](#windows-系统) 14 | - [macos 系统](#macos-系统) 15 | - [常见问题:Chrome 浏览器](#常见问题chrome-浏览器) 16 | 17 | ### Windows 系统 18 | 19 | 首先,如果您使用了任何代理软件 (例如梯子),请将它们关闭。 20 | 21 | 点击开始菜单,然后点击齿轮图标进入系统设置; 22 | 23 | ![](https://gamecat.fun/s/win1.jpg) 24 | 25 | 在设置中,点击“网络和 Internet”; 26 | 27 | ![](https://gamecat.fun/s/win2.jpg) 28 | 29 | 在左侧点击“代理”;在右侧打开“使用代理服务器”选项,在地址中填写 `p.gamecat.fun`,在端口中填写 `9000`,然后点击保存; 30 | 31 | ![](https://gamecat.fun/s/win3.jpg) 32 | 33 | 打开您之前使用游猫网配装器的浏览器,在地址栏中输入 `http://gamecat.fun/httpisstupid`; 34 | 35 | **注意**,前缀的 `http://` 不能省略,更不能写成 `https://`; 36 | 37 | ![](https://gamecat.fun/s/win4.jpg) 38 | 39 | 如果一切顺利,您将会打开我们的旧数据转移程序。浏览器会自动提示您下载压缩包; 40 | 41 | 如果您使用 Chrome 浏览器,由于 Chrome 浏览器奇怪的缓存和强制 HTTPS 机制,您可能会遇到问题。您可以在[这里](#常见问题chrome-浏览器)查看解决方法; 42 | 43 | ![](https://gamecat.fun/s/win5.jpg) 44 | 45 | 下载完成后,其中应当有 `favorite_sets.txt`,`talismans.txt` 和 `qurious_crafting.txt` 三个文件; 46 | 47 | ![](https://gamecat.fun/s/win6.jpg) 48 | 49 | 重新按照上述步骤回到代理设置,关闭“使用代理服务器”选项; 50 | 51 | ![](https://gamecat.fun/s/win7.jpg) 52 | 53 | 然后,您就可以打开游猫网配装器,在【配装收藏】,【护石列表】和【怪异炼化记录】中分别导入 `favorite_sets.txt` (**注意**,不是 `favorite_sets_raw.txt`),`talismans.txt` 和 `qurious_crafting.txt` 三个文件了。 54 | 55 | **注意**:导入将会覆盖您现有的记录。如果要合并两个记录,您需要点击“导入并合并”按钮。 56 | 57 | ### macos 系统 58 | 59 | 首先,如果您使用了任何代理软件 (例如梯子),请将它们关闭。 60 | 61 | 进入“系统偏好设置”,然后点击“网络”; 62 | 63 | ![](https://gamecat.fun/s/mac1.jpg) 64 | 65 | 在左侧选择您正在使用的网络接口(一般为 Wi-Fi),然后点击右下角的“高级…”按钮; 66 | 67 | ![](https://gamecat.fun/s/mac2a.jpg) 68 | 69 | 进入“代理”选项卡,在左侧分别选择 “网页代理 (HTTP)” 和 “安全网页代理 (HTTPS)” 选项,在左侧将它们勾选,并在右侧设置代理服务器为 `p.gamecat.fun:9000`,然后点击“好”; 70 | 71 | **注意**,两个选项右侧的代理设置都需要填; 72 | 73 | ![](https://gamecat.fun/s/mac3.jpg) 74 | 75 | 点击右下角的“应用”; 76 | 77 | ![](https://gamecat.fun/s/mac4.jpg) 78 | 79 | 打开您之前使用游猫网配装器的浏览器,在地址栏中输入 `http://gamecat.fun/httpisstupid`; 80 | 81 | **注意**,前缀的 `http://` 不能省略,更不能写成 `https://`; 82 | 83 | ![](https://gamecat.fun/s/mac5.jpg) 84 | 85 | 如果一切顺利,您将会打开我们的旧数据转移程序。浏览器会自动提示您下载压缩包; 86 | 87 | 如果您使用 Chrome 浏览器,由于 Chrome 浏览器奇怪的缓存和强制 HTTPS 机制,您可能会遇到问题。您可以在[这里](#常见问题chrome-浏览器)查看解决方法; 88 | 89 | ![](https://gamecat.fun/s/mac6.jpg) 90 | 91 | 下载完成后,其中应当有 `favorite_sets.txt`,`talismans.txt` 和 `qurious_crafting.txt` 三个文件; 92 | 93 | ![](https://gamecat.fun/s/mac7.jpg) 94 | 95 | 重新按照上述步骤回到代理设置,取消勾选“网页代理 (HTTP)” 和 “安全网页代理 (HTTPS)”选项,点击“好”; 96 | 97 | ![](https://gamecat.fun/s/mac8.jpg) 98 | 99 | 然后点击右下角的“应用”,删除代理设置; 100 | 101 | ![](https://gamecat.fun/s/mac4.jpg) 102 | 103 | 然后,您就可以打开游猫网配装器,在【配装收藏】,【护石列表】和【怪异炼化记录】中分别导入 `favorite_sets.txt` (**注意**,不是 `favorite_sets_raw.txt`),`talismans.txt` 和 `qurious_crafting.txt` 三个文件了。 104 | 105 | **注意**:导入将会覆盖您现有的记录。如果要合并两个记录,您需要点击“导入并合并”按钮。 106 | 107 | ### 常见问题:Chrome 浏览器 108 | 109 | 由于 Chrome 浏览器奇怪的缓存和强制 HTTPS 机制,您可能会遇到问题,浏览器提示“gamecat.fun 未发送任何数据”; 110 | 111 | ![](https://gamecat.fun/s/chrome1.jpg) 112 | 113 | 首先,先在地址栏中输入 `chrome://settings/system`,进入 Chrome 的系统设置; 114 | 115 | 如果您看到“Chrome 使用的是由某款扩展程序指定的代理设置”,您需要首先停用或者删除这款扩展程序; 116 | 117 | ![](https://gamecat.fun/s/chrome7.jpg) 118 | 119 | 如果您看到“打开您计算机的代理设置”(或者,在停用/删除扩展程序后看到这行字),那么就没有问题,可以进行下一步了; 120 | 121 | ![](https://gamecat.fun/s/chrome8.jpg) 122 | 123 | 接下来,您可以点击地址栏右侧的三个点,打开菜单,选择“更多工具”子菜单,然后打开“开发者工具”; 124 | 125 | ![](https://gamecat.fun/s/chrome2.jpg) 126 | 127 | 在开发者工具中,进入“Network”选项卡,勾选“Disable cache”选项; 128 | 129 | ![](https://gamecat.fun/s/chrome3.jpg) 130 | 131 | 一些同学可能使用的是中文版的开发者工具,这时您可以进入“网络”选项卡,勾选“停用缓存”; 132 | 133 | ![](https://gamecat.fun/s/chrome4.jpg) 134 | 135 | 然后,**保持开发者工具打开,不要关闭**,在地址栏中,将光标移动到最左边,把 `https` 改为 `http`; 136 | 137 | ![](https://gamecat.fun/s/chrome5.jpg) 138 | 139 | 之后回车,您应该就可以进入旧数据转移程序了。如果仍有问题,可以尝试刷新一次; 140 | 141 | ![](https://gamecat.fun/s/chrome6.jpg) 142 | --------------------------------------------------------------------------------