@lf_maple/koishi-plugin-phi-plugin-full 0.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (629) hide show
  1. package/LICENSE +22 -0
  2. package/core/.github/ISSUE_TEMPLATE/bug.yaml +133 -0
  3. package/core/.github/ISSUE_TEMPLATE/config.yml +1 -0
  4. package/core/.github/ISSUE_TEMPLATE/enhancement.yml +44 -0
  5. package/core/.vscode/c_cpp_properties.json +18 -0
  6. package/core/.vscode/launch.json +24 -0
  7. package/core/.vscode/settings.json +59 -0
  8. package/core/CHANGELOG.md +184 -0
  9. package/core/LICENSE +674 -0
  10. package/core/README.md +330 -0
  11. package/core/README_en.md +285 -0
  12. package/core/apps/Dan.js +129 -0
  13. package/core/apps/RankList.js +322 -0
  14. package/core/apps/aliasProposal.js +223 -0
  15. package/core/apps/apiSetting.js +592 -0
  16. package/core/apps/b19.js +1329 -0
  17. package/core/apps/botClient.js +64 -0
  18. package/core/apps/chart.js +692 -0
  19. package/core/apps/guessGame/guessIll.js +821 -0
  20. package/core/apps/guessGame/guessLetter.js +831 -0
  21. package/core/apps/guessGame/guessTips.js +254 -0
  22. package/core/apps/guessGame/letterGameUtils.js +74 -0
  23. package/core/apps/guessGame.js +214 -0
  24. package/core/apps/help.js +117 -0
  25. package/core/apps/manage.js +288 -0
  26. package/core/apps/market.js +243 -0
  27. package/core/apps/money.js +1064 -0
  28. package/core/apps/phisong.js +1418 -0
  29. package/core/apps/session.js +664 -0
  30. package/core/apps/setting.js +468 -0
  31. package/core/apps/update.js +541 -0
  32. package/core/apps/user.js +968 -0
  33. package/core/components/Config.js +249 -0
  34. package/core/components/Data.js +304 -0
  35. package/core/components/FileWatcherRegistry.js +102 -0
  36. package/core/components/Logger.js +11 -0
  37. package/core/components/ProcessCleanup.js +113 -0
  38. package/core/components/Version.js +56 -0
  39. package/core/components/YamlReader.js +157 -0
  40. package/core/components/baseClass.js +287 -0
  41. package/core/components/common.js +47 -0
  42. package/core/components/index.js +13 -0
  43. package/core/components/platform/index.js +79 -0
  44. package/core/components/platform/koishi.js +800 -0
  45. package/core/components/platform/koishiDatabaseRedis.js +391 -0
  46. package/core/components/platform/memoryRedis.js +209 -0
  47. package/core/components/platform/types.d.ts +272 -0
  48. package/core/components/platform/yunzai.js +604 -0
  49. package/core/components/segment.js +4 -0
  50. package/core/config/config//350/277/231/351/207/214/346/230/257/351/205/215/347/275/256/346/226/207/344/273/266/347/233/256/345/275/225.txt +0 -0
  51. package/core/config/default_config/banGroup.yaml +14 -0
  52. package/core/config/default_config/config.yaml +159 -0
  53. package/core/config/default_config/nickconfig.yaml +6 -0
  54. package/core/config/default_config/otherinfo.yaml +51 -0
  55. package/core/guoba.support.js +597 -0
  56. package/core/index.js +85 -0
  57. package/core/lib/AES.js +40 -0
  58. package/core/lib/Base64.js +22 -0
  59. package/core/lib/ByteReader.js +168 -0
  60. package/core/lib/GameProgress.js +37 -0
  61. package/core/lib/GameRecord.js +47 -0
  62. package/core/lib/GameSettings.js +24 -0
  63. package/core/lib/GameUser.js +19 -0
  64. package/core/lib/Level.js +6 -0
  65. package/core/lib/LevelRecord.js +9 -0
  66. package/core/lib/PhigrosUser.js +135 -0
  67. package/core/lib/SaveManager.js +117 -0
  68. package/core/lib/Summary.js +47 -0
  69. package/core/lib/TapTap/CompleteQRCodeData.js +27 -0
  70. package/core/lib/TapTap/LCHelper.js +81 -0
  71. package/core/lib/TapTap/TapTapHelper.js +170 -0
  72. package/core/lib/TapTap/getQRcode.js +61 -0
  73. package/core/lib/Util.js +30 -0
  74. package/core/lib/getQRcode.js +73 -0
  75. package/core/lib/http.js +105 -0
  76. package/core/model/README.md +3 -0
  77. package/core/model/api/aliasProposalService.js +151 -0
  78. package/core/model/api/apiVersion.js +67 -0
  79. package/core/model/api/autoSeekApi.js +165 -0
  80. package/core/model/api/botApiAuth.js +208 -0
  81. package/core/model/api/botSyncService.js +78 -0
  82. package/core/model/api/gameRecordPayload.js +24 -0
  83. package/core/model/api/makeRequest.js +1004 -0
  84. package/core/model/api/makeRequestFnc.js +17 -0
  85. package/core/model/api/phiApiClient.js +53 -0
  86. package/core/model/api/phiApiErrors.js +121 -0
  87. package/core/model/filesystem/getFile.js +256 -0
  88. package/core/model/filesystem/path.js +84 -0
  89. package/core/model/game/Chart.js +57 -0
  90. package/core/model/game/LevelRecordInfo.js +109 -0
  91. package/core/model/game/SongsInfo.js +46 -0
  92. package/core/model/game/b30Analysis.js +93 -0
  93. package/core/model/game/chartParser/Chart.js +23 -0
  94. package/core/model/game/chartParser/JudgeLine.js +38 -0
  95. package/core/model/game/chartParser/base/JudgeLineEvent.js +99 -0
  96. package/core/model/game/chartParser/base/Note.js +44 -0
  97. package/core/model/game/chartParser/base/SpeedEvent.js +25 -0
  98. package/core/model/game/chartParser/base/baseType.js +2 -0
  99. package/core/model/game/constNum.js +215 -0
  100. package/core/model/game/fCompute.js +711 -0
  101. package/core/model/game/getChartTag.js +140 -0
  102. package/core/model/game/getComment.js +132 -0
  103. package/core/model/game/getInfo.js +1069 -0
  104. package/core/model/game/getRksRank.js +77 -0
  105. package/core/model/game/markdown.js +77 -0
  106. package/core/model/integrations/Vika.js +103 -0
  107. package/core/model/integrations/getInfoFromTap.js +80 -0
  108. package/core/model/render/getPic.js +79 -0
  109. package/core/model/render/picmodle.js +496 -0
  110. package/core/model/render/progress-bar.js +44 -0
  111. package/core/model/render/puppeteer.js +431 -0
  112. package/core/model/render/renderPressureHistory.js +71 -0
  113. package/core/model/render/send.js +94 -0
  114. package/core/model/save/Save.js +953 -0
  115. package/core/model/save/analyzeSaveHistory.js +413 -0
  116. package/core/model/save/getBackup.js +328 -0
  117. package/core/model/save/getSave.js +90 -0
  118. package/core/model/save/getSaveFromApi.js +46 -0
  119. package/core/model/save/saveHistory.js +586 -0
  120. package/core/model/save/scoreHistory.js +101 -0
  121. package/core/model/theme/catalog.js +192 -0
  122. package/core/model/theme/installGuard.js +275 -0
  123. package/core/model/theme/installLock.js +174 -0
  124. package/core/model/theme/installer.js +398 -0
  125. package/core/model/theme/manager.js +408 -0
  126. package/core/model/theme/marketClient.js +294 -0
  127. package/core/model/theme/paths.js +42 -0
  128. package/core/model/theme/policy.js +54 -0
  129. package/core/model/theme/recovery.js +167 -0
  130. package/core/model/theme/useService.js +187 -0
  131. package/core/model/type/aliasProposal.d.ts +45 -0
  132. package/core/model/type/type.js +420 -0
  133. package/core/model/user/apiPermission.js +62 -0
  134. package/core/model/user/getBanGroup.js +120 -0
  135. package/core/model/user/getNotes.js +48 -0
  136. package/core/model/user/pluginData.js +101 -0
  137. package/core/model/user/userCredentialStore.js +154 -0
  138. package/core/model/user/userCredentials.js +860 -0
  139. package/core/package.json +60 -0
  140. package/core/resources/0608badSave/save.json +1 -0
  141. package/core/resources/LICENSE +201 -0
  142. package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.art +220 -0
  143. package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.css +345 -0
  144. package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.html +434 -0
  145. package/core/resources/html/arcgrosB19/arcgros.png +0 -0
  146. package/core/resources/html/arcgrosB19/arcgrosB19-orz.html +276 -0
  147. package/core/resources/html/arcgrosB19/arcgrosB19.art +168 -0
  148. package/core/resources/html/arcgrosB19/arcgrosB19.css +637 -0
  149. package/core/resources/html/atlas/atlas-orz.html +313 -0
  150. package/core/resources/html/atlas/atlas.art +194 -0
  151. package/core/resources/html/atlas/atlas.css +695 -0
  152. package/core/resources/html/avatar/-SURREALISM-.png +0 -0
  153. package/core/resources/html/avatar/Alkaid.png +0 -0
  154. package/core/resources/html/avatar/Aphasia.png +0 -0
  155. package/core/resources/html/avatar/Artificial Existence.png +0 -0
  156. package/core/resources/html/avatar/Bonus Time.png +0 -0
  157. package/core/resources/html/avatar/Burn.png +0 -0
  158. package/core/resources/html/avatar/Cereris1.png +0 -0
  159. package/core/resources/html/avatar/Cereris2.png +0 -0
  160. package/core/resources/html/avatar/Cereris3.png +0 -0
  161. package/core/resources/html/avatar/Christmas -2019.png +0 -0
  162. package/core/resources/html/avatar/Cipher1.png +0 -0
  163. package/core/resources/html/avatar/Class Memories.png +0 -0
  164. package/core/resources/html/avatar/Credits.png +0 -0
  165. package/core/resources/html/avatar/Dash.png +0 -0
  166. package/core/resources/html/avatar/Dlyrotz.png +0 -0
  167. package/core/resources/html/avatar/Doppelganger1.png +0 -0
  168. package/core/resources/html/avatar/Doppelganger2.png +0 -0
  169. package/core/resources/html/avatar/Drop it.png +0 -0
  170. package/core/resources/html/avatar/Energy Synergy Matrix1.png +0 -0
  171. package/core/resources/html/avatar/Energy Synergy Matrix2.png +0 -0
  172. package/core/resources/html/avatar/Energy Synergy Matrix3.png +0 -0
  173. package/core/resources/html/avatar/Engine x Start!! (melody mix).png +0 -0
  174. package/core/resources/html/avatar/Engine x Start!! extra 1 -by cycats.png +0 -0
  175. package/core/resources/html/avatar/Eradication Catastrophe.png +0 -0
  176. package/core/resources/html/avatar/FULi AUTO SHOOTER extra 1 -by cycats.png +0 -0
  177. package/core/resources/html/avatar/FULi AUTO SHOOTER.png +0 -0
  178. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special1.png +0 -0
  179. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special2.png +0 -0
  180. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2641.png +0 -0
  181. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2642.png +0 -0
  182. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2643.png +0 -0
  183. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2644.png +0 -0
  184. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2645.png +0 -0
  185. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2646.png +0 -0
  186. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2647.png +0 -0
  187. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2648.png +0 -0
  188. package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2649.png +0 -0
  189. package/core/resources/html/avatar/Find_Me.png +0 -0
  190. package/core/resources/html/avatar/Geopelia 1 -by cycats.png +0 -0
  191. package/core/resources/html/avatar/Geopelia 2 -by cycats.png +0 -0
  192. package/core/resources/html/avatar/Geopelia 3 -by /344/275/225/345/221/265.png +0 -0
  193. package/core/resources/html/avatar/Geopelia in WEPLAY -by /346/265/267/344/272/247.png +0 -0
  194. package/core/resources/html/avatar/Gino-AprilFool.png +0 -0
  195. package/core/resources/html/avatar/Glaciaxion.png +0 -0
  196. package/core/resources/html/avatar/HumaN.png +0 -0
  197. package/core/resources/html/avatar/Indelible Scar.png +0 -0
  198. package/core/resources/html/avatar/Introduction.png +0 -0
  199. package/core/resources/html/avatar/Khronostasis Katharsis.png +0 -0
  200. package/core/resources/html/avatar/MARENOL.png +0 -0
  201. package/core/resources/html/avatar/Marenol extra 1 -by /345/226/265n/350/221/265.png +0 -0
  202. package/core/resources/html/avatar/Non-Melodic Ragez (MUG Edit).png +0 -0
  203. package/core/resources/html/avatar/Non-Melodic Ragez extra 1 -by cycats.png +0 -0
  204. package/core/resources/html/avatar/Oblivion +0 -0
  205. package/core/resources/html/avatar/OblivionPHIN.png +0 -0
  206. package/core/resources/html/avatar/Para.png +0 -0
  207. package/core/resources/html/avatar/Pixel Rebelz1.png +0 -0
  208. package/core/resources/html/avatar/Pixel Rebelz2.png +0 -0
  209. package/core/resources/html/avatar/Pixel Rebelz3.png +0 -0
  210. package/core/resources/html/avatar/RIPPER extra 1 -by cycats.png +0 -0
  211. package/core/resources/html/avatar/RIPPER extra 2 -by /344/275/225/345/221/265.png +0 -0
  212. package/core/resources/html/avatar/Sein.png +0 -0
  213. package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special.png +0 -0
  214. package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special2.png +0 -0
  215. package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/231/256/351/200/232.png +0 -0
  216. package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/233/262/347/273/230Ver.png +0 -0
  217. package/core/resources/html/avatar/ShineAfter-/351/270/240-Special.png +0 -0
  218. package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/231/256/351/200/232.png +0 -0
  219. package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/233/262/347/273/230Ver.png +0 -0
  220. package/core/resources/html/avatar/ShineAfter-/351/270/240/345/222/214/346/260/264/351/235/222-Special.png +0 -0
  221. package/core/resources/html/avatar/Snow Desert.png +0 -0
  222. package/core/resources/html/avatar/Sparkle New Life.png +0 -0
  223. package/core/resources/html/avatar/Sultan Rage.png +0 -0
  224. package/core/resources/html/avatar/Winter /342/206/221cube/342/206/223.png +0 -0
  225. package/core/resources/html/avatar/Xenolith.png +0 -0
  226. package/core/resources/html/avatar/[PRAW].png +0 -0
  227. package/core/resources/html/avatar/dB doll.png +0 -0
  228. package/core/resources/html/avatar/ripper.png +0 -0
  229. package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2721.png +0 -0
  230. package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2722.png +0 -0
  231. package/core/resources/html/avatar//344/270/207/345/220/250/345/214/277/345/220/215/344/277/241.png +0 -0
  232. package/core/resources/html/avatar//344/272/221/345/245/263/345/255/251 extra 1 -by /345/276/241/345/235/202/346/236/234/345/255/220.png +0 -0
  233. package/core/resources/html/avatar//344/272/221/345/245/263/345/255/251.png +0 -0
  234. package/core/resources/html/avatar//345/205/211.png +0 -0
  235. package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2051.png +0 -0
  236. package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2052.png +0 -0
  237. package/core/resources/html/avatar//346/260/264/351/235/222-/344/270/200/345/221/250/345/271/264/347/233/270/350/201/232.png +0 -0
  238. package/core/resources/html/avatar//346/267/267/344/271/261-Confusion.png +0 -0
  239. package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2361.png +0 -0
  240. package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2362.png +0 -0
  241. package/core/resources/html/avatar//347/223/267/345/262/201-Special.png +0 -0
  242. package/core/resources/html/avatar//347/223/267/345/262/2011.png +0 -0
  243. package/core/resources/html/avatar//347/223/267/345/262/2012.png +0 -0
  244. package/core/resources/html/avatar//347/223/267/345/262/2013.png +0 -0
  245. package/core/resources/html/avatar//347/223/267/345/262/2014.png +0 -0
  246. package/core/resources/html/avatar//347/223/267/345/262/2015.png +0 -0
  247. package/core/resources/html/avatar//347/223/267/345/262/2016.png +0 -0
  248. package/core/resources/html/avatar//347/223/267/345/262/2017.png +0 -0
  249. package/core/resources/html/avatar//347/233/217/350/214/227-Special.png +0 -0
  250. package/core/resources/html/avatar//347/233/217/350/214/2271.png +0 -0
  251. package/core/resources/html/avatar//347/233/217/350/214/2272.png +0 -0
  252. package/core/resources/html/avatar//347/233/217/350/214/2273.png +0 -0
  253. package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2611.png +0 -0
  254. package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2612.png +0 -0
  255. package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2501.png +0 -0
  256. package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2502.png +0 -0
  257. package/core/resources/html/avatar//351/235/222/350/212/275-Special.png +0 -0
  258. package/core/resources/html/avatar//351/235/222/350/212/275.png +0 -0
  259. package/core/resources/html/avatar//351/243/216/345/261/277.png +0 -0
  260. package/core/resources/html/avatar//351/270/240-AprilFool.png +0 -0
  261. package/core/resources/html/avatar//351/270/240-/344/270/200/345/221/250/345/271/264/347/233/270/350/201/232.png +0 -0
  262. package/core/resources/html/b19/b19.art +490 -0
  263. package/core/resources/html/b19/b19.css +1261 -0
  264. package/core/resources/html/b19/b19666.art +350 -0
  265. package/core/resources/html/b19/b19666.css +1409 -0
  266. package/core/resources/html/b19/b19666.html +481 -0
  267. package/core/resources/html/b19/b19title.css +120 -0
  268. package/core/resources/html/b19/best19.html +853 -0
  269. package/core/resources/html/b19/dss2-orz.html +428 -0
  270. package/core/resources/html/b19/dss2.art +298 -0
  271. package/core/resources/html/b19/dss2.css +776 -0
  272. package/core/resources/html/b19/res/666.jpeg +0 -0
  273. package/core/resources/html/chap/chap-orz.html +93 -0
  274. package/core/resources/html/chap/chap.art +87 -0
  275. package/core/resources/html/chap/chap.css +365 -0
  276. package/core/resources/html/chartImg/chartImg.art +169 -0
  277. package/core/resources/html/chartImg/chartImg.css +439 -0
  278. package/core/resources/html/chartImg/echarts-wordcloud.min.js +3 -0
  279. package/core/resources/html/chartImg/echarts.js +85796 -0
  280. package/core/resources/html/chartImg/img/Drag.png +0 -0
  281. package/core/resources/html/chartImg/img/DragHL.png +0 -0
  282. package/core/resources/html/chartImg/img/Flick.png +0 -0
  283. package/core/resources/html/chartImg/img/FlickHL.png +0 -0
  284. package/core/resources/html/chartImg/img/Hold.png +0 -0
  285. package/core/resources/html/chartImg/img/HoldHL.png +0 -0
  286. package/core/resources/html/chartImg/img/Hold_End.png +0 -0
  287. package/core/resources/html/chartImg/img/Hold_Head.png +0 -0
  288. package/core/resources/html/chartImg/img/Hold_HeadHL.png +0 -0
  289. package/core/resources/html/chartImg/img/Tap.png +0 -0
  290. package/core/resources/html/chartImg/img/TapHL.png +0 -0
  291. package/core/resources/html/chartInfo/chartInfo-orz.html +250 -0
  292. package/core/resources/html/chartInfo/chartInfo.art +222 -0
  293. package/core/resources/html/chartInfo/chartInfo.css +265 -0
  294. package/core/resources/html/chartInfo/echarts-wordcloud.min.js +3 -0
  295. package/core/resources/html/chartInfo/echarts.js +85796 -0
  296. package/core/resources/html/clg/clg-orz.html +218 -0
  297. package/core/resources/html/clg/clg.art +88 -0
  298. package/core/resources/html/clg/clg.css +230 -0
  299. package/core/resources/html/clg/demo.jpg +0 -0
  300. package/core/resources/html/common/common.css +319 -0
  301. package/core/resources/html/common/css/playerInfo.css +136 -0
  302. package/core/resources/html/common/font/Aldrich-Regular.ttf +0 -0
  303. package/core/resources/html/common/font/HIMALAYA.TTF +0 -0
  304. package/core/resources/html/common/font/NotoColorEmoji-Regular.ttf +0 -0
  305. package/core/resources/html/common/font/NotoSans-Regular.ttf +0 -0
  306. package/core/resources/html/common/font/NotoSansArabic.ttf +0 -0
  307. package/core/resources/html/common/font/NotoSansCanadianAboriginal.ttf +0 -0
  308. package/core/resources/html/common/font/NotoSansJP.ttf +0 -0
  309. package/core/resources/html/common/font/NotoSansKannada.ttf +0 -0
  310. package/core/resources/html/common/font/NotoSansMath-Regular.ttf +0 -0
  311. package/core/resources/html/common/font/NotoSansSymbols2.ttf +0 -0
  312. package/core/resources/html/common/font/phi.ttf +0 -0
  313. package/core/resources/html/common/font//345/220/236/345/274/245/346/201/260/344/277/212.ttf +0 -0
  314. package/core/resources/html/common/layout/default.art +324 -0
  315. package/core/resources/html/common/layout/elem.art +21 -0
  316. package/core/resources/html/common/theme/snow/snow.css +17 -0
  317. package/core/resources/html/common/theme/snow/snow.js +19 -0
  318. package/core/resources/html/common/theme/star/star.js +201 -0
  319. package/core/resources/html/common/theme/topText/topText.css +15 -0
  320. package/core/resources/html/common/theme/topText/topText.js +30 -0
  321. package/core/resources/html/difficultyHistory/difficultyHistory-orz.html +361 -0
  322. package/core/resources/html/difficultyHistory/difficultyHistory.art +102 -0
  323. package/core/resources/html/difficultyHistory/difficultyHistory.css +205 -0
  324. package/core/resources/html/guess/guess-orz.html +50 -0
  325. package/core/resources/html/guess/guess.art +51 -0
  326. package/core/resources/html/guess/guess.css +33 -0
  327. package/core/resources/html/help/help-orz.html +73 -0
  328. package/core/resources/html/help/help.art +84 -0
  329. package/core/resources/html/help/help.css +266 -0
  330. package/core/resources/html/historyB30/historyB30-orz.html +168 -0
  331. package/core/resources/html/historyB30/historyB30.art +143 -0
  332. package/core/resources/html/historyB30/historyB30.css +270 -0
  333. package/core/resources/html/ill/ill-orz.html +21 -0
  334. package/core/resources/html/ill/ill.art +23 -0
  335. package/core/resources/html/ill/ill.css +79 -0
  336. package/core/resources/html/jrrp/ShineAfter.removebg.png +0 -0
  337. package/core/resources/html/jrrp/jrrp-orz.html +68 -0
  338. package/core/resources/html/jrrp/jrrp.art +58 -0
  339. package/core/resources/html/jrrp/jrrp.css +251 -0
  340. package/core/resources/html/list/list-orz.html +35 -0
  341. package/core/resources/html/list/list.art +67 -0
  342. package/core/resources/html/list/list.css +259 -0
  343. package/core/resources/html/lvsco/demo.jpg +0 -0
  344. package/core/resources/html/lvsco/lvsco-orz.html +334 -0
  345. package/core/resources/html/lvsco/lvsco.art +314 -0
  346. package/core/resources/html/lvsco/lvsco.css +706 -0
  347. package/core/resources/html/market/detail.art +44 -0
  348. package/core/resources/html/market/market.art +86 -0
  349. package/core/resources/html/market/market.css +64 -0
  350. package/core/resources/html/newSong/newSong.art +34 -0
  351. package/core/resources/html/newSong/newSong.css +48 -0
  352. package/core/resources/html/newSong/newSong.html +23 -0
  353. package/core/resources/html/newnotice/newnotice.art +47 -0
  354. package/core/resources/html/newnotice/newnotice.css +83 -0
  355. package/core/resources/html/otherimg/0.png +0 -0
  356. package/core/resources/html/otherimg/1.png +0 -0
  357. package/core/resources/html/otherimg/2.png +0 -0
  358. package/core/resources/html/otherimg/3.png +0 -0
  359. package/core/resources/html/otherimg/4.png +0 -0
  360. package/core/resources/html/otherimg/5.png +0 -0
  361. package/core/resources/html/otherimg/A.png +0 -0
  362. package/core/resources/html/otherimg/B.png +0 -0
  363. package/core/resources/html/otherimg/C.png +0 -0
  364. package/core/resources/html/otherimg/F.png +0 -0
  365. package/core/resources/html/otherimg/FC.png +0 -0
  366. package/core/resources/html/otherimg/NEW.png +0 -0
  367. package/core/resources/html/otherimg/Phigros_Icon_3.0.0.png +0 -0
  368. package/core/resources/html/otherimg/S.png +0 -0
  369. package/core/resources/html/otherimg/Star1.png +0 -0
  370. package/core/resources/html/otherimg/Star2.png +0 -0
  371. package/core/resources/html/otherimg/V.png +0 -0
  372. package/core/resources/html/otherimg/callback.png +0 -0
  373. package/core/resources/html/otherimg/chapHelp.png +0 -0
  374. package/core/resources/html/otherimg/dan_code.png +0 -0
  375. package/core/resources/html/otherimg/data.png +0 -0
  376. package/core/resources/html/otherimg/helpDoc.png +0 -0
  377. package/core/resources/html/otherimg/nickSuggest.png +0 -0
  378. package/core/resources/html/otherimg/phi.png +0 -0
  379. package/core/resources/html/otherimg/phigros.png +0 -0
  380. package/core/resources/html/otherimg/snow1.png +0 -0
  381. package/core/resources/html/otherimg/snow2.png +0 -0
  382. package/core/resources/html/otherimg/snow3.png +0 -0
  383. package/core/resources/html/otherimg/snow4.png +0 -0
  384. package/core/resources/html/otherimg/title.png +0 -0
  385. package/core/resources/html/rand/rand-orz.html +62 -0
  386. package/core/resources/html/rand/rand.art +59 -0
  387. package/core/resources/html/rand/rand.css +257 -0
  388. package/core/resources/html/rankingList/rankingList-orz.html +456 -0
  389. package/core/resources/html/rankingList/rankingList.art +171 -0
  390. package/core/resources/html/rankingList/rankingList.css +570 -0
  391. package/core/resources/html/rankingList-old/rankingList-orz.html +300 -0
  392. package/core/resources/html/rankingList-old/rankingList.art +89 -0
  393. package/core/resources/html/rankingList-old/rankingList.css +265 -0
  394. package/core/resources/html/score/score-orz.html +625 -0
  395. package/core/resources/html/score/score.art +249 -0
  396. package/core/resources/html/score/score.css +435 -0
  397. package/core/resources/html/score/scoreOld-orz.html +128 -0
  398. package/core/resources/html/score/scoreOld.art +230 -0
  399. package/core/resources/html/score/scoreOld.css +475 -0
  400. package/core/resources/html/score/scoreRankList-orz.html +613 -0
  401. package/core/resources/html/score/scoreRankList.art +231 -0
  402. package/core/resources/html/score/scoreRankList.css +197 -0
  403. package/core/resources/html/setting/setting-orz.html +123 -0
  404. package/core/resources/html/setting/setting.art +72 -0
  405. package/core/resources/html/setting/setting.css +170 -0
  406. package/core/resources/html/setting/userSetting-orz.html +132 -0
  407. package/core/resources/html/setting/userSetting.art +48 -0
  408. package/core/resources/html/setting/userSetting.css +160 -0
  409. package/core/resources/html/sign/sign-orz.html +262 -0
  410. package/core/resources/html/sign/sign.art +163 -0
  411. package/core/resources/html/sign/sign.css +706 -0
  412. package/core/resources/html/suggest/suggest.art +271 -0
  413. package/core/resources/html/suggest/suggest.css +300 -0
  414. package/core/resources/html/table/table-orz.html +228 -0
  415. package/core/resources/html/table/table.art +163 -0
  416. package/core/resources/html/table/table.css +401 -0
  417. package/core/resources/html/tasks/tasks-orz.html +83 -0
  418. package/core/resources/html/tasks/tasks.art +118 -0
  419. package/core/resources/html/tasks/tasks.css +334 -0
  420. package/core/resources/html/update/update-orz.html +735 -0
  421. package/core/resources/html/update/update.art +259 -0
  422. package/core/resources/html/update/update.css +676 -0
  423. package/core/resources/html/userinfo/userinfo-old-orz.html +408 -0
  424. package/core/resources/html/userinfo/userinfo-old.art +233 -0
  425. package/core/resources/html/userinfo/userinfo-old.css +466 -0
  426. package/core/resources/html/userinfo/userinfo-orz.html +543 -0
  427. package/core/resources/html/userinfo/userinfo.art +288 -0
  428. package/core/resources/html/userinfo/userinfo.css +757 -0
  429. package/core/resources/info/DLC/arc.json +412 -0
  430. package/core/resources/info/DLC/chunithm.json +1172 -0
  431. package/core/resources/info/DLC/dynamix.json +455 -0
  432. package/core/resources/info/DLC/fanshi.json +132 -0
  433. package/core/resources/info/DLC/lanota.json +412 -0
  434. package/core/resources/info/DLC/maimai.json +1110 -0
  435. package/core/resources/info/DLC/orz.json +158 -0
  436. package/core/resources/info/DLC/rizline.json +40 -0
  437. package/core/resources/info/DLC/rotaeno.json +159 -0
  438. package/core/resources/info/DLC/ryceam.json +53 -0
  439. package/core/resources/info/avatar.txt +109 -0
  440. package/core/resources/info/chaplist.yaml +102 -0
  441. package/core/resources/info/help/api.json +83 -0
  442. package/core/resources/info/help.json +436 -0
  443. package/core/resources/info/info.csv +315 -0
  444. package/core/resources/info/infolist.json +1758 -0
  445. package/core/resources/info/jrrp.json +92 -0
  446. package/core/resources/info/nicklist.yaml +2373 -0
  447. package/core/resources/info/notesInfo.json +1 -0
  448. package/core/resources/info/notice.json +11 -0
  449. package/core/resources/info/oldInfo/100/change.csv +218 -0
  450. package/core/resources/info/oldInfo/100/info.json +7 -0
  451. package/core/resources/info/oldInfo/101/change.csv +218 -0
  452. package/core/resources/info/oldInfo/101/info.json +7 -0
  453. package/core/resources/info/oldInfo/102/change.csv +223 -0
  454. package/core/resources/info/oldInfo/102/info.json +7 -0
  455. package/core/resources/info/oldInfo/103/change.csv +224 -0
  456. package/core/resources/info/oldInfo/103/info.json +7 -0
  457. package/core/resources/info/oldInfo/104/change.csv +225 -0
  458. package/core/resources/info/oldInfo/104/info.json +7 -0
  459. package/core/resources/info/oldInfo/105/change.csv +228 -0
  460. package/core/resources/info/oldInfo/105/info.json +7 -0
  461. package/core/resources/info/oldInfo/106/change.csv +229 -0
  462. package/core/resources/info/oldInfo/106/info.json +7 -0
  463. package/core/resources/info/oldInfo/108/change.csv +233 -0
  464. package/core/resources/info/oldInfo/108/info.json +7 -0
  465. package/core/resources/info/oldInfo/109/change.csv +235 -0
  466. package/core/resources/info/oldInfo/109/info.json +7 -0
  467. package/core/resources/info/oldInfo/110/change.csv +235 -0
  468. package/core/resources/info/oldInfo/110/info.json +7 -0
  469. package/core/resources/info/oldInfo/111/change.csv +242 -0
  470. package/core/resources/info/oldInfo/111/info.json +7 -0
  471. package/core/resources/info/oldInfo/112/change.csv +242 -0
  472. package/core/resources/info/oldInfo/112/info.json +7 -0
  473. package/core/resources/info/oldInfo/113/change.csv +244 -0
  474. package/core/resources/info/oldInfo/113/info.json +7 -0
  475. package/core/resources/info/oldInfo/115/change.csv +247 -0
  476. package/core/resources/info/oldInfo/115/info.json +7 -0
  477. package/core/resources/info/oldInfo/116/change.csv +249 -0
  478. package/core/resources/info/oldInfo/116/info.json +7 -0
  479. package/core/resources/info/oldInfo/118/change.csv +252 -0
  480. package/core/resources/info/oldInfo/118/info.json +7 -0
  481. package/core/resources/info/oldInfo/119/change.csv +255 -0
  482. package/core/resources/info/oldInfo/119/info.json +7 -0
  483. package/core/resources/info/oldInfo/120/change.csv +255 -0
  484. package/core/resources/info/oldInfo/120/info.json +7 -0
  485. package/core/resources/info/oldInfo/121/change.csv +257 -0
  486. package/core/resources/info/oldInfo/121/info.json +7 -0
  487. package/core/resources/info/oldInfo/122/change.csv +260 -0
  488. package/core/resources/info/oldInfo/122/info.json +7 -0
  489. package/core/resources/info/oldInfo/123/change.csv +260 -0
  490. package/core/resources/info/oldInfo/123/info.json +7 -0
  491. package/core/resources/info/oldInfo/124/change.csv +262 -0
  492. package/core/resources/info/oldInfo/124/info.json +7 -0
  493. package/core/resources/info/oldInfo/125/change.csv +266 -0
  494. package/core/resources/info/oldInfo/125/info.json +7 -0
  495. package/core/resources/info/oldInfo/126/change.csv +269 -0
  496. package/core/resources/info/oldInfo/126/info.json +7 -0
  497. package/core/resources/info/oldInfo/127/change.csv +270 -0
  498. package/core/resources/info/oldInfo/127/info.json +7 -0
  499. package/core/resources/info/oldInfo/128/change.csv +273 -0
  500. package/core/resources/info/oldInfo/128/info.json +7 -0
  501. package/core/resources/info/oldInfo/129/change.csv +274 -0
  502. package/core/resources/info/oldInfo/129/info.json +7 -0
  503. package/core/resources/info/oldInfo/130/change.csv +275 -0
  504. package/core/resources/info/oldInfo/130/info.json +7 -0
  505. package/core/resources/info/oldInfo/131/change.csv +278 -0
  506. package/core/resources/info/oldInfo/131/info.json +7 -0
  507. package/core/resources/info/oldInfo/132/change.csv +280 -0
  508. package/core/resources/info/oldInfo/132/info.json +7 -0
  509. package/core/resources/info/oldInfo/133/change.csv +284 -0
  510. package/core/resources/info/oldInfo/133/info.json +7 -0
  511. package/core/resources/info/oldInfo/134/change.csv +286 -0
  512. package/core/resources/info/oldInfo/134/info.json +7 -0
  513. package/core/resources/info/oldInfo/135/change.csv +290 -0
  514. package/core/resources/info/oldInfo/135/info.json +7 -0
  515. package/core/resources/info/oldInfo/136/change.csv +290 -0
  516. package/core/resources/info/oldInfo/136/info.json +7 -0
  517. package/core/resources/info/oldInfo/137/change.csv +293 -0
  518. package/core/resources/info/oldInfo/137/info.json +7 -0
  519. package/core/resources/info/oldInfo/138/change.csv +295 -0
  520. package/core/resources/info/oldInfo/138/info.json +7 -0
  521. package/core/resources/info/oldInfo/139/change.csv +295 -0
  522. package/core/resources/info/oldInfo/139/info.json +7 -0
  523. package/core/resources/info/oldInfo/140/change.csv +298 -0
  524. package/core/resources/info/oldInfo/140/info.json +7 -0
  525. package/core/resources/info/oldInfo/141/change.csv +300 -0
  526. package/core/resources/info/oldInfo/141/info.json +7 -0
  527. package/core/resources/info/oldInfo/142/change.csv +302 -0
  528. package/core/resources/info/oldInfo/142/info.json +7 -0
  529. package/core/resources/info/oldInfo/143/change.csv +303 -0
  530. package/core/resources/info/oldInfo/143/info.json +7 -0
  531. package/core/resources/info/oldInfo/144/change.csv +303 -0
  532. package/core/resources/info/oldInfo/144/info.json +7 -0
  533. package/core/resources/info/oldInfo/145/change.csv +305 -0
  534. package/core/resources/info/oldInfo/145/info.json +7 -0
  535. package/core/resources/info/oldInfo/146/change.csv +305 -0
  536. package/core/resources/info/oldInfo/146/info.json +7 -0
  537. package/core/resources/info/oldInfo/148/change.csv +307 -0
  538. package/core/resources/info/oldInfo/148/info.json +7 -0
  539. package/core/resources/info/oldInfo/149/change.csv +307 -0
  540. package/core/resources/info/oldInfo/149/info.json +7 -0
  541. package/core/resources/info/oldInfo/151/change.csv +309 -0
  542. package/core/resources/info/oldInfo/151/info.json +7 -0
  543. package/core/resources/info/oldInfo/152/change.csv +312 -0
  544. package/core/resources/info/oldInfo/152/info.json +7 -0
  545. package/core/resources/info/oldInfo/153/change.csv +313 -0
  546. package/core/resources/info/oldInfo/153/info.json +7 -0
  547. package/core/resources/info/oldInfo/154/change.csv +315 -0
  548. package/core/resources/info/oldInfo/154/info.json +7 -0
  549. package/core/resources/info/oldInfo/92/change.csv +204 -0
  550. package/core/resources/info/oldInfo/92/info.json +7 -0
  551. package/core/resources/info/oldInfo/93/change.csv +206 -0
  552. package/core/resources/info/oldInfo/93/info.json +7 -0
  553. package/core/resources/info/oldInfo/94/change.csv +209 -0
  554. package/core/resources/info/oldInfo/94/info.json +7 -0
  555. package/core/resources/info/oldInfo/95/change.csv +211 -0
  556. package/core/resources/info/oldInfo/95/info.json +7 -0
  557. package/core/resources/info/oldInfo/96/change.csv +216 -0
  558. package/core/resources/info/oldInfo/96/info.json +7 -0
  559. package/core/resources/info/oldInfo/98/change.csv +216 -0
  560. package/core/resources/info/oldInfo/98/info.json +7 -0
  561. package/core/resources/info/oldInfo/99/change.csv +217 -0
  562. package/core/resources/info/oldInfo/99/info.json +7 -0
  563. package/core/resources/info/oldNotesInfo.json +1 -0
  564. package/core/resources/info/sentences.json +1 -0
  565. package/core/resources/info/spinfo.json +362 -0
  566. package/core/resources/info/tips.txt +278 -0
  567. package/core/resources/otherill//351/233/252/351/231/215SP.png +0 -0
  568. package/core/resources/song-select.html +535 -0
  569. package/core/resources/themes/README.md +24 -0
  570. package/core/resources/themes/milthm/A.png +0 -0
  571. package/core/resources/themes/milthm/B.png +0 -0
  572. package/core/resources/themes/milthm/C.png +0 -0
  573. package/core/resources/themes/milthm/F.png +0 -0
  574. package/core/resources/themes/milthm/FC.png +0 -0
  575. package/core/resources/themes/milthm/S.png +0 -0
  576. package/core/resources/themes/milthm/V.png +0 -0
  577. package/core/resources/themes/milthm/arcgrosB19.css +36 -0
  578. package/core/resources/themes/milthm/b19.art +464 -0
  579. package/core/resources/themes/milthm/b19.css +1314 -0
  580. package/core/resources/themes/milthm/bg.png +0 -0
  581. package/core/resources/themes/milthm/clg.css +37 -0
  582. package/core/resources/themes/milthm/difficultyHistory.css +42 -0
  583. package/core/resources/themes/milthm/font.ttf +0 -0
  584. package/core/resources/themes/milthm/help.css +36 -0
  585. package/core/resources/themes/milthm/historyB30.css +48 -0
  586. package/core/resources/themes/milthm/info.yaml +45 -0
  587. package/core/resources/themes/milthm/list.css +39 -0
  588. package/core/resources/themes/milthm/phi.png +0 -0
  589. package/core/resources/themes/milthm/setting.css +37 -0
  590. package/core/resources/themes/milthm/sign.css +81 -0
  591. package/core/resources/themes/milthm/suggest.css +40 -0
  592. package/core/resources/themes/milthm/table.css +54 -0
  593. package/core/resources/themes/milthm/update.css +68 -0
  594. package/core/tests/aliasProposalService.test.js +82 -0
  595. package/core/tests/apiAccountDeletion.test.js +125 -0
  596. package/core/tests/apiPermission.test.js +44 -0
  597. package/core/tests/apiVersion.test.js +55 -0
  598. package/core/tests/b30Analysis.test.js +38 -0
  599. package/core/tests/backgroundIllustration.test.js +21 -0
  600. package/core/tests/botApiAuthRecovery.test.js +148 -0
  601. package/core/tests/botSyncService.test.js +42 -0
  602. package/core/tests/fileWatcherRegistry.test.js +44 -0
  603. package/core/tests/gameRecordPayload.test.js +34 -0
  604. package/core/tests/guessLetter.test.js +79 -0
  605. package/core/tests/makeRequestHandling.test.js +118 -0
  606. package/core/tests/marketOverflow.test.js +31 -0
  607. package/core/tests/platformTemplateCache.test.js +92 -0
  608. package/core/tests/pluginDataThemePreference.test.js +36 -0
  609. package/core/tests/processCleanup.test.js +58 -0
  610. package/core/tests/puppeteerShutdown.test.js +17 -0
  611. package/core/tests/renderPressureHistory.test.js +59 -0
  612. package/core/tests/saveStats.test.js +26 -0
  613. package/core/tests/themeInstallGuard.test.js +289 -0
  614. package/core/tests/themeManager.test.js +625 -0
  615. package/core/tests/themeManagerInit.test.js +11 -0
  616. package/core/tests/themeMarket.test.js +855 -0
  617. package/core/tests/themePageRouting.test.js +431 -0
  618. package/core/tests/themePolicy.test.js +28 -0
  619. package/core/tests/themeStorageRecovery.test.js +192 -0
  620. package/core/tests/userCredentialModuleBoundaries.test.js +41 -0
  621. package/core/tests/userCredentials.test.js +285 -0
  622. package/core/tsconfig.json +32 -0
  623. package/core/types/vendor.d.ts +14 -0
  624. package/lib/index.cjs +358 -0
  625. package/lib/index.d.cts +182 -0
  626. package/lib/index.d.ts +182 -0
  627. package/lib/index.js +320 -0
  628. package/package.json +74 -0
  629. package/readme.md +3 -0
@@ -0,0 +1,1329 @@
1
+ import common from '../components/common.js'
2
+ import Config from '../components/Config.js';
3
+ import send from '../model/render/send.js';
4
+ import picmodle from '../model/render/picmodle.js'
5
+ import ScoreHistory from '../model/save/scoreHistory.js';
6
+ import fCompute from '../model/game/fCompute.js';
7
+ import getInfo from '../model/game/getInfo.js';
8
+ import { allLevel, LevelNum } from '../model/game/constNum.js';
9
+ import getNotes from '../model/user/getNotes.js';
10
+ import getPic from '../model/render/getPic.js';
11
+ import getBanGroup from '../model/user/getBanGroup.js';
12
+ import makeRequest from '../model/api/makeRequest.js';
13
+ import { buildGameRecordPayload } from '../model/api/gameRecordPayload.js';
14
+ import phiPluginBase from '../components/baseClass.js';
15
+ import logger from '../components/Logger.js';
16
+ import LevelRecordInfo from '../model/game/LevelRecordInfo.js';
17
+ import SongsInfo from '../model/game/SongsInfo.js';
18
+ import Version from '../components/Version.js';
19
+ import { canUseApi } from '../model/user/apiPermission.js';
20
+ import { UserCredentials } from '../model/user/userCredentials.js';
21
+ import {
22
+ buildRksHistogram,
23
+ getB30AnalysisRecords,
24
+ } from '../model/game/b30Analysis.js';
25
+
26
+ /**@import {botEvent} from '../components/baseClass.js' */
27
+
28
+ const ChallengeModeName = ['白', '绿', '蓝', '红', '金', '彩']
29
+
30
+ /**@type {levelKind[]} */
31
+ const Level = ['EZ', 'HD', 'IN', 'AT'] //存档的难度映射
32
+
33
+ export class phib19 extends phiPluginBase {
34
+ constructor() {
35
+ super({
36
+ name: 'phi-b19',
37
+ dsc: 'phiros b19查询',
38
+ event: 'message',
39
+ priority: 1000,
40
+ rule: [
41
+ {
42
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)((b|B)\\s*[0-9]+|rks|pgr|RKS|PGR).*$`,
43
+ fnc: 'b19'
44
+ },
45
+ {
46
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(p|x|fc|P|X|FC)\\s*[0-9]+.*$`,
47
+ fnc: 'p30'
48
+ },
49
+ {
50
+ reg: `^[#/杠刚钢纲](${Config.getUserCfg('config', 'cmdhead')})(\\s*)[a啊阿批屁劈]\\s*((b|B)[0-9]+|[比必币]([0-9]+|三零))$`,
51
+ fnc: 'arcgrosB19'
52
+ },
53
+ {
54
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)lmtacc.*$`,
55
+ fnc: 'lmtAcc'
56
+ },
57
+ {
58
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)best(\\s*)[1-9]?[0-9]?$`,
59
+ fnc: 'bestn'
60
+ },
61
+ {
62
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(score|单曲成绩)[1-2]?.*$`,
63
+ fnc: 'singlescore'
64
+ },
65
+ {
66
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(suggest|推分(建议)?).*$`,
67
+ fnc: 'suggest'
68
+ },
69
+ {
70
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)chap.*$`,
71
+ fnc: 'chap'
72
+ },
73
+ {
74
+ reg: `^[#/](${Config.getUserCfg('config', 'cmdhead')})(\\s*)(achievement|ahv).*$`,
75
+ fnc: 'achievement'
76
+ }
77
+ ]
78
+ })
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @param {botEvent} e
84
+ * @returns
85
+ */
86
+ async b19(e) {
87
+ const credentials = UserCredentials.fromEvent(e)
88
+
89
+ if (await getBanGroup.get(e, 'b19')) {
90
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
91
+ return false
92
+ }
93
+ let save;
94
+ let msg = e.msg
95
+
96
+ let askOtherId = msg.match(/-id\s+([0-9]+)/i)
97
+ msg = msg.replace(askOtherId?.[0] || '', '')
98
+
99
+ if (askOtherId && await canUseApi(e)) {
100
+ let otherId = /** @type {apiUserId} */ (askOtherId[1]);
101
+
102
+ try {
103
+ save = await credentials.getCloudSaveByApiId(otherId);
104
+ if (!save) throw new Error('API未返回存档')
105
+ } catch (err) {
106
+ send.send_with_At(e, `获取用户 ${otherId} 的存档失败!请确认该用户公开了存档且ID正确喵!\n错误信息:${err}`);
107
+ return true;
108
+ }
109
+ } else {
110
+ save = await send.getsave_result(e)
111
+ if (!save) {
112
+ return true
113
+ }
114
+
115
+ }
116
+
117
+ let err = save.checkNoInfo()
118
+
119
+ if (err.length) {
120
+ send.send_with_At(e, "以下曲目无信息,可能导致b19显示错误\n" + err.join('\n'))
121
+ }
122
+
123
+
124
+ let numMsg = e.msg.match(/^.*?(b|rks|pgr)[0-9]*/i)?.[0]
125
+
126
+ let nnum = Number(numMsg?.replace(/^.*?(b|rks|pgr)/i, '') ?? 33)
127
+ if (!nnum) {
128
+ nnum = 33
129
+ }
130
+
131
+ nnum = Math.max(nnum, 33)
132
+ nnum = Math.min(nnum, Config.getUserCfg('config', 'B19MaxNum'))
133
+
134
+ let bksong = msg.replace(/^.*?(b|rks|pgr)[0-9]*\s*/g, '')
135
+
136
+ if (bksong) {
137
+ let songId = getInfo.fuzzysongsnick(bksong)[0]
138
+ if (songId) {
139
+ // console.info(tem)
140
+ bksong = getInfo.getill(songId, 'blur')
141
+ } else {
142
+ bksong = ''
143
+ }
144
+ }
145
+
146
+ let plugin_data = await getNotes.getNotesData(e.user_id)
147
+
148
+ if (!Config.getUserCfg('config', 'isGuild')) {
149
+ send.reply(e, "正在生成图片,请稍等一下哦!\n//·/w\\·\\\\", false, { recallMsg: 5 })
150
+ }
151
+
152
+
153
+ let save_b19 = await save.getB19(e, nnum, { avgType: plugin_data.b30AvgKind, color: plugin_data.b30AvgColor })
154
+ let stats = await save.getStats()
155
+
156
+ let b30Analysis = null
157
+ if (plugin_data.showB30Analysis !== false && nnum == 33) {
158
+ const records = getB30AnalysisRecords(save_b19)
159
+ const histogram = buildRksHistogram(records)
160
+ const apiEnabled = await canUseApi(e, 'scoreStatistics')
161
+ let tagAnalysis = null
162
+ if (apiEnabled && records.length) {
163
+ tagAnalysis = askOtherId
164
+ ? await makeRequest.getB30TagAnalysis(
165
+ { api_user_id: /** @type {apiUserId} */ (askOtherId[1]) },
166
+ { event: e },
167
+ )
168
+ : await makeRequest.getB30TagAnalysis(
169
+ { gameRecord: buildGameRecordPayload(save.gameRecord) },
170
+ { event: e },
171
+ )
172
+ }
173
+ b30Analysis = {
174
+ histogram,
175
+ tagAnalysis,
176
+ showTags: apiEnabled,
177
+ histogramWide: !apiEnabled,
178
+ }
179
+ }
180
+
181
+ const spInfo = [];
182
+
183
+ /**
184
+ * 回复的消息
185
+ * @type {any[]}
186
+ */
187
+ const res = [];
188
+
189
+ const saveVer = save.saveInfo.summary.gameVersion
190
+ if (saveVer &&
191
+ !isNaN(saveVer) &&
192
+ saveVer != Number(Version.phigrosVerNum)) {
193
+ if (saveVer < Number(Version.phigrosVerNum)) {
194
+ spInfo.push(`${getInfo.versionInfoByCode[`${saveVer}`]?.version_label || saveVer} Update to ${Version.phigros}`)
195
+ spInfo.push(`Real RKS: ${save_b19.com_rks.toFixed(4)}`)
196
+ if (Math.abs(save_b19.com_rks - save.saveInfo.summary.rankingScore) > 1e-4) {
197
+ res.push(`请注意,当前版本可能更改了定数\n计算rks: ${save_b19.com_rks}\n存档rks: ${save.saveInfo.summary.rankingScore}`)
198
+ }
199
+ } else {
200
+ spInfo.push(`${getInfo.versionInfoByCode[`${saveVer}`]?.version_label || saveVer} later than ${Version.phigros}`)
201
+
202
+ if (Math.abs(save_b19.com_rks - save.saveInfo.summary.rankingScore) > 1e-4) {
203
+ res.push(`请注意,您的版本可能更改了定数或计算规则\n计算rks: ${save_b19.com_rks}\n存档rks: ${save.saveInfo.summary.rankingScore}`)
204
+ }
205
+ }
206
+
207
+ } else {
208
+ if (Math.abs(save_b19.com_rks - save.saveInfo.summary.rankingScore) > 1e-4) {
209
+ res.push(`请注意,您的版本可能更改了定数或计算规则\n计算rks: ${save_b19.com_rks}\n存档rks: ${save.saveInfo.summary.rankingScore}`)
210
+ }
211
+ }
212
+
213
+
214
+ // let dan = await get.getDan(e.user_id)
215
+ let money = save.gameProgress?.money || [0, 0, 0, 0, 0]
216
+ let gameuser = {
217
+ avatar: getInfo.idgetavatar(save.gameuser.avatar),
218
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
219
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
220
+ rks: save.saveInfo.summary.rankingScore,
221
+ data: `${money[4] ? `${money[4]}PiB ` : ''}${money[3] ? `${money[3]}TiB ` : ''}${money[2] ? `${money[2]}GiB ` : ''}${money[1] ? `${money[1]}MiB ` : ''}${money[0] ? `${money[0]}KiB ` : ''}`,
222
+ selfIntro: save.gameuser.selfIntro,
223
+ backgroundUrl: await fCompute.getBackground(save.gameuser.background),
224
+ PlayerId: fCompute.convertRichText(save.saveInfo.PlayerId),
225
+ // dan: dan,
226
+ }
227
+ // console.info(save_b19.b19_list)
228
+ let data = {
229
+ BSIllPath: getInfo.getill(/**@type {idString} */('BANGINGSTRIKE.DewPleiades.0'), 'common'),
230
+ phi: save_b19.phi,
231
+ b19_list: save_b19.b19_list,
232
+ PlayerId: gameuser.PlayerId,
233
+ Rks: Number(save.saveInfo.summary.rankingScore).toFixed(4),
234
+ Date: fCompute.formatDate(save.saveInfo.summary.updatedAt),
235
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
236
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
237
+ // dan: await get.getDan(e.user_id),
238
+ background: bksong || getInfo.getill(getInfo.illlist[Number((Math.random() * (getInfo.illlist.length - 1)).toFixed(0))], 'blur'),
239
+ theme: plugin_data?.theme || 'star',
240
+ gameuser,
241
+ nnum,
242
+ stats,
243
+ spInfo,
244
+ b30Analysis,
245
+ }
246
+ const img = await picmodle.b19(e, data)
247
+ res.unshift(img);
248
+ send.send_with_At(e, res)
249
+ }
250
+
251
+ /**
252
+ *
253
+ * @param {botEvent} e
254
+ * @returns
255
+ */
256
+ async p30(e) {
257
+
258
+ if (await getBanGroup.get(e, 'p30')) {
259
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
260
+ return false
261
+ }
262
+
263
+ let save = await send.getsave_result(e)
264
+ if (!save) {
265
+ return true
266
+ }
267
+
268
+ let err = save.checkNoInfo()
269
+
270
+ if (err.length) {
271
+ send.send_with_At(e, "以下曲目无信息,可能导致b19显示错误\n" + err.join('\n'))
272
+ }
273
+
274
+
275
+ let match = e.msg.match(/^.*?(p|x|fc)\s*([0-9]+)/i)
276
+ let nnum = Number(match?.[2] || 33)
277
+ if (!nnum) {
278
+ nnum = 33
279
+ }
280
+
281
+ nnum = Math.max(nnum, 33)
282
+ nnum = Math.min(nnum, Config.getUserCfg('config', 'B19MaxNum'))
283
+
284
+ let bksong = e.msg.replace(/^.*?(p|x|fc)\s*[0-9]+\s*/i, '')
285
+
286
+ if (bksong) {
287
+ let songId = getInfo.fuzzysongsnick(bksong)[0]
288
+ if (songId) {
289
+ // console.info(tem)
290
+ bksong = getInfo.getill(songId, 'blur')
291
+ } else {
292
+ bksong = ''
293
+ }
294
+ }
295
+
296
+ let plugin_data = await getNotes.getNotesData(e.user_id)
297
+
298
+
299
+ if (!Config.getUserCfg('config', 'isGuild'))
300
+ send.reply(e, "正在生成图片,请稍等一下哦!\n//·/w\\·\\\\", false, { recallMsg: 5 })
301
+
302
+ let save_b19;
303
+ let spInfo = [];
304
+
305
+ const type = e.msg.match(/^.*?(p|x|fc)\s*([0-9]+)/i)?.[1].toLowerCase();
306
+ switch (type) {
307
+ case 'p': {
308
+ save_b19 = await save.getBestWithLimit(nnum, [{ type: 'acc', value: [100, 100] }])
309
+ spInfo.push("All Perfect Mode");
310
+ break;
311
+ }
312
+ case 'fc': {
313
+ save_b19 = await save.getBestWithLimit(nnum, [{ type: 'custom', value: (record) => ((record.fc === true) && (record.score != 1e6)) }], false)
314
+ spInfo.push("Full Combo Mode");
315
+ break;
316
+ }
317
+ case 'x': {
318
+ save_b19 = await save.getBestWithLimit(nnum, [{
319
+ type: 'custom',
320
+ value: (record) => {
321
+ return fCompute.comJust1Good(record.score, getInfo.ori_info[record.id]?.chart?.[record.rank]?.combo || 1e9)
322
+ }
323
+ }], false)
324
+ spInfo.push("1 Good Mode");
325
+ break;
326
+ }
327
+ default: {
328
+ save_b19 = await save.getBestWithLimit(nnum, [{ type: 'acc', value: [100, 100] }])
329
+ spInfo.push("All Perfect Mode");
330
+ }
331
+ }
332
+
333
+ let stats = await save.getStats()
334
+
335
+
336
+ // let dan = await get.getDan(e.user_id)
337
+ let money = save.gameProgress.money
338
+ let gameuser = {
339
+ avatar: getInfo.idgetavatar(save.gameuser.avatar),
340
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
341
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
342
+ rks: save_b19.com_rks,
343
+ data: `${money[4] ? `${money[4]}PiB ` : ''}${money[3] ? `${money[3]}TiB ` : ''}${money[2] ? `${money[2]}GiB ` : ''}${money[1] ? `${money[1]}MiB ` : ''}${money[0] ? `${money[0]}KiB ` : ''}`,
344
+ selfIntro: save.gameuser.selfIntro,
345
+ backgroundUrl: await fCompute.getBackground(save.gameuser.background),
346
+ PlayerId: fCompute.convertRichText(save.saveInfo.PlayerId),
347
+ // dan: dan,
348
+ }
349
+
350
+ let data = {
351
+ phi: save_b19.phi,
352
+ b19_list: save_b19.b19_list,
353
+ PlayerId: gameuser.PlayerId,
354
+ Rks: save_b19.com_rks.toFixed(4),
355
+ Date: save.saveInfo.summary.updatedAt,
356
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
357
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
358
+ // dan: await get.getDan(e.user_id),
359
+ background: bksong || getInfo.getill(getInfo.illlist[Number((Math.random() * (getInfo.illlist.length - 1)).toFixed(0))], 'blur'),
360
+ theme: plugin_data?.theme || 'star',
361
+ gameuser,
362
+ nnum,
363
+ stats,
364
+ spInfo,
365
+ }
366
+
367
+ let res = [await picmodle.b19(e, data)]
368
+ res.push(`计算rks: ${save_b19.com_rks}\n存档rks: ${save.saveInfo.summary.rankingScore}`)
369
+ send.send_with_At(e, res)
370
+ }
371
+
372
+ /**
373
+ * arc版查分图
374
+ * @param {botEvent} e
375
+ * @returns
376
+ */
377
+ async arcgrosB19(e) {
378
+
379
+ if (await getBanGroup.get(e, 'arcgrosB19')) {
380
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
381
+ return false
382
+ }
383
+
384
+ let save = await send.getsave_result(e)
385
+ if (!save) {
386
+ return true
387
+ }
388
+
389
+
390
+ let err = save.checkNoInfo()
391
+
392
+ if (err.length) {
393
+ send.send_with_At(e, "以下曲目无信息,可能导致b19显示错误\n" + err.join('\n'))
394
+ }
395
+
396
+
397
+ let numMsg = e.msg.match(/(b|B)[0-9]*/g)
398
+ let nnum = numMsg ? Number(numMsg[0].replace(/(b|B)/g, '')) - 1 : 32
399
+ if (!nnum) { nnum = 32 }
400
+
401
+ nnum = Math.max(nnum, 30)
402
+ nnum = Math.min(nnum, Config.getUserCfg('config', 'B19MaxNum'))
403
+
404
+ let save_b19 = await save.getB19(e, nnum)
405
+
406
+ let money = save.gameProgress.money
407
+ let gameuser = {
408
+ avatar: getInfo.idgetavatar(save.gameuser.avatar),
409
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
410
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
411
+ rks: save.saveInfo.summary.rankingScore,
412
+ data: `${money[4] ? `${money[4]}PiB ` : ''}${money[3] ? `${money[3]}TiB ` : ''}${money[2] ? `${money[2]}GiB ` : ''}${money[1] ? `${money[1]}MiB ` : ''}${money[0] ? `${money[0]}KiB ` : ''}`,
413
+ selfIntro: save.gameuser.selfIntro,
414
+ backgroundUrl: await fCompute.getBackground(save.gameuser.background),
415
+ PlayerId: save.saveInfo.PlayerId,
416
+ }
417
+
418
+ let plugin_data = await getNotes.getNotesData(e.user_id)
419
+
420
+ let data = {
421
+ phi: save_b19.phi,
422
+ b19_list: save_b19.b19_list,
423
+ gameuser,
424
+ PlayerId: fCompute.convertRichText(save.saveInfo.PlayerId),
425
+ Rks: Number(save.saveInfo.summary.rankingScore).toFixed(4),
426
+ Date: save.saveInfo.summary.updatedAt,
427
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
428
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
429
+ // dan: await get.getDan(e.user_id),
430
+ background: getInfo.getill(getInfo.illlist[Number((Math.random() * (getInfo.illlist.length - 1)).toFixed(0))], 'blur'),
431
+ theme: plugin_data?.theme || 'star',
432
+ nnum: nnum,
433
+ }
434
+
435
+ send.send_with_At(e, await picmodle.arcgros_b19(e, data))
436
+ }
437
+
438
+ /**
439
+ * 限制最低acc后的rks
440
+ * @param {botEvent} e
441
+ * @returns
442
+ */
443
+ async lmtAcc(e) {
444
+ if (await getBanGroup.get(e, 'lmtAcc')) {
445
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
446
+ return false
447
+ }
448
+
449
+ let save = await send.getsave_result(e)
450
+ if (!save) {
451
+ return false
452
+ }
453
+
454
+ let err = save.checkNoInfo()
455
+
456
+ if (err.length) {
457
+ send.send_with_At(e, "以下曲目无信息,可能导致b19显示错误\n" + err.join('\n'))
458
+ }
459
+
460
+
461
+ let acc = Number(e.msg.replace(/^.*lmtacc\s*/g, ''))
462
+
463
+ if (!acc || acc < 0 || acc > 100) {
464
+ send.send_with_At(e, `我听不懂 ${e.msg.replace(/^.*lmtacc\s*/g, '')} 是多少喵!请指定一个0-100的数字喵!\n格式:/${Config.getUserCfg('config', 'cmdhead')} lmtAcc <0-100>`)
465
+ return false
466
+ }
467
+
468
+
469
+ let nnum = 33
470
+
471
+ let plugin_data = await getNotes.getNotesData(e.user_id)
472
+
473
+
474
+ if (!Config.getUserCfg('config', 'isGuild'))
475
+ send.reply(e, "正在生成图片,请稍等一下哦!\n//·/w\\·\\\\", false, { recallMsg: 5 })
476
+
477
+ let save_b19 = await save.getBestWithLimit(nnum, [{ type: 'acc', value: [acc, 100] }])
478
+ let stats = await save.getStats()
479
+
480
+
481
+ // let dan = await get.getDan(e.user_id)
482
+ let money = save.gameProgress.money
483
+ let gameuser = {
484
+ avatar: getInfo.idgetavatar(save.gameuser.avatar),
485
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
486
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
487
+ rks: save_b19.com_rks,
488
+ data: `${money[4] ? `${money[4]}PiB ` : ''}${money[3] ? `${money[3]}TiB ` : ''}${money[2] ? `${money[2]}GiB ` : ''}${money[1] ? `${money[1]}MiB ` : ''}${money[0] ? `${money[0]}KiB ` : ''}`,
489
+ selfIntro: save.gameuser.selfIntro,
490
+ backgroundUrl: await fCompute.getBackground(save.gameuser.background),
491
+ PlayerId: fCompute.convertRichText(save.saveInfo.PlayerId),
492
+ // dan: dan,
493
+ }
494
+
495
+ let data = {
496
+ phi: save_b19.phi,
497
+ b19_list: save_b19.b19_list,
498
+ PlayerId: gameuser.PlayerId,
499
+ Rks: save_b19.com_rks.toFixed(4),
500
+ Date: save.saveInfo.summary.updatedAt,
501
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
502
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
503
+ // dan: await get.getDan(e.user_id),
504
+ background: getInfo.getill(getInfo.illlist[Number((Math.random() * (getInfo.illlist.length - 1)).toFixed(0))], 'blur'),
505
+ theme: plugin_data?.theme || 'star',
506
+ gameuser,
507
+ nnum,
508
+ stats,
509
+ spInfo: [`ACC is limited to ${acc}%`],
510
+ }
511
+
512
+ let res = [await picmodle.b19(e, data)]
513
+ res.push(`计算rks: ${save_b19.com_rks}\n存档rks: ${save.saveInfo.summary.rankingScore}`)
514
+ send.send_with_At(e, res)
515
+
516
+ }
517
+
518
+ /**
519
+ * 获取bestn文字版
520
+ * @param {botEvent} e
521
+ * @returns
522
+ */
523
+ async bestn(e) {
524
+
525
+ if (await getBanGroup.get(e, 'bestn')) {
526
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
527
+ }
528
+
529
+ const save = await send.getsave_result(e)
530
+
531
+ if (!save) {
532
+ return true
533
+ }
534
+
535
+ let numMsg = e.msg.replace(/[#/](.*?)(best)(\s*)/g, '')
536
+
537
+ if (Number(numMsg) % 1 != 0) {
538
+ await send.reply(e, `${numMsg}不是个数字吧!`, true)
539
+ return true
540
+ }
541
+
542
+ let num = Number(numMsg)
543
+
544
+ if (!num)
545
+ num = 19 //未指定默认b19
546
+
547
+ const { b19_list, phi } = await save.getB19(e, num)
548
+
549
+
550
+ let Remsg = []
551
+ let tmsg = ''
552
+ tmsg += `PlayerId: ${save.saveInfo.PlayerId} Rks: ${Number(save.saveInfo.summary.rankingScore).toFixed(4)} ChallengeMode: ${ChallengeModeName[(save.saveInfo.summary.challengeModeRank - (save.saveInfo.summary.challengeModeRank % 100)) / 100]}${save.saveInfo.summary.challengeModeRank % 100} Date: ${save.saveInfo.updatedAt}`
553
+ phi.forEach((item, index) => {
554
+ if (item?.song) {
555
+ tmsg += `\n#φ:${item.song}<${item.rank}>${item.difficulty}`
556
+ } else {
557
+ tmsg += "\n你还没有满分的曲目哦!收掉一首歌可以让你的RKS大幅度增加的!"
558
+ }
559
+ })
560
+ /**防止消息过长发送失败每条消息10行 */
561
+ let tot = 1
562
+ for (let i = 0; i < num && i < b19_list.length; ++i) {
563
+ if (tot <= 10) {
564
+ tmsg += `\n#B${i + 1}:${b19_list[i].song}<${b19_list[i].rank}>${b19_list[i].difficulty} ${b19_list[i].score} ${b19_list[i].Rating} ${b19_list[i].acc.toFixed(4)}%[${b19_list[i].rks.toFixed(4)}]->:${b19_list[i].suggest}`
565
+ } else {
566
+ Remsg.push(tmsg)
567
+ tmsg = `#B${i + 1}:${b19_list[i].song}<${b19_list[i].rank}>${b19_list[i].difficulty} ${b19_list[i].score} ${b19_list[i].Rating} ${b19_list[i].acc.toFixed(4)}%[${b19_list[i].rks.toFixed(4)}]->:${b19_list[i].suggest}`
568
+ tot = 0
569
+ }
570
+ ++tot
571
+ }
572
+
573
+ Remsg.push(tmsg)
574
+
575
+ if (e.isGroup) {
576
+ /**群聊只发送10条 */
577
+ send.send_with_At(e, Remsg[0])
578
+ send.send_with_At(e, `消息过长,自动转为私聊发送喵~`)
579
+ send.pick_send(e, await common.makeForwardMsg(e, Remsg, undefined))
580
+ } else {
581
+ send.reply(e, await common.makeForwardMsg(e, Remsg, undefined))
582
+ }
583
+ }
584
+
585
+
586
+ /**
587
+ * @param {botEvent} e
588
+ * @returns
589
+ */
590
+ async singlescore(e) {
591
+
592
+ if (await getBanGroup.get(e, 'singlescore')) {
593
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
594
+ return false
595
+ }
596
+
597
+ let song = e.msg.replace(/[#/](.*?)(score|单曲成绩)[1-2]?(\s*)/g, '')
598
+
599
+ let difArgs = song.match(/-dif\s+(EZ|HD|IN|AT)/i)?.[0];
600
+ if (difArgs) {
601
+ song = song.replace(difArgs, '');
602
+ difArgs = difArgs.replace(/-dif\s+/i, '').toUpperCase();
603
+ }
604
+ let unRankArgsMsg = song.match(/-unrank/i)?.[0];
605
+ let unRankArgs;
606
+ if (unRankArgsMsg) {
607
+ song = song.replace(unRankArgsMsg, '');
608
+ unRankArgs = true;
609
+ } else {
610
+ unRankArgs = false;
611
+ }
612
+ let orderByArgs = song.match(/-or\s+(acc|score|fc|time)/i)?.[0];
613
+ if (orderByArgs) {
614
+ song = song.replace(orderByArgs, '');
615
+ orderByArgs = orderByArgs.replace(/-or\s+/i, '').toLowerCase();
616
+ orderByArgs = orderByArgs.replace('time', 'update_at');
617
+ } else {
618
+ orderByArgs = 'acc';
619
+ }
620
+
621
+ if (!song) {
622
+ send.send_with_At(e, `请指定曲名哦!\n格式:/${Config.getUserCfg('config', 'cmdhead')} score <曲名>`)
623
+ return true
624
+ }
625
+ const songIds = getInfo.fuzzysongsnick(song)
626
+ if (!songIds[0]) {
627
+ send.send_with_At(e, `未找到 ${song} 的有关信息哦!`)
628
+ return true
629
+ }
630
+ if (songIds.length > 1) {
631
+ const options = {
632
+ dif: difArgs,
633
+ unRank: unRankArgs,
634
+ orderBy: orderByArgs
635
+ }
636
+ this.choseMutiNick(e, songIds, options, (e, songId, options) => { getScore(songId, e, options); })
637
+ } else {
638
+ await getScore(songIds[0], e, {
639
+ dif: difArgs,
640
+ unRank: unRankArgs,
641
+ orderBy: orderByArgs
642
+ })
643
+ }
644
+ return true
645
+ }
646
+
647
+ /**
648
+ * 推分建议,建议的是RKS+0.01的所需值
649
+ * @param {botEvent} e
650
+ * @returns
651
+ */
652
+ async suggest(e) {
653
+
654
+ if (await getBanGroup.get(e, 'suggest')) {
655
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
656
+ return false
657
+ }
658
+
659
+ const save = await send.getsave_result(e)
660
+
661
+ if (!save) {
662
+ return true
663
+ }
664
+
665
+ /**处理范围要求 */
666
+ let { range, isask, scoreAsk } = fCompute.match_request(e.msg)
667
+
668
+ /**取出信息 */
669
+ let Record = save.gameRecord
670
+
671
+ /**计算 */
672
+
673
+
674
+ let rks = save.saveInfo.summary.rankingScore
675
+ let gameRecord = save.gameRecord
676
+ for (let id of fCompute.objectKeys(gameRecord)) {
677
+ gameRecord[id] = gameRecord[id]
678
+ }
679
+
680
+ let info = getInfo.ori_info
681
+
682
+ const { com_rks, phi } = await save.getB19(e, 1000, { avgType: "none" });
683
+
684
+ /**@type {Record<idString, Record<levelKind, number>>} */
685
+ const allTaskList = {};
686
+ /**
687
+ * @type {{ id: idString; level: levelKind; apCount: number; total: number; illustration: string }[]}
688
+ */
689
+ const phiTaskList = [];
690
+
691
+ if (await canUseApi(e, 'scoreStatistics')) {
692
+
693
+ const res = await makeRequest.getAllSongAccAvgB30({
694
+ songIds: getInfo.idList,
695
+ minRks: Math.floor((com_rks - 0.05) / 0.05) * 0.05,
696
+ maxRks: Math.floor((com_rks + 0.05) / 0.05) * 0.05
697
+ }, { event: e })
698
+ if (res) {
699
+ const ids = fCompute.objectKeys(res)
700
+ ids.forEach(id => {
701
+ if (!info[id]) {
702
+ return;
703
+ }
704
+ if (!allTaskList[id]) {
705
+ allTaskList[id] = /** @type {Record<levelKind, number>} */ ({});
706
+ }
707
+ Level.forEach(lv => {
708
+ if (!info[id]?.chart?.[lv]) {
709
+ return;
710
+ }
711
+ const avg = res[id][lv].accAvg || 0;
712
+ if (avg > (save.gameRecord?.[id]?.[LevelNum[lv]]?.acc || 0)) {
713
+ allTaskList[id][lv] = avg;
714
+ }
715
+ })
716
+ })
717
+ }
718
+ const apfcRes = await makeRequest.getSongsApFcCount({
719
+ songId: getInfo.idList || [],
720
+ rank: Level,
721
+ rksRange: {
722
+ min: Math.floor((com_rks - 0.05) / 0.05) * 0.05,
723
+ max: Math.floor((com_rks + 0.05) / 0.05) * 0.05
724
+ }
725
+ }, { event: e })
726
+ if (apfcRes) {
727
+ const ids = fCompute.objectKeys(apfcRes);
728
+ ids.forEach(id => {
729
+ if (!info[id]) {
730
+ return;
731
+ }
732
+ Level.forEach(lv => {
733
+ if (!info[id]?.chart?.[lv]) {
734
+ return;
735
+ }
736
+ const songInfo = info[id];
737
+ const diff = info[id].chart[lv].difficulty;
738
+ if (!(phi.length < 3 || diff > (phi[2]?.difficulty || 0))) {
739
+ return;
740
+ }
741
+ if ((save.gameRecord?.[id]?.[LevelNum[lv]]?.score || 0) >= 1e6) {
742
+ return;
743
+ }
744
+ if (apfcRes[id][lv].apCount > 0) {
745
+ phiTaskList.push({
746
+ id,
747
+ level: lv,
748
+ total: apfcRes[id][lv].total || 0,
749
+ // diff: diff,
750
+ apCount: apfcRes[id][lv].apCount || 0,
751
+ ...songInfo,
752
+ illustration: getInfo.getill(id, 'low') ?? '',
753
+ });
754
+ }
755
+ })
756
+ })
757
+ }
758
+ }
759
+
760
+
761
+
762
+ /**
763
+ * @type {({ suggest: number, avg: number } & { illustration: string, difficulty: number, rank: levelKind } & SongsInfo)[][]}
764
+ */
765
+ let data = [[], [], [], [], [], []]
766
+
767
+
768
+
769
+ for (const id of fCompute.objectKeys(Record)) {
770
+ const songInfo = getInfo.info(id);
771
+ if (!songInfo) {
772
+ logger.warn('[phi-plugin]', id, '曲目无信息')
773
+ continue
774
+ }
775
+ /**
776
+ * @type {(((LevelRecordInfo | {}) & { suggest?: number }) | null)[]}
777
+ */
778
+ let record = Record[id]
779
+ for (let lv of [0, 1, 2, 3]) {
780
+ if (!songInfo.chart[Level[lv]]) continue
781
+ let difficulty = songInfo.chart[Level[lv]]?.difficulty
782
+ if (!difficulty) continue
783
+ if (range[0] <= difficulty && difficulty <= range[1] && isask[lv]) {
784
+ if ((!record[lv] && !scoreAsk.NEW)) continue
785
+ if (!record[lv]) {
786
+ record[lv] = { suggest: -1 };
787
+ } else {
788
+ if ('id' in record[lv] && !scoreAsk[record[lv].Rating == 'phi' ? 'PHI' : record[lv].Rating]) continue
789
+ }
790
+ const x = record[lv]
791
+ x.suggest = save.getSuggest(id, lv, undefined, difficulty)
792
+ if (x.suggest == -1) {
793
+ continue
794
+ }
795
+ data[suggestType(x.suggest)].push({
796
+ ...songInfo,
797
+ difficulty: difficulty,
798
+ ...x,
799
+ rank: Level[lv],
800
+ illustration: getInfo.getill(id, 'low') ?? '',
801
+ suggest: x.suggest,
802
+ avg: allTaskList[id]?.[Level[lv]] || 0,
803
+ })
804
+ }
805
+ }
806
+ }
807
+
808
+ if (data.length > Config.getUserCfg('config', 'listScoreMaxNum')) {
809
+ send.send_with_At(e, `谱面数量过多(${data.length})大于设置的最大值(${Config.getUserCfg('config', 'listScoreMaxNum')}),只显示前${Config.getUserCfg('config', 'listScoreMaxNum')}条!`)
810
+ }
811
+
812
+ data.splice(Config.getUserCfg('config', 'listScoreMaxNum'))
813
+
814
+ for (let i = 0; i < data.length; ++i) {
815
+ data[i] = data[i].sort(cmpsugg()).slice(0, 3);
816
+ }
817
+
818
+ const phidata = phiTaskList.sort((a, b) => {
819
+ return b.apCount - a.apCount
820
+ }).slice(0, 3);
821
+
822
+ let plugin_data = await getNotes.getNotesData(e.user_id)
823
+
824
+ send.send_with_At(e, await picmodle.common(e, 'suggest', {
825
+ head_title: "推分建议",
826
+ song: data,
827
+ phisong: phidata,
828
+ background: getInfo.getill(getInfo.illlist[fCompute.randInt(0, getInfo.illlist.length - 1)]),
829
+ theme: plugin_data?.theme || 'star',
830
+ PlayerId: save.saveInfo.PlayerId,
831
+ Rks: Number(save.saveInfo.summary.rankingScore).toFixed(4),
832
+ Date: save.saveInfo.summary.updatedAt,
833
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
834
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
835
+ // dan: await get.getDan(e.user_id)
836
+ }))
837
+
838
+ }
839
+
840
+ /**
841
+ * 查询章节成绩
842
+ * @param {botEvent} e
843
+ * @returns
844
+ */
845
+ async chap(e) {
846
+
847
+ if (await getBanGroup.get(e, 'chap')) {
848
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
849
+ return false
850
+ }
851
+ let msg = e.msg.replace(/^[#/].*chap\s*/, '').toUpperCase()
852
+ if (msg == 'HELP' || !msg) {
853
+ send.send_with_At(e, getPic.getimg('chapHelp'))
854
+ return true
855
+ }
856
+
857
+ let save = await send.getsave_result(e)
858
+ if (!save) {
859
+ return false
860
+ }
861
+
862
+ let chap = fCompute.fuzzySearch(msg, getInfo.chapNick)[0]?.value
863
+
864
+ if (!chap && msg != 'ALL') {
865
+ send.send_with_At(e, `未找到${msg}章节QAQ!可以使用 /${Config.getUserCfg('config', 'cmdhead')} chap help 来查询支持的名称嗷!`)
866
+ return false
867
+ }
868
+
869
+ /**
870
+ * @type {Record<string, { illustration: string, chart: Partial<Record<levelKind, Partial<{ difficulty: number, Rating: string, score?: number, acc?: string, rks?: string, fc?: boolean, suggest: string }>>> }>}
871
+ */
872
+ let song_box = {}
873
+
874
+ /**统计各评分出现次数 */
875
+ let count = {
876
+ tot: 0,
877
+ phi: 0,
878
+ FC: 0,
879
+ V: 0,
880
+ S: 0,
881
+ A: 0,
882
+ B: 0,
883
+ C: 0,
884
+ F: 0,
885
+ NEW: 0
886
+ }
887
+
888
+ /**统计各难度出现次数 */
889
+ let rank = {
890
+ EZ: 0,
891
+ HD: 0,
892
+ IN: 0,
893
+ AT: 0
894
+ }
895
+
896
+ /**统计各难度ACC和 */
897
+ let rankAcc = {
898
+ EZ: 0,
899
+ HD: 0,
900
+ IN: 0,
901
+ AT: 0
902
+ }
903
+
904
+ const ids = fCompute.objectKeys(getInfo.ori_info)
905
+
906
+ for (const id of ids) {
907
+ if (getInfo.ori_info[id]?.chapter == chap || msg == 'ALL') {
908
+ song_box[id] = { illustration: getInfo.getill(id, 'low'), chart: {} }
909
+ /**曲目成绩对象 */
910
+ let songRecord = save.getSongsRecord(id)
911
+ let info = getInfo.info(id, true)
912
+ if (!info) continue;
913
+ getInfo.allLevel?.forEach((level, i) => {
914
+ /**SP */
915
+ if (i === undefined) return
916
+ /**跳过旧谱 */
917
+ if (level == 'LEGACY') return
918
+ if (!info.chart[level]) return
919
+ if (!info.chart[level].difficulty) return
920
+ let Record = songRecord?.[i]
921
+ song_box[id].chart[level] = {
922
+ difficulty: info.chart[level].difficulty,
923
+ Rating: Record?.Rating || 'NEW',
924
+ suggest: save.getSuggest(id, i, 4, info.chart[level].difficulty)
925
+ }
926
+ if (Record) {
927
+ song_box[id].chart[level].score = Record.score
928
+ song_box[id].chart[level].acc = Record.acc.toFixed(4)
929
+ song_box[id].chart[level].rks = Record.rks.toFixed(4)
930
+ song_box[id].chart[level].fc = Record.fc
931
+ }
932
+ ++count.tot
933
+ if (Record?.Rating) {
934
+ ++count[Record.Rating]
935
+ rankAcc[level] += Number(Record.acc || 0)
936
+ } else {
937
+ ++count.NEW
938
+ }
939
+ ++rank[level]
940
+ })
941
+ }
942
+ }
943
+
944
+ /**
945
+ * @type {Partial<Record<levelKind, number>>}
946
+ */
947
+ let progress = {}
948
+
949
+
950
+
951
+ for (let level of Level) {
952
+ if (rank[level]) {
953
+ progress[level] = rankAcc[level] / rank[level]
954
+ }
955
+ }
956
+
957
+ send.send_with_At(e, await picmodle.chap(e, {
958
+ player: { id: save.saveInfo.PlayerId },
959
+ count,
960
+ song_box,
961
+ progress,
962
+ num: rank.EZ,
963
+ chapName: msg == 'ALL' ? 'AllSong' : chap,
964
+ chapIll: getInfo.getChapIll(msg == 'ALL' ? 'AllSong' : chap),
965
+ }))
966
+
967
+ }
968
+
969
+ /**
970
+ *
971
+ * @param {botEvent} e
972
+ */
973
+ async achievement(e) {
974
+ if (await getBanGroup.get(e, 'achievement')) {
975
+ send.send_with_At(e, '这里被管理员禁止使用这个功能了呐QAQ!')
976
+ return false
977
+ }
978
+
979
+ let save = await send.getsave_result(e)
980
+ if (!save) {
981
+ return false
982
+ }
983
+
984
+ let dif = Number(e.msg.match(/[0-9]+/)?.[0])
985
+
986
+ if (!dif) {
987
+ send.send_with_At(e, `请输入定数嗷!\n/格式:${Config.getUserCfg('config', 'cmdhead')} table <定数>`, true)
988
+ return false
989
+ }
990
+
991
+ if (dif > getInfo.MAX_DIFFICULTY) {
992
+ send.send_with_At(e, `定数已经超过最高的定数${getInfo.MAX_DIFFICULTY}了QAQ!`)
993
+ return false
994
+ }
995
+
996
+ if (dif < 1) {
997
+ send.send_with_At(e, `定数不能小于 1 QAQ!`)
998
+ return false
999
+ }
1000
+
1001
+ let matchVersion = e.msg.match(/-v\s*(\S+)/i)?.[1];
1002
+ let matchVerCode = 0;
1003
+ if (matchVersion) {
1004
+ if (matchVersion.includes('.')) {
1005
+ if (!getInfo.versionInfoByLabel[matchVersion]) {
1006
+ send.send_with_At(e, `未找到版本 ${matchVersion} 的相关信息QAQ!`)
1007
+ return true
1008
+ }
1009
+ matchVerCode = getInfo.versionInfoByLabel[matchVersion].version_code
1010
+ } else {
1011
+ let verCodeNum = Number(matchVersion)
1012
+ if (!getInfo.versionInfoByCode[verCodeNum]) {
1013
+ send.send_with_At(e, `未找到版本 ${matchVersion} 的相关信息QAQ!`)
1014
+ return true
1015
+ }
1016
+ matchVerCode = verCodeNum
1017
+ }
1018
+ } else {
1019
+ matchVerCode = Version.phigrosVerNum
1020
+ }
1021
+
1022
+ const versionInfo = getInfo.versionInfoByCode[matchVerCode]
1023
+ if (!versionInfo) {
1024
+ console.error(`[phi-plugin] 版本信息获取失败,versionCode: ${matchVerCode}`);
1025
+ send.send_with_At(e, `发生未知错误QAQ!请回报管理员!`)
1026
+ return true
1027
+ }
1028
+
1029
+ let pluginData = await getNotes.getNotesData(e.user_id)
1030
+ const data = {
1031
+ title: {
1032
+ difficulty: dif,
1033
+ total: 0,
1034
+ version: versionInfo.version_label,
1035
+ dec: "Player Achievements"
1036
+ },
1037
+ /**@type {{difficulty: string, songs: {rank: string, illustration: string}[], rating: ratingKind}[]} */
1038
+ table: [],
1039
+ background: getInfo.getill(getInfo.illlist[Math.floor((Math.random() * (getInfo.illlist.length - 1)))], 'blur'),
1040
+ theme: pluginData?.theme || 'star',
1041
+ gameuser: save.getPlayerInfo(),
1042
+ }
1043
+
1044
+ const info_by_difficulty = getInfo.historyDifficultyByVerDifficulty[versionInfo.version_code];
1045
+ for (let i = 0; i < 10; ++i) {
1046
+ const difStr = Math.round((dif + i * 0.1) * 10) / 10;
1047
+ if (!info_by_difficulty[difStr.toFixed(1)]) continue;
1048
+ data.title.total += info_by_difficulty[difStr.toFixed(1)].length;
1049
+ let minScore = Infinity;
1050
+ let fcFlag = true;
1051
+ data.table.push({
1052
+ difficulty: difStr.toFixed(1),
1053
+ songs: info_by_difficulty[difStr.toFixed(1)]?.map(chart => {
1054
+ const playerRecord = save.getScore(chart.id, chart.rank);
1055
+ minScore = Math.min(minScore, playerRecord?.score || 0);
1056
+ if (!playerRecord?.fc) {
1057
+ fcFlag = false;
1058
+ }
1059
+ return ({
1060
+ rank: chart.rank,
1061
+ illustration: getInfo.getill(chart.id, 'low'),
1062
+ score: playerRecord?.acc || 0,
1063
+ })
1064
+ }) || [],
1065
+ rating: fCompute.rate(minScore, fcFlag)
1066
+ })
1067
+
1068
+ }
1069
+
1070
+ send.send_with_At(e, await picmodle.common(e, 'table', data));
1071
+ }
1072
+ }
1073
+
1074
+ /**
1075
+ *
1076
+ * @param {idString} songId
1077
+ * @param {botEvent} e
1078
+ * @param {any} args
1079
+ * @returns
1080
+ */
1081
+ async function getScore(songId, e, args = {}) {
1082
+
1083
+ const credentials = UserCredentials.fromEvent(e)
1084
+
1085
+ const save = await send.getsave_result(e)
1086
+
1087
+ if (!save) {
1088
+ return true
1089
+ }
1090
+
1091
+ const info = getInfo.info(songId, true)
1092
+ if (!info) {
1093
+ send.send_with_At(e, `未找到${songId}的相关信息QAQ!`)
1094
+ return true
1095
+ }
1096
+
1097
+ /**获取成绩 */
1098
+
1099
+ let Record = save.gameRecord
1100
+ let songRecord = Record[songId]
1101
+
1102
+ if (!songRecord) {
1103
+ send.send_with_At(e, `我不知道你关于[${info.song}]的成绩哦!可以试试更新成绩哦!\n格式:/${Config.getUserCfg('config', 'cmdhead')} update`)
1104
+ return true
1105
+ }
1106
+
1107
+ // const dan = await get.getDan(e.user_id)
1108
+
1109
+ /**获取历史成绩 */
1110
+ /**
1111
+ * @type {songRecordHistory | undefined}
1112
+ */
1113
+ let HistoryData = undefined;
1114
+ if (await canUseApi(e)) {
1115
+ try {
1116
+ HistoryData = await credentials.getCloudSongHistory(songId)
1117
+ if (!HistoryData) HistoryData = (await credentials.getLocalHistory())?.scoreHistory[songId]
1118
+ } catch (err) {
1119
+ logger.warn(`[phi-plugin] API ERR`, err)
1120
+ HistoryData = (await credentials.getLocalHistory())?.scoreHistory[songId]
1121
+ }
1122
+ } else {
1123
+ HistoryData = (await credentials.getLocalHistory())?.scoreHistory[songId]
1124
+ }
1125
+
1126
+ /** @type {(import('../model/save/scoreHistory.js').extendedScoreHistoryDetail | {date_new: string})[]} */
1127
+ let history = []
1128
+
1129
+ if (HistoryData) {
1130
+ for (let i of allLevel) {
1131
+ if (!HistoryData[i]) continue
1132
+ HistoryData[i].forEach((item) => {
1133
+ const tem = ScoreHistory.extend(songId, i, item)
1134
+ history.push({ ...tem, date_new: fCompute.formatDate(tem.date_new) })
1135
+ })
1136
+ }
1137
+ }
1138
+
1139
+ history.sort((a, b) => new Date(b.date_new).getTime() - new Date(a.date_new).getTime())
1140
+
1141
+ history.splice(16)
1142
+
1143
+
1144
+ let data = {
1145
+ songName: info.song,
1146
+ PlayerId: save.saveInfo.PlayerId,
1147
+ avatar: getInfo.idgetavatar(save.saveInfo.summary.avatar),
1148
+ Rks: Number(save.saveInfo.summary.rankingScore).toFixed(2),
1149
+ Date: save.saveInfo.summary.updatedAt,
1150
+ ChallengeMode: Math.floor(save.saveInfo.summary.challengeModeRank / 100),
1151
+ ChallengeModeRank: save.saveInfo.summary.challengeModeRank % 100,
1152
+ /**@type {Partial<Record<allLevelKind, any>>} */
1153
+ scoreData: {},
1154
+ // CLGMOD: dan?.Dan,
1155
+ // EX: dan?.EX,
1156
+ history: history,
1157
+ illustration: '',
1158
+ }
1159
+
1160
+ for (let level of Level) {
1161
+ if (!info.chart[level]) break
1162
+ data.scoreData[level] = {};
1163
+ data.scoreData[level].difficulty = info.chart[level].difficulty
1164
+ }
1165
+ data.illustration = getInfo.getill(songId)
1166
+ // console.info(ans)
1167
+ /**
1168
+ * 用户游玩过的最高难度
1169
+ * @type {levelKind | ''}
1170
+ */
1171
+ let maxRank = ''
1172
+ songRecord.forEach((record, i) => {
1173
+ const chartInfo = info.chart[Level[i]]
1174
+ if (!chartInfo) return
1175
+ if (record) {
1176
+ data.scoreData[Level[i]] = {
1177
+ ...record,
1178
+ acc: record.acc.toFixed(4),
1179
+ rks: record.rks.toFixed(4),
1180
+ suggest: '',
1181
+ }
1182
+ const suggest = save.getSuggest(songId, i, undefined, chartInfo.difficulty);
1183
+ if (suggest != -1) {
1184
+ data.scoreData[Level[i]].suggest = suggest.toFixed(4) + '%'
1185
+ if (suggest < 98.5) {
1186
+ data.scoreData[Level[i]].suggestType = 0
1187
+ } else if (suggest < 99) {
1188
+ data.scoreData[Level[i]].suggestType = 1
1189
+ } else if (suggest < 99.5) {
1190
+ data.scoreData[Level[i]].suggestType = 2
1191
+ } else if (suggest < 99.7) {
1192
+ data.scoreData[Level[i]].suggestType = 3
1193
+ } else if (suggest < 99.85) {
1194
+ data.scoreData[Level[i]].suggestType = 4
1195
+ } else {
1196
+ data.scoreData[Level[i]].suggestType = 5
1197
+ }
1198
+ } else {
1199
+ data.scoreData[Level[i]].suggest = "无法推分"
1200
+ }
1201
+ maxRank = Level[i]
1202
+ } else {
1203
+ data.scoreData[Level[i]] = {
1204
+ ...data.scoreData[Level[i]],
1205
+ Rating: 'NEW',
1206
+ suggest: save.getSuggest(songId, i, 4, chartInfo.difficulty) || '无法推分'
1207
+ }
1208
+ }
1209
+ })
1210
+
1211
+ // 处理每个难度的P/B位
1212
+ const { phi, b19_list } = await save.getB19(e, 27, { avgType: 'none', allPhi: true })
1213
+
1214
+ phi.forEach((item, index) => {
1215
+ if (item?.id == songId) {
1216
+ data.scoreData[item.rank].phiN = Math.min(3, index + 1);
1217
+ }
1218
+ });
1219
+
1220
+ b19_list.forEach((item, index) => {
1221
+ if (item.id == songId) {
1222
+ data.scoreData[item.rank].b19N = Math.min(27, index + 1);
1223
+ }
1224
+ });
1225
+
1226
+
1227
+ maxRank = args?.dif || maxRank
1228
+
1229
+ data.Rks = Number(save.saveInfo.summary.rankingScore).toFixed(4)
1230
+
1231
+ if (!args?.unRank && await canUseApi(e)) {
1232
+ const credentials = UserCredentials.fromEvent(e)
1233
+ const scoreRanklist = await credentials.getScoreRanklistByUser(
1234
+ {
1235
+ songId,
1236
+ rank: maxRank || 'IN',
1237
+ orderBy: args?.orderBy || 'acc'
1238
+ },
1239
+ {
1240
+ ignoreUnboundError: true,
1241
+ }
1242
+ )
1243
+ if (scoreRanklist) {
1244
+ scoreRanklist.users.forEach((/** @type {any} */ item) => {
1245
+ // @ts-ignore
1246
+ item.gameuser.challengeMode = Math.floor(item.gameuser.challengeModeRank / 100);
1247
+ item.gameuser.challengeModeRank = item.gameuser.challengeModeRank % 100;
1248
+ item.gameuser.avatar = getInfo.idgetavatar(item.gameuser.avatar);
1249
+ // @ts-ignore
1250
+ item.record.Rating = fCompute.rate(item.record.score, item.record.fc);
1251
+ // @ts-ignore
1252
+ item.record.updated_at = fCompute.formatDate(item.record.updated_at);
1253
+ if (item.index == scoreRanklist.userRank) {
1254
+ // @ts-ignore
1255
+ item.isUser = true;
1256
+ }
1257
+ })
1258
+ // @ts-ignore
1259
+ data.ranklist = scoreRanklist;
1260
+ // @ts-ignore
1261
+ data.ranklist.selected = maxRank;
1262
+ }
1263
+ const apFcCount = await makeRequest.getSongApFcCount({ songId }, { event: e })
1264
+ if (apFcCount) {
1265
+
1266
+ for (let level of Level) {
1267
+ if (!info.chart[level]) break;
1268
+ const count = apFcCount[level];
1269
+ if (!count || !count.total) continue;
1270
+ data.scoreData[level].apFcCount = {
1271
+ ap: count.apCount / count.total,
1272
+ fc: count.fcCount / count.total,
1273
+ total: count.total
1274
+ };
1275
+ }
1276
+
1277
+ }
1278
+ }
1279
+
1280
+
1281
+ send.send_with_At(e, await picmodle.score(e, data, 1))
1282
+
1283
+ }
1284
+
1285
+ function cmpsugg() {
1286
+ /**
1287
+ * @param {object & {suggest: number, difficulty: number, avg: number}} a
1288
+ * @param {object & {suggest: number, difficulty: number, avg: number}} b
1289
+ * @returns
1290
+ */
1291
+ const tem = (a, b) => {
1292
+ /**
1293
+ * @param {number} difficulty
1294
+ * @param {number} suggest
1295
+ * @param {number} avg
1296
+ * @returns
1297
+ */
1298
+ function com(difficulty, suggest, avg) {
1299
+ return difficulty * 100 * (suggest - avg);
1300
+ }
1301
+ let s_a = a.suggest
1302
+ let s_b = b.suggest
1303
+ return com(a.difficulty, s_a, a.avg) - com(b.difficulty, s_b, b.avg)
1304
+ // return (Number(a.suggest.replace("%", '')) - a.rks) - (Number(b.suggest.replace("%", '')) - b.rks)
1305
+ }
1306
+ return tem
1307
+ }
1308
+
1309
+ /**
1310
+ *
1311
+ * @param {number} suggest
1312
+ * @returns
1313
+ */
1314
+ function suggestType(suggest) {
1315
+
1316
+ if (suggest < 98.5) {
1317
+ return 0;
1318
+ } else if (suggest < 99) {
1319
+ return 1;
1320
+ } else if (suggest < 99.5) {
1321
+ return 2;
1322
+ } else if (suggest < 99.7) {
1323
+ return 3;
1324
+ } else if (suggest < 99.85) {
1325
+ return 4;
1326
+ } else {
1327
+ return 5;
1328
+ }
1329
+ }