@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.
- package/LICENSE +22 -0
- package/core/.github/ISSUE_TEMPLATE/bug.yaml +133 -0
- package/core/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/core/.github/ISSUE_TEMPLATE/enhancement.yml +44 -0
- package/core/.vscode/c_cpp_properties.json +18 -0
- package/core/.vscode/launch.json +24 -0
- package/core/.vscode/settings.json +59 -0
- package/core/CHANGELOG.md +184 -0
- package/core/LICENSE +674 -0
- package/core/README.md +330 -0
- package/core/README_en.md +285 -0
- package/core/apps/Dan.js +129 -0
- package/core/apps/RankList.js +322 -0
- package/core/apps/aliasProposal.js +223 -0
- package/core/apps/apiSetting.js +592 -0
- package/core/apps/b19.js +1329 -0
- package/core/apps/botClient.js +64 -0
- package/core/apps/chart.js +692 -0
- package/core/apps/guessGame/guessIll.js +821 -0
- package/core/apps/guessGame/guessLetter.js +831 -0
- package/core/apps/guessGame/guessTips.js +254 -0
- package/core/apps/guessGame/letterGameUtils.js +74 -0
- package/core/apps/guessGame.js +214 -0
- package/core/apps/help.js +117 -0
- package/core/apps/manage.js +288 -0
- package/core/apps/market.js +243 -0
- package/core/apps/money.js +1064 -0
- package/core/apps/phisong.js +1418 -0
- package/core/apps/session.js +664 -0
- package/core/apps/setting.js +468 -0
- package/core/apps/update.js +541 -0
- package/core/apps/user.js +968 -0
- package/core/components/Config.js +249 -0
- package/core/components/Data.js +304 -0
- package/core/components/FileWatcherRegistry.js +102 -0
- package/core/components/Logger.js +11 -0
- package/core/components/ProcessCleanup.js +113 -0
- package/core/components/Version.js +56 -0
- package/core/components/YamlReader.js +157 -0
- package/core/components/baseClass.js +287 -0
- package/core/components/common.js +47 -0
- package/core/components/index.js +13 -0
- package/core/components/platform/index.js +79 -0
- package/core/components/platform/koishi.js +800 -0
- package/core/components/platform/koishiDatabaseRedis.js +391 -0
- package/core/components/platform/memoryRedis.js +209 -0
- package/core/components/platform/types.d.ts +272 -0
- package/core/components/platform/yunzai.js +604 -0
- package/core/components/segment.js +4 -0
- 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
- package/core/config/default_config/banGroup.yaml +14 -0
- package/core/config/default_config/config.yaml +159 -0
- package/core/config/default_config/nickconfig.yaml +6 -0
- package/core/config/default_config/otherinfo.yaml +51 -0
- package/core/guoba.support.js +597 -0
- package/core/index.js +85 -0
- package/core/lib/AES.js +40 -0
- package/core/lib/Base64.js +22 -0
- package/core/lib/ByteReader.js +168 -0
- package/core/lib/GameProgress.js +37 -0
- package/core/lib/GameRecord.js +47 -0
- package/core/lib/GameSettings.js +24 -0
- package/core/lib/GameUser.js +19 -0
- package/core/lib/Level.js +6 -0
- package/core/lib/LevelRecord.js +9 -0
- package/core/lib/PhigrosUser.js +135 -0
- package/core/lib/SaveManager.js +117 -0
- package/core/lib/Summary.js +47 -0
- package/core/lib/TapTap/CompleteQRCodeData.js +27 -0
- package/core/lib/TapTap/LCHelper.js +81 -0
- package/core/lib/TapTap/TapTapHelper.js +170 -0
- package/core/lib/TapTap/getQRcode.js +61 -0
- package/core/lib/Util.js +30 -0
- package/core/lib/getQRcode.js +73 -0
- package/core/lib/http.js +105 -0
- package/core/model/README.md +3 -0
- package/core/model/api/aliasProposalService.js +151 -0
- package/core/model/api/apiVersion.js +67 -0
- package/core/model/api/autoSeekApi.js +165 -0
- package/core/model/api/botApiAuth.js +208 -0
- package/core/model/api/botSyncService.js +78 -0
- package/core/model/api/gameRecordPayload.js +24 -0
- package/core/model/api/makeRequest.js +1004 -0
- package/core/model/api/makeRequestFnc.js +17 -0
- package/core/model/api/phiApiClient.js +53 -0
- package/core/model/api/phiApiErrors.js +121 -0
- package/core/model/filesystem/getFile.js +256 -0
- package/core/model/filesystem/path.js +84 -0
- package/core/model/game/Chart.js +57 -0
- package/core/model/game/LevelRecordInfo.js +109 -0
- package/core/model/game/SongsInfo.js +46 -0
- package/core/model/game/b30Analysis.js +93 -0
- package/core/model/game/chartParser/Chart.js +23 -0
- package/core/model/game/chartParser/JudgeLine.js +38 -0
- package/core/model/game/chartParser/base/JudgeLineEvent.js +99 -0
- package/core/model/game/chartParser/base/Note.js +44 -0
- package/core/model/game/chartParser/base/SpeedEvent.js +25 -0
- package/core/model/game/chartParser/base/baseType.js +2 -0
- package/core/model/game/constNum.js +215 -0
- package/core/model/game/fCompute.js +711 -0
- package/core/model/game/getChartTag.js +140 -0
- package/core/model/game/getComment.js +132 -0
- package/core/model/game/getInfo.js +1069 -0
- package/core/model/game/getRksRank.js +77 -0
- package/core/model/game/markdown.js +77 -0
- package/core/model/integrations/Vika.js +103 -0
- package/core/model/integrations/getInfoFromTap.js +80 -0
- package/core/model/render/getPic.js +79 -0
- package/core/model/render/picmodle.js +496 -0
- package/core/model/render/progress-bar.js +44 -0
- package/core/model/render/puppeteer.js +431 -0
- package/core/model/render/renderPressureHistory.js +71 -0
- package/core/model/render/send.js +94 -0
- package/core/model/save/Save.js +953 -0
- package/core/model/save/analyzeSaveHistory.js +413 -0
- package/core/model/save/getBackup.js +328 -0
- package/core/model/save/getSave.js +90 -0
- package/core/model/save/getSaveFromApi.js +46 -0
- package/core/model/save/saveHistory.js +586 -0
- package/core/model/save/scoreHistory.js +101 -0
- package/core/model/theme/catalog.js +192 -0
- package/core/model/theme/installGuard.js +275 -0
- package/core/model/theme/installLock.js +174 -0
- package/core/model/theme/installer.js +398 -0
- package/core/model/theme/manager.js +408 -0
- package/core/model/theme/marketClient.js +294 -0
- package/core/model/theme/paths.js +42 -0
- package/core/model/theme/policy.js +54 -0
- package/core/model/theme/recovery.js +167 -0
- package/core/model/theme/useService.js +187 -0
- package/core/model/type/aliasProposal.d.ts +45 -0
- package/core/model/type/type.js +420 -0
- package/core/model/user/apiPermission.js +62 -0
- package/core/model/user/getBanGroup.js +120 -0
- package/core/model/user/getNotes.js +48 -0
- package/core/model/user/pluginData.js +101 -0
- package/core/model/user/userCredentialStore.js +154 -0
- package/core/model/user/userCredentials.js +860 -0
- package/core/package.json +60 -0
- package/core/resources/0608badSave/save.json +1 -0
- package/core/resources/LICENSE +201 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.art +220 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.css +345 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.html +434 -0
- package/core/resources/html/arcgrosB19/arcgros.png +0 -0
- package/core/resources/html/arcgrosB19/arcgrosB19-orz.html +276 -0
- package/core/resources/html/arcgrosB19/arcgrosB19.art +168 -0
- package/core/resources/html/arcgrosB19/arcgrosB19.css +637 -0
- package/core/resources/html/atlas/atlas-orz.html +313 -0
- package/core/resources/html/atlas/atlas.art +194 -0
- package/core/resources/html/atlas/atlas.css +695 -0
- package/core/resources/html/avatar/-SURREALISM-.png +0 -0
- package/core/resources/html/avatar/Alkaid.png +0 -0
- package/core/resources/html/avatar/Aphasia.png +0 -0
- package/core/resources/html/avatar/Artificial Existence.png +0 -0
- package/core/resources/html/avatar/Bonus Time.png +0 -0
- package/core/resources/html/avatar/Burn.png +0 -0
- package/core/resources/html/avatar/Cereris1.png +0 -0
- package/core/resources/html/avatar/Cereris2.png +0 -0
- package/core/resources/html/avatar/Cereris3.png +0 -0
- package/core/resources/html/avatar/Christmas -2019.png +0 -0
- package/core/resources/html/avatar/Cipher1.png +0 -0
- package/core/resources/html/avatar/Class Memories.png +0 -0
- package/core/resources/html/avatar/Credits.png +0 -0
- package/core/resources/html/avatar/Dash.png +0 -0
- package/core/resources/html/avatar/Dlyrotz.png +0 -0
- package/core/resources/html/avatar/Doppelganger1.png +0 -0
- package/core/resources/html/avatar/Doppelganger2.png +0 -0
- package/core/resources/html/avatar/Drop it.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix1.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix2.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix3.png +0 -0
- package/core/resources/html/avatar/Engine x Start!! (melody mix).png +0 -0
- package/core/resources/html/avatar/Engine x Start!! extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Eradication Catastrophe.png +0 -0
- package/core/resources/html/avatar/FULi AUTO SHOOTER extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/FULi AUTO SHOOTER.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special1.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special2.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2641.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2642.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2643.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2644.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2645.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2646.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2647.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2648.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2649.png +0 -0
- package/core/resources/html/avatar/Find_Me.png +0 -0
- package/core/resources/html/avatar/Geopelia 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Geopelia 2 -by cycats.png +0 -0
- package/core/resources/html/avatar/Geopelia 3 -by /344/275/225/345/221/265.png +0 -0
- package/core/resources/html/avatar/Geopelia in WEPLAY -by /346/265/267/344/272/247.png +0 -0
- package/core/resources/html/avatar/Gino-AprilFool.png +0 -0
- package/core/resources/html/avatar/Glaciaxion.png +0 -0
- package/core/resources/html/avatar/HumaN.png +0 -0
- package/core/resources/html/avatar/Indelible Scar.png +0 -0
- package/core/resources/html/avatar/Introduction.png +0 -0
- package/core/resources/html/avatar/Khronostasis Katharsis.png +0 -0
- package/core/resources/html/avatar/MARENOL.png +0 -0
- package/core/resources/html/avatar/Marenol extra 1 -by /345/226/265n/350/221/265.png +0 -0
- package/core/resources/html/avatar/Non-Melodic Ragez (MUG Edit).png +0 -0
- package/core/resources/html/avatar/Non-Melodic Ragez extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Oblivion +0 -0
- package/core/resources/html/avatar/OblivionPHIN.png +0 -0
- package/core/resources/html/avatar/Para.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz1.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz2.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz3.png +0 -0
- package/core/resources/html/avatar/RIPPER extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/RIPPER extra 2 -by /344/275/225/345/221/265.png +0 -0
- package/core/resources/html/avatar/Sein.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special2.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/231/256/351/200/232.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/233/262/347/273/230Ver.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-Special.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/231/256/351/200/232.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/233/262/347/273/230Ver.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240/345/222/214/346/260/264/351/235/222-Special.png +0 -0
- package/core/resources/html/avatar/Snow Desert.png +0 -0
- package/core/resources/html/avatar/Sparkle New Life.png +0 -0
- package/core/resources/html/avatar/Sultan Rage.png +0 -0
- package/core/resources/html/avatar/Winter /342/206/221cube/342/206/223.png +0 -0
- package/core/resources/html/avatar/Xenolith.png +0 -0
- package/core/resources/html/avatar/[PRAW].png +0 -0
- package/core/resources/html/avatar/dB doll.png +0 -0
- package/core/resources/html/avatar/ripper.png +0 -0
- package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2721.png +0 -0
- package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2722.png +0 -0
- package/core/resources/html/avatar//344/270/207/345/220/250/345/214/277/345/220/215/344/277/241.png +0 -0
- 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
- package/core/resources/html/avatar//344/272/221/345/245/263/345/255/251.png +0 -0
- package/core/resources/html/avatar//345/205/211.png +0 -0
- package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2051.png +0 -0
- package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2052.png +0 -0
- 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
- package/core/resources/html/avatar//346/267/267/344/271/261-Confusion.png +0 -0
- package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2361.png +0 -0
- package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2362.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/201-Special.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2011.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2012.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2013.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2014.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2015.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2016.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2017.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/227-Special.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2271.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2272.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2273.png +0 -0
- package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2611.png +0 -0
- package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2612.png +0 -0
- package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2501.png +0 -0
- package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2502.png +0 -0
- package/core/resources/html/avatar//351/235/222/350/212/275-Special.png +0 -0
- package/core/resources/html/avatar//351/235/222/350/212/275.png +0 -0
- package/core/resources/html/avatar//351/243/216/345/261/277.png +0 -0
- package/core/resources/html/avatar//351/270/240-AprilFool.png +0 -0
- 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
- package/core/resources/html/b19/b19.art +490 -0
- package/core/resources/html/b19/b19.css +1261 -0
- package/core/resources/html/b19/b19666.art +350 -0
- package/core/resources/html/b19/b19666.css +1409 -0
- package/core/resources/html/b19/b19666.html +481 -0
- package/core/resources/html/b19/b19title.css +120 -0
- package/core/resources/html/b19/best19.html +853 -0
- package/core/resources/html/b19/dss2-orz.html +428 -0
- package/core/resources/html/b19/dss2.art +298 -0
- package/core/resources/html/b19/dss2.css +776 -0
- package/core/resources/html/b19/res/666.jpeg +0 -0
- package/core/resources/html/chap/chap-orz.html +93 -0
- package/core/resources/html/chap/chap.art +87 -0
- package/core/resources/html/chap/chap.css +365 -0
- package/core/resources/html/chartImg/chartImg.art +169 -0
- package/core/resources/html/chartImg/chartImg.css +439 -0
- package/core/resources/html/chartImg/echarts-wordcloud.min.js +3 -0
- package/core/resources/html/chartImg/echarts.js +85796 -0
- package/core/resources/html/chartImg/img/Drag.png +0 -0
- package/core/resources/html/chartImg/img/DragHL.png +0 -0
- package/core/resources/html/chartImg/img/Flick.png +0 -0
- package/core/resources/html/chartImg/img/FlickHL.png +0 -0
- package/core/resources/html/chartImg/img/Hold.png +0 -0
- package/core/resources/html/chartImg/img/HoldHL.png +0 -0
- package/core/resources/html/chartImg/img/Hold_End.png +0 -0
- package/core/resources/html/chartImg/img/Hold_Head.png +0 -0
- package/core/resources/html/chartImg/img/Hold_HeadHL.png +0 -0
- package/core/resources/html/chartImg/img/Tap.png +0 -0
- package/core/resources/html/chartImg/img/TapHL.png +0 -0
- package/core/resources/html/chartInfo/chartInfo-orz.html +250 -0
- package/core/resources/html/chartInfo/chartInfo.art +222 -0
- package/core/resources/html/chartInfo/chartInfo.css +265 -0
- package/core/resources/html/chartInfo/echarts-wordcloud.min.js +3 -0
- package/core/resources/html/chartInfo/echarts.js +85796 -0
- package/core/resources/html/clg/clg-orz.html +218 -0
- package/core/resources/html/clg/clg.art +88 -0
- package/core/resources/html/clg/clg.css +230 -0
- package/core/resources/html/clg/demo.jpg +0 -0
- package/core/resources/html/common/common.css +319 -0
- package/core/resources/html/common/css/playerInfo.css +136 -0
- package/core/resources/html/common/font/Aldrich-Regular.ttf +0 -0
- package/core/resources/html/common/font/HIMALAYA.TTF +0 -0
- package/core/resources/html/common/font/NotoColorEmoji-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSans-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSansArabic.ttf +0 -0
- package/core/resources/html/common/font/NotoSansCanadianAboriginal.ttf +0 -0
- package/core/resources/html/common/font/NotoSansJP.ttf +0 -0
- package/core/resources/html/common/font/NotoSansKannada.ttf +0 -0
- package/core/resources/html/common/font/NotoSansMath-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSansSymbols2.ttf +0 -0
- package/core/resources/html/common/font/phi.ttf +0 -0
- package/core/resources/html/common/font//345/220/236/345/274/245/346/201/260/344/277/212.ttf +0 -0
- package/core/resources/html/common/layout/default.art +324 -0
- package/core/resources/html/common/layout/elem.art +21 -0
- package/core/resources/html/common/theme/snow/snow.css +17 -0
- package/core/resources/html/common/theme/snow/snow.js +19 -0
- package/core/resources/html/common/theme/star/star.js +201 -0
- package/core/resources/html/common/theme/topText/topText.css +15 -0
- package/core/resources/html/common/theme/topText/topText.js +30 -0
- package/core/resources/html/difficultyHistory/difficultyHistory-orz.html +361 -0
- package/core/resources/html/difficultyHistory/difficultyHistory.art +102 -0
- package/core/resources/html/difficultyHistory/difficultyHistory.css +205 -0
- package/core/resources/html/guess/guess-orz.html +50 -0
- package/core/resources/html/guess/guess.art +51 -0
- package/core/resources/html/guess/guess.css +33 -0
- package/core/resources/html/help/help-orz.html +73 -0
- package/core/resources/html/help/help.art +84 -0
- package/core/resources/html/help/help.css +266 -0
- package/core/resources/html/historyB30/historyB30-orz.html +168 -0
- package/core/resources/html/historyB30/historyB30.art +143 -0
- package/core/resources/html/historyB30/historyB30.css +270 -0
- package/core/resources/html/ill/ill-orz.html +21 -0
- package/core/resources/html/ill/ill.art +23 -0
- package/core/resources/html/ill/ill.css +79 -0
- package/core/resources/html/jrrp/ShineAfter.removebg.png +0 -0
- package/core/resources/html/jrrp/jrrp-orz.html +68 -0
- package/core/resources/html/jrrp/jrrp.art +58 -0
- package/core/resources/html/jrrp/jrrp.css +251 -0
- package/core/resources/html/list/list-orz.html +35 -0
- package/core/resources/html/list/list.art +67 -0
- package/core/resources/html/list/list.css +259 -0
- package/core/resources/html/lvsco/demo.jpg +0 -0
- package/core/resources/html/lvsco/lvsco-orz.html +334 -0
- package/core/resources/html/lvsco/lvsco.art +314 -0
- package/core/resources/html/lvsco/lvsco.css +706 -0
- package/core/resources/html/market/detail.art +44 -0
- package/core/resources/html/market/market.art +86 -0
- package/core/resources/html/market/market.css +64 -0
- package/core/resources/html/newSong/newSong.art +34 -0
- package/core/resources/html/newSong/newSong.css +48 -0
- package/core/resources/html/newSong/newSong.html +23 -0
- package/core/resources/html/newnotice/newnotice.art +47 -0
- package/core/resources/html/newnotice/newnotice.css +83 -0
- package/core/resources/html/otherimg/0.png +0 -0
- package/core/resources/html/otherimg/1.png +0 -0
- package/core/resources/html/otherimg/2.png +0 -0
- package/core/resources/html/otherimg/3.png +0 -0
- package/core/resources/html/otherimg/4.png +0 -0
- package/core/resources/html/otherimg/5.png +0 -0
- package/core/resources/html/otherimg/A.png +0 -0
- package/core/resources/html/otherimg/B.png +0 -0
- package/core/resources/html/otherimg/C.png +0 -0
- package/core/resources/html/otherimg/F.png +0 -0
- package/core/resources/html/otherimg/FC.png +0 -0
- package/core/resources/html/otherimg/NEW.png +0 -0
- package/core/resources/html/otherimg/Phigros_Icon_3.0.0.png +0 -0
- package/core/resources/html/otherimg/S.png +0 -0
- package/core/resources/html/otherimg/Star1.png +0 -0
- package/core/resources/html/otherimg/Star2.png +0 -0
- package/core/resources/html/otherimg/V.png +0 -0
- package/core/resources/html/otherimg/callback.png +0 -0
- package/core/resources/html/otherimg/chapHelp.png +0 -0
- package/core/resources/html/otherimg/dan_code.png +0 -0
- package/core/resources/html/otherimg/data.png +0 -0
- package/core/resources/html/otherimg/helpDoc.png +0 -0
- package/core/resources/html/otherimg/nickSuggest.png +0 -0
- package/core/resources/html/otherimg/phi.png +0 -0
- package/core/resources/html/otherimg/phigros.png +0 -0
- package/core/resources/html/otherimg/snow1.png +0 -0
- package/core/resources/html/otherimg/snow2.png +0 -0
- package/core/resources/html/otherimg/snow3.png +0 -0
- package/core/resources/html/otherimg/snow4.png +0 -0
- package/core/resources/html/otherimg/title.png +0 -0
- package/core/resources/html/rand/rand-orz.html +62 -0
- package/core/resources/html/rand/rand.art +59 -0
- package/core/resources/html/rand/rand.css +257 -0
- package/core/resources/html/rankingList/rankingList-orz.html +456 -0
- package/core/resources/html/rankingList/rankingList.art +171 -0
- package/core/resources/html/rankingList/rankingList.css +570 -0
- package/core/resources/html/rankingList-old/rankingList-orz.html +300 -0
- package/core/resources/html/rankingList-old/rankingList.art +89 -0
- package/core/resources/html/rankingList-old/rankingList.css +265 -0
- package/core/resources/html/score/score-orz.html +625 -0
- package/core/resources/html/score/score.art +249 -0
- package/core/resources/html/score/score.css +435 -0
- package/core/resources/html/score/scoreOld-orz.html +128 -0
- package/core/resources/html/score/scoreOld.art +230 -0
- package/core/resources/html/score/scoreOld.css +475 -0
- package/core/resources/html/score/scoreRankList-orz.html +613 -0
- package/core/resources/html/score/scoreRankList.art +231 -0
- package/core/resources/html/score/scoreRankList.css +197 -0
- package/core/resources/html/setting/setting-orz.html +123 -0
- package/core/resources/html/setting/setting.art +72 -0
- package/core/resources/html/setting/setting.css +170 -0
- package/core/resources/html/setting/userSetting-orz.html +132 -0
- package/core/resources/html/setting/userSetting.art +48 -0
- package/core/resources/html/setting/userSetting.css +160 -0
- package/core/resources/html/sign/sign-orz.html +262 -0
- package/core/resources/html/sign/sign.art +163 -0
- package/core/resources/html/sign/sign.css +706 -0
- package/core/resources/html/suggest/suggest.art +271 -0
- package/core/resources/html/suggest/suggest.css +300 -0
- package/core/resources/html/table/table-orz.html +228 -0
- package/core/resources/html/table/table.art +163 -0
- package/core/resources/html/table/table.css +401 -0
- package/core/resources/html/tasks/tasks-orz.html +83 -0
- package/core/resources/html/tasks/tasks.art +118 -0
- package/core/resources/html/tasks/tasks.css +334 -0
- package/core/resources/html/update/update-orz.html +735 -0
- package/core/resources/html/update/update.art +259 -0
- package/core/resources/html/update/update.css +676 -0
- package/core/resources/html/userinfo/userinfo-old-orz.html +408 -0
- package/core/resources/html/userinfo/userinfo-old.art +233 -0
- package/core/resources/html/userinfo/userinfo-old.css +466 -0
- package/core/resources/html/userinfo/userinfo-orz.html +543 -0
- package/core/resources/html/userinfo/userinfo.art +288 -0
- package/core/resources/html/userinfo/userinfo.css +757 -0
- package/core/resources/info/DLC/arc.json +412 -0
- package/core/resources/info/DLC/chunithm.json +1172 -0
- package/core/resources/info/DLC/dynamix.json +455 -0
- package/core/resources/info/DLC/fanshi.json +132 -0
- package/core/resources/info/DLC/lanota.json +412 -0
- package/core/resources/info/DLC/maimai.json +1110 -0
- package/core/resources/info/DLC/orz.json +158 -0
- package/core/resources/info/DLC/rizline.json +40 -0
- package/core/resources/info/DLC/rotaeno.json +159 -0
- package/core/resources/info/DLC/ryceam.json +53 -0
- package/core/resources/info/avatar.txt +109 -0
- package/core/resources/info/chaplist.yaml +102 -0
- package/core/resources/info/help/api.json +83 -0
- package/core/resources/info/help.json +436 -0
- package/core/resources/info/info.csv +315 -0
- package/core/resources/info/infolist.json +1758 -0
- package/core/resources/info/jrrp.json +92 -0
- package/core/resources/info/nicklist.yaml +2373 -0
- package/core/resources/info/notesInfo.json +1 -0
- package/core/resources/info/notice.json +11 -0
- package/core/resources/info/oldInfo/100/change.csv +218 -0
- package/core/resources/info/oldInfo/100/info.json +7 -0
- package/core/resources/info/oldInfo/101/change.csv +218 -0
- package/core/resources/info/oldInfo/101/info.json +7 -0
- package/core/resources/info/oldInfo/102/change.csv +223 -0
- package/core/resources/info/oldInfo/102/info.json +7 -0
- package/core/resources/info/oldInfo/103/change.csv +224 -0
- package/core/resources/info/oldInfo/103/info.json +7 -0
- package/core/resources/info/oldInfo/104/change.csv +225 -0
- package/core/resources/info/oldInfo/104/info.json +7 -0
- package/core/resources/info/oldInfo/105/change.csv +228 -0
- package/core/resources/info/oldInfo/105/info.json +7 -0
- package/core/resources/info/oldInfo/106/change.csv +229 -0
- package/core/resources/info/oldInfo/106/info.json +7 -0
- package/core/resources/info/oldInfo/108/change.csv +233 -0
- package/core/resources/info/oldInfo/108/info.json +7 -0
- package/core/resources/info/oldInfo/109/change.csv +235 -0
- package/core/resources/info/oldInfo/109/info.json +7 -0
- package/core/resources/info/oldInfo/110/change.csv +235 -0
- package/core/resources/info/oldInfo/110/info.json +7 -0
- package/core/resources/info/oldInfo/111/change.csv +242 -0
- package/core/resources/info/oldInfo/111/info.json +7 -0
- package/core/resources/info/oldInfo/112/change.csv +242 -0
- package/core/resources/info/oldInfo/112/info.json +7 -0
- package/core/resources/info/oldInfo/113/change.csv +244 -0
- package/core/resources/info/oldInfo/113/info.json +7 -0
- package/core/resources/info/oldInfo/115/change.csv +247 -0
- package/core/resources/info/oldInfo/115/info.json +7 -0
- package/core/resources/info/oldInfo/116/change.csv +249 -0
- package/core/resources/info/oldInfo/116/info.json +7 -0
- package/core/resources/info/oldInfo/118/change.csv +252 -0
- package/core/resources/info/oldInfo/118/info.json +7 -0
- package/core/resources/info/oldInfo/119/change.csv +255 -0
- package/core/resources/info/oldInfo/119/info.json +7 -0
- package/core/resources/info/oldInfo/120/change.csv +255 -0
- package/core/resources/info/oldInfo/120/info.json +7 -0
- package/core/resources/info/oldInfo/121/change.csv +257 -0
- package/core/resources/info/oldInfo/121/info.json +7 -0
- package/core/resources/info/oldInfo/122/change.csv +260 -0
- package/core/resources/info/oldInfo/122/info.json +7 -0
- package/core/resources/info/oldInfo/123/change.csv +260 -0
- package/core/resources/info/oldInfo/123/info.json +7 -0
- package/core/resources/info/oldInfo/124/change.csv +262 -0
- package/core/resources/info/oldInfo/124/info.json +7 -0
- package/core/resources/info/oldInfo/125/change.csv +266 -0
- package/core/resources/info/oldInfo/125/info.json +7 -0
- package/core/resources/info/oldInfo/126/change.csv +269 -0
- package/core/resources/info/oldInfo/126/info.json +7 -0
- package/core/resources/info/oldInfo/127/change.csv +270 -0
- package/core/resources/info/oldInfo/127/info.json +7 -0
- package/core/resources/info/oldInfo/128/change.csv +273 -0
- package/core/resources/info/oldInfo/128/info.json +7 -0
- package/core/resources/info/oldInfo/129/change.csv +274 -0
- package/core/resources/info/oldInfo/129/info.json +7 -0
- package/core/resources/info/oldInfo/130/change.csv +275 -0
- package/core/resources/info/oldInfo/130/info.json +7 -0
- package/core/resources/info/oldInfo/131/change.csv +278 -0
- package/core/resources/info/oldInfo/131/info.json +7 -0
- package/core/resources/info/oldInfo/132/change.csv +280 -0
- package/core/resources/info/oldInfo/132/info.json +7 -0
- package/core/resources/info/oldInfo/133/change.csv +284 -0
- package/core/resources/info/oldInfo/133/info.json +7 -0
- package/core/resources/info/oldInfo/134/change.csv +286 -0
- package/core/resources/info/oldInfo/134/info.json +7 -0
- package/core/resources/info/oldInfo/135/change.csv +290 -0
- package/core/resources/info/oldInfo/135/info.json +7 -0
- package/core/resources/info/oldInfo/136/change.csv +290 -0
- package/core/resources/info/oldInfo/136/info.json +7 -0
- package/core/resources/info/oldInfo/137/change.csv +293 -0
- package/core/resources/info/oldInfo/137/info.json +7 -0
- package/core/resources/info/oldInfo/138/change.csv +295 -0
- package/core/resources/info/oldInfo/138/info.json +7 -0
- package/core/resources/info/oldInfo/139/change.csv +295 -0
- package/core/resources/info/oldInfo/139/info.json +7 -0
- package/core/resources/info/oldInfo/140/change.csv +298 -0
- package/core/resources/info/oldInfo/140/info.json +7 -0
- package/core/resources/info/oldInfo/141/change.csv +300 -0
- package/core/resources/info/oldInfo/141/info.json +7 -0
- package/core/resources/info/oldInfo/142/change.csv +302 -0
- package/core/resources/info/oldInfo/142/info.json +7 -0
- package/core/resources/info/oldInfo/143/change.csv +303 -0
- package/core/resources/info/oldInfo/143/info.json +7 -0
- package/core/resources/info/oldInfo/144/change.csv +303 -0
- package/core/resources/info/oldInfo/144/info.json +7 -0
- package/core/resources/info/oldInfo/145/change.csv +305 -0
- package/core/resources/info/oldInfo/145/info.json +7 -0
- package/core/resources/info/oldInfo/146/change.csv +305 -0
- package/core/resources/info/oldInfo/146/info.json +7 -0
- package/core/resources/info/oldInfo/148/change.csv +307 -0
- package/core/resources/info/oldInfo/148/info.json +7 -0
- package/core/resources/info/oldInfo/149/change.csv +307 -0
- package/core/resources/info/oldInfo/149/info.json +7 -0
- package/core/resources/info/oldInfo/151/change.csv +309 -0
- package/core/resources/info/oldInfo/151/info.json +7 -0
- package/core/resources/info/oldInfo/152/change.csv +312 -0
- package/core/resources/info/oldInfo/152/info.json +7 -0
- package/core/resources/info/oldInfo/153/change.csv +313 -0
- package/core/resources/info/oldInfo/153/info.json +7 -0
- package/core/resources/info/oldInfo/154/change.csv +315 -0
- package/core/resources/info/oldInfo/154/info.json +7 -0
- package/core/resources/info/oldInfo/92/change.csv +204 -0
- package/core/resources/info/oldInfo/92/info.json +7 -0
- package/core/resources/info/oldInfo/93/change.csv +206 -0
- package/core/resources/info/oldInfo/93/info.json +7 -0
- package/core/resources/info/oldInfo/94/change.csv +209 -0
- package/core/resources/info/oldInfo/94/info.json +7 -0
- package/core/resources/info/oldInfo/95/change.csv +211 -0
- package/core/resources/info/oldInfo/95/info.json +7 -0
- package/core/resources/info/oldInfo/96/change.csv +216 -0
- package/core/resources/info/oldInfo/96/info.json +7 -0
- package/core/resources/info/oldInfo/98/change.csv +216 -0
- package/core/resources/info/oldInfo/98/info.json +7 -0
- package/core/resources/info/oldInfo/99/change.csv +217 -0
- package/core/resources/info/oldInfo/99/info.json +7 -0
- package/core/resources/info/oldNotesInfo.json +1 -0
- package/core/resources/info/sentences.json +1 -0
- package/core/resources/info/spinfo.json +362 -0
- package/core/resources/info/tips.txt +278 -0
- package/core/resources/otherill//351/233/252/351/231/215SP.png +0 -0
- package/core/resources/song-select.html +535 -0
- package/core/resources/themes/README.md +24 -0
- package/core/resources/themes/milthm/A.png +0 -0
- package/core/resources/themes/milthm/B.png +0 -0
- package/core/resources/themes/milthm/C.png +0 -0
- package/core/resources/themes/milthm/F.png +0 -0
- package/core/resources/themes/milthm/FC.png +0 -0
- package/core/resources/themes/milthm/S.png +0 -0
- package/core/resources/themes/milthm/V.png +0 -0
- package/core/resources/themes/milthm/arcgrosB19.css +36 -0
- package/core/resources/themes/milthm/b19.art +464 -0
- package/core/resources/themes/milthm/b19.css +1314 -0
- package/core/resources/themes/milthm/bg.png +0 -0
- package/core/resources/themes/milthm/clg.css +37 -0
- package/core/resources/themes/milthm/difficultyHistory.css +42 -0
- package/core/resources/themes/milthm/font.ttf +0 -0
- package/core/resources/themes/milthm/help.css +36 -0
- package/core/resources/themes/milthm/historyB30.css +48 -0
- package/core/resources/themes/milthm/info.yaml +45 -0
- package/core/resources/themes/milthm/list.css +39 -0
- package/core/resources/themes/milthm/phi.png +0 -0
- package/core/resources/themes/milthm/setting.css +37 -0
- package/core/resources/themes/milthm/sign.css +81 -0
- package/core/resources/themes/milthm/suggest.css +40 -0
- package/core/resources/themes/milthm/table.css +54 -0
- package/core/resources/themes/milthm/update.css +68 -0
- package/core/tests/aliasProposalService.test.js +82 -0
- package/core/tests/apiAccountDeletion.test.js +125 -0
- package/core/tests/apiPermission.test.js +44 -0
- package/core/tests/apiVersion.test.js +55 -0
- package/core/tests/b30Analysis.test.js +38 -0
- package/core/tests/backgroundIllustration.test.js +21 -0
- package/core/tests/botApiAuthRecovery.test.js +148 -0
- package/core/tests/botSyncService.test.js +42 -0
- package/core/tests/fileWatcherRegistry.test.js +44 -0
- package/core/tests/gameRecordPayload.test.js +34 -0
- package/core/tests/guessLetter.test.js +79 -0
- package/core/tests/makeRequestHandling.test.js +118 -0
- package/core/tests/marketOverflow.test.js +31 -0
- package/core/tests/platformTemplateCache.test.js +92 -0
- package/core/tests/pluginDataThemePreference.test.js +36 -0
- package/core/tests/processCleanup.test.js +58 -0
- package/core/tests/puppeteerShutdown.test.js +17 -0
- package/core/tests/renderPressureHistory.test.js +59 -0
- package/core/tests/saveStats.test.js +26 -0
- package/core/tests/themeInstallGuard.test.js +289 -0
- package/core/tests/themeManager.test.js +625 -0
- package/core/tests/themeManagerInit.test.js +11 -0
- package/core/tests/themeMarket.test.js +855 -0
- package/core/tests/themePageRouting.test.js +431 -0
- package/core/tests/themePolicy.test.js +28 -0
- package/core/tests/themeStorageRecovery.test.js +192 -0
- package/core/tests/userCredentialModuleBoundaries.test.js +41 -0
- package/core/tests/userCredentials.test.js +285 -0
- package/core/tsconfig.json +32 -0
- package/core/types/vendor.d.ts +14 -0
- package/lib/index.cjs +358 -0
- package/lib/index.d.cts +182 -0
- package/lib/index.d.ts +182 -0
- package/lib/index.js +320 -0
- package/package.json +74 -0
- package/readme.md +3 -0
|
@@ -0,0 +1,821 @@
|
|
|
1
|
+
import common from '../../components/common.js'
|
|
2
|
+
import Config from '../../components/Config.js'
|
|
3
|
+
import logger from '../../components/Logger.js'
|
|
4
|
+
import getInfo from '../../model/game/getInfo.js'
|
|
5
|
+
import send from '../../model/render/send.js'
|
|
6
|
+
import picmodle from "../../model/render/picmodle.js";
|
|
7
|
+
import SongsInfo from '../../model/game/SongsInfo.js'
|
|
8
|
+
import fCompute from '../../model/game/fCompute.js'
|
|
9
|
+
import getPic from '../../model/render/getPic.js'
|
|
10
|
+
|
|
11
|
+
let songIdList = getInfo.illlist || [] //所有有曲绘的曲目列表
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @type {Record<string, Record<idString, number>>}
|
|
15
|
+
*/
|
|
16
|
+
let songweights = {} //存储每首歌曲被抽取的权重
|
|
17
|
+
|
|
18
|
+
/** @type {Record<string, NodeJS.Timeout>} */
|
|
19
|
+
const songweightCleanupTimers = {}
|
|
20
|
+
const SONGWEIGHT_IDLE_TTL = 60 * 60 * 1000
|
|
21
|
+
|
|
22
|
+
/** @param {string} groupId */
|
|
23
|
+
function scheduleSongweightCleanup(groupId) {
|
|
24
|
+
if (songweightCleanupTimers[groupId]) clearTimeout(songweightCleanupTimers[groupId])
|
|
25
|
+
songweightCleanupTimers[groupId] = setTimeout(() => {
|
|
26
|
+
delete songweights[groupId]
|
|
27
|
+
delete songweightCleanupTimers[groupId]
|
|
28
|
+
}, SONGWEIGHT_IDLE_TTL)
|
|
29
|
+
songweightCleanupTimers[groupId].unref?.()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//曲目初始洗牌
|
|
33
|
+
songIdList = fCompute.randArray(songIdList)
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 答案列表
|
|
37
|
+
* @type {Record<string, idString>}
|
|
38
|
+
*/
|
|
39
|
+
let ansList = {}
|
|
40
|
+
/**
|
|
41
|
+
* @type {Record<string, any>}
|
|
42
|
+
*/
|
|
43
|
+
const eList = {}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {Object} guessIllData
|
|
48
|
+
* @property {string} illustration 曲绘路径
|
|
49
|
+
* @property {number} width 展示的宽度
|
|
50
|
+
* @property {number} height 展示的高度
|
|
51
|
+
* @property {number} x 展示的X位置
|
|
52
|
+
* @property {number} y 展示的Y位置
|
|
53
|
+
* @property {number} blur 模糊度
|
|
54
|
+
* @property {number} saturate 饱和度 (0=灰度, 1=正常, >1=过饱和)
|
|
55
|
+
* @property {boolean} invert 反相度 (0=正常, 1=完全反相)
|
|
56
|
+
* @property {number} hueRotate 色相旋转角度 (deg)
|
|
57
|
+
* @property {boolean} lineMode 是否线稿模式
|
|
58
|
+
* @property {number|boolean} style 是否全局视野 (0/1 or false/true)
|
|
59
|
+
* @property {string} filterStyle 用于模板的CSS filter字符串
|
|
60
|
+
* @property {string[]} chosenInterferences 记录选择的干扰类型
|
|
61
|
+
* @property {string} [ans] 答案图片路径(游戏结束时)
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @typedef {Object} interferenceConfig
|
|
66
|
+
* @property {string[]} chosen 当前选择的干扰类型列表
|
|
67
|
+
* @property {number[]} fncModifier fnc类型修正 (要在fnc中添加或删除的类型)
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* @typedef {import('../guessGame.js').GameList} GameList
|
|
71
|
+
* @typedef {['chapter', 'bpm', 'composer', 'length', 'illustrator', 'chart']} remainInfoType
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @import { botEvent } from '../../components/baseClass.js'
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
const ifeCNMap = {
|
|
81
|
+
'blur': '模糊',
|
|
82
|
+
'saturate': '饱和',
|
|
83
|
+
'invert': '反相',
|
|
84
|
+
'hueRotate': '色相',
|
|
85
|
+
'lineMode': '线稿'
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @param {botEvent} e
|
|
90
|
+
* @returns {string}
|
|
91
|
+
*/
|
|
92
|
+
function groupKey(e) {
|
|
93
|
+
return String(e.group_id || e.chatId || e.user_id)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default new class guessIll {
|
|
97
|
+
/**
|
|
98
|
+
* 猜曲绘
|
|
99
|
+
* @param {botEvent} e
|
|
100
|
+
* @param {GameList} gameList
|
|
101
|
+
*/
|
|
102
|
+
async start(e, gameList) {
|
|
103
|
+
const group_id = groupKey(e)
|
|
104
|
+
if (ansList[group_id]) {
|
|
105
|
+
send.reply(e, "请不要重复发起哦!", true)
|
|
106
|
+
return true
|
|
107
|
+
}
|
|
108
|
+
if (songIdList.length == 0) {
|
|
109
|
+
send.reply(e, '当前曲库暂无有曲绘的曲目哦!更改曲库后需要重启哦!')
|
|
110
|
+
return true
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (!songweights[group_id]) {
|
|
114
|
+
songweights[group_id] = {}
|
|
115
|
+
|
|
116
|
+
//将每一首曲目的权重初始化为1
|
|
117
|
+
songIdList.forEach(song => {
|
|
118
|
+
songweights[group_id][song] = 1
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
scheduleSongweightCleanup(group_id)
|
|
122
|
+
|
|
123
|
+
let songId = getRandomSong(e)
|
|
124
|
+
let songs_info = getInfo.info(songId)
|
|
125
|
+
|
|
126
|
+
let cnnt = 0
|
|
127
|
+
while (!songs_info || songs_info.can_t_be_guessill) {
|
|
128
|
+
++cnnt
|
|
129
|
+
if (cnnt >= 50) {
|
|
130
|
+
logger.error(`[phi guess]抽取曲目失败,请检查曲库设置`)
|
|
131
|
+
send.reply(e, `[phi guess]抽取曲目失败,请检查曲库设置`)
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
songId = getRandomSong(e)
|
|
135
|
+
songs_info = getInfo.info(songId)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
ansList[group_id] = songs_info.id
|
|
139
|
+
gameList[group_id] = { gameType: "guessIll" }
|
|
140
|
+
eList[group_id] = e
|
|
141
|
+
|
|
142
|
+
let w_ = fCompute.randInt(100, 140)
|
|
143
|
+
let h_ = fCompute.randInt(100, 140)
|
|
144
|
+
let x_ = fCompute.randInt(0, 2048 - w_)
|
|
145
|
+
let y_ = fCompute.randInt(0, 1080 - h_)
|
|
146
|
+
|
|
147
|
+
let lvMsg = e.msg.match(/-[lL]\s*(\d+)/)?.[0]?.match(/(\d+)/)?.[0]
|
|
148
|
+
|
|
149
|
+
// 根据难度等级生成干扰组合
|
|
150
|
+
const level = lvMsg ? Number(lvMsg) : fCompute.randFromArray([[0, 2], [1, 5], [2, 2], [3, 1]]);
|
|
151
|
+
const interference = generateInterference(level);
|
|
152
|
+
|
|
153
|
+
let data = {
|
|
154
|
+
illustration: getInfo.getill(songs_info.id),
|
|
155
|
+
width: w_,
|
|
156
|
+
height: h_,
|
|
157
|
+
x: x_,
|
|
158
|
+
y: y_,
|
|
159
|
+
blur: interference.blur,
|
|
160
|
+
saturate: interference.saturate,
|
|
161
|
+
invert: interference.invert,
|
|
162
|
+
hueRotate: interference.hueRotate,
|
|
163
|
+
lineMode: interference.lineMode,
|
|
164
|
+
chosenInterferences: interference.chosenInterferences,
|
|
165
|
+
style: 0,
|
|
166
|
+
filterStyle: buildFilterStyle(interference),
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* 已知信息
|
|
170
|
+
* @type {Record<string, string>}
|
|
171
|
+
*/
|
|
172
|
+
const known_info = {}
|
|
173
|
+
/** @type {remainInfoType} */
|
|
174
|
+
const remain_info = ['chapter', 'bpm', 'composer', 'length', 'illustrator', 'chart']
|
|
175
|
+
/**
|
|
176
|
+
* 随机给出提示
|
|
177
|
+
* 0: 区域扩大
|
|
178
|
+
* 1: 模糊度减小
|
|
179
|
+
* 2: 给出一条文字信息
|
|
180
|
+
* 3: 显示区域位置
|
|
181
|
+
* 4: 干扰减弱(非模糊类干扰减弱)
|
|
182
|
+
*/
|
|
183
|
+
let fnc = [0, 1, 2, 3]
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* 返回带有权重的随机干扰操作列表
|
|
187
|
+
* @param {number[]} fnc
|
|
188
|
+
* @param {guessIllData} data
|
|
189
|
+
*/
|
|
190
|
+
function genRandFncArr(fnc, data) {
|
|
191
|
+
/**
|
|
192
|
+
* @type {[number, number][]}
|
|
193
|
+
*/
|
|
194
|
+
const res = []
|
|
195
|
+
fnc.forEach(f => {
|
|
196
|
+
switch (f) {
|
|
197
|
+
case 0:
|
|
198
|
+
res.push([0, Math.floor((1 - (data.width * data.height) / (1080 * 2048)) * 100)]);
|
|
199
|
+
break;
|
|
200
|
+
case 1:
|
|
201
|
+
res.push([1, Math.floor((data.blur / 16) * 30)]);
|
|
202
|
+
break;
|
|
203
|
+
case 2:
|
|
204
|
+
res.push([2, Math.floor(remain_info.length / 6 * 50)]);
|
|
205
|
+
break;
|
|
206
|
+
case 3:
|
|
207
|
+
res.push([3, fCompute.randInt(10, 50)]);
|
|
208
|
+
break;
|
|
209
|
+
case 4:
|
|
210
|
+
let interferenceCount = 0
|
|
211
|
+
if (data.saturate !== 1) interferenceCount += 15
|
|
212
|
+
if (data.invert) interferenceCount += 5
|
|
213
|
+
if (data.hueRotate !== 0) interferenceCount += 20
|
|
214
|
+
if (data.lineMode) interferenceCount += 5
|
|
215
|
+
res.push([4, interferenceCount]);
|
|
216
|
+
}
|
|
217
|
+
})
|
|
218
|
+
return res;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// 如果初始没有模糊干扰,移除类型1
|
|
222
|
+
if (!interference.blur && fnc.indexOf(1) !== -1) {
|
|
223
|
+
fnc.splice(fnc.indexOf(1), 1)
|
|
224
|
+
}
|
|
225
|
+
// 如果存在非模糊类干扰,加入类型4
|
|
226
|
+
if (interference.lineMode || interference.saturate !== 1 || interference.invert !== false || interference.hueRotate !== 0) {
|
|
227
|
+
fnc.push(4)
|
|
228
|
+
}
|
|
229
|
+
logger.info(data)
|
|
230
|
+
|
|
231
|
+
send.reply(e,
|
|
232
|
+
[`下面开始进行猜曲绘哦!回答可以直接发送哦!每过${Config.getUserCfg('config', 'GuessTipCd')}秒后将会给出进一步提示。`,
|
|
233
|
+
`发送 /${Config.getUserCfg('config', 'cmdhead')} ans 结束游戏`,
|
|
234
|
+
`本局难度:${level},当前干扰类型:${data.chosenInterferences.length ? data.chosenInterferences.join('、') : '无干扰'}`].join('\n')
|
|
235
|
+
)
|
|
236
|
+
if (Config.getUserCfg('config', 'GuessTipRecall'))
|
|
237
|
+
await send.reply(e, await picmodle.guess(e, data), false, { recallMsg: Config.getUserCfg('config', 'GuessTipCd') })
|
|
238
|
+
else
|
|
239
|
+
await send.reply(e, await picmodle.guess(e, data))
|
|
240
|
+
|
|
241
|
+
/**单局时间不超过4分半 */
|
|
242
|
+
const time = Config.getUserCfg('config', 'GuessTipCd')
|
|
243
|
+
for (let i = 0; i < Math.min(270 / time, 30); ++i) {
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
for (let j = 0; j < time; ++j) {
|
|
247
|
+
await common.sleep(1000)
|
|
248
|
+
|
|
249
|
+
e = eList[group_id]
|
|
250
|
+
if (ansList[group_id]) {
|
|
251
|
+
if (ansList[group_id] != songs_info.id) {
|
|
252
|
+
await gameover(e, data)
|
|
253
|
+
return true
|
|
254
|
+
}
|
|
255
|
+
} else {
|
|
256
|
+
await gameover(e, data)
|
|
257
|
+
return true
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
let remsg = [] //回复内容
|
|
261
|
+
let tipmsg = '' //这次干了什么
|
|
262
|
+
const select = fCompute.randFromArray(genRandFncArr(fnc, data));
|
|
263
|
+
|
|
264
|
+
switch (select) {
|
|
265
|
+
case 0: {
|
|
266
|
+
area_increase(100, data, fnc)
|
|
267
|
+
tipmsg = `[区域扩增!]`
|
|
268
|
+
break
|
|
269
|
+
}
|
|
270
|
+
case 1: {
|
|
271
|
+
blur_down(2, data, fnc)
|
|
272
|
+
tipmsg = `[清晰度上升!]`
|
|
273
|
+
break
|
|
274
|
+
}
|
|
275
|
+
case 2: {
|
|
276
|
+
gave_a_tip(known_info, remain_info, songs_info, fnc)
|
|
277
|
+
tipmsg = `[追加提示!]`
|
|
278
|
+
break
|
|
279
|
+
}
|
|
280
|
+
case 3: {
|
|
281
|
+
data.style = 1
|
|
282
|
+
fnc.splice(fnc.indexOf(3), 1)
|
|
283
|
+
tipmsg = `[全局视野!]`
|
|
284
|
+
break
|
|
285
|
+
}
|
|
286
|
+
case 4: {
|
|
287
|
+
const reduced = interference_reduce(data, fnc)
|
|
288
|
+
tipmsg = `[${reduced}干扰减弱!]`
|
|
289
|
+
break
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (data.blur || data.saturate !== 1 || data.invert || data.hueRotate !== 0 || data.lineMode) {
|
|
293
|
+
tipmsg += `\n当前干扰类型:`
|
|
294
|
+
if (data.blur) tipmsg += `模糊 `
|
|
295
|
+
if (data.saturate !== 1) tipmsg += `饱和 `
|
|
296
|
+
if (data.invert) tipmsg += `反相 `
|
|
297
|
+
if (data.hueRotate !== 0) tipmsg += `色相 `
|
|
298
|
+
if (data.lineMode) tipmsg += `线稿 `
|
|
299
|
+
} else {
|
|
300
|
+
tipmsg += `\n当前没有任何干扰了哦!`
|
|
301
|
+
}
|
|
302
|
+
if (known_info.chapter) tipmsg += `\n该曲目隶属于 ${known_info.chapter}`
|
|
303
|
+
if (known_info.bpm) tipmsg += `\n该曲目的 BPM 值为 ${known_info.bpm}`
|
|
304
|
+
if (known_info.composer) tipmsg += `\n该曲目的作者为 ${known_info.composer}`
|
|
305
|
+
if (known_info.length) tipmsg += `\n该曲目的时长为 ${known_info.length}`
|
|
306
|
+
if (known_info.illustrator) tipmsg += `\n该曲目曲绘的作者为 ${known_info.illustrator}`
|
|
307
|
+
if (known_info.chart) tipmsg += known_info.chart
|
|
308
|
+
remsg = []
|
|
309
|
+
remsg.push(await picmodle.guess(e, data))
|
|
310
|
+
remsg.push(tipmsg)
|
|
311
|
+
|
|
312
|
+
e = eList[group_id]
|
|
313
|
+
|
|
314
|
+
if (ansList[group_id]) {
|
|
315
|
+
if (ansList[group_id] != songs_info.id) {
|
|
316
|
+
await gameover(e, data)
|
|
317
|
+
return true
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
await gameover(e, data)
|
|
321
|
+
return true
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
if (Config.getUserCfg('config', 'GuessTipRecall'))
|
|
325
|
+
send.reply(e, remsg, false, { recallMsg: Config.getUserCfg('config', 'GuessTipCd') + 1 })
|
|
326
|
+
else
|
|
327
|
+
send.reply(e, remsg)
|
|
328
|
+
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
for (let j = 0; j < time; ++j) {
|
|
332
|
+
await common.sleep(1000)
|
|
333
|
+
|
|
334
|
+
e = eList[group_id]
|
|
335
|
+
|
|
336
|
+
if (ansList[group_id]) {
|
|
337
|
+
if (ansList[group_id] != songs_info.id) {
|
|
338
|
+
await gameover(e, data)
|
|
339
|
+
return true
|
|
340
|
+
}
|
|
341
|
+
} else {
|
|
342
|
+
await gameover(e, data)
|
|
343
|
+
return true
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
e = eList[group_id]
|
|
348
|
+
|
|
349
|
+
const t = ansList[group_id]
|
|
350
|
+
delete ansList[group_id]
|
|
351
|
+
delete gameList[group_id]
|
|
352
|
+
await send.reply(e, "呜,怎么还没有人答对啊QAQ!只能说答案了喵……")
|
|
353
|
+
|
|
354
|
+
await send.reply(e, await getPic.GetSongsInfoAtlas(e, t))
|
|
355
|
+
await gameover(e, data)
|
|
356
|
+
|
|
357
|
+
return true
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* 玩家猜测
|
|
362
|
+
* @param {any} e
|
|
363
|
+
* @param {GameList} gameList
|
|
364
|
+
*/
|
|
365
|
+
async guess(e, gameList) {
|
|
366
|
+
const group_id = groupKey(e)
|
|
367
|
+
const { msg } = e
|
|
368
|
+
if (ansList[group_id]) {
|
|
369
|
+
eList[group_id] = e
|
|
370
|
+
if (typeof msg === 'string') {
|
|
371
|
+
const ans = msg.replace(/[#/](我)?猜(\s*)/g, '')
|
|
372
|
+
const ids = getInfo.fuzzysongsnick(ans, 0.95)
|
|
373
|
+
if (ids[0]) {
|
|
374
|
+
for (let i in ids) {
|
|
375
|
+
if (ansList[group_id] == ids[i]) {
|
|
376
|
+
const t = ansList[group_id]
|
|
377
|
+
delete ansList[group_id]
|
|
378
|
+
delete gameList[group_id]
|
|
379
|
+
delete eList[group_id]
|
|
380
|
+
send.send_with_At(e, '恭喜你,答对啦喵!ヾ(≧▽≦*)o', true)
|
|
381
|
+
await send.reply(e, await getPic.GetSongsInfoAtlas(e, t))
|
|
382
|
+
return true
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (ids[1]) {
|
|
386
|
+
send.send_with_At(e, `不是 ${ans} 哦喵!≧ ﹏ ≦`, true, { recallMsg: 5 })
|
|
387
|
+
} else {
|
|
388
|
+
send.send_with_At(e, `不是 ${getInfo.info(ids[0])?.song ?? ids[0]} 哦喵!≧ ﹏ ≦`, true, { recallMsg: 5 })
|
|
389
|
+
}
|
|
390
|
+
return false
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return false
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* 获取答案
|
|
399
|
+
* @param {any} e
|
|
400
|
+
* @param {GameList} gameList
|
|
401
|
+
* @returns
|
|
402
|
+
*/
|
|
403
|
+
async ans(e, gameList) {
|
|
404
|
+
const group_id = groupKey(e)
|
|
405
|
+
if (ansList[group_id]) {
|
|
406
|
+
const t = ansList[group_id]
|
|
407
|
+
delete ansList[group_id]
|
|
408
|
+
delete gameList[group_id]
|
|
409
|
+
delete eList[group_id]
|
|
410
|
+
await send.reply(e, '好吧,下面开始公布答案。', true)
|
|
411
|
+
await send.reply(e, await getPic.GetSongsInfoAtlas(e, t))
|
|
412
|
+
return true
|
|
413
|
+
}
|
|
414
|
+
return false
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* 洗牌
|
|
419
|
+
* @param {any} e
|
|
420
|
+
*/
|
|
421
|
+
async mix(e) {
|
|
422
|
+
const group_id = groupKey(e)
|
|
423
|
+
|
|
424
|
+
if (ansList[group_id]) {
|
|
425
|
+
await send.reply(e, `当前有正在进行的游戏,请等待游戏结束再执行该指令`, true)
|
|
426
|
+
return false
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// 曲目初始洗牌
|
|
430
|
+
songIdList = fCompute.randArray(songIdList)
|
|
431
|
+
|
|
432
|
+
songweights[group_id] = songweights[group_id] || {}
|
|
433
|
+
scheduleSongweightCleanup(group_id)
|
|
434
|
+
|
|
435
|
+
// 将权重归1
|
|
436
|
+
songIdList.forEach(song => {
|
|
437
|
+
songweights[group_id][song] = 1
|
|
438
|
+
})
|
|
439
|
+
|
|
440
|
+
await send.reply(e, `洗牌成功了www`, true)
|
|
441
|
+
return true
|
|
442
|
+
}
|
|
443
|
+
}()
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* 游戏结束,发送相应位置
|
|
449
|
+
* @param {import('../../components/baseClass.js').botEvent} e
|
|
450
|
+
* @param {any} data
|
|
451
|
+
*/
|
|
452
|
+
async function gameover(e, data) {
|
|
453
|
+
data.filterStyle = buildFilterStyle(data)
|
|
454
|
+
data.ans = data.illustration
|
|
455
|
+
data.style = 1
|
|
456
|
+
await send.reply(e, await picmodle.guess(e, data))
|
|
457
|
+
delete eList[groupKey(e)]
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* RandBetween
|
|
462
|
+
* @param {number} top 随机值上界
|
|
463
|
+
* @param {number} [bottom=0] 随机值下界
|
|
464
|
+
* @returns {number} 随机整数
|
|
465
|
+
*/
|
|
466
|
+
function randbt(top, bottom = 0) {
|
|
467
|
+
return Number((Math.random() * (top - bottom)).toFixed(0)) + bottom
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* 区域扩增
|
|
472
|
+
* @param {number} size 增大的像素值
|
|
473
|
+
* @param {guessIllData} data
|
|
474
|
+
* @param {number[]} fnc
|
|
475
|
+
*/
|
|
476
|
+
function area_increase(size, data, fnc) {
|
|
477
|
+
if (data.height < 1080) {
|
|
478
|
+
if (data.height + size >= 1080) {
|
|
479
|
+
data.height = 1080
|
|
480
|
+
data.y = 0
|
|
481
|
+
} else {
|
|
482
|
+
data.height += size
|
|
483
|
+
data.y = Math.max(0, data.y - size / 2)
|
|
484
|
+
data.y = Math.min(data.y, 1080 - data.height)
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
if (data.width < 2048) {
|
|
488
|
+
if (data.width + size >= 2048) {
|
|
489
|
+
data.width = 2048
|
|
490
|
+
data.x = 0
|
|
491
|
+
fnc.splice(fnc.indexOf(0), 1)
|
|
492
|
+
} else {
|
|
493
|
+
data.width += size
|
|
494
|
+
data.x = Math.max(0, data.x - size / 2)
|
|
495
|
+
data.x = Math.min(data.x, 2048 - data.width)
|
|
496
|
+
}
|
|
497
|
+
} else {
|
|
498
|
+
logger.error('err')
|
|
499
|
+
return true
|
|
500
|
+
}
|
|
501
|
+
return false
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* 降低模糊度
|
|
506
|
+
* @param {number} size 降低值
|
|
507
|
+
* @param {guessIllData} data
|
|
508
|
+
* @param {number[]} fnc
|
|
509
|
+
*/
|
|
510
|
+
function blur_down(size, data, fnc) {
|
|
511
|
+
if (data.blur) {
|
|
512
|
+
data.blur = Math.max(0, data.blur - size)
|
|
513
|
+
data.filterStyle = buildFilterStyle(data)
|
|
514
|
+
if (!data.blur) fnc.splice(fnc.indexOf(1), 1)
|
|
515
|
+
} else {
|
|
516
|
+
logger.error('err')
|
|
517
|
+
return true
|
|
518
|
+
}
|
|
519
|
+
return false
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* 获得一个歌曲信息的提示
|
|
524
|
+
* @param {Record<string, string>} known_info
|
|
525
|
+
* @param {remainInfoType} remain_info
|
|
526
|
+
* @param {SongsInfo} songs_info
|
|
527
|
+
* @param {number[]} fnc
|
|
528
|
+
*/
|
|
529
|
+
function gave_a_tip(known_info, remain_info, songs_info, fnc) {
|
|
530
|
+
if (remain_info.length) {
|
|
531
|
+
const t = randbt(remain_info.length - 1)
|
|
532
|
+
const aim = remain_info[t]
|
|
533
|
+
if (!aim) {
|
|
534
|
+
logger.error('Error: aim is undefined')
|
|
535
|
+
return true
|
|
536
|
+
}
|
|
537
|
+
remain_info.splice(t, 1)
|
|
538
|
+
|
|
539
|
+
if (!remain_info.length) fnc.splice(fnc.indexOf(2), 1)
|
|
540
|
+
|
|
541
|
+
if (aim === 'chart') {
|
|
542
|
+
/**
|
|
543
|
+
* @type {levelKind[]}
|
|
544
|
+
*/
|
|
545
|
+
let charts = /**@type {levelKind[]} */(Object.keys(songs_info.chart))
|
|
546
|
+
|
|
547
|
+
let t1 = charts[fCompute.randInt(0, charts.length - 1)]
|
|
548
|
+
|
|
549
|
+
known_info[aim] = `\n该曲目的 ${t1} 谱面的`
|
|
550
|
+
|
|
551
|
+
switch (fCompute.randInt(0, 2)) {
|
|
552
|
+
case 0: {
|
|
553
|
+
/**定数 */
|
|
554
|
+
known_info[aim] += `定数为 ${songs_info[aim][t1]?.['difficulty']}`
|
|
555
|
+
break
|
|
556
|
+
}
|
|
557
|
+
case 1: {
|
|
558
|
+
/**物量 */
|
|
559
|
+
known_info[aim] += `物量为 ${songs_info[aim][t1]?.['combo']}`
|
|
560
|
+
break
|
|
561
|
+
}
|
|
562
|
+
case 2: {
|
|
563
|
+
/**谱师 */
|
|
564
|
+
known_info[aim] += `谱师为 ${songs_info[aim][t1]?.['charter']}`
|
|
565
|
+
break
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
} else {
|
|
569
|
+
known_info[aim] = songs_info[aim]
|
|
570
|
+
}
|
|
571
|
+
} else {
|
|
572
|
+
logger.error('Error: remaining info is empty')
|
|
573
|
+
return true
|
|
574
|
+
}
|
|
575
|
+
return false
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* 根据干扰数据构建 CSS filter 字符串
|
|
580
|
+
* @param {guessIllData} data
|
|
581
|
+
* @returns {string}
|
|
582
|
+
*/
|
|
583
|
+
function buildFilterStyle(data) {
|
|
584
|
+
let filters = []
|
|
585
|
+
if (data.lineMode) {
|
|
586
|
+
// 线稿模式:使用 SVG 边缘检测滤镜 (#phiLineArt)
|
|
587
|
+
filters.push('url(#phiLineArt)')
|
|
588
|
+
} else {
|
|
589
|
+
// 非线稿模式下才应用颜色类干扰
|
|
590
|
+
if (data.saturate !== 1 && typeof data.saturate === 'number') filters.push(`saturate(${data.saturate})`)
|
|
591
|
+
if (data.invert !== false) filters.push(`invert(${data.invert ? 1 : 0})`)
|
|
592
|
+
if (data.hueRotate !== 0) filters.push(`hue-rotate(${data.hueRotate}deg)`)
|
|
593
|
+
}
|
|
594
|
+
if (data.blur > 0) filters.push(`blur(${data.blur}px)`)
|
|
595
|
+
return `filter: ${filters.join(' ')};`
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* 难度等级干扰定义
|
|
600
|
+
* Level 1: 单一干扰 (blur/saturate/invert/hueRotate/lineMode 中随机一种)
|
|
601
|
+
* Level 2: blur + 任一其他干扰
|
|
602
|
+
* Level 3: blur + 两种颜色干扰, 或 blur + lineMode
|
|
603
|
+
* 规则: lineMode 与颜色类干扰(saturate/invert/hueRotate)不可共存
|
|
604
|
+
*
|
|
605
|
+
* @param {number} level 难度等级 1-3
|
|
606
|
+
* @returns {guessIllData} 干扰数据
|
|
607
|
+
*/
|
|
608
|
+
function generateInterference(level) {
|
|
609
|
+
/**
|
|
610
|
+
* 颜色类干扰
|
|
611
|
+
* @type {(keyof ifeCNMap)[]}
|
|
612
|
+
*/
|
|
613
|
+
const colorTypes = ['saturate', 'invert', 'hueRotate']
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* 所有干扰类型
|
|
617
|
+
* @type {(keyof ifeCNMap)[]}
|
|
618
|
+
*/
|
|
619
|
+
const allTypes = ['blur', 'saturate', 'invert', 'hueRotate', 'lineMode']
|
|
620
|
+
|
|
621
|
+
/** @type {(keyof ifeCNMap)[]} */
|
|
622
|
+
const commonTypes = ['blur', 'saturate', 'invert', 'hueRotate']
|
|
623
|
+
|
|
624
|
+
/** @type {(keyof ifeCNMap)[]} */
|
|
625
|
+
let chosen = []
|
|
626
|
+
|
|
627
|
+
switch (level) {
|
|
628
|
+
case 0: {
|
|
629
|
+
// 无干扰
|
|
630
|
+
chosen = []
|
|
631
|
+
break
|
|
632
|
+
}
|
|
633
|
+
case 1: {
|
|
634
|
+
// 单一干扰:从除线稿类型中随机选1个
|
|
635
|
+
chosen = [commonTypes[fCompute.randInt(0, commonTypes.length - 1)]]
|
|
636
|
+
break
|
|
637
|
+
}
|
|
638
|
+
case 2: {
|
|
639
|
+
// blur + 任一颜色干扰 或 仅线稿(线稿本身就很有干扰性,所以有一定概率单独出现)
|
|
640
|
+
if (Math.random() < 0.6) {
|
|
641
|
+
chosen = ['blur', colorTypes[fCompute.randInt(0, colorTypes.length - 1)]]
|
|
642
|
+
} else {
|
|
643
|
+
chosen = ['lineMode']
|
|
644
|
+
}
|
|
645
|
+
break
|
|
646
|
+
}
|
|
647
|
+
case 3:
|
|
648
|
+
default: {
|
|
649
|
+
// 70%概率: blur + 两种颜色干扰
|
|
650
|
+
// 30%概率: blur + lineMode (线稿本身就很有干扰性)
|
|
651
|
+
if (Math.random() < 0.7) {
|
|
652
|
+
const shuffled = fCompute.randArray([...colorTypes])
|
|
653
|
+
chosen = ['blur', shuffled[0], shuffled[1]]
|
|
654
|
+
} else {
|
|
655
|
+
chosen = ['blur', 'lineMode']
|
|
656
|
+
}
|
|
657
|
+
break
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/** @type {guessIllData} */
|
|
662
|
+
let result = {
|
|
663
|
+
illustration: '',
|
|
664
|
+
width: 0,
|
|
665
|
+
height: 0,
|
|
666
|
+
x: 0,
|
|
667
|
+
y: 0,
|
|
668
|
+
blur: 0,
|
|
669
|
+
saturate: 1,
|
|
670
|
+
invert: false,
|
|
671
|
+
hueRotate: 0,
|
|
672
|
+
lineMode: false,
|
|
673
|
+
style: 0,
|
|
674
|
+
filterStyle: '',
|
|
675
|
+
chosenInterferences: [], // 记录选择的干扰类型
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
for (const type of chosen) {
|
|
679
|
+
switch (type) {
|
|
680
|
+
case 'blur':
|
|
681
|
+
result.blur = fCompute.randInt(8, 16)
|
|
682
|
+
break
|
|
683
|
+
case 'saturate':
|
|
684
|
+
// 0(灰度) ~ 0.3(低饱和) 或 2.5~4(过饱和),避免接近正常值1
|
|
685
|
+
result.saturate = Math.random() < 0.5
|
|
686
|
+
? fCompute.randFloatBetween(0, 0.3, 2)
|
|
687
|
+
: fCompute.randFloatBetween(2.5, 4, 2)
|
|
688
|
+
break
|
|
689
|
+
case 'invert':
|
|
690
|
+
result.invert = true;
|
|
691
|
+
break
|
|
692
|
+
case 'hueRotate':
|
|
693
|
+
result.hueRotate = fCompute.randInt(60, 300)
|
|
694
|
+
// 避开接近0/360的区域(太接近原色)
|
|
695
|
+
if (result.hueRotate > 330 && result.hueRotate <= 360) result.hueRotate = 330
|
|
696
|
+
break
|
|
697
|
+
case 'lineMode':
|
|
698
|
+
result.lineMode = true
|
|
699
|
+
break
|
|
700
|
+
}
|
|
701
|
+
result.chosenInterferences.push(ifeCNMap[type] || type)
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
return result
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* 减弱非模糊类干扰
|
|
709
|
+
* @param {guessIllData} data
|
|
710
|
+
* @param {number[]} fnc
|
|
711
|
+
* @returns {string} 被减弱的干扰名称
|
|
712
|
+
*/
|
|
713
|
+
function interference_reduce(data, fnc) {
|
|
714
|
+
/** @type {Record<'saturate' | 'invert' | 'hueRotate' | 'lineMode', string>} */
|
|
715
|
+
const nameMap = { saturate: '饱和度', invert: '反相', hueRotate: '色相', lineMode: '线稿' }
|
|
716
|
+
/**
|
|
717
|
+
* 当前可减弱的非模糊干扰
|
|
718
|
+
* @type {[keyof typeof nameMap, number][]}
|
|
719
|
+
*/
|
|
720
|
+
const reducible = []
|
|
721
|
+
if (data.saturate !== 1) reducible.push(['saturate', 30])
|
|
722
|
+
if (data.invert) reducible.push(['invert', 25])
|
|
723
|
+
if (data.hueRotate !== 0) reducible.push(['hueRotate', 50])
|
|
724
|
+
if (data.lineMode) reducible.push(['lineMode', 5])
|
|
725
|
+
|
|
726
|
+
if (reducible.length === 0) {
|
|
727
|
+
fnc.splice(fnc.indexOf(4), 1)
|
|
728
|
+
return ''
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
const target = fCompute.randFromArray(reducible)
|
|
732
|
+
|
|
733
|
+
switch (target) {
|
|
734
|
+
case 'saturate': {
|
|
735
|
+
// 向正常值1靠近
|
|
736
|
+
const step = fCompute.randFloatBetween(0.2, 0.5, 2)
|
|
737
|
+
if (data.saturate < 1) {
|
|
738
|
+
data.saturate = Math.min(1, data.saturate + step)
|
|
739
|
+
} else {
|
|
740
|
+
data.saturate = Math.max(1, data.saturate - step)
|
|
741
|
+
}
|
|
742
|
+
if (data.saturate === 1) {
|
|
743
|
+
checkRemainingInterferences(data, fnc)
|
|
744
|
+
}
|
|
745
|
+
break
|
|
746
|
+
}
|
|
747
|
+
case 'invert': {
|
|
748
|
+
data.invert = false
|
|
749
|
+
checkRemainingInterferences(data, fnc)
|
|
750
|
+
break
|
|
751
|
+
}
|
|
752
|
+
case 'hueRotate': {
|
|
753
|
+
// 向0靠近
|
|
754
|
+
const step = fCompute.randInt(20, 40)
|
|
755
|
+
if (data.hueRotate > 180) {
|
|
756
|
+
data.hueRotate = Math.min(360, data.hueRotate + step)
|
|
757
|
+
if (data.hueRotate >= 360) data.hueRotate = 0
|
|
758
|
+
} else {
|
|
759
|
+
data.hueRotate = Math.max(0, data.hueRotate - step)
|
|
760
|
+
}
|
|
761
|
+
if (data.hueRotate === 0) {
|
|
762
|
+
checkRemainingInterferences(data, fnc)
|
|
763
|
+
}
|
|
764
|
+
break
|
|
765
|
+
}
|
|
766
|
+
case 'lineMode': {
|
|
767
|
+
data.lineMode = false
|
|
768
|
+
checkRemainingInterferences(data, fnc)
|
|
769
|
+
break
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
data.filterStyle = buildFilterStyle(data)
|
|
774
|
+
return nameMap[target] || target
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* 检查是否还有非模糊类干扰,没有则从fnc中移除类型4
|
|
779
|
+
* @param {guessIllData} data
|
|
780
|
+
* @param {number[]} fnc
|
|
781
|
+
*/
|
|
782
|
+
function checkRemainingInterferences(data, fnc) {
|
|
783
|
+
const hasOtherInterference = data.lineMode
|
|
784
|
+
|| (data.saturate !== 1)
|
|
785
|
+
|| (data.invert)
|
|
786
|
+
|| (data.hueRotate !== 0)
|
|
787
|
+
if (!hasOtherInterference) {
|
|
788
|
+
const idx = fnc.indexOf(4)
|
|
789
|
+
if (idx !== -1) fnc.splice(idx, 1)
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* 定义随机抽取曲目的函数
|
|
795
|
+
* @param {botEvent} e
|
|
796
|
+
* @returns {idString}
|
|
797
|
+
*/
|
|
798
|
+
function getRandomSong(e) {
|
|
799
|
+
//对象解构提取groupid
|
|
800
|
+
const group_id = groupKey(e)
|
|
801
|
+
|
|
802
|
+
//计算曲目的总权重
|
|
803
|
+
const totalWeight = Object.values(songweights[group_id]).reduce((total, weight) => total + weight, 0)
|
|
804
|
+
|
|
805
|
+
//生成一个0到总权重之间带有6位小数的随机数
|
|
806
|
+
const randomWeight = fCompute.randFloatBetween(0, totalWeight, 6)
|
|
807
|
+
|
|
808
|
+
let accumulatedWeight = 0
|
|
809
|
+
const ids = /** @type {idString[]} */(Object.keys(songweights[group_id]))
|
|
810
|
+
for (const id of ids) {
|
|
811
|
+
const weight = songweights[group_id][id]
|
|
812
|
+
accumulatedWeight += weight
|
|
813
|
+
if (accumulatedWeight >= randomWeight) {
|
|
814
|
+
songweights[group_id][id] *= 0.4 //权重每次衰减60%
|
|
815
|
+
return id
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
//如果由于浮点数精度问题未能正确选择歌曲,则随机返回一首
|
|
820
|
+
return songIdList[fCompute.randInt(0, songIdList.length - 1)]
|
|
821
|
+
}
|