#角色详情 中增加对物理伤害的记录与展示

This commit is contained in:
yoimiya-kokomi 2022-04-16 06:24:25 +08:00
parent 8386de213f
commit f9911c872f
4 changed files with 13 additions and 5 deletions

View File

@ -567,7 +567,7 @@ export async function renderProfile(e, char, render) {
cDmg: p(a.cDmg),
mastery: c(a.mastery),
recharge: p(a.recharge),
dmgBonus: p(a.dmgBonus)
dmgBonus: p(Math.max(a.dmgBonus * 1 || 0, a.phyBonus * 1 || 0))
};
let avatar = await getAvatar(e, char, MysApi);
@ -595,7 +595,6 @@ export async function renderProfile(e, char, render) {
attr,
avatar,
talent,
key: char.key,
cons: char.cons,
name: char.name,
elem: char.elem,
@ -603,7 +602,7 @@ export async function renderProfile(e, char, render) {
totalMark,
weapon: avatar.weapon,
talentMap: { a: "普攻", e: "战技", q: "爆发" },
cfgScale: Cfg.scale(1.25)
cfgScale: Cfg.scale(1.5)
}, "png");
if (base64) {
e.reply(segment.image(`base64://${base64}`));

View File

@ -2,6 +2,7 @@ import fs from "fs";
import fetch from "node-fetch";
import lodash from "lodash";
import Format from "./Format.js";
import Character from "./models/Character.js";
const _path = process.cwd();
const cfgPath = `${_path}/plugins/miao-plugin/components/setting.json`;
@ -87,8 +88,10 @@ let Data = {
},
getAvatar(data) {
let char = Character.get(data["英雄Id"]);
return {
id: data["英雄Id"],
name: char ? char.name : "",
lv: data['等级'],
attr: Data.getAttr(data),
weapon: Data.getWeapon(data),
@ -139,6 +142,7 @@ let Data = {
maxDmg = Math.max(data[`属性${key}元素伤害加成`] * 1, maxDmg);
});
ret.dmgBonus = (maxDmg * 100).toFixed(2);
ret.phyBonus = (data[`属性物理伤害加成`] * 100).toFixed(2);
return ret;
},

View File

@ -510,3 +510,8 @@ body {
box-shadow: 0 0 4px 0 #deaf39 inset;
background: #fff6dd;
}
.char-优菈 .main-pic {
margin-left: -175px;
}

View File

@ -6,7 +6,7 @@
<link rel="stylesheet" type="text/css" href="{{_res_path}}/common/common.css"/>
<link rel="stylesheet" type="text/css" href="{{_res_path}}/character/detail.css"/>
</head>
<body {{cfgScale}} class="elem_{{elem}} char-{{key}}">
<body {{cfgScale}} class="elem_{{elem}} char-{{name}}">
<div class="container" id="container">
<div class="basic">
<div class="main-pic"
@ -34,7 +34,7 @@
<li><i class="i-cr"></i>暴击率<strong>{{attr.cRate}}</strong></li>
<li><i class="i-cd"></i>暴击伤害<strong>{{attr.cDmg}}</strong></li>
<li><i class="i-re"></i>元素充能<strong>{{attr.recharge}}</strong></li>
<li><i class="i-dmg"></i>元素伤害<strong>{{attr.dmgBonus}}</strong></li>
<li><i class="i-dmg"></i>伤害加成<strong>{{attr.dmgBonus}}</strong></li>
</ul>
</div>
<div class="char-cons">