* 增加 #圣遗物列表 命令,对已经获取面板的所有角色圣遗物进行评分,并展示高评分的圣遗物列表

* 增加 `#面板角色列表` 命令,查看已经获取面板的角色列表
* 公子面板增加EQ蒸发伤害计算
* 一些bugfix
This commit is contained in:
yoimiya-kokomi 2022-04-29 04:50:58 +08:00
parent 3597ac5277
commit 23f14b028f
8 changed files with 195 additions and 9 deletions

View File

@ -5,7 +5,9 @@
* `#角色面板` 功能升级
* 优化无角色面板数据时的引导
* 优化返回的图像格式及分辨率,平衡响应速度及显示效果
* 添加 `#胡桃面板更新` 命令获取单个角色面板数据每天可更新5次
* 增加 `#圣遗物列表` 命令,对已经获取面板的所有角色圣遗物进行评分,并展示高评分的圣遗物列表
* 增加 `#面板角色列表` 命令,查看已经获取面板的角色列表
* 增加 `#胡桃面板更新` 命令获取单个角色面板数据每天可更新5次
* 更改 `#全部面板更新` 命令获取角色展柜全部8个角色每天可更新3次

View File

@ -63,13 +63,15 @@ export async function character(e, { render, User }) {
}
let mode = 'card';
let name = msg.replace(/#|老婆|老公|[1|2|5][0-9]{8}/g, "").trim();
if (/(详情|详细|面板|面版)$/.test(msg)) {
mode = 'profile';
} else if (/(详情|详细|面板|面版)更新$/.test(msg)) {
name = name.replace(/(详情|详细|面板|面版)/, "").trim();
} else if (/(详情|详细|面板|面版)更新/.test(msg)) {
mode = "refresh";
name = name.replace(/(详情|详细|面板|面版)更新/, "").trim();
}
let name = msg.replace(/#|老婆|老公|详情|详细|面板|面版|更新|[1|2|5][0-9]{8}/g, "").trim();
let char = Character.get(name);
if (!char) {
@ -714,3 +716,92 @@ export async function enemyLv(e) {
return true;
}
export async function getArtis(e, { render }) {
let MysApi = await e.getMysApi({
auth: "cookie",
targetType: "self",
cookieType: "self",
actionName: "查询角色天赋命座等信息"
});
if (!MysApi) {
return true;
}
let selfUser = e.selfUser,
uid = selfUser.uid;
let artis = [],
profiles = Profile.getAll(uid) || {};
if (!profiles || profiles.length === 0) {
e.reply("暂无角色圣遗物详情");
return true;
}
lodash.forEach(profiles || [], (ds) => {
let name = ds.name;
if (!name) {
return;
}
let { mark: usefulMark } = Reliquaries.getUseful(name);
/* 处理圣遗物 */
if (ds.artis) {
lodash.forEach(ds.artis, (arti) => {
let mark = Reliquaries.getMark(name, arti.attrs);
let maxMark = Reliquaries.getMaxMark(name, arti.main[0] || "");
arti.mark = Format.comma(mark, 1);
arti._mark = mark;
arti.markType = Reliquaries.getMarkScore(mark, maxMark);
arti.main = Profile.formatArti(arti.main);
arti.attrs = Profile.formatArti(arti.attrs);
arti.usefulMark = usefulMark;
arti.avatar = name;
artis.push(arti);
})
}
});
artis = lodash.sortBy(artis, "_mark");
artis = artis.reverse();
artis = artis.slice(0, 20);
let base64 = await render("character", "artis", {
save_id: uid,
uid: uid,
artis,
cfgScale: Cfg.scale(1.4)
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}
return true;
}
export async function getProfileAll(e) {
let MysApi = await e.getMysApi({
auth: "cookie",
targetType: "self",
cookieType: "self",
actionName: "查询角色天赋命座等信息"
});
if (!MysApi) {
return true;
}
let uid = MysApi.selfUser.uid;
let profiles = Profile.getAll(uid) || {};
if (profiles.length === 0) {
e.reply("尚未获取任何角色数据");
} else {
let chars = [];
lodash.forEach(profiles, (ds) => {
ds.name && chars.push(ds.name)
});
e.reply("当前已获取面板角色: " + chars.join(", "));
}
return true;
}

View File

@ -381,7 +381,8 @@ let Calc = {
// 反应区
let eleNum = 1;
if (ele) {
eleNum = { zf: 1.5, rh: 2 }[ele] || 1;
// todo 更详细
eleNum = (attr.element === "水" ? { zf: 2 } : { zf: 1.5, rh: 2 })[ele] || 1;
if (attr[ele]) {
eleNum = eleNum * (1 + attr[ele] / 100);
}

View File

@ -1,4 +1,4 @@
import { character, getProfile, wife, wifeReg, enemyLv } from "./apps/character.js";
import { character, getProfile, wife, wifeReg, enemyLv, getArtis, getProfileAll } from "./apps/character.js";
import { consStat, abyssPct } from "./apps/stat.js";
import { wiki } from "./apps/wiki.js";
import { help, versionInfo } from "./apps/help.js";
@ -19,7 +19,9 @@ export {
help,
versionInfo,
getProfile,
enemyLv
enemyLv,
getArtis,
getProfileAll
};
@ -28,6 +30,14 @@ let rule = {
reg: "^#(喵喵)?(.*)(详情|详细|面板|面版)?(更新)?$",
describe: "【#角色】角色详情",
},
getArtis: {
reg: "#圣遗物列表",
describe: "【#角色】圣遗物列表",
},
getProfileAll: {
reg: "#面板角色列表",
describe: "【#角色】查看当前已获取面板数据的角色列表",
},
wife: {
reg: wifeReg,
describe: "【#角色】#老公 #老婆 查询",

View File

@ -0,0 +1,33 @@
.container {
width: 790px;
}
.artis {
width: 790px;
}
.artis .item {
height: 205px;
overflow: hidden;
}
.artis .item .avatar {
position: absolute;
left: 32px;
top: 26px;
width: 38px;
height: 38px;
border-radius: 50%;
overflow: hidden;
z-index: 3;
}
.artis .item .arti-icon img {
width: 52px;
height: 52px;
}
.artis .item .avatar img {
max-width: 100%;
max-height: 100%;
}

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<link rel="shortcut icon" href="#"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/common/common.css"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/detail.css"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/artis.css"/>
</head>
<body {{cfgScale}} class="elem_geo char-{{name}}">
<div class="container" id="container">
<div class="artis">
{{each artis ds}}
<div class="item arti">
{{if ds.name && ds.main && ds.main[0] && ds.main[0]!="undefined"}}
<div class="avatar">
<img src="{{_res_path}}meta/character/{{ds.avatar}}/side.png" onerror="whenError(this)"/>
</div>
<div class="arti-icon">
<img src="{{_sys_res_path}}/genshin/logo/reliquaries/{{ds.name}}.png"/>
</div>
<div class="head">
<strong>{{ds.name}}</strong>
<span class="mark mark-{{ds.markType}}"><span>{{ds.mark}}分</span> - {{ds.markType}}</span>
</div>
<ul class="detail">
<li class="arti-main"><span class="title">{{ds.main[0]}}</span><span class="val">+{{ds.main[1]}}</span></li>
{{each ds.attrs attr}}
{{if attr[0]}}
<li class="{{ds.usefulMark[attr[0]] ? `useful`:`nouse`}}"><span class="title">{{attr[0]}}</span><span
class="val">+{{attr[1]}}</span></li>
{{/if}}
{{/each}}
</ul>
{{/if}}
</div>
{{/each}}
</div>
<div class="copyright">Created By Yunzai-Bot & Miao-Plugin</div>
</div>
</body>
<script type="text/javascript"></script>
</html>

View File

@ -420,7 +420,7 @@ body {
display: block;
}
.artis .item img {
.artis .item .arti-icon img {
width: 60px;
height: 60px;
}

View File

@ -7,6 +7,12 @@ export const details = [{
},{
title: "开E后Q伤害",
dmg: ({ talent }, dmg) => dmg(talent.q['技能伤害·近战'], 'q')
},{
title: "开E后Q蒸发",
dmg: ({ talent }, dmg) => dmg(talent.q['技能伤害·近战'], 'q','zf')
}];
export const buffs = [];
export const buffs = [{
title: "元素精通:蒸发伤害提高[zf]%",
mastery: "zf"
}];