mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-22 06:58:24 +00:00
1. #角色详情伤害计算增加 魈、胡桃
2. 增加 #敌人等级88 来设置伤害计算的敌人等级
This commit is contained in:
parent
bc8fb2360a
commit
860bf2cf8d
@ -634,7 +634,7 @@ export async function renderProfile(e, char, render) {
|
||||
|
||||
let enemyLv = await selfUser.getCfg(`char.enemyLv`, 91);
|
||||
let dmgMsg = [], dmgData = [];
|
||||
let dmgCalc = await Calc.calcData({ profile, char, avatar, talent, enemyLv });
|
||||
let dmgCalc = await Calc.calcData({ profile, char, avatar, talentData: talent, enemyLv });
|
||||
if (dmgCalc && dmgCalc.ret) {
|
||||
lodash.forEach(dmgCalc.ret, (ds) => {
|
||||
ds.dmg = Format.comma(ds.dmg, 0);
|
||||
@ -672,3 +672,25 @@ export async function renderProfile(e, char, render) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
export async function enemyLv(e) {
|
||||
let selfUser = await e.checkAuth({
|
||||
auth: "self"
|
||||
})
|
||||
|
||||
if (!selfUser || !e.msg) {
|
||||
return true;
|
||||
}
|
||||
let ret = /敌人等级\s*(\d{1,3})\s*$/.exec(e.msg);
|
||||
if (ret && ret[1]) {
|
||||
let lv = ret[1] * 1;
|
||||
|
||||
await selfUser.setCfg("char.enemyLv", lv);
|
||||
|
||||
lv = await selfUser.getCfg("char.enemyLv", 91);
|
||||
e.reply(`敌人等级已经设置为${lv}`);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
@ -261,7 +261,7 @@ let Calc = {
|
||||
})
|
||||
return retBuffs;
|
||||
},
|
||||
async calcData({ profile, char, avatar, talentData }) {
|
||||
async calcData({ profile, char, avatar, talentData, enemyLv = 91 }) {
|
||||
let charCalcData = await Calc.getCharCalcRule(char.name);
|
||||
|
||||
//avatar.element;
|
||||
@ -334,7 +334,7 @@ let Calc = {
|
||||
}
|
||||
|
||||
// 防御区
|
||||
let enemyLv = 86, lv = avatar.level;
|
||||
let lv = avatar.level;
|
||||
let defNum = (lv + 100) / ((lv + 100) + (enemyLv + 100) * (1 - enemyDef) * (1 - enemyIgnore));
|
||||
|
||||
// 抗性区
|
||||
@ -357,7 +357,7 @@ let Calc = {
|
||||
avg: atkNum * pctNum * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
|
||||
}
|
||||
if (global.debugView === "web-debug") {
|
||||
console.log(attr, { atkNum, pctNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum }, ret)
|
||||
// console.log(attr, { atkNum, pctNum, dmgNum, cpctNum, cdmgNum, defNum, eleNum }, ret)
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
8
index.js
8
index.js
@ -1,4 +1,4 @@
|
||||
import { character, getProfile, wife, wifeReg } from "./apps/character.js";
|
||||
import { character, getProfile, wife, wifeReg, enemyLv } from "./apps/character.js";
|
||||
import { consStat, abyssPct } from "./apps/stat.js";
|
||||
import { wiki } from "./apps/wiki.js";
|
||||
import { help } from "./apps/help.js";
|
||||
@ -6,7 +6,7 @@ import lodash from "lodash";
|
||||
|
||||
import { rule as adminRule, updateRes, sysCfg } from "./apps/admin.js";
|
||||
|
||||
export { character, wife, consStat, abyssPct, wiki, updateRes, sysCfg, help, getProfile };
|
||||
export { character, wife, consStat, abyssPct, wiki, updateRes, sysCfg, help, getProfile, enemyLv };
|
||||
|
||||
|
||||
let rule = {
|
||||
@ -38,6 +38,10 @@ let rule = {
|
||||
reg: "^#\s*(获取|更新)(游戏|角色)*(详情|详细|面板|面版)\s*$",
|
||||
describe: "【#角色】 获取游戏橱窗详情数据",
|
||||
},
|
||||
enemyLv: {
|
||||
ret: "^#\s*敌人等级\s*\d{1,3}\s*$",
|
||||
describe: "【#角色】 设置伤害计算中目标敌人的等级",
|
||||
},
|
||||
...adminRule
|
||||
};
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
<div class="dmg-notice">伤害计算功能完善中,结果可能不准确,计算数据仅供参考</div>
|
||||
<div class="dmg-notice">目标为{{enemyLv}}小宝,如需调整等级请使用 #敌人等级85 来进行设置</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="artis">
|
||||
|
Loading…
Reference in New Issue
Block a user