2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 11:00:51 +08:00

增加星穹铁道图鉴数据

This commit is contained in:
ctrlcvs 2023-06-06 12:41:02 +08:00
parent fa9d0f10ac
commit ff6d0dff37
465 changed files with 26465 additions and 1 deletions

View File

@ -1,3 +1,7 @@
# 1.2.9
* 增加星穹铁道武器图鉴
* 指令`#于夜色中图鉴`
* 需要在设置中开启 指令:`#图鉴设置星铁图鉴开启`
# 1.2.8
* 增加`#原神充值` 原神离线充值
* 增加`#商品列表`

View File

@ -20,6 +20,8 @@ let cfgMap = {
"获取sk":"ck.sk",
"目录":"Atlas.all",
"扫码绑定":'mhy.qrcode',
"星铁图鉴":'sr.Search',
"星铁匹配":'sr.Atlas'
};
let sysCfgReg = `^#图鉴设置\s*(${lodash.keys(cfgMap).join("|")})?\s*(.*)$`;
export const rule = {
@ -80,6 +82,7 @@ export async function sysCfg(e, {
} else {
val = !/关闭/.test(val);
}
if (cfgKey) {
Cfg.set(cfgKey, val);
}
@ -96,6 +99,8 @@ export async function sysCfg(e, {
notePlus: fs.existsSync(notePlus),
bg: await rodom(), //获取底图
Atlasall:getStatus("Atlas.all",false),
srAtlas:getStatus("sr.Atlas",false),
srSearch:getStatus("sr.Search",false),
}
//渲染图像
return await Common.render("admin/index", {

View File

@ -3,6 +3,7 @@ import schedule from "node-schedule";
import {
AtlasAlias,getBasicVoide
} from "./xiaoyao_image.js";
import { srAtlasAlias} from './srGallery.js'
import {
versionInfo,
help
@ -72,7 +73,7 @@ export {
updCookie,
DailyNoteTask,
noteTask,
AtlasAlias,
AtlasAlias,srAtlasAlias,
Note,
};
import gsCfg from '../model/gsCfg.js';
@ -91,6 +92,10 @@ let rule = {
reg: "^(#(.*)|.*图鉴)$",
describe: "角色、食物、怪物、武器信息图鉴",
},
srAtlasAlias: {
reg: "^((#|\\*)(.*)|.*图鉴)$",
describe: "sr 星穹铁道武器信息图鉴",
},
Note: {
reg: "^#*(多|全|全部)*(体力|树脂|查询体力|便笺|便签)$",
describe: "体力",

20
apps/srGallery.js Normal file
View File

@ -0,0 +1,20 @@
import {
Cfg
} from "../components/index.js";
import {AtlasAlias} from '../model/srGallery.js'
export async function srAtlasAlias(e,{render}) {
if (!Cfg.get("sr.Search")) {
return false;
}
let reg = /(#|\*)(.*)/;
if (Cfg.get("sr.Atlas")) {
reg = /(#\*)?(.*)图鉴/;
}
if (!reg.test(e.msg)) {
return false;
}
return await AtlasAlias(e,{render})
}

View File

@ -5,6 +5,10 @@ export const render = async function (path, params, cfg) {
let { render, e } = cfg;
let _layout_path = process.cwd() + "/plugins/xiaoyao-cvs-plugin/resources/";
let layout_path= process.cwd() + "/plugins/xiaoyao-cvs-plugin/resources/common/layout/";
if(paths.length>2){
paths[0] = `${paths[0]}/${paths[1]}`
paths[1] = `${paths[2]}`
}
let base64 = await render(paths[0], paths[1], {
...params,
_layout_path,

View File

@ -17,7 +17,9 @@ if (isV3) {
Bot.logger=logger
index = await Data.importModule('/plugins/xiaoyao-cvs-plugin/adapter', 'index.js')
}
export const atlas = index.atlas || {}
Bot.logger.info(`---------^_^---------`)
Bot.logger.info(`图鉴插件${currentVersion}初始化~`)

89
model/srGallery.js Normal file
View File

@ -0,0 +1,89 @@
import fs from "fs";
import {
Cfg,Data
} from "../components/index.js";
import lodash from 'lodash';
import Common from "../components/Common.js";
const _path = process.cwd();
let pathPlus = `${_path}/plugins/xiaoyao-cvs-plugin/resources/sr/`
export async function AtlasAlias(e,{render}) {
let data =await GetData(e)
if(!data) return false
await Common.render(`sr/weapon/index`, {
...data
},{
e,
render,
scale: 1.4
})
return true
}
export async function GetData(e) {
let name=e.msg.replace(/\*|#|星铁|星穹铁道|图鉴|专武/g,'')
let list = Data.readJSON(pathPlus, 'weapon/data.json')
let items = Data.readJSON(pathPlus, 'items/data.json')
let role=GetRole(name)
if(!role) return false;
name=role.name
let roleData;
let isUp=e.msg.includes('专武');
lodash.forEach(list,(v,k)=>{
if(isUp&&v.belongRole.includes(name)){
roleData= v
return
}else if([v.name,...v.names,...v?.suitRole].includes(name)&&!isUp){
roleData= v
return
}
})
if(roleData){
let newMaterial=[]
for (const materialElement of roleData.material) {
for (const newMaterialElement of materialElement) {
if(!lodash.map(newMaterial,'id').includes(newMaterialElement.id)&&![2].includes(newMaterialElement.id*1)){
newMaterial.push(newMaterialElement)
}else{
for (let v =0;v<newMaterial.length;v++) {
if(newMaterial[v].id==newMaterialElement.id){
newMaterial[v].num+=newMaterialElement.num
}
newMaterial[v]={...items[newMaterial[v].id],...newMaterial[v]}
}
}
}
}
roleData.material=newMaterial
for (const item of Object.keys(roleData.fullValues)) {
let {base,stop} = roleData.fullValues[item]
roleData.fullValues[item]={
base: parseInt(base),stop:parseInt(stop)
}
}
let suitRole=[]
for (const item of roleData.suitRole) {
let list=GetRole(item)
if(roleData.belongRole.includes(item)) list.isUp=true
suitRole.push(list)
}
roleData.suitRole=suitRole
}
return roleData
}
let GetRole=(name)=>{
let list = Data.readJSON(pathPlus, 'character/data.json')
let role;
lodash.forEach(list,(v,k)=>{
if([v.name,...v.names].includes(name)){
role=v
}
})
return role
}

View File

@ -30,6 +30,22 @@
</div>
<div class="cfg-desc">图鉴匹配规则需要 开启:图鉴结尾 关闭:原魔、圣遗物、食物无需图鉴结尾</div>
</li>
<li class="cfg-li">
<div class="cfg-line">
星铁图鉴查询
<span class="cfg-hint"> #图鉴设置星铁图鉴 + 开启/关闭</span>
{{@srSearch}}
</div>
<div class="cfg-desc">sr图鉴当前仅支持武器图鉴数据</div>
</li>
<li class="cfg-li">
<div class="cfg-line">
星铁图鉴匹配查询
<span class="cfg-hint"> #图鉴设置星铁匹配 + 开启/关闭</span>
{{@srAtlas}}
</div>
<div class="cfg-desc">图鉴匹配规则需要 开启:图鉴结尾 关闭:#开头 </div>
</li>
<li class="cfg-li">
<div class="cfg-line">
图鉴目录开关

View File

@ -0,0 +1,258 @@
{
"1001": {
"id": 1001,
"key": "mar7th",
"name": "三月七",
"abbr": "三月七",
"names":["三月七","mar7th","3月7","相遇之缘","37","三月"],
"star": 4,
"elem": "冰",
"weapon": "存护"
},
"1002": {
"id": 1002,
"key": "danheng",
"name": "丹恒",
"abbr": "丹恒",
"names":["单恒","单桓","冷面","小青龙","冷面小青龙"],
"star": 4,
"elem": "风",
"weapon": "巡猎"
},
"1003": {
"id": 1003,
"key": "himeko",
"name": "姬子",
"abbr": "姬子",
"names":["姬子","姬姬子"],
"star": 5,
"elem": "火",
"weapon": "智识"
},
"1004": {
"id": 1004,
"key": "welt",
"name": "瓦尔特",
"abbr": "瓦尔特",
"names":["瓦尔特","老杨","杨叔","瓦尔特杨"],
"star": 5,
"elem": "虚数",
"weapon": "虚无"
},
"1005": {
"id": 1005,
"key": "kafka",
"name": "卡芙卡",
"abbr": "卡芙卡",
"names": ["亲妈","卡芙卡"],
"star": 5,
"elem": "雷",
"weapon": "虚无"
},
"1006": {
"id": 1006,
"key": "silverwolf",
"name": "银狼",
"abbr": "银狼",
"names": ["小鸭鸭","小板鸭","黑客","骇客","骇兔"],
"star": 5,
"elem": "量子",
"weapon": "虚无"
},
"1008": {
"id": 1008,
"key": "arlan",
"name": "阿兰",
"abbr": "阿兰",
"names": ["阿兰"],
"star": 4,
"elem": "雷",
"weapon": "毁灭"
},
"1009": {
"id": 1009,
"key": "asta",
"name": "艾丝妲",
"abbr": "艾丝妲",
"names": ["艾丝妲","宇宙级富婆"],
"star": 4,
"elem": "火",
"weapon": "同谐"
},
"1013": {
"id": 1013,
"key": "herta",
"name": "黑塔",
"abbr": "黑塔",
"names": ["黑塔","转圈圈"],
"star": 4,
"elem": "冰",
"weapon": "智识"
},
"1101": {
"id": 1101,
"key": "bronya",
"name": "布洛妮娅",
"abbr": "布洛妮娅",
"names": ["大鸭鸭","鸭鸭","板鸭","布洛尼亚","布洛妮亚","布洛尼娅"],
"star": 5,
"elem": "风",
"weapon": "同谐"
},
"1102": {
"id": 1102,
"key": "seele",
"name": "希儿",
"abbr": "希儿",
"names": ["希尔","蝴蝶","云天明","随蝴蝶一起消散吧"],
"star": 5,
"elem": "量子",
"weapon": "巡猎"
},
"1103": {
"id": 1103,
"key": "serval",
"name": "希露瓦",
"abbr": "希露瓦",
"names": ["希璐瓦"],
"star": 4,
"elem": "雷",
"weapon": "智识"
},
"1104": {
"id": 1104,
"key": "gepard",
"name": "杰帕德",
"abbr": "杰帕德",
"names": ["杰哥","杰帕德"],
"star": 5,
"elem": "冰",
"weapon": "存护"
},
"1105": {
"id": 1105,
"key": "natasha",
"name": "娜塔莎",
"abbr": "娜塔莎",
"names": ["纳塔莎","纳塔沙","纳塔沙","娜塔莎"],
"star": 4,
"elem": "物理",
"weapon": "丰饶"
},
"1106": {
"id": 1106,
"key": "pela",
"name": "佩拉",
"abbr": "佩拉",
"names": ["佩拉","佩菈"],
"star": 4,
"elem": "冰",
"weapon": "虚无"
},
"1107": {
"id": 1107,
"key": "clara",
"name": "克拉拉",
"abbr": "克拉拉",
"names": ["克拉拉"],
"star": 5,
"elem": "物理",
"weapon": "毁灭"
},
"1108": {
"id": 1108,
"key": "sampo",
"name": "桑博",
"abbr": "桑博",
"names": ["桑柏","桑伯","桑博"],
"star": 4,
"elem": "风",
"weapon": "虚无"
},
"1109": {
"id": 1109,
"key": "hook",
"name": "虎克",
"abbr": "虎克",
"names": ["虎克","胡可","虎克大人","漆黑的虎克","漆黑的虎克大人","鼹鼠党","鼹鼠党老大"],
"star": 4,
"elem": "火",
"weapon": "毁灭"
},
"1201": {
"id": 1201,
"key": "qingque",
"name": "青雀",
"abbr": "青雀",
"names": ["青雀","赌神","赌圣","青鹊"],
"star": 4,
"elem": "量子",
"weapon": "智识"
},
"1202": {
"id": 1202,
"key": "tingyun",
"name": "停云",
"abbr": "停云",
"names": ["停云","狐狸精"],
"star": 4,
"elem": "雷",
"weapon": "同谐"
},
"1203": {
"id": 1203,
"key": "luocha",
"name": "罗刹",
"abbr": "罗刹",
"names": ["罗刹","罗沙","罗杀"],
"star": 5,
"elem": "虚数",
"weapon": "丰饶"
},
"1204": {
"id": 1204,
"key": "jingyuan",
"name": "景元",
"abbr": "景元",
"names": ["景元","景原","景源","神君发射器"],
"star": 5,
"elem": "雷",
"weapon": "智识"
},
"1206": {
"id": 1206,
"key": "sushang",
"name": "素裳",
"abbr": "素裳",
"names": ["素裳"],
"star": 4,
"elem": "物理",
"weapon": "巡猎"
},
"1209": {
"id": 1209,
"key": "yanqing",
"name": "彦卿",
"abbr": "彦卿",
"names": ["彦卿","延卿","闫卿","彦清","彦青"],
"star": 5,
"elem": "冰",
"weapon": "巡猎"
},
"1211": {
"id": 1211,
"key": "bailu",
"name": "白露",
"abbr": "白露",
"names": ["白露","小龙人","白鹿"],
"star": 5,
"elem": "雷",
"weapon": "丰饶"
},
"8002": {
"id": 8002,
"name": "开拓者",
"names": ["开拓者","星"],
"star": 5
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Some files were not shown because too many files have changed in this diff Show More