mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-21 22:48:13 +00:00
增加#添加刻晴图像
命令,感谢 **@叶**
* 可通过命令上传添加指定角色图片,上传至 **resources/character-img/刻晴/upload** * 请将图像与命令一同发送,后续会支持at图像及命令后发送图像 部分功能的页面文案及功能优化
This commit is contained in:
parent
10ff5c1a9b
commit
67394bf623
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
|||||||
/components/setting.json
|
/components/setting.json
|
||||||
/config.js
|
/config.js
|
||||||
*.css.map
|
*.css.map
|
||||||
|
/resources/character-img/*/upload/
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
# 1.8.1
|
||||||
|
|
||||||
|
* 增加`#添加刻晴图像`命令,感谢 **@叶**
|
||||||
|
* 可通过命令上传添加指定角色图片,上传至 **resources/character-img/刻晴/upload**
|
||||||
|
* 请将图像与命令一同发送,后续会支持at图像及命令后发送图像
|
||||||
|
* 部分功能的页面文案及功能优化
|
||||||
|
|
||||||
# 1.8.0
|
# 1.8.0
|
||||||
|
|
||||||
* `#角色面板`、`#圣遗物列表` 使用新的圣遗物评分逻辑计算评分
|
* `#角色面板`、`#圣遗物列表` 使用新的圣遗物评分逻辑计算评分
|
||||||
@ -22,7 +29,6 @@
|
|||||||
* 角色图像增加小清新开关,默认关闭
|
* 角色图像增加小清新开关,默认关闭
|
||||||
* 对增量包内的角色图像进行分级,较为清凉的图像独立管理
|
* 对增量包内的角色图像进行分级,较为清凉的图像独立管理
|
||||||
* 勇士们可使用 `#喵喵设置小清新开启` 启用
|
* 勇士们可使用 `#喵喵设置小清新开启` 启用
|
||||||
* 自行添加请到 **resources/character-img/** 的对应角色目录下添加
|
|
||||||
* 伤害计算增加扩散、感电的计算逻辑,感谢 **@49631073**的逻辑梳理
|
* 伤害计算增加扩散、感电的计算逻辑,感谢 **@49631073**的逻辑梳理
|
||||||
* `#角色面板` 伤害计算增加部分角色,目前支持
|
* `#角色面板` 伤害计算增加部分角色,目前支持
|
||||||
* 长柄武器:雷神、胡桃、魈、钟离、香菱
|
* 长柄武器:雷神、胡桃、魈、钟离、香菱
|
||||||
|
@ -8,6 +8,9 @@ import { renderProfile } from "./character/profile-detail.js";
|
|||||||
|
|
||||||
export { enemyLv, getOriginalPicture } from "./character/utils.js";
|
export { enemyLv, getOriginalPicture } from "./character/utils.js";
|
||||||
|
|
||||||
|
// 角色图像上传
|
||||||
|
export { uploadCharacterImg } from "./character/character-img-upload.js";
|
||||||
|
|
||||||
//
|
//
|
||||||
export { getProfileAll, getProfile, profileHelp };
|
export { getProfileAll, getProfile, profileHelp };
|
||||||
|
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
import { segment } from "oicq";
|
|
||||||
import fetch from "node-fetch";
|
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import Data from "../components/Data.js";
|
|
||||||
import { Character } from "../components/models.js";
|
|
||||||
import lodash from "lodash";
|
|
||||||
import { promisify } from "util";
|
import { promisify } from "util";
|
||||||
import { pipeline } from "stream";
|
import { pipeline } from "stream";
|
||||||
|
import { segment } from "oicq";
|
||||||
|
import MD5 from "md5";
|
||||||
|
import fetch from "node-fetch";
|
||||||
|
import lodash from "lodash";
|
||||||
|
import Data from "../../components/Data.js";
|
||||||
|
import { Character } from "../../components/models.js";
|
||||||
|
|
||||||
|
|
||||||
const rootPath = process.cwd() + "/plugins/miao-plugin/";
|
const _res_path = process.cwd() + "/plugins/miao-plugin/resources/";
|
||||||
let regex = /^#*喵喵(上传|添加)(.+)写真.*$/;
|
let regex = /^#?\s*(?:喵喵)?(?:上传|添加)(.+)(?:照片|写真|图片|图像)\s*$/;
|
||||||
|
|
||||||
export const rule = {
|
export const rule = {
|
||||||
uploadCharacterImage: {
|
uploadCharacterImage: {
|
||||||
@ -19,47 +20,48 @@ export const rule = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function uploadCharacterImage(e) {
|
export async function uploadCharacterImg(e) {
|
||||||
let promise = await isAllowedToUploadCharacterImage(e);
|
let promise = await isAllowedToUploadCharacterImage(e);
|
||||||
if (!promise) {
|
if (!promise) {
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let imageMessages = [];
|
let imageMessages = [];
|
||||||
let msg = e.msg;
|
let msg = e.msg;
|
||||||
let regexResult = regex.exec(msg);
|
let regRet = regex.exec(msg);
|
||||||
//通过解析正则获取消息中的角色名
|
//通过解析正则获取消息中的角色名
|
||||||
let characterName = regexResult[2];
|
if (!regRet || !regRet[1]) {
|
||||||
//将消息中的角色名转换为官方名称
|
return;
|
||||||
let officialName = Character.get(characterName).name;
|
|
||||||
if (officialName === undefined) {
|
|
||||||
e.reply("未查询到该角色。请输入有效的角色名或别名。");
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
console.log("本次要上传的角色是: ", officialName);
|
let char = Character.get(regRet[1]);
|
||||||
|
if (!char || !char.name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let name = char.name;
|
||||||
for (let val of e.message) {
|
for (let val of e.message) {
|
||||||
if ("image" === val.type) {
|
if ("image" === val.type) {
|
||||||
imageMessages.push(val);
|
imageMessages.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (imageMessages.length <= 0) {
|
if (imageMessages.length <= 0) {
|
||||||
e.reply("消息中未找到图片,无法添加。");
|
// TODO 支持at图片添加,以及支持后发送
|
||||||
|
e.reply("消息中未找到图片,请将要发送的图片与消息一同发送..");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
await saveImages(e, officialName, imageMessages);
|
await saveImages(e, name, imageMessages);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveImages(e, officialName, imageMessages) {
|
async function saveImages(e, name, imageMessages) {
|
||||||
let imgMaxSize = e.groupConfig.imgMaxSize || 1;
|
let imgMaxSize = e.groupConfig.imgMaxSize || 1;
|
||||||
let pathSuffix = "resources/miao-res-plus/character-img/" + officialName;
|
let pathSuffix = `character-img/${name}/upload`;
|
||||||
let path = rootPath + pathSuffix;
|
let path = _res_path + pathSuffix;
|
||||||
|
|
||||||
if (!fs.existsSync(path)) {
|
if (!fs.existsSync(path)) {
|
||||||
console.log("路径不存在,创建目录: ", path);
|
Data.createDir(_res_path, pathSuffix);
|
||||||
Data.createDir(rootPath, pathSuffix);
|
|
||||||
}
|
}
|
||||||
let senderName = lodash.truncate(e.sender.card, { length: 8 });
|
let senderName = lodash.truncate(e.sender.card, { length: 8 });
|
||||||
|
let imgCount = 0;
|
||||||
for (let val of imageMessages) {
|
for (let val of imageMessages) {
|
||||||
const response = await fetch(val.url);
|
const response = await fetch(val.url);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
@ -75,12 +77,27 @@ async function saveImages(e, officialName, imageMessages) {
|
|||||||
if (response.headers.get("content-type") === "image/gif") {
|
if (response.headers.get("content-type") === "image/gif") {
|
||||||
fileType = "gif";
|
fileType = "gif";
|
||||||
}
|
}
|
||||||
|
let imgPath = `${path}/${fileName}.${fileType}`;
|
||||||
const streamPipeline = promisify(pipeline);
|
const streamPipeline = promisify(pipeline);
|
||||||
await streamPipeline(response.body, fs.createWriteStream(`${path}/${fileName}.${fileType}`));
|
await streamPipeline(response.body, fs.createWriteStream(imgPath));
|
||||||
|
|
||||||
|
// 使用md5作为文件名
|
||||||
|
let buffers = fs.readFileSync(imgPath);
|
||||||
|
let base64 = new Buffer.from(buffers, 'base64').toString();
|
||||||
|
let md5 = MD5(base64);
|
||||||
|
let newImgPath = `${path}/${md5}.${fileType}`
|
||||||
|
if (fs.existsSync(newImgPath)) {
|
||||||
|
fs.unlink(newImgPath, (err) => {
|
||||||
|
console.log('unlink', err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
fs.rename(imgPath, newImgPath, (err) => {
|
||||||
|
console.log('rename', err);
|
||||||
|
})
|
||||||
|
imgCount++;
|
||||||
Bot.logger.mark(`添加成功: ${path}/${fileName}`);
|
Bot.logger.mark(`添加成功: ${path}/${fileName}`);
|
||||||
}
|
}
|
||||||
e.reply([segment.at(e.user_id, senderName), `\n添加${officialName}信息成功。`]);
|
e.reply([segment.at(e.user_id, senderName), `\n成功添加${imgCount}张${name}图片。`]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,6 +108,11 @@ async function isAllowedToUploadCharacterImage(e) {
|
|||||||
if (!e.msg) {
|
if (!e.msg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!e.isMaster) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 由于添加角色图是全局,暂时屏蔽非管理员的添加
|
||||||
if (e.isPrivate) {
|
if (e.isPrivate) {
|
||||||
if (!e.isMaster) {
|
if (!e.isMaster) {
|
||||||
e.reply(`只有主人才能添加。`);
|
e.reply(`只有主人才能添加。`);
|
@ -4,7 +4,7 @@
|
|||||||
* */
|
* */
|
||||||
import lodash from "lodash";
|
import lodash from "lodash";
|
||||||
import { Profile, Common, Models, Format } from "../../components/index.js";
|
import { Profile, Common, Models, Format } from "../../components/index.js";
|
||||||
import { getTargetUid, profileHelp } from "./profile-common.js";
|
import { autoRefresh, getTargetUid, profileHelp, autoGetProfile } from "./profile-common.js";
|
||||||
import { Character, Artifact } from "../../components/models.js";
|
import { Character, Artifact } from "../../components/models.js";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -13,11 +13,22 @@ import { Character, Artifact } from "../../components/models.js";
|
|||||||
export async function profileArtis(e, { render }) {
|
export async function profileArtis(e, { render }) {
|
||||||
let { uid, avatar } = e;
|
let { uid, avatar } = e;
|
||||||
|
|
||||||
let profile = await Profile.get(uid, avatar);
|
let { profile, char, err } = await autoGetProfile(e, uid, avatar, async () => {
|
||||||
let char = Character.get(profile.name);
|
await profileArtis(e, { render });
|
||||||
|
});
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let charCfg = Artifact.getCharCfg(profile.name);
|
let charCfg = Artifact.getCharCfg(profile.name);
|
||||||
let { artis, totalMark, totalMarkClass, usefulMark } = getArtis(profile.name, profile.artis);
|
let { artis, totalMark, totalMarkClass, usefulMark } = getArtis(profile.name, profile.artis);
|
||||||
|
|
||||||
|
if (!profile.artis || profile.artis.length === 0) {
|
||||||
|
e.reply("未能获得圣遗物详情,请重新获取面板信息后查看")
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
let { attrMap } = Artifact.getMeta();
|
let { attrMap } = Artifact.getMeta();
|
||||||
|
|
||||||
//渲染图像
|
//渲染图像
|
||||||
@ -52,7 +63,6 @@ export async function profileArtisList(e, { render }) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lodash.forEach(profiles || [], (ds) => {
|
lodash.forEach(profiles || [], (ds) => {
|
||||||
let name = ds.name;
|
let name = ds.name;
|
||||||
if (!name || name === "空" || name === "荧") {
|
if (!name || name === "空" || name === "荧") {
|
||||||
|
@ -95,7 +95,7 @@ export async function autoRefresh(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!data.chars) {
|
if (!data.chars) {
|
||||||
e.reply("请确认角色已在【游戏内】橱窗展示并开放了查看详情。设置完毕后请5分钟后使用 #面板更新 重新获取");
|
e.reply("请确认角色已在【游戏内】橱窗展示并开放了查看详情。请在设置完毕5分钟后使用 #面板更新 重新获取");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
let ret = [];
|
let ret = [];
|
||||||
@ -106,7 +106,7 @@ export async function autoRefresh(e) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (ret.length === 0) {
|
if (ret.length === 0) {
|
||||||
e.reply("请确认角色已在【游戏内】橱窗展示并开放了查看详情。设置完毕后请5分钟后使用 #面板更新 重新获取")
|
e.reply("请确认角色已在【游戏内】橱窗展示并开放了查看详情。请在设置完毕5分钟后使用 #面板更新 重新获取")
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// e.reply(`本次获取成功角色: ${ret.join(", ")} `)
|
// e.reply(`本次获取成功角色: ${ret.join(", ")} `)
|
||||||
@ -116,6 +116,40 @@ export async function autoRefresh(e) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function autoGetProfile(e, uid, avatar, callback) {
|
||||||
|
|
||||||
|
let refresh = async () => {
|
||||||
|
let refreshRet = await autoRefresh(e);
|
||||||
|
if (refreshRet) {
|
||||||
|
await callback();
|
||||||
|
}
|
||||||
|
return refreshRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
let char = Character.get(avatar);
|
||||||
|
if (!char) {
|
||||||
|
return { err: true };
|
||||||
|
}
|
||||||
|
|
||||||
|
let profile = await Profile.get(uid, char.id);
|
||||||
|
if (!profile) {
|
||||||
|
if (await refresh()) {
|
||||||
|
return { err: true };
|
||||||
|
} else {
|
||||||
|
e.reply(`请确认${char.name}已展示在【游戏内】的角色展柜中,并打开了“显示角色详情”。然后请使用 #更新面板\n命令来获取${char.name}的面板详情`);
|
||||||
|
}
|
||||||
|
return { err: true };
|
||||||
|
} else if (!['enka', 'input2', 'miao', 'miao-pre'].includes(profile.dataSource)) {
|
||||||
|
if (!await refresh()) {
|
||||||
|
e.reply(`由于数据格式升级,请重新获取面板信息后查看`);
|
||||||
|
}
|
||||||
|
return { err: true };
|
||||||
|
}
|
||||||
|
|
||||||
|
return { profile, char, refresh }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 面板数据更新
|
* 面板数据更新
|
||||||
* */
|
* */
|
||||||
|
@ -19,7 +19,7 @@ export async function wiki(e, { render }) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let reg = /#?(.+)(命座|命之座|天赋|技能|资料|照片|写真|图片|插画)$/, msg = e.msg;
|
let reg = /#?(.+)(命座|命之座|天赋|技能|资料|照片|写真|图片|图像)$/, msg = e.msg;
|
||||||
let ret = reg.exec(msg);
|
let ret = reg.exec(msg);
|
||||||
|
|
||||||
if (!ret || !ret[1] || !ret[2]) {
|
if (!ret || !ret[1] || !ret[2]) {
|
||||||
|
@ -28,6 +28,9 @@ function sleep(ms) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getServ(uid) {
|
function getServ(uid) {
|
||||||
|
if (config.profileApi) {
|
||||||
|
return config.profileApi({ Enka, Miao })
|
||||||
|
}
|
||||||
if ((uid + '')[0] === '5') {
|
if ((uid + '')[0] === '5') {
|
||||||
return Miao;
|
return Miao;
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ class Character extends Base {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
addImg(`character-img/${name}`);
|
addImg(`character-img/${name}`);
|
||||||
|
addImg(`character-img/${name}/upload`);
|
||||||
addImg(`character-img/${name}/se`, !se)
|
addImg(`character-img/${name}/se`, !se)
|
||||||
|
|
||||||
const plusPath = `./plugins/miao-plugin/resources/miao-res-plus/`;
|
const plusPath = `./plugins/miao-plugin/resources/miao-res-plus/`;
|
||||||
|
@ -4,26 +4,21 @@ import Data from "./enka-data.js";
|
|||||||
let Enka = {
|
let Enka = {
|
||||||
key: "enka",
|
key: "enka",
|
||||||
cd: 5,
|
cd: 5,
|
||||||
async request({ e, uid, config }) {
|
async request({ e, uid, avatar, config }) {
|
||||||
let profileApi = config.profileApi || function (uid) {
|
let profileApi = config.enkaApi || function ({ uid }) {
|
||||||
return `https://enka.shinshin.moe/u/${uid}/__data.json`
|
return `https://enka.shinshin.moe/u/${uid}/__data.json`
|
||||||
};
|
};
|
||||||
let api = profileApi(uid);
|
let api = profileApi({ uid, avatar });
|
||||||
|
|
||||||
let req = await fetch(api);
|
let req = await fetch(api);
|
||||||
let data = await req.json();
|
let data = await req.json();
|
||||||
if (!data.playerInfo) {
|
if (!data.playerInfo) {
|
||||||
if ((uid + '')[0] === '5') {
|
e.reply(`请求失败:${data.msg || "可能是面板服务并发过高,请稍后重试"}`);
|
||||||
e.reply(`请求失败:暂时不支持B服角色面板更新,请等待服务后续升级`);
|
|
||||||
} else {
|
|
||||||
e.reply(`请求失败:${data.msg || "请求错误,请稍后重试"}`);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let details = data.avatarInfoList;
|
let details = data.avatarInfoList;
|
||||||
if (!details || details.length === 0 || !details[0].propMap) {
|
if (!details || details.length === 0 || !details[0].propMap) {
|
||||||
e.reply(`请打开角色展柜的显示详情`);
|
e.reply(`请打开游戏内角色展柜的“显示详情”后,等待5分钟重新获取面板`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return Data.getData(uid, data);
|
return Data.getData(uid, data);
|
||||||
|
@ -10,10 +10,12 @@ const url = "http://49.232.91.210/profile";
|
|||||||
let Miao = {
|
let Miao = {
|
||||||
key: "miao",
|
key: "miao",
|
||||||
cd: 1,
|
cd: 1,
|
||||||
async request({ e, uid, avatar = '' }) {
|
async request({ e, uid, avatar = '', config }) {
|
||||||
let api = `${url}/list?uid=${uid}`;
|
let profileApi = config.miaoApi && lodash.isFunction(config.miaoApi) ? config.miaoApi : function ({ uid }) {
|
||||||
|
return `http://49.232.91.210/profile/list?uid=${uid}`
|
||||||
|
};
|
||||||
|
let api = profileApi({ uid, avatar });
|
||||||
let data;
|
let data;
|
||||||
|
|
||||||
let req = await fetch(api);
|
let req = await fetch(api);
|
||||||
data = await req.json();
|
data = await req.json();
|
||||||
if (data.status !== 0) {
|
if (data.status !== 0) {
|
||||||
@ -21,7 +23,7 @@ let Miao = {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!data.uidListData || data.uidListData.length === 0) {
|
if (!data.uidListData || data.uidListData.length === 0) {
|
||||||
e.reply(`请打开角色展柜的显示详情`);
|
e.reply(`请打开游戏内角色展柜的“显示详情”后,等待5分钟重新获取面板`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
25
index.js
25
index.js
@ -6,8 +6,10 @@ export {
|
|||||||
profileArtisList,
|
profileArtisList,
|
||||||
getProfileAll,
|
getProfileAll,
|
||||||
profileHelp,
|
profileHelp,
|
||||||
getOriginalPicture
|
getOriginalPicture,
|
||||||
|
uploadCharacterImg
|
||||||
} from "./apps/character.js";
|
} from "./apps/character.js";
|
||||||
|
|
||||||
import { wifeReg } from "./apps/character.js";
|
import { wifeReg } from "./apps/character.js";
|
||||||
|
|
||||||
import { consStat, abyssPct, abyssTeam } from "./apps/stat.js";
|
import { consStat, abyssPct, abyssTeam } from "./apps/stat.js";
|
||||||
@ -17,9 +19,7 @@ import lodash from "lodash";
|
|||||||
import common from "../../lib/common.js";
|
import common from "../../lib/common.js";
|
||||||
import { rule as adminRule, updateRes, sysCfg, updateMiaoPlugin, profileCfg } from "./apps/admin.js";
|
import { rule as adminRule, updateRes, sysCfg, updateMiaoPlugin, profileCfg } from "./apps/admin.js";
|
||||||
import { currentVersion } from "./components/Changelog.js";
|
import { currentVersion } from "./components/Changelog.js";
|
||||||
import {
|
|
||||||
uploadCharacterImage
|
|
||||||
} from "./apps/uploadCharacterImage.js";
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
consStat,
|
consStat,
|
||||||
@ -32,8 +32,7 @@ export {
|
|||||||
help,
|
help,
|
||||||
versionInfo,
|
versionInfo,
|
||||||
calendar,
|
calendar,
|
||||||
profileCfg,
|
profileCfg
|
||||||
uploadCharacterImage
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -43,6 +42,10 @@ let rule = {
|
|||||||
//reg: "noCheck",
|
//reg: "noCheck",
|
||||||
describe: "【#角色】角色详情",
|
describe: "【#角色】角色详情",
|
||||||
},
|
},
|
||||||
|
uploadCharacterImg: {
|
||||||
|
reg: "^#*(喵喵)?(上传|添加)(.+)(照片|写真|图片|图像)\\s*$",
|
||||||
|
describe: "喵喵上传角色写真",
|
||||||
|
},
|
||||||
profileArtisList: {
|
profileArtisList: {
|
||||||
reg: "^#圣遗物列表\\s*(\\d{9})?$",
|
reg: "^#圣遗物列表\\s*(\\d{9})?$",
|
||||||
describe: "【#角色】圣遗物列表",
|
describe: "【#角色】圣遗物列表",
|
||||||
@ -63,10 +66,6 @@ let rule = {
|
|||||||
reg: "^#?(获取|给我|我要|求|发|发下|发个|发一下)?原图(吧|呗)?$",
|
reg: "^#?(获取|给我|我要|求|发|发下|发个|发一下)?原图(吧|呗)?$",
|
||||||
describe: "【#原图】 回复角色卡片,可获取原图",
|
describe: "【#原图】 回复角色卡片,可获取原图",
|
||||||
},
|
},
|
||||||
uploadCharacterImage: {
|
|
||||||
reg: "^#*喵喵(上传|添加)(.+)写真.*$",
|
|
||||||
describe: "喵喵上传角色写真",
|
|
||||||
},
|
|
||||||
consStat: {
|
consStat: {
|
||||||
reg: "^#(喵喵)?角色(持有|持有率|命座|命之座|.命)(分布|统计|持有|持有率)?$",
|
reg: "^#(喵喵)?角色(持有|持有率|命座|命之座|.命)(分布|统计|持有|持有率)?$",
|
||||||
describe: "【#统计】 #角色持有率 #角色5命统计",
|
describe: "【#统计】 #角色持有率 #角色5命统计",
|
||||||
@ -80,7 +79,7 @@ let rule = {
|
|||||||
describe: "【#角色】 #深渊组队",
|
describe: "【#角色】 #深渊组队",
|
||||||
},
|
},
|
||||||
wiki: {
|
wiki: {
|
||||||
reg: "^(#|喵喵)?.*(天赋|技能|命座|命之座|资料|照片|写真|图片|插画)$",
|
reg: "^(#|喵喵)?.*(天赋|技能|命座|命之座|资料|照片|写真|图片|图像)$",
|
||||||
describe: "【#资料】 #神里天赋 #夜兰命座",
|
describe: "【#资料】 #神里天赋 #夜兰命座",
|
||||||
},
|
},
|
||||||
help: {
|
help: {
|
||||||
@ -96,11 +95,11 @@ let rule = {
|
|||||||
describe: "【#角色】 设置伤害计算中目标敌人的等级",
|
describe: "【#角色】 设置伤害计算中目标敌人的等级",
|
||||||
},
|
},
|
||||||
versionInfo: {
|
versionInfo: {
|
||||||
reg: "^#喵喵版本$",
|
reg: "^#?喵喵版本$",
|
||||||
describe: "【#帮助】 喵喵版本介绍",
|
describe: "【#帮助】 喵喵版本介绍",
|
||||||
},
|
},
|
||||||
calendar: {
|
calendar: {
|
||||||
reg: "^#喵喵(日历|活动|日历列表)$",
|
reg: "^#?喵喵(日历|活动|日历列表)$",
|
||||||
describe: "【#日历】 活动日历",
|
describe: "【#日历】 活动日历",
|
||||||
},
|
},
|
||||||
...adminRule
|
...adminRule
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
<div>副词条最高分</div>
|
<div>副词条最高分</div>
|
||||||
<div>主词条最高分</div>
|
<div>主词条最高分</div>
|
||||||
</div>
|
</div>
|
||||||
{{each attrMap ds key}}{{if ds.type!== "plus"}}
|
{{each attrMap ds key}}{{if ds.type!== "plus" && charCfg.weight[key] > 0}}
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="th">{{ds.title}}</div>
|
<div class="th">{{ds.title}}</div>
|
||||||
<div class="td">{{charCfg.weight[key]}}</div>
|
<div class="td">{{charCfg.weight[key]}}</div>
|
||||||
@ -125,10 +125,10 @@
|
|||||||
{{/if}}{{/each}}
|
{{/if}}{{/each}}
|
||||||
</div>
|
</div>
|
||||||
<ul class="cont-msg">
|
<ul class="cont-msg">
|
||||||
<li>每个角色有不同的词条评分权重,后续会逐步扩充不同流派的规则</li>
|
<li>每个角色有不同的词条评分权重(已隐藏权重为0的词条),后续会逐步扩充不同流派的规则</li>
|
||||||
<li>以权重值100的单词条理论最高分46.6分为基准,根据权重值及当前词条成长计算每点得分</li>
|
<li>以权重值100的单词条理论最高分46.6分为基准,根据权重值及当前词条成长计算每点得分</li>
|
||||||
<li><strong>词条得分:</strong> 词条数值 * 当前词条每点得分。小攻击、小防御、小生命折算为对应百分比词条进行计分</li>
|
<li><strong>词条得分:</strong> 词条数值 * 当前词条每点得分。小攻击、小防御、小生命折算为对应百分比词条进行计分</li>
|
||||||
<li><strong>原始总分:</strong>计算所有副词条的评分之和,沙杯头三个位置附加25%的主词条评分</li>
|
<li><strong>原始总分(对齐前):</strong>计算所有副词条的评分之和,沙杯头三个位置附加25%的主词条评分</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -147,15 +147,7 @@
|
|||||||
<div>理之冠</div>
|
<div>理之冠</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="th">最优主词条权重值</div>
|
<div class="th">最高分(对齐前)</div>
|
||||||
<div>-</div>
|
|
||||||
<div>-</div>
|
|
||||||
<div>{{charCfg.maxMark.m3}}</div>
|
|
||||||
<div>{{charCfg.maxMark.m4}}</div>
|
|
||||||
<div>{{charCfg.maxMark.m5}}</div>
|
|
||||||
</div>
|
|
||||||
<div class="tr">
|
|
||||||
<div class="th">理论最高原始总分</div>
|
|
||||||
{{each charCfg.maxMark m key}}
|
{{each charCfg.maxMark m key}}
|
||||||
{{if key.length === 1}}
|
{{if key.length === 1}}
|
||||||
<div>{{ mark( m / 6 )}}</div>
|
<div>{{ mark( m / 6 )}}</div>
|
||||||
@ -163,13 +155,21 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="th">理论总分对齐比例</div>
|
<div class="th">总分对齐比例</div>
|
||||||
{{each charCfg.maxMark m key}}
|
{{each charCfg.maxMark m key}}
|
||||||
{{if key.length === 1}}
|
{{if key.length === 1}}
|
||||||
<div>{{( 66 / (46.6/6/100 * m) * 100).toFixed(1)}}%</div>
|
<div>{{( 66 / (46.6/6/100 * m) * 100).toFixed(1)}}%</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tr">
|
||||||
|
<div class="th">最优主词缀权重</div>
|
||||||
|
<div>-</div>
|
||||||
|
<div>-</div>
|
||||||
|
<div>{{charCfg.maxMark.m3}}</div>
|
||||||
|
<div>{{charCfg.maxMark.m4}}</div>
|
||||||
|
<div>{{charCfg.maxMark.m5}}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="cont-msg">
|
<ul class="cont-msg">
|
||||||
<li><strong>总分对齐比例: </strong>根据<strong>{{data.name}}</strong>不同圣遗物位置可选词条及评分,计算理论最高原始词条总分。为使不同角色不同位置最终总分对齐,规定圣遗物满分为66分。理论总分对齐比例
|
<li><strong>总分对齐比例: </strong>根据<strong>{{data.name}}</strong>不同圣遗物位置可选词条及评分,计算理论最高原始词条总分。为使不同角色不同位置最终总分对齐,规定圣遗物满分为66分。理论总分对齐比例
|
||||||
|
@ -45,7 +45,8 @@
|
|||||||
{{each cons con idx}}
|
{{each cons con idx}}
|
||||||
<div class="cons-item">
|
<div class="cons-item">
|
||||||
<div class="talent-icon {{idx * 1 > data.cons * 1 ? 'off' : '' }}">
|
<div class="talent-icon {{idx * 1 > data.cons * 1 ? 'off' : '' }}">
|
||||||
<div class="talent-icon-img" style="background-image:url({{_res_path}}/meta/character/{{name}}/cons_{{idx}}.png)"></div>
|
<div class="talent-icon-img"
|
||||||
|
style="background-image:url({{_res_path}}/meta/character/{{name}}/cons_{{idx}}.png)"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
@ -102,6 +103,12 @@
|
|||||||
面板信息来源于手工输入,面板信息及伤害计算可能不准确。通过<strong>#录入{{name}}面板</strong>可录入面板数据
|
面板信息来源于手工输入,面板信息及伤害计算可能不准确。通过<strong>#录入{{name}}面板</strong>可录入面板数据
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{else if mode === "profile"}}
|
||||||
|
<div class="cont">
|
||||||
|
<div class="cont-footer dmg-desc">
|
||||||
|
当前评分为<strong>喵喵版评分规则</strong>,分值仅供参考。可使用<strong>#{{name}}圣遗物</strong>来查看评分详情
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{if mode === "profile" && dataSource === "input2"}}
|
{{if mode === "profile" && dataSource === "input2"}}
|
||||||
|
BIN
resources/common/bg/bg-dendro.jpg
Normal file
BIN
resources/common/bg/bg-dendro.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 202 KiB |
BIN
resources/common/bg/talent-dendro.png
Normal file
BIN
resources/common/bg/talent-dendro.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
@ -213,6 +213,13 @@ body {
|
|||||||
.pyro-bg {
|
.pyro-bg {
|
||||||
background-image: url("./bg/bg-pyro.jpg");
|
background-image: url("./bg/bg-pyro.jpg");
|
||||||
}
|
}
|
||||||
|
.elem-dendro .talent-icon {
|
||||||
|
background-image: url("./bg/talent-dendro.png");
|
||||||
|
}
|
||||||
|
.elem-dendro .elem-bg,
|
||||||
|
.dendro-bg {
|
||||||
|
background-image: url("./bg/bg-dendro.jpg");
|
||||||
|
}
|
||||||
/* cont */
|
/* cont */
|
||||||
.cont {
|
.cont {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
@ -162,7 +162,7 @@ body {
|
|||||||
|
|
||||||
/******** ELEM ********/
|
/******** ELEM ********/
|
||||||
|
|
||||||
@elems: anemo, cryo, electro, geo, hydro, pyro;
|
@elems: anemo, cryo, electro, geo, hydro, pyro, dendro;
|
||||||
|
|
||||||
each(@elems, {
|
each(@elems, {
|
||||||
.elem-@{value} .talent-icon {
|
.elem-@{value} .talent-icon {
|
||||||
|
@ -65,7 +65,7 @@ export const usefulAttr = {
|
|||||||
'珊瑚宫心海': { hp: 100, atk: 50, def: 0, cp: 0, cd: 0, mastery: 0, dmg: 100, phy: 0, recharge: 55, heal: 100 },
|
'珊瑚宫心海': { hp: 100, atk: 50, def: 0, cp: 0, cd: 0, mastery: 0, dmg: 100, phy: 0, recharge: 55, heal: 100 },
|
||||||
'莫娜': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 75, heal: 0 },
|
'莫娜': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 75, heal: 0 },
|
||||||
'阿贝多': { hp: 0, atk: 0, def: 100, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'阿贝多': { hp: 0, atk: 0, def: 100, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
'迪奥娜': { hp: 100, atk: 0, def: 0, cp: 0, cd: 0, mastery: 0, dmg: 65, phy: 0, recharge: 55, heal: 100 },
|
'迪奥娜': { hp: 100, atk: 50, def: 0, cp: 50, cd: 50, mastery: 0, dmg: 100, phy: 0, recharge: 75, heal: 100 },
|
||||||
'优菈': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 40, phy: 100, recharge: 40, heal: 0 },
|
'优菈': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 40, phy: 100, recharge: 40, heal: 0 },
|
||||||
'达达利亚': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'达达利亚': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
'魈': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'魈': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
@ -78,7 +78,7 @@ export const usefulAttr = {
|
|||||||
'凝光': { hp: 0, atk: 80, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'凝光': { hp: 0, atk: 80, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
'北斗': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 },
|
'北斗': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 0 },
|
||||||
'刻晴': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 100, recharge: 0, heal: 0 },
|
'刻晴': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 100, recharge: 0, heal: 0 },
|
||||||
'托马': { hp: 100, atk: 0, def: 0, cp: 50, cd: 50, mastery: 0, dmg: 75, phy: 0, recharge: 55, heal: 0 },
|
'托马': { hp: 100, atk: 50, def: 0, cp: 50, cd: 50, mastery: 0, dmg: 75, phy: 0, recharge: 55, heal: 0 },
|
||||||
'迪卢克': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'迪卢克': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
'芭芭拉': { hp: 100, atk: 50, def: 0, cp: 75, cd: 75, mastery: 0, dmg: 80, phy: 0, recharge: 55, heal: 100 },
|
'芭芭拉': { hp: 100, atk: 50, def: 0, cp: 75, cd: 75, mastery: 0, dmg: 80, phy: 0, recharge: 55, heal: 100 },
|
||||||
'芭芭拉-暴力': { hp: 50, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 50 },
|
'芭芭拉-暴力': { hp: 50, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 55, heal: 50 },
|
||||||
@ -88,7 +88,7 @@ export const usefulAttr = {
|
|||||||
'七七': { hp: 0, atk: 100, def: 0, cp: 75, cd: 75, mastery: 0, dmg: 60, phy: 70, recharge: 55, heal: 100 },
|
'七七': { hp: 0, atk: 100, def: 0, cp: 75, cd: 75, mastery: 0, dmg: 60, phy: 70, recharge: 55, heal: 100 },
|
||||||
'凯亚': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 100, recharge: 0, heal: 0 },
|
'凯亚': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 100, recharge: 0, heal: 0 },
|
||||||
'烟绯': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'烟绯': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
'早柚': { hp: 0, atk: 0, def: 0, cp: 0, cd: 0, mastery: 100, dmg: 80, phy: 0, recharge: 55, heal: 100 },
|
'早柚': { hp: 0, atk: 50, def: 0, cp: 50, cd: 50, mastery: 100, dmg: 80, phy: 0, recharge: 55, heal: 100 },
|
||||||
'安柏': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 100, recharge: 0, heal: 0 },
|
'安柏': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 100, recharge: 0, heal: 0 },
|
||||||
'丽莎': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'丽莎': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 75, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
'埃洛伊': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
'埃洛伊': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 0, heal: 0 },
|
||||||
@ -96,5 +96,5 @@ export const usefulAttr = {
|
|||||||
'砂糖': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 100, dmg: 40, phy: 0, recharge: 70, heal: 0 },
|
'砂糖': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 100, dmg: 40, phy: 0, recharge: 70, heal: 0 },
|
||||||
'雷泽': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 50, phy: 100, recharge: 0, heal: 0 },
|
'雷泽': { hp: 0, atk: 75, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 50, phy: 100, recharge: 0, heal: 0 },
|
||||||
'夜兰': { hp: 80, atk: 0, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 75, heal: 0 },
|
'夜兰': { hp: 80, atk: 0, def: 0, cp: 100, cd: 100, mastery: 0, dmg: 100, phy: 0, recharge: 75, heal: 0 },
|
||||||
'久岐忍': { hp: 100, atk: 0, def: 0, cp: 80, cd: 80, mastery: 80, dmg: 100, phy: 0, recharge: 75, heal: 100 },
|
'久岐忍': { hp: 100, atk: 50, def: 0, cp: 80, cd: 80, mastery: 80, dmg: 100, phy: 0, recharge: 75, heal: 100 },
|
||||||
};
|
};
|
||||||
|
@ -17,6 +17,17 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
<img class="genshin_logo" src="{{_sys_res_path}}/genshin/roleAll/原神.png"/>
|
<img class="genshin_logo" src="{{_sys_res_path}}/genshin/roleAll/原神.png"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="cont msg-cont">
|
||||||
|
<div class="cont-title">深渊出场率统计</div>
|
||||||
|
<div class="cont-body">
|
||||||
|
<ul class="cont-msg">
|
||||||
|
<li>数据来自<strong>胡桃API</strong>,为Snap Genshin用户自主上传的角色池信息,感谢SG团队</li>
|
||||||
|
<li>百分比基于全部上传用户的数据进行统计,结果供参考</li>
|
||||||
|
<li>由于是用户自主上传,数据可能有一定滞后。出场率会在深渊开启后一段时间逐步稳定</li>
|
||||||
|
<li>数据最后更新时间:{{lastUpdate}}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<% let pct = function (num) {
|
<% let pct = function (num) {
|
||||||
return (num * 100).toFixed(2);
|
return (num * 100).toFixed(2);
|
||||||
} %>
|
} %>
|
||||||
@ -39,9 +50,7 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
<p class="notice notice-center"> 数据来源:DGP-Studio-胡桃API . 最后更新时间:{{lastUpdate}} </p>
|
|
||||||
</div>
|
</div>
|
||||||
{{/block}}
|
{{/block}}
|
@ -29,7 +29,7 @@ return (num * 100).toFixed(2);
|
|||||||
<div class="cont-title">角色持有率说明</div>
|
<div class="cont-title">角色持有率说明</div>
|
||||||
<div class="cont-body">
|
<div class="cont-body">
|
||||||
<ul class="cont-msg">
|
<ul class="cont-msg">
|
||||||
<li>数据来自<strong>胡桃API</strong>,为SnapGenshin用户自主上传的角色池信息,感谢SG团队</li>
|
<li>数据来自<strong>胡桃API</strong>,为Snap Genshin用户自主上传的角色池信息,感谢SG团队</li>
|
||||||
<li>百分比基于全部上传用户的数据进行统计,能够一定程度上反映角色持有情况,结果供参考</li>
|
<li>百分比基于全部上传用户的数据进行统计,能够一定程度上反映角色持有情况,结果供参考</li>
|
||||||
<li>由于是用户自主上传,数据可能有一定滞后。新角色的持有率会在卡池结束后的一段时间逐步稳定</li>
|
<li>由于是用户自主上传,数据可能有一定滞后。新角色的持有率会在卡池结束后的一段时间逐步稳定</li>
|
||||||
<li>数据最后更新时间:{{lastUpdate}}</li>
|
<li>数据最后更新时间:{{lastUpdate}}</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user