面板属性计算增加武器常驻Buff计算

This commit is contained in:
Kokomi 2022-11-22 05:26:06 +08:00
parent b74d2c80f2
commit f95826a812
17 changed files with 2858 additions and 2180 deletions

View File

@ -276,4 +276,20 @@ export default class ProfileArtis extends Base {
} }
return ret return ret
} }
static _eachArtisSet (sets, fn) {
lodash.forEach(sets || [], (v, k) => {
let artisSet = ArtifactSet.get(k)
if (artisSet) {
if (v >= 4) {
fn(artisSet, 2)
}
fn(artisSet, v)
}
})
}
eachArtisSet (fn) {
ProfileArtis._eachArtisSet(this.sets, fn)
}
} }

112
models/ProfileAttr.js Normal file
View File

@ -0,0 +1,112 @@
import lodash from 'lodash'
import Base from './Base.js'
import DmgMastery from './profile-lib/DmgMastery.js'
import { Format } from '../components/index.js'
const baseAttr = 'atk,def,hp,mastery,recharge,cpct,cdmg,dmg,phy,heal,shield'.split(',')
let attrReg = new RegExp(`^(${baseAttr.join('|')})(Base|Plus|Pct|Inc)$`)
class ProfileAttr extends Base {
constructor (data = null) {
super()
this._init(data)
}
_init (data) {
// 基础属性
this._attr = {}
let attr = this._attr
lodash.forEach(baseAttr, (key) => {
attr[key] = {
base: 0,
plus: 0,
pct: 0
}
})
if (data) {
this.setAttr(data, true)
}
}
static init (data = null) {
return new ProfileAttr(data)
}
/**
* getter
*
* @param key
* @returns {*|number}
* @private
*/
_get (key) {
let attr = this._attr
if (baseAttr.includes(key)) {
let a = attr[key]
return a.base * (1 + a.pct / 100) + a.plus
}
let testRet = attrReg.exec(key)
if (testRet && testRet[1] && testRet[2]) {
let key = testRet[1]
let key2 = testRet[2].toLowerCase()
return attr[key][key2] || 0
}
}
/**
* 添加或追加Attr数据
* @param key
* @param val
* @returns {boolean}
*/
addAttr (key, val) {
let attr = this._attr
if (baseAttr.includes(key)) {
attr[key].plus += val * 1
return true
}
let testRet = attrReg.exec(key)
if (testRet && testRet[1] && testRet[2]) {
let key = testRet[1]
let key2 = testRet[2].toLowerCase()
attr[key][key2] += val * 1
return true
}
return false
}
/**
* 设置属性
* @param data
* @param withBase带有base数据的初始化设置会将atk/hp/def视作结果数据而非plus数据
*/
setAttr (data, withBase = false) {
if (withBase) {
lodash.forEach(['hp', 'def', 'atk'], (key) => {
let base = `${key}Base`
if (data[key] && data[base]) {
data[`${key}Plus`] = data[key] - data[base]
delete data[key]
}
})
}
lodash.forEach(data, (val, key) => {
this.addAttr(key, val)
})
}
getAttr () {
let ret = {}
lodash.forEach(baseAttr, (key) => {
ret[key] = this[key]
if (['hp', 'atk', 'def'].includes(key)) {
ret[`${key}Base`] = this[`${key}Base`]
}
})
return ret
}
}
export default ProfileAttr

View File

@ -9,6 +9,7 @@ import ProfileServ from './ProfileServ.js'
import ProfileReq from './ProfileReq.js' import ProfileReq from './ProfileReq.js'
import ProfileData from './ProfileData.js' import ProfileData from './ProfileData.js'
import ProfileArtis from './ProfileArtis.js' import ProfileArtis from './ProfileArtis.js'
import ProfileAttr from './ProfileAttr.js'
import ProfileDmg from './ProfileDmg.js' import ProfileDmg from './ProfileDmg.js'
import ProfileRank from './ProfileRank.js' import ProfileRank from './ProfileRank.js'
import Material from './Material.js' import Material from './Material.js'
@ -28,6 +29,7 @@ export {
ProfileReq, ProfileReq,
ProfileData, ProfileData,
ProfileArtis, ProfileArtis,
ProfileAttr,
ProfileDmg, ProfileDmg,
ProfileRank, ProfileRank,
Material, Material,

View File

@ -3,8 +3,10 @@
* @type {{}} * @type {{}}
*/ */
import { Weapon } from '../index.js' import { Weapon, ProfileAttr } from '../index.js'
import { attrNameMap } from '../../resources/meta/artifact/artis-mark.js' import { attrNameMap } from '../../resources/meta/artifact/artis-mark.js'
import { calc as artisBuffs } from '../../resources/meta/artifact/index.js'
import { calc as weaponBuffs } from '../../resources/meta/weapon/index.js'
import lodash from 'lodash' import lodash from 'lodash'
class AttrCalc { class AttrCalc {
@ -13,48 +15,53 @@ class AttrCalc {
this.char = profile.char this.char = profile.char
} }
/**
* 静态调用入口
* @param profile
* @returns {boolean|void}
*/
static getAttr (profile) { static getAttr (profile) {
let attr = new AttrCalc(profile) let attr = new AttrCalc(profile)
if (profile?.char?.name !== '纳西妲') { if (!process.argv.includes('web-debug')) {
return false return false
} }
return attr.calc() return attr.calc()
} }
/**
* 实例调用入口
* @param profile
*/
calc (profile) { calc (profile) {
this.init() this.attr = ProfileAttr.init({
recharge: 100,
cpct: 5,
cdmg: 50
})
this.setCharAttr() this.setCharAttr()
this.setWeaponAttr() this.setWeaponAttr()
this.setArtisAttr() this.setArtisAttr()
console.log(this.attr) console.log(this.attr, this.attr.getAttr())
} }
/**
* 属性初始化
*/
init () { init () {
this.attr = {
atkBase: 0,
atkPct: 0,
atkPlus: 0,
hpBase: 0,
hpPct: 0,
hpPlus: 0,
defBase: 0,
defPct: 0,
defPlus: 0,
mastery: 0,
recharge: 100,
shield: 0,
heal: 0,
dmg: 0,
phy: 0,
cpct: 5,
cdmg: 50
}
} }
addAttr (key, val) {
this.attr.addAttr(key, val)
}
/**
* 计算角色属性
* @param affix
*/
setCharAttr (affix = '') { setCharAttr (affix = '') {
let { char, level } = this.profile let { char, level } = this.profile
let metaAttr = char.detail?.attr || {} let metaAttr = char.detail?.attr || {}
let { keys, details } = metaAttr let { keys = {}, details = {} } = metaAttr
let lvLeft = 0 let lvLeft = 0
let lvRight = 0 let lvRight = 0
let lvStep = [1, 20, 50, 60, 70, 80, 90] let lvStep = [1, 20, 50, 60, 70, 80, 90]
@ -64,21 +71,23 @@ class AttrCalc {
lvRight = lvStep[idx + 1] lvRight = lvStep[idx + 1]
} }
} }
let detailLeft = details[lvLeft + '+'] || details[lvLeft] let detailLeft = details[lvLeft + '+'] || details[lvLeft] || {}
let detailRight = details[lvRight] let detailRight = details[lvRight] || {}
let getLvData = (idx) => { let getLvData = (idx) => {
let valueLeft = detailLeft[idx] let valueLeft = detailLeft[idx]
let valueRight = detailRight[idx] let valueRight = detailRight[idx]
return valueLeft * 1 + ((valueRight - valueLeft) * (level - lvLeft) / (lvRight - lvLeft)) return valueLeft * 1 + ((valueRight - valueLeft) * (level - lvLeft) / (lvRight - lvLeft))
} }
let attr = this.attr this.addAttr('hpBase', getLvData(0))
attr.hpBase += getLvData(0) this.addAttr('atkBase', getLvData(1))
attr.atkBase += getLvData(1) this.addAttr('defBase', getLvData(2))
attr.defBase += getLvData(2) this.addAttr(keys[3], (details[lvRight] || [])[3])
attr[keys[3]] += details[lvRight][3]
} }
/**
* 计算武器属性
*/
setWeaponAttr () { setWeaponAttr () {
let wData = this.profile?.weapon let wData = this.profile?.weapon
let weapon = Weapon.get(wData?.name) let weapon = Weapon.get(wData?.name)
@ -92,31 +101,66 @@ class AttrCalc {
lvRight = lvStep[idx + 1] lvRight = lvStep[idx + 1]
} }
} }
let attr = this.attr
let wAttr = weapon?.detail?.attr let wAttr = weapon?.detail?.attr
let wAtk = wAttr.atk let wAtk = wAttr.atk
let valueLeft = wAtk[lvLeft + '+'] || wAtk[lvLeft] let valueLeft = wAtk[lvLeft + '+'] || wAtk[lvLeft]
let valueRight = wAtk[lvRight] let valueRight = wAtk[lvRight]
attr.atkBase += valueLeft * 1 + ((valueRight - valueLeft) * (level - lvLeft) / (lvRight - lvLeft)) this.addAttr('atkBase', valueLeft * 1 + ((valueRight - valueLeft) * (level - lvLeft) / (lvRight - lvLeft)))
let wBonus = wAttr.bonusData let wBonus = wAttr.bonusData
valueLeft = wBonus[lvLeft + '+'] || wBonus[lvLeft] valueLeft = wBonus[lvLeft + '+'] || wBonus[lvLeft]
valueRight = wBonus[lvRight] valueRight = wBonus[lvRight]
let valueStep = (valueRight - valueLeft) / ((lvRight - lvLeft) / 5) let valueStep = (valueRight - valueLeft) / ((lvRight - lvLeft) / 5)
let add = valueLeft + Math.floor((level - lvLeft) / 5) * valueStep let add = valueLeft + Math.floor((level - lvLeft) / 5) * valueStep
attr[wAttr.bonusKey] += add this.addAttr(wAttr.bonusKey, add)
let wBuffs = weaponBuffs[weapon.name] || []
if (lodash.isPlainObject(wBuffs)) {
wBuffs = [wBuffs]
}
let affix = wData.affix || 1
lodash.forEach(wBuffs, (buff) => {
if (!buff.isStatic) {
return true
}
if (buff) {
lodash.forEach(buff.refine, (r, key) => {
console.log(affix, key, r[affix - 1])
this.addAttr(key, r[affix - 1] * (buff.buffCount || 1))
})
}
})
} }
/**
* 计算圣遗物属性
*/
setArtisAttr () { setArtisAttr () {
let artis = this.profile?.artis let artis = this.profile?.artis
let attr = this.attr // 计算圣遗物词条
artis.forEach((arti) => { artis.forEach((arti) => {
this.calcArtisAttr(arti.main) this.calcArtisAttr(arti.main)
lodash.forEach(arti.attrs, (ds) => { lodash.forEach(arti.attrs, (ds) => {
this.calcArtisAttr(ds) this.calcArtisAttr(ds)
}) })
}) })
// 计算圣遗物静态加成
artis.eachArtisSet((set, num) => {
let buff = artisBuffs[set.name] && artisBuffs[set.name][num]
if (!buff.isStatic) {
return true
}
lodash.forEach(buff.data, (val, key) => {
console.log(buff.title, key, val)
this.addAttr(key, val)
})
})
} }
/**
* 计算单条圣遗物词缀
* @param ds
* @returns {boolean}
*/
calcArtisAttr (ds) { calcArtisAttr (ds) {
let title = ds.title let title = ds.title
let key = attrNameMap[title] let key = attrNameMap[title]
@ -124,13 +168,12 @@ class AttrCalc {
key = 'dmg' key = 'dmg'
} }
if (!key) { if (!key) {
console.log(title)
return false return false
} }
if (['atk', 'hp', 'def'].includes(key)) { if (['atk', 'hp', 'def'].includes(key)) {
key = key + 'Pct' key = key + 'Pct'
} }
this.attr[key] += ds.value * 1 this.attr.addAttr(key, ds.value * 1)
} }
static getArtisKey (ds) { static getArtisKey (ds) {

View File

@ -3,7 +3,7 @@
* */ * */
import lodash from 'lodash' import lodash from 'lodash'
import { Data } from '../../components/index.js' import { Data } from '../../components/index.js'
import { ArtifactSet } from '../index.js' import { ProfileArtis } from '../index.js'
let weaponBuffs = {} let weaponBuffs = {}
let artisBuffs = {} let artisBuffs = {}
@ -17,26 +17,16 @@ setTimeout(async function init () {
let DmgBuffs = { let DmgBuffs = {
// 圣遗物Buff // 圣遗物Buff
getArtisBuffs (artis = {}) { getArtisBuffs (artis = {}) {
if (!artis) {
return []
}
let buffs = artisBuffs let buffs = artisBuffs
let retBuffs = [] let retBuffs = []
let addBuff = function (buff, name, num) { ProfileArtis._eachArtisSet(artis, (sets, num) => {
let buff = buffs[sets.name] && buffs[sets.name][num]
if (buff && !buff.isStatic) { if (buff && !buff.isStatic) {
let artiSet = ArtifactSet.get(name)
retBuffs.push({ retBuffs.push({
...buff, ...buff,
title: `${artiSet ? artiSet.abbr : name}${num}` + buff.title title: `${sets.name}${num}` + buff.title
}) })
} }
}
lodash.forEach(artis, (v, k) => {
let aBuff = buffs[k] || {}
addBuff(aBuff[v], k, v)
if (v >= 4 && buffs[k + '2']) {
addBuff(aBuff['2'], k, 2)
}
}) })
return retBuffs return retBuffs
}, },
@ -48,6 +38,9 @@ let DmgBuffs = {
weaponCfg = [weaponCfg] weaponCfg = [weaponCfg]
} }
lodash.forEach(weaponCfg, (ds) => { lodash.forEach(weaponCfg, (ds) => {
if (ds.isStatic) {
return true
}
if (!//.test(ds.title)) { if (!//.test(ds.title)) {
ds.title = `${weaponName}${ds.title}` ds.title = `${weaponName}${ds.title}`
} }

View File

@ -23,7 +23,7 @@ const attr = function (key, val, unit = '%') {
const buffs = { const buffs = {
行者之心: { 行者之心: {
2: attr('atk', 18), 2: attr('atkPct', 18),
4: { 4: {
title: '重击的暴击率提高30%', title: '重击的暴击率提高30%',
data: { data: {
@ -33,7 +33,7 @@ const buffs = {
}, },
勇士之心: { 勇士之心: {
2: attr('atk', 18), 2: attr('atkPct', 18),
4: { 4: {
title: '对生命值高于50%的敌人造成的伤害增加30%', title: '对生命值高于50%的敌人造成的伤害增加30%',
data: { data: {
@ -43,7 +43,7 @@ const buffs = {
}, },
守护之心: { 守护之心: {
2: attr('def', 30) 2: attr('defPct', 30)
}, },
奇迹: {}, 奇迹: {},
@ -280,7 +280,7 @@ const buffs = {
}, },
千岩牢固: { 千岩牢固: {
2: attr('hp', 20), 2: attr('hpPct', 20),
4: { 4: {
title: '元素战技命中敌人后攻击力提升20%', title: '元素战技命中敌人后攻击力提升20%',
data: { data: {
@ -323,7 +323,7 @@ const buffs = {
}, },
华馆梦醒形骸记: { 华馆梦醒形骸记: {
2: attr('def', 30), 2: attr('defPct', 30),
4: { 4: {
title: '满层获得24%防御及24%岩伤加成', title: '满层获得24%防御及24%岩伤加成',
sort: 0, sort: 0,
@ -339,7 +339,7 @@ const buffs = {
}, },
辰砂往生录: { 辰砂往生录: {
2: attr('atk', 18), 2: attr('atkPct', 18),
4: { 4: {
title: '满层提高48%攻击力', title: '满层提高48%攻击力',
@ -350,7 +350,7 @@ const buffs = {
}, },
来歆余响: { 来歆余响: {
2: attr('atk', 18), 2: attr('atkPct', 18),
4: { 4: {
title: '触发提高普攻[aPlus]伤害', title: '触发提高普攻[aPlus]伤害',
data: { data: {

View File

@ -21,7 +21,7 @@
}, },
"growAttr": { "growAttr": {
"key": "cpct", "key": "cpct",
"value": "19.2%" "value": 19.2
}, },
"talentKey": { "talentKey": {
"6031": "a", "6031": "a",

View File

@ -425,6 +425,387 @@
] ]
} }
}, },
"talentData": {
"a": {
"一段伤害": [
40.68,
43.99,
47.3,
52.03,
55.34,
59.13,
64.33,
69.53,
74.73,
80.41,
86.09,
91.76,
97.44,
103.11,
108.79
],
"二段伤害": [
39.04,
42.22,
45.4,
49.94,
53.12,
56.75,
61.74,
66.74,
71.73,
77.18,
82.63,
88.08,
93.52,
98.97,
104.42
],
"三段伤害": [
51.6,
55.8,
60,
66,
70.2,
75,
81.6,
88.2,
94.8,
102,
109.2,
116.4,
123.6,
130.8,
138
],
"四段伤害": [
65.02,
70.3,
75.6,
83.16,
88.46,
94.5,
102.82,
111.14,
119.44,
128.52,
137.6,
146.66,
155.74,
164.8,
173.88
],
"四段伤害2": [
[
32.51,
32.51
],
[
35.15,
35.15
],
[
37.8,
37.8
],
[
41.58,
41.58
],
[
44.23,
44.23
],
[
47.25,
47.25
],
[
51.41,
51.41
],
[
55.57,
55.57
],
[
59.72,
59.72
],
[
64.26,
64.26
],
[
68.8,
68.8
],
[
73.33,
73.33
],
[
77.87,
77.87
],
[
82.4,
82.4
],
[
86.94,
86.94
]
],
"瞄准射击": [
43.86,
47.43,
51,
56.1,
59.67,
63.75,
69.36,
74.97,
80.58,
86.7,
92.82,
98.94,
105.06,
111.18,
117.3
],
"满蓄力瞄准射击": [
124,
133.3,
142.6,
155,
164.3,
173.6,
186,
198.4,
210.8,
223.2,
235.6,
248,
263.5,
279,
294.5
],
"破局矢伤害": [
11.58,
12.44,
13.31,
14.47,
15.34,
16.21,
17.36,
18.52,
19.68,
20.84,
21.99,
23.15,
24.6,
26.05,
27.49
],
"下坠期间伤害": [
56.83,
61.45,
66.08,
72.69,
77.31,
82.6,
89.87,
97.14,
104.41,
112.34,
120.27,
128.2,
136.12,
144.05,
151.98
],
"低空/高空坠地冲击伤害": [
[
113.63,
141.93
],
[
122.88,
153.49
],
[
132.13,
165.04
],
[
145.35,
181.54
],
[
154.59,
193.1
],
[
165.16,
206.3
],
[
179.7,
224.45
],
[
194.23,
242.61
],
[
208.77,
260.76
],
[
224.62,
280.57
],
[
240.48,
300.37
],
[
256.34,
320.18
],
[
272.19,
339.98
],
[
288.05,
359.79
],
[
303.9,
379.59
]
],
"低空/高空坠地冲击伤害2": [
[
113.63,
141.93
],
[
122.88,
153.49
],
[
132.13,
165.04
],
[
145.35,
181.54
],
[
154.59,
193.1
],
[
165.16,
206.3
],
[
179.7,
224.45
],
[
194.23,
242.61
],
[
208.77,
260.76
],
[
224.62,
280.57
],
[
240.48,
300.37
],
[
256.34,
320.18
],
[
272.19,
339.98
],
[
288.05,
359.79
],
[
303.9,
379.59
]
]
},
"e": {
"技能伤害": [
22.61,
24.31,
26.01,
28.27,
29.96,
31.66,
33.92,
36.18,
38.44,
40.7,
42.97,
45.23,
48.05,
50.88,
53.71
]
},
"q": {
"技能伤害": [
7.31,
7.86,
8.4,
9.13,
9.68,
10.23,
10.96,
11.69,
12.42,
13.15,
13.89,
14.62,
15.53,
16.44,
17.36
],
"玄掷玲珑伤害": [
14.61,
15.72,
16.799999999999997,
18.27,
19.38,
20.46,
21.93,
23.4,
24.839999999999996,
26.31,
27.78,
29.22,
31.049999999999997,
32.88,
34.71
]
}
},
"cons": { "cons": {
"1": { "1": {
"name": "与谋者,以局入局", "name": "与谋者,以局入局",
@ -488,5 +869,87 @@
"效果存在期间重新施放渊图玲珑骰,将移除原有的上述效果。" "效果存在期间重新施放渊图玲珑骰,将移除原有的上述效果。"
] ]
} }
] ],
"attr": {
"keys": [
"hpBase",
"atkBase",
"defBase",
"cpct"
],
"details": {
"1": [
1125,
18.99,
42.66,
0
],
"20": [
2918,
49.27,
110.66,
0
],
"50": [
7472,
126.16,
283.37,
4.8
],
"60": [
9374,
158.26,
355.47,
9.6
],
"70": [
11056,
186.66,
419.26,
9.6
],
"80": [
12749,
215.24,
483.47,
14.4
],
"90": [
14450,
243.96,
547.98,
19.2
],
"20+": [
3883,
65.55,
147.23,
0
],
"50+": [
8386,
141.58,
318.02,
9.6
],
"60+": [
10059,
169.83,
381.46,
9.6
],
"70+": [
11741,
198.23,
445.25,
14.4
],
"80+": [
13434,
226.81,
509.46,
19.2
]
}
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,9 @@
export default function (step) { export default function (step, staticStep) {
return { return {
猎弓: false,
历练的猎弓: false,
鸦羽弓: { 鸦羽弓: {
check: ({ element }) => ['水', '火'].includes(element), check: ({ element }) => ['水', '火'].includes(element),
title: '对处于水或火元素影响下的敌人,造成的伤害提高[dmg]%', title: '对处于水或火元素影响下的敌人,造成的伤害提高[dmg]%',
@ -7,12 +11,16 @@ export default function (step) {
dmg: step(12) dmg: step(12)
} }
}, },
神射手之誓: { 神射手之誓: {
title: '针对要害造成的伤害提升[a2Dmg]%', title: '针对要害造成的伤害提升[a2Dmg]%',
refine: { refine: {
a2Dmg: step(24) a2Dmg: step(24)
} }
}, },
反曲弓: false,
弹弓: { 弹弓: {
title: '普攻与重击的箭矢0.3秒内击中敌人,伤害增加[a2Dmg]%', title: '普攻与重击的箭矢0.3秒内击中敌人,伤害增加[a2Dmg]%',
refine: { refine: {
@ -20,6 +28,13 @@ export default function (step) {
a2Dmg: step(36, 6) a2Dmg: step(36, 6)
} }
}, },
信使: false,
黑檀弓: false,
西风猎弓: false,
绝弦: { 绝弦: {
title: '元素战技与元素爆发的伤害提高[eDmg]%', title: '元素战技与元素爆发的伤害提高[eDmg]%',
refine: { refine: {
@ -27,32 +42,9 @@ export default function (step) {
qDmg: step(24) qDmg: step(24)
} }
}, },
暗巷猎手: {
title: '满层提高[dmg]%伤害', 祭礼弓: false,
refine: {
dmg: step(20)
}
},
黑岩战弓: {
title: '击败敌人后,攻击力满层提升[atkPct]%',
buffCount: 3,
refine: {
atkPct: step(12)
}
},
钢轮弓: {
title: '普通攻击与重击命中时,满层提升[atkPct]%',
buffCount: 4,
refine: {
atkPct: step(4)
}
},
试作澹月: {
title: '重击命中要害提高[atkPct]%攻击力',
refine: {
atkPct: step(36)
}
},
宗室长弓: { 宗室长弓: {
title: '3层提高暴击率[cpct]%', title: '3层提高暴击率[cpct]%',
buffCount: 3, buffCount: 3,
@ -60,18 +52,54 @@ export default function (step) {
cpct: step(8) cpct: step(8)
} }
}, },
弓藏: { 弓藏: {
title: '普攻造成的伤害提升[aDmg]%', title: '普攻造成的伤害提升[aDmg]%重击造成的伤害下降10%',
refine: { refine: {
aDmg: step(40) aDmg: step(40),
a2Dmg: -10
} }
}, },
风花之颂: {
title: '施放元素战技时攻击力提升[atkPct]%', 试作澹月: {
title: '重击命中要害提高[atkPct]%攻击力',
refine: { refine: {
atkPct: step(16) atkPct: step(36)
} }
}, },
钢轮弓: {
title: '普通攻击与重击命中时,满层提升[atkPct]%',
buffCount: 4,
refine: {
atkPct: step(4)
}
},
黑岩战弓: {
title: '击败敌人后,攻击力满层提升[atkPct]%',
buffCount: 3,
refine: {
atkPct: step(12)
}
},
苍翠猎弓: false,
暗巷猎手: {
title: '满层提高[dmg]%伤害',
refine: {
dmg: step(20)
}
},
落霞: {
title: '二层状态下提高伤害[dmg]%',
refine: {
dmg: step(10, 2.5)
}
},
幽夜华尔兹: { 幽夜华尔兹: {
title: 'Buff下普攻及元素战技造成的伤害提升[aDmg]%', title: 'Buff下普攻及元素战技造成的伤害提升[aDmg]%',
refine: { refine: {
@ -79,6 +107,14 @@ export default function (step) {
eDmg: step(20) eDmg: step(20)
} }
}, },
风花之颂: {
title: '施放元素战技时攻击力提升[atkPct]%',
refine: {
atkPct: step(16)
}
},
破魔之弓: { 破魔之弓: {
title: '满能量下普攻伤害提高[aDmg]%,重击伤害提高[a2Dmg]%', title: '满能量下普攻伤害提高[aDmg]%,重击伤害提高[a2Dmg]%',
buffCount: 2, buffCount: 2,
@ -87,6 +123,7 @@ export default function (step) {
a2Dmg: step(12) a2Dmg: step(12)
} }
}, },
掠食者: { 掠食者: {
check: ({ element }) => element === '冰', check: ({ element }) => element === '冰',
title: '满Buff普攻与重击伤害提高[aDmg]%埃洛伊攻击力提升66', title: '满Buff普攻与重击伤害提高[aDmg]%埃洛伊攻击力提升66',
@ -95,44 +132,25 @@ export default function (step) {
atkPlus: 66 atkPlus: 66
} }
}, },
曚云之月: { 曚云之月: {
title: '满层元素爆发伤害提高[qDmg]%', title: '满层元素爆发伤害提高[qDmg]%',
refine: { refine: {
qDmg: step(40) qDmg: step(40)
} }
}, },
冬极白星: [{
title: '元素战技与元素爆发伤害提高[eDmg]%', 王下近侍: {
title: '施放元素战技或元素爆发时精通提高[mastery]',
refine: { refine: {
eDmg: step(12), mastery: step(60, 20)
qDmg: step(12)
} }
}, { },
title: '满Buff下提高攻击力[atkPct]%',
refine: { 竭泽: false,
atkPct: step(48, 12)
} 天空之翼: staticStep('cdmg', 20),
}],
飞雷之弦振: [{
title: '满Buff下提高普攻伤害[aDmg]%',
refine: {
aDmg: step(40)
}
}],
终末嗟叹之诗: [{
title: '元素精通提高[_mastery]',
sort: 0,
refine: {
_mastery: step(60)
}
}, {
title: 'Buff下提高元素精通[mastery],攻击力[atkPct]%',
sort: 0,
refine: {
mastery: step(100),
atkPct: step(20)
}
}],
阿莫斯之弓: [{ 阿莫斯之弓: [{
title: '普攻与重击伤害提高[a2Dmg]%', title: '普攻与重击伤害提高[a2Dmg]%',
refine: { refine: {
@ -148,13 +166,43 @@ export default function (step) {
} }
}], }],
若水: { 终末嗟叹之诗: [staticStep('mastery', 60), {
title: 'Buff下提高元素精通[mastery],攻击力[atkPct]%',
sort: 0,
refine: {
mastery: step(100),
atkPct: step(20)
}
}],
冬极白星: [{
title: '元素战技与元素爆发伤害提高[eDmg]%',
refine: {
eDmg: step(12),
qDmg: step(12)
}
}, {
title: '满Buff下提高攻击力[atkPct]%',
refine: {
atkPct: step(48, 12)
}
}],
飞雷之弦振: [staticStep('atkPct', 20), {
title: '满Buff下提高普攻伤害[aDmg]%',
refine: {
aDmg: step(40)
}
}],
若水: [staticStep('hpPct', 16), {
title: '生命值提高[_hpPct]%,伤害提高[dmg]%', title: '生命值提高[_hpPct]%,伤害提高[dmg]%',
refine: { refine: {
_hpPct: step(16), _hpPct: step(16),
dmg: step(20) dmg: step(20)
} }
}, }],
陨龙之梦: { 陨龙之梦: {
title: '护盾+满Buff提高攻击力[atkPct]%', title: '护盾+满Buff提高攻击力[atkPct]%',
buffCount: 10, buffCount: 10,
@ -162,12 +210,7 @@ export default function (step) {
atkPct: step(4) atkPct: step(4)
} }
}, },
落霞: {
title: '二层状态下提高伤害[dmg]%',
refine: {
dmg: step(10, 2.5)
}
},
猎人之径: { 猎人之径: {
title: '元素伤害提高[dmg]%,重击造成的伤害值提高[a2Plus]', title: '元素伤害提高[dmg]%,重击造成的伤害值提高[a2Plus]',
sort: 5, sort: 5,
@ -175,12 +218,7 @@ export default function (step) {
dmg: ({ refine }) => step(12)[refine], dmg: ({ refine }) => step(12)[refine],
a2Plus: ({ attr, calc, refine }) => calc(attr.mastery) * step(160)[refine] / 100 a2Plus: ({ attr, calc, refine }) => calc(attr.mastery) * step(160)[refine] / 100
} }
},
王下近侍: {
title: '施放元素战技或元素爆发时精通提高[mastery]',
refine: {
mastery: step(60, 20)
}
} }
} }
} }

View File

@ -1,4 +1,4 @@
export default function (step) { export default function (step, staticStep) {
return { return {
翡玉法球: { 翡玉法球: {
check: ({ element }) => element === '水', check: ({ element }) => element === '水',
@ -106,7 +106,7 @@ export default function (step) {
shield: step(20) shield: step(20)
} }
}], }],
不灭月华: { 不灭月华: [staticStep('heal', 10, 2.5), {
title: '治疗加成提高[_heal]%,普攻伤害增加[aPlus]', title: '治疗加成提高[_heal]%,普攻伤害增加[aPlus]',
refine: { refine: {
_heal: step(10, 2.5) _heal: step(10, 2.5)
@ -114,7 +114,7 @@ export default function (step) {
data: { data: {
aPlus: ({ attr, calc, refine }) => calc(attr.hp) * step(1, 0.5)[refine] / 100 aPlus: ({ attr, calc, refine }) => calc(attr.hp) * step(1, 0.5)[refine] / 100
} }
}, }],
神乐之真意: { 神乐之真意: {
title: '满层提高元素战技伤害[eDmg]%,元素伤害提高[dmg]%', title: '满层提高元素战技伤害[eDmg]%,元素伤害提高[dmg]%',
refine: { refine: {

View File

@ -1,4 +1,4 @@
export default function (step) { export default function (step, staticStep) {
return { return {
沐浴龙血的剑: { 沐浴龙血的剑: {
check: ({ element }) => ['火', '雷'].includes(element), check: ({ element }) => ['火', '雷'].includes(element),
@ -99,12 +99,12 @@ export default function (step) {
phy: step(8) phy: step(8)
} }
}, },
狼的末路: { 狼的末路: [staticStep('atkPct', 20), {
title: '攻击命中生命值低于30%的敌人时,攻击力提升[atkPct]%', title: '攻击命中生命值低于30%的敌人时,攻击力提升[atkPct]%',
refine: { refine: {
atkPct: step(40) atkPct: step(40)
} }
}, }],
无工之剑: [{ 无工之剑: [{
title: '护盾强效提高[shield]%', title: '护盾强效提高[shield]%',
refine: { refine: {
@ -117,19 +117,19 @@ export default function (step) {
atkPct: step(4) atkPct: step(4)
} }
}], }],
松籁响起之时: { 松籁响起之时: [staticStep('atkPct', 16), {
title: 'Buff状态下提高攻击力[atkPct]%', title: 'Buff状态下提高攻击力[atkPct]%',
refine: { refine: {
atkPct: step(20) atkPct: step(20)
} }
}, }],
赤角石溃杵: { 赤角石溃杵: [staticStep('defPct', 28), {
title: '普通攻击与重击造成的伤害值提高[aPlus]', title: '普通攻击与重击造成的伤害值提高[aPlus]',
data: { data: {
aPlus: ({ attr, calc, refine }) => calc(attr.def) * step(40)[refine] / 100, aPlus: ({ attr, calc, refine }) => calc(attr.def) * step(40)[refine] / 100,
a2Plus: ({ attr, calc, refine }) => calc(attr.def) * step(40)[refine] / 100 a2Plus: ({ attr, calc, refine }) => calc(attr.def) * step(40)[refine] / 100
} }
}, }],
森林王器: { 森林王器: {
title: '拾取种识之叶的角色元素精通提升[mastery]', title: '拾取种识之叶的角色元素精通提升[mastery]',
refine: { refine: {

View File

@ -16,10 +16,20 @@ const step = function (start, step = 0) {
return ret return ret
} }
const attr = function (key, start, _step) {
let refine = {}
refine[key] = step(start, _step)
return {
title: `${key}提高[key]`,
isStatic: true,
refine
}
}
for (let type in weaponType) { for (let type in weaponType) {
// calc // calc
let typeCalc = await Data.importDefault(`resources/meta/weapon/${type}/calc.js`) let typeCalc = await Data.importDefault(`resources/meta/weapon/${type}/calc.js`)
let typeRet = typeCalc(step) let typeRet = typeCalc(step, attr)
calc = lodash.extend(calc, typeRet) calc = lodash.extend(calc, typeRet)
// data // data

View File

@ -1,4 +1,4 @@
export default function (step) { export default function (step, staticStep) {
return { return {
白缨枪: { 白缨枪: {
title: '白缨枪普通攻击伤害提高[aDmg]%', title: '白缨枪普通攻击伤害提高[aDmg]%',
@ -83,7 +83,7 @@ export default function (step) {
phy: step(12) phy: step(12)
} }
}, },
护摩之杖: { 护摩之杖: [staticStep('hpPct', 20), {
title: '角色生命低于50%时额外获得[atkPlus]攻击力', title: '角色生命低于50%时额外获得[atkPlus]攻击力',
data: { data: {
atkPlus: ({ attr, refine, calc }) => { atkPlus: ({ attr, refine, calc }) => {
@ -91,7 +91,8 @@ export default function (step) {
return totalHp * ([0.8, 1, 1.2, 1.4, 1.6][refine] + [1, 1.2, 1.4, 1.6, 1.8][refine]) / 100 return totalHp * ([0.8, 1, 1.2, 1.4, 1.6][refine] + [1, 1.2, 1.4, 1.6, 1.8][refine]) / 100
} }
} }
}, }],
天空之脊: staticStep('cpct', 8),
薙草之稻光: [{ 薙草之稻光: [{
title: '元素爆发12秒内元素充能提高[rechargePlus]%', title: '元素爆发12秒内元素充能提高[rechargePlus]%',
sort: 0, sort: 0,

View File

@ -1,4 +1,4 @@
export default function (step) { export default function (step, staticStep) {
return { return {
辰砂之纺锤: { 辰砂之纺锤: {
title: '元素战技造成的伤害值提高[ePlus]', title: '元素战技造成的伤害值提高[ePlus]',
@ -127,7 +127,7 @@ export default function (step) {
dmg: step(28) dmg: step(28)
} }
}], }],
苍古自由之誓: { 苍古自由之誓: [staticStep('dmg', 10), {
title: '触发Buff后提高普攻重击与下落攻击[aDmg]%,攻击力提升[atkPct]%', title: '触发Buff后提高普攻重击与下落攻击[aDmg]%,攻击力提升[atkPct]%',
refine: { refine: {
aDmg: step(16), aDmg: step(16),
@ -135,8 +135,8 @@ export default function (step) {
a3Dmg: step(16), a3Dmg: step(16),
atkPct: step(20) atkPct: step(20)
} }
}, }],
磐岩结绿: [{ 磐岩结绿: [staticStep('hpPct', 20), {
title: '基于生命值上限提高攻击力[atkPlus]', title: '基于生命值上限提高攻击力[atkPlus]',
data: { data: {
atkPlus: ({ attr, calc, refine }) => calc(attr.hp) * step(1.2)[refine] / 100 atkPlus: ({ attr, calc, refine }) => calc(attr.hp) * step(1.2)[refine] / 100
@ -162,23 +162,23 @@ export default function (step) {
a2Plus: ({ attr, calc, refine }) => calc(attr.atk) * step(20)[refine] / 100 a2Plus: ({ attr, calc, refine }) => calc(attr.atk) * step(20)[refine] / 100
} }
}], }],
风鹰剑: { 风鹰剑: [staticStep('atkPct', 20), {
title: '攻击力提高[_atkPct]%', title: '攻击力提高[_atkPct]%',
refine: { refine: {
_atkPct: step(20) _atkPct: step(20)
} }
}, }],
原木刀: { 原木刀: {
title: '拾取种识之叶的角色元素精通提升[mastery]', title: '拾取种识之叶的角色元素精通提升[mastery]',
refine: { refine: {
mastery: step(60) mastery: step(60)
} }
}, },
圣显之钥: { 圣显之钥: [staticStep('hpPct', 20), {
title: '基于生命提升元素精通,满层提升[mastery]', title: '基于生命提升元素精通,满层提升[mastery]',
data: { data: {
mastery: ({ attr, calc, refine }) => step(0.36 + 0.2)[refine] * calc(attr.hp) / 100 mastery: ({ attr, calc, refine }) => step(0.36 + 0.2)[refine] * calc(attr.hp) / 100
} }
} }]
} }
} }

View File

@ -264,4 +264,4 @@ let eta = {
流浪者: '2022-12-07 11:00:00', 流浪者: '2022-12-07 11:00:00',
珐露珊: '2022-12-07 11:00:00' 珐露珊: '2022-12-07 11:00:00'
} }
await down('73', true) await down('60', true)

View File

@ -91,7 +91,7 @@ const CharData = {
if (!colIdxs[i]) { if (!colIdxs[i]) {
return return
} }
data.push(($(this).text().trim('%') * 1) || 0) data.push((lodash.trim($(this).text(), '%') * 1) || 0)
}) })
lvStat[lvl] = data lvStat[lvl] = data
}) })