mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +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 enemyLv = await selfUser.getCfg(`char.enemyLv`, 91);
|
||||||
let dmgMsg = [], dmgData = [];
|
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) {
|
if (dmgCalc && dmgCalc.ret) {
|
||||||
lodash.forEach(dmgCalc.ret, (ds) => {
|
lodash.forEach(dmgCalc.ret, (ds) => {
|
||||||
ds.dmg = Format.comma(ds.dmg, 0);
|
ds.dmg = Format.comma(ds.dmg, 0);
|
||||||
@ -671,4 +671,26 @@ export async function renderProfile(e, char, render) {
|
|||||||
e.reply(segment.image(`base64://${base64}`));
|
e.reply(segment.image(`base64://${base64}`));
|
||||||
}
|
}
|
||||||
return true;
|
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;
|
return retBuffs;
|
||||||
},
|
},
|
||||||
async calcData({ profile, char, avatar, talentData }) {
|
async calcData({ profile, char, avatar, talentData, enemyLv = 91 }) {
|
||||||
let charCalcData = await Calc.getCharCalcRule(char.name);
|
let charCalcData = await Calc.getCharCalcRule(char.name);
|
||||||
|
|
||||||
//avatar.element;
|
//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));
|
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
|
avg: atkNum * pctNum * dmgNum * (1 + cpctNum * cdmgNum) * defNum * kNum * eleNum
|
||||||
}
|
}
|
||||||
if (global.debugView === "web-debug") {
|
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;
|
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 { consStat, abyssPct } from "./apps/stat.js";
|
||||||
import { wiki } from "./apps/wiki.js";
|
import { wiki } from "./apps/wiki.js";
|
||||||
import { help } from "./apps/help.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";
|
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 = {
|
let rule = {
|
||||||
@ -38,6 +38,10 @@ let rule = {
|
|||||||
reg: "^#\s*(获取|更新)(游戏|角色)*(详情|详细|面板|面版)\s*$",
|
reg: "^#\s*(获取|更新)(游戏|角色)*(详情|详细|面板|面版)\s*$",
|
||||||
describe: "【#角色】 获取游戏橱窗详情数据",
|
describe: "【#角色】 获取游戏橱窗详情数据",
|
||||||
},
|
},
|
||||||
|
enemyLv: {
|
||||||
|
ret: "^#\s*敌人等级\s*\d{1,3}\s*$",
|
||||||
|
describe: "【#角色】 设置伤害计算中目标敌人的等级",
|
||||||
|
},
|
||||||
...adminRule
|
...adminRule
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
<div class="dmg-notice">伤害计算功能完善中,结果可能不准确,计算数据仅供参考</div>
|
<div class="dmg-notice">目标为{{enemyLv}}小宝,如需调整等级请使用 #敌人等级85 来进行设置</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="artis">
|
<div class="artis">
|
||||||
|
Loading…
Reference in New Issue
Block a user