import { getCategory, createExtraEntry, createBase, createSamples } from './base'; import { Entry, Quality, EquipBase, Equip, Categorys } from './bean'; import { qualitys, entry_initor, extra_entry_num } from './constant'; const extraEntrys = ['atk', 'hp', 'def', 'defPercent', 'hpPercent', 'dmgReduc', 'critAvoid', 'critDmgReduc']; const coefficient = { shabby: 0.7, ordinary: 1, artifact: 1.5, epic: 1.8, unique: 2, colorful: 2 }; export const armorColorfulCategorys: Categorys[] = [ new Categorys( 'baihua', 'armor/百花内甲.png', [ { type: 'def', valCoefficient: 1.0 }, { type: 'hp', valCoefficient: 1.4 }, { type: 'atk', valCoefficient: 1.4 }, ], 'BHXDJC', 0.9 ), new Categorys( 'heixi', 'armor/黑犀.png', [ { type: 'def', valCoefficient: 1.8 }, { type: 'hp', valCoefficient: 1 }, { type: 'bloc', valCoefficient: 1 }, ], 'TieBi' ), new Categorys( 'guiwen', 'armor/龟纹铠.png', [ { type: 'def', valCoefficient: 1.0 }, { type: 'hp', valCoefficient: 1.4 }, { type: 'bloc', valCoefficient: 1.4 }, ], 'DuJunQianNeng' ), new Categorys( 'wuxing', 'armor/五行压贴.png', [ { type: 'def', valCoefficient: 0.7 }, { type: 'hp', valCoefficient: 1.5 }, { type: 'bloc', valCoefficient: 1.4 }, ], 'JinGuangHuShen' ), new Categorys( 'guimen', 'armor/鬼门甲.png', [ { type: 'bloc', valCoefficient: 2.8 }, { type: 'def', valCoefficient: 1.0 }, ], 'LaoBuKePo' ), ]; export const armorUniqueCategorys: Categorys[] = [ new Categorys('dispute', 'U_Armor01.png', [ { type: 'def', valCoefficient: 1.0 }, { type: 'hp', valCoefficient: 1.4 }, { type: 'atk', valCoefficient: 1.4 }, ]), new Categorys('jianHao', 'U_Armor02.png', [ { type: 'def', valCoefficient: 2.1 }, { type: 'hp', valCoefficient: 2.6 }, ]), new Categorys('samurai', 'U_Armor03.png', [ { type: 'def', valCoefficient: 1.3 }, { type: 'hp', valCoefficient: 1.7 }, { type: 'atk', valCoefficient: 0.9 }, ]), new Categorys('trackers', 'U_Armor04.png', [ { type: 'def', valCoefficient: 0.9 }, { type: 'critDmg', valCoefficient: 1.7 }, { type: 'atk', valCoefficient: 1.7 }, ]), new Categorys('rongYi', 'U_Armor05.png', [ { type: 'hp', valCoefficient: 1.6 }, { type: 'atk', valCoefficient: 2.4 }, { type: 'bloc', valCoefficient: 1.2 }, ]), new Categorys('nightwear', 'U_Armor06.png', [ { type: 'def', valCoefficient: 1.2 }, { type: 'hp', valCoefficient: 1.5 }, { type: 'atk', valCoefficient: 1.2 }, ]), new Categorys('wildDragon', 'U_Armor07.png', [ { type: 'def', valCoefficient: 1.5 }, { type: 'bloc', valCoefficient: 1.2 }, { type: 'hp', valCoefficient: 1.4 }, ]), ]; export const armorCategorys: Categorys[] = [ new Categorys('guard', 'A_A2.png', [ { type: 'def', valCoefficient: 2 }, { type: 'hp', valCoefficient: 0.6 }, ]), new Categorys('redWillow', 'A_A3.png', [ { type: 'def', valCoefficient: 0.9 }, { type: 'hp', valCoefficient: 1.2 }, ]), new Categorys('warrior', 'A_A5.png', [ { type: 'def', valCoefficient: 1.1 }, { type: 'hp', valCoefficient: 0.8 }, ]), new Categorys('lightArmor', 'A_A7.png', [ { type: 'def', valCoefficient: 0.7 }, { type: 'hp', valCoefficient: 0.5 }, { type: 'atk', valCoefficient: 0.5 }, ]), new Categorys('furryArmor', 'A_A9.png', [ { type: 'def', valCoefficient: 0.8 }, { type: 'hp', valCoefficient: 0.8 }, { type: 'atk', valCoefficient: 0.4 }, ]), ]; export const initialArmor = () => { const type = 'armor'; const qualityBean = new Quality(qualitys[0], coefficient[qualitys[0]]); const base = new EquipBase('initial', 'A_A3.png', [new Entry('def', 1, '+1', 1, 1)]); const extraEntry = [new Entry('hp', 10, '+10', 10, 10)]; return new Equip(type, 1, qualityBean, base, extraEntry); }; export const createArmor = (quality, lv) => { const type = 'armor'; const qualityBean = new Quality(quality, coefficient[quality]); const category = getCategory(quality, armorCategorys, armorUniqueCategorys, armorColorfulCategorys); 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(armorExtraEntry(quality, lv)); } return new Equip(type, lv, qualityBean, base, extraEntry); }; export const armorExtraEntry = (quality, lv) => { return createExtraEntry(quality, lv, extraEntrys, coefficient); }; export const armorSamples = createSamples(armorCategorys, armorUniqueCategorys, armorColorfulCategorys, 'armor', coefficient);