|
|
@ -1,153 +1,118 @@ |
|
|
|
import { Entry, Quality, EquipBase, Equip } from './bean'; |
|
|
|
import { getCategory, createExtraEntry, createBase, createSamples } from './base'; |
|
|
|
import { qualitys, entry_initor, extra_entry_num } from './constant'; |
|
|
|
import { Entry, Quality, EquipBase, Equip, Categorys } from './bean'; |
|
|
|
|
|
|
|
import { qualitys, extra_entry_num } from './constant'; |
|
|
|
|
|
|
|
|
|
|
|
const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def', 'dmgPercent']; |
|
|
|
const extraEntrys = ['atk', 'crit', 'critDmg', 'hp', 'def', 'dmgPercent']; |
|
|
|
|
|
|
|
|
|
|
|
const coefficient = { shabby: 0.6, ordinary: 0.9, artifact: 1.3, epic: 1.6, unique: 1.8, colorful: 1.8 }; |
|
|
|
const coefficient = { shabby: 0.6, ordinary: 0.9, artifact: 1.3, epic: 1.6, unique: 1.8, colorful: 1.8 }; |
|
|
|
|
|
|
|
|
|
|
|
export const jewelryColorfulCategorys = [ |
|
|
|
export const jewelryColorfulCategorys: Categorys[] = [ |
|
|
|
{ |
|
|
|
new Categorys( |
|
|
|
name: 'shuzhuang', |
|
|
|
'shuzhuang', |
|
|
|
icon: 'jewelry/梳妆镜.png', |
|
|
|
'jewelry/梳妆镜.png', |
|
|
|
entry: [ |
|
|
|
[ |
|
|
|
{ type: 'atk', valCoefficient: 1 }, |
|
|
|
{ type: 'atk', valCoefficient: 1 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.7 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.7 }, |
|
|
|
{ type: 'def', valCoefficient: 0.4 }, |
|
|
|
{ type: 'def', valCoefficient: 0.4 }, |
|
|
|
], |
|
|
|
], |
|
|
|
skill: 'JHSY', |
|
|
|
'JHSY' |
|
|
|
}, |
|
|
|
), |
|
|
|
{ |
|
|
|
new Categorys( |
|
|
|
name: 'liulipan', |
|
|
|
'liulipan', |
|
|
|
icon: 'jewelry/琉璃盘.png', |
|
|
|
'jewelry/琉璃盘.png', |
|
|
|
entry: [ |
|
|
|
[ |
|
|
|
{ type: 'atk', valCoefficient: 0.6 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.6 }, |
|
|
|
{ type: 'hp', valCoefficient: 1.5 }, |
|
|
|
{ type: 'hp', valCoefficient: 1.5 }, |
|
|
|
], |
|
|
|
], |
|
|
|
skill: 'Liulipan', |
|
|
|
'Liulipan' |
|
|
|
}, |
|
|
|
), |
|
|
|
{ |
|
|
|
new Categorys( |
|
|
|
name: 'ghdp', |
|
|
|
'ghdp', |
|
|
|
icon: 'jewelry/勾魂夺魂.png', |
|
|
|
'jewelry/勾魂夺魂.png', |
|
|
|
entry: [ |
|
|
|
[ |
|
|
|
{ type: 'critDmg', valCoefficient: 1 }, |
|
|
|
{ type: 'critDmg', valCoefficient: 1 }, |
|
|
|
{ type: 'crit', valCoefficient: 0.4 }, |
|
|
|
{ type: 'crit', valCoefficient: 0.4 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.5 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.5 }, |
|
|
|
], |
|
|
|
], |
|
|
|
skill: 'CritFear', |
|
|
|
'CritFear' |
|
|
|
}, |
|
|
|
), |
|
|
|
{ |
|
|
|
new Categorys( |
|
|
|
name: 'youerhuan', |
|
|
|
'youerhuan', |
|
|
|
icon: 'jewelry/白骨夫人的右耳环.png', |
|
|
|
'jewelry/白骨夫人的右耳环.png', |
|
|
|
entry: [ |
|
|
|
[ |
|
|
|
{ type: 'critDmg', valCoefficient: 1.5 }, |
|
|
|
{ type: 'critDmg', valCoefficient: 1.5 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
], |
|
|
|
], |
|
|
|
skill: 'Vampire1', |
|
|
|
'Vampire1' |
|
|
|
}, |
|
|
|
), |
|
|
|
{ |
|
|
|
new Categorys( |
|
|
|
name: 'jingboyu', |
|
|
|
'jingboyu', |
|
|
|
icon: 'jewelry/金钵盂.png', |
|
|
|
'jewelry/金钵盂.png', |
|
|
|
entry: [ |
|
|
|
[ |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'def', valCoefficient: 0.6 }, |
|
|
|
{ type: 'def', valCoefficient: 0.6 }, |
|
|
|
], |
|
|
|
], |
|
|
|
skill: 'Prototype', |
|
|
|
'Prototype' |
|
|
|
}, |
|
|
|
), |
|
|
|
{ |
|
|
|
new Categorys( |
|
|
|
name: 'zijingboyu', |
|
|
|
'zijingboyu', |
|
|
|
icon: 'jewelry/紫金钵盂.png', |
|
|
|
'jewelry/紫金钵盂.png', |
|
|
|
entry: [ |
|
|
|
[ |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'def', valCoefficient: 0.6 }, |
|
|
|
{ type: 'def', valCoefficient: 0.6 }, |
|
|
|
], |
|
|
|
], |
|
|
|
skill: 'Fate', |
|
|
|
'Fate' |
|
|
|
}, |
|
|
|
), |
|
|
|
]; |
|
|
|
]; |
|
|
|
export const jewelryUniqueCategorys = [ |
|
|
|
export const jewelryUniqueCategorys: Categorys[] = [ |
|
|
|
{ |
|
|
|
new Categorys('hanjing', 'jewelry/寒晶佩.png', [ |
|
|
|
name: 'hanjing', |
|
|
|
|
|
|
|
icon: 'jewelry/寒晶佩.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'atk', valCoefficient: 1 }, |
|
|
|
{ type: 'atk', valCoefficient: 1 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.8 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.8 }, |
|
|
|
{ type: 'def', valCoefficient: 0.9 }, |
|
|
|
{ type: 'def', valCoefficient: 0.9 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
new Categorys('ylhm', 'jewelry/月灵幻梦.png', [ |
|
|
|
{ |
|
|
|
|
|
|
|
name: 'ylhm', |
|
|
|
|
|
|
|
icon: 'jewelry/月灵幻梦.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.5 }, |
|
|
|
{ type: 'critDmg', valCoefficient: 1.5 }, |
|
|
|
{ type: 'crit', valCoefficient: 0.5 }, |
|
|
|
{ type: 'crit', valCoefficient: 0.5 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.8 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
new Categorys('liangren', 'jewelry/月灵良人幻梦.png', [ |
|
|
|
{ |
|
|
|
|
|
|
|
name: 'liangren', |
|
|
|
|
|
|
|
icon: 'jewelry/良人.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.2 }, |
|
|
|
{ type: 'critDmg', valCoefficient: 1.2 }, |
|
|
|
{ type: 'dmgPercent', valCoefficient: 0.4 }, |
|
|
|
{ type: 'dmgPercent', valCoefficient: 0.4 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.7 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.7 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
new Categorys('duzhan', 'jewelry/督战.png', [ |
|
|
|
{ |
|
|
|
|
|
|
|
name: 'duzhan', |
|
|
|
|
|
|
|
icon: 'jewelry/督战.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.6 }, |
|
|
|
{ type: 'critDmg', valCoefficient: 1.6 }, |
|
|
|
{ type: 'atk', valCoefficient: 1.6 }, |
|
|
|
{ type: 'atk', valCoefficient: 1.6 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
new Categorys('cltx', 'jewelry/赤羚天禧.png', [ |
|
|
|
{ |
|
|
|
|
|
|
|
name: 'cltx', |
|
|
|
|
|
|
|
icon: 'jewelry/赤羚天禧.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'dmgPercent', valCoefficient: 0.5 }, |
|
|
|
{ type: 'dmgPercent', valCoefficient: 0.5 }, |
|
|
|
{ type: 'def', valCoefficient: 0.9 }, |
|
|
|
{ type: 'def', valCoefficient: 0.9 }, |
|
|
|
{ type: 'hp', valCoefficient: 1.2 }, |
|
|
|
{ type: 'hp', valCoefficient: 1.2 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
|
|
|
|
]; |
|
|
|
]; |
|
|
|
export const jewelryCategorys = [ |
|
|
|
export const jewelryCategorys: Categorys[] = [ |
|
|
|
{ |
|
|
|
new Categorys('weihun', 'jewelry/未婚.png', [ |
|
|
|
name: 'weihun', |
|
|
|
|
|
|
|
icon: 'jewelry/未婚.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'def', valCoefficient: 0.9 }, |
|
|
|
{ type: 'def', valCoefficient: 0.9 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.5 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.5 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
new Categorys('huangyan', 'jewelry/谎言.png', [ |
|
|
|
{ |
|
|
|
|
|
|
|
name: 'huangyan', |
|
|
|
|
|
|
|
icon: 'jewelry/谎言.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'crit', valCoefficient: 1.1 }, |
|
|
|
{ type: 'crit', valCoefficient: 1.1 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.5 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.5 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.6 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.6 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
new Categorys('zhenjing', 'jewelry/真经.png', [ |
|
|
|
{ |
|
|
|
|
|
|
|
name: 'zhenjing', |
|
|
|
|
|
|
|
icon: 'jewelry/真经.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'crit', valCoefficient: 1.1 }, |
|
|
|
{ type: 'crit', valCoefficient: 1.1 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.6 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.5 }, |
|
|
|
{ type: 'atk', valCoefficient: 0.5 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
new Categorys('maming', 'jewelry/马鸣玉佩.png', [ |
|
|
|
{ |
|
|
|
|
|
|
|
name: 'maming', |
|
|
|
|
|
|
|
icon: 'jewelry/马鸣玉佩.png', |
|
|
|
|
|
|
|
entry: [ |
|
|
|
|
|
|
|
{ type: 'crit', valCoefficient: 0.75 }, |
|
|
|
{ type: 'crit', valCoefficient: 0.75 }, |
|
|
|
{ type: 'critDmg', valCoefficient: 0.5 }, |
|
|
|
{ type: 'critDmg', valCoefficient: 0.5 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.5 }, |
|
|
|
{ type: 'hp', valCoefficient: 0.5 }, |
|
|
|
], |
|
|
|
]), |
|
|
|
}, |
|
|
|
|
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
export const initialJewelry = () => { |
|
|
|
export const initialJewelry = () => { |
|
|
@ -161,69 +126,13 @@ export const initialJewelry = () => { |
|
|
|
export const createJewelry = (quality, lv): Equip => { |
|
|
|
export const createJewelry = (quality, lv): Equip => { |
|
|
|
const type = 'jewelry'; |
|
|
|
const type = 'jewelry'; |
|
|
|
const qualityBean = new Quality(quality, coefficient[quality]); |
|
|
|
const qualityBean = new Quality(quality, coefficient[quality]); |
|
|
|
const category = getCategory(quality); |
|
|
|
const category = getCategory(quality, jewelryCategorys, jewelryUniqueCategorys, jewelryColorfulCategorys); |
|
|
|
const base = createBase(quality, lv, category); |
|
|
|
const base = createBase(quality, lv, category, coefficient); |
|
|
|
const extraEntry = new Array(); |
|
|
|
const extraEntry = new Array(); |
|
|
|
const extraEntryNum = extra_entry_num[quality]; |
|
|
|
const extraEntryNum = extra_entry_num[quality]; |
|
|
|
for (let i = 0; i < extraEntryNum; i++) { |
|
|
|
for (let i = 0; i < extraEntryNum; i++) { |
|
|
|
extraEntry.push(jewelryExtraEntry(quality, lv)); |
|
|
|
extraEntry.push(createExtraEntry(quality, lv, extraEntrys, coefficient)); |
|
|
|
} |
|
|
|
} |
|
|
|
return new Equip(type, lv, qualityBean, base, extraEntry); |
|
|
|
return new Equip(type, lv, qualityBean, base, extraEntry); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
export const jewelrySamples = createSamples(jewelryCategorys, jewelryUniqueCategorys, jewelryColorfulCategorys, 'jewelry', coefficient); |
|
|
|
export const jewelryExtraEntry = (quality, lv) => { |
|
|
|
|
|
|
|
const type = extraEntrys[Math.floor(Math.random() * extraEntrys.length)]; |
|
|
|
|
|
|
|
const initor = entry_initor[type]; |
|
|
|
|
|
|
|
const qualityCoefficient = coefficient[quality]; |
|
|
|
|
|
|
|
const entry = initor(lv, qualityCoefficient); |
|
|
|
|
|
|
|
return entry; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const createBase = (quality, lv, category) => { |
|
|
|
|
|
|
|
const entry = new Array(); |
|
|
|
|
|
|
|
category.entry.forEach((item) => { |
|
|
|
|
|
|
|
const initor = entry_initor[item.type]; |
|
|
|
|
|
|
|
const qualityCoefficient = coefficient[quality]; |
|
|
|
|
|
|
|
entry.push(initor(lv, qualityCoefficient, item.valCoefficient)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return new EquipBase(category.name, category.icon, entry, category.skill); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
const getCategory = (quality) => { |
|
|
|
|
|
|
|
let categorys = jewelryCategorys; |
|
|
|
|
|
|
|
switch (quality) { |
|
|
|
|
|
|
|
case qualitys[4]: |
|
|
|
|
|
|
|
categorys = jewelryUniqueCategorys; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case qualitys[5]: |
|
|
|
|
|
|
|
categorys = jewelryColorfulCategorys; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return categorys[Math.floor(Math.random() * categorys.length)]; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const jewelrySample = (quality, category): Equip => { |
|
|
|
|
|
|
|
const type = 'jewelry'; |
|
|
|
|
|
|
|
const lv = 100; |
|
|
|
|
|
|
|
const qualityBean = new Quality(quality, coefficient[quality]); |
|
|
|
|
|
|
|
const base = createBase(quality, lv, category); |
|
|
|
|
|
|
|
const extraEntry = new Array(); |
|
|
|
|
|
|
|
return new Equip(type, lv, qualityBean, base, extraEntry); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const jewelrySamples = { |
|
|
|
|
|
|
|
colorful: new Array(), |
|
|
|
|
|
|
|
unique: new Array(), |
|
|
|
|
|
|
|
epic: new Array(), |
|
|
|
|
|
|
|
artifact: new Array(), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
jewelryColorfulCategorys.forEach((item) => { |
|
|
|
|
|
|
|
jewelrySamples.colorful.push(jewelrySample('colorful', item)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
jewelryUniqueCategorys.forEach((item) => { |
|
|
|
|
|
|
|
jewelrySamples.unique.push(jewelrySample('unique', item)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
jewelryCategorys.forEach((item) => { |
|
|
|
|
|
|
|
jewelrySamples.epic.push(jewelrySample('epic', item)); |
|
|
|
|
|
|
|
jewelrySamples.artifact.push(jewelrySample('artifact', item)); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
export { jewelrySamples }; |
|
|
|
|
|
|
|