miao-plugin/models/dmg/DmgMastery.js

26 lines
684 B
JavaScript
Raw Normal View History

2022-10-06 22:20:46 +00:00
import { erType } from './DmgCalcMeta.js'
let DmgMastery = {
getMultiple (type, mastery = 0) {
let typeCfg = erType[type]
if (typeCfg.type === 'pct') {
return (25 / 9) * mastery / (mastery + 1400)
} else if (typeCfg.type === 'fusion') {
return 16 * mastery / (mastery + 2000)
2022-11-05 15:47:44 +00:00
} else if (typeCfg.type === 'bonus') {
return 5 * mastery / (mastery + 1200)
} else if (typeCfg.type === 'shield') {
return (40 / 9) * mastery / (mastery + 1400)
}
return 0
},
getBasePct (type, element) {
let typeCfg = erType[type]
if (typeCfg) {
return typeCfg.num({ element }) || 1
}
return 1
}
}
export default DmgMastery