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