miao-plugin/tools/dmg-calc-tool.js

21 lines
574 B
JavaScript
Raw Normal View History

// eslint-disable-next-line no-unused-vars
2023-03-07 17:52:11 +00:00
import { Data } from '#miao'
import { ProfileDmg } from '#miao.models'
import { ProfileWeapon } from '../apps/profile/ProfileWeapon.js'
export async function calcDmg (inputData, enemyLv = 86) {
2022-08-22 20:53:31 +00:00
let dmg = new ProfileDmg(inputData)
let ret = await dmg.calcData({ enemyLv })
if (ret === false) {
return {}
} else {
ret = Data.getData(ret, 'ret,msg,enemyName')
ret.enemyLevel = enemyLv
}
2022-08-22 20:53:31 +00:00
return ret
}
export async function calcWeapon (inputData, enemyLv = 86) {
return await ProfileWeapon.calc(inputData)
}