import { getCategory, createExtraEntry, createBase, createSamples } from './base'; import { Entry, Quality, EquipBase, Equip, Categorys } from './bean'; import { qualitys, extra_entry_num } from './constant'; 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 }; export const jewelryColorfulCategorys: Categorys[] = [ new Categorys( 'shuzhuang', 'jewelry/梳妆镜.png', [ { type: 'atk', valCoefficient: 1 }, { type: 'hp', valCoefficient: 0.7 }, { type: 'def', valCoefficient: 0.4 }, ], 'JHSY' ), new Categorys( 'liulipan', 'jewelry/琉璃盘.png', [ { type: 'atk', valCoefficient: 0.6 }, { type: 'hp', valCoefficient: 1.5 }, ], 'Liulipan' ), new Categorys( 'ghdp', 'jewelry/勾魂夺魂.png', [ { type: 'critDmg', valCoefficient: 1 }, { type: 'crit', valCoefficient: 0.4 }, { type: 'atk', valCoefficient: 0.5 }, ], 'CritFear' ), new Categorys( 'youerhuan', 'jewelry/白骨夫人的右耳环.png', [ { type: 'critDmg', valCoefficient: 1.5 }, { type: 'atk', valCoefficient: 0.8 }, ], 'Vampire1' ), new Categorys( 'jingboyu', 'jewelry/金钵盂.png', [ { type: 'atk', valCoefficient: 0.8 }, { type: 'hp', valCoefficient: 0.6 }, { type: 'def', valCoefficient: 0.6 }, ], 'Prototype' ), new Categorys( 'zijingboyu', 'jewelry/紫金钵盂.png', [ { type: 'atk', valCoefficient: 0.8 }, { type: 'hp', valCoefficient: 0.6 }, { type: 'def', valCoefficient: 0.6 }, ], 'Fate' ), ]; export const jewelryUniqueCategorys: Categorys[] = [ new Categorys('hanjing', 'jewelry/寒晶佩.png', [ { type: 'atk', valCoefficient: 1 }, { type: 'hp', valCoefficient: 0.8 }, { type: 'def', valCoefficient: 0.9 }, ]), new Categorys('ylhm', 'jewelry/月灵幻梦.png', [ { type: 'critDmg', valCoefficient: 1.5 }, { type: 'crit', valCoefficient: 0.5 }, { type: 'atk', valCoefficient: 0.8 }, ]), new Categorys('liangren', 'jewelry/良人.png', [ { type: 'critDmg', valCoefficient: 1.2 }, { type: 'dmgPercent', valCoefficient: 0.4 }, { type: 'atk', valCoefficient: 0.7 }, ]), new Categorys('duzhan', 'jewelry/督战.png', [ { type: 'critDmg', valCoefficient: 1.6 }, { type: 'atk', valCoefficient: 1.6 }, ]), new Categorys('cltx', 'jewelry/赤羚天禧.png', [ { type: 'dmgPercent', valCoefficient: 0.5 }, { type: 'def', valCoefficient: 0.9 }, { type: 'hp', valCoefficient: 1.2 }, ]), ]; export const jewelryCategorys: Categorys[] = [ new Categorys('weihun', 'jewelry/未婚.png', [ { type: 'def', valCoefficient: 0.9 }, { type: 'hp', valCoefficient: 0.6 }, { type: 'atk', valCoefficient: 0.5 }, ]), new Categorys('huangyan', 'jewelry/谎言.png', [ { type: 'crit', valCoefficient: 1.1 }, { type: 'hp', valCoefficient: 0.5 }, { type: 'atk', valCoefficient: 0.6 }, ]), new Categorys('zhenjing', 'jewelry/真经.png', [ { type: 'crit', valCoefficient: 1.1 }, { type: 'hp', valCoefficient: 0.6 }, { type: 'atk', valCoefficient: 0.5 }, ]), new Categorys('maming', 'jewelry/马鸣玉佩.png', [ { type: 'crit', valCoefficient: 0.75 }, { type: 'critDmg', valCoefficient: 0.5 }, { type: 'hp', valCoefficient: 0.5 }, ]), ]; export const initialJewelry = () => { const type = 'jewelry'; const qualityBean = new Quality(qualitys[0], coefficient[qualitys[0]]); const base = new EquipBase('shiwangsy', 'jewelry/狮王手印.png', [new Entry('atk', 1, '+1', 1, 1)]); const extraEntry = [new Entry('crit', 10, '+10%', 10, 10)]; return new Equip(type, 1, qualityBean, base, extraEntry); }; export const createJewelry = (quality, lv): Equip => { const type = 'jewelry'; const qualityBean = new Quality(quality, coefficient[quality]); const category = getCategory(quality, jewelryCategorys, jewelryUniqueCategorys, jewelryColorfulCategorys); const base = createBase(quality, lv, category, coefficient); const extraEntry = new Array(); const extraEntryNum = extra_entry_num[quality]; for (let i = 0; i < extraEntryNum; i++) { extraEntry.push(createExtraEntry(quality, lv, extraEntrys, coefficient)); } return new Equip(type, lv, qualityBean, base, extraEntry); }; export const jewelrySamples = createSamples(jewelryCategorys, jewelryUniqueCategorys, jewelryColorfulCategorys, 'jewelry', coefficient);