一个全随机的刷装备小游戏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.7 KiB

import { getCategory, createExtraEntry, createBase, createSamples } from './base';
import { Entry, Quality, EquipBase, Equip, Categorys } from './bean';
import { qualitys, entry_initor, extra_entry_num } from './constant';
2 months ago
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 },
],
1 month ago
'BHXDJC',
0.9
),
];
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 },
]),
2 months ago
];
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 },
]),
2 months ago
];
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)];
2 months ago
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);
2 months ago
const extraEntry = new Array();
const extraEntryNum = extra_entry_num[quality];
for (let i = 0; i < extraEntryNum; i++) {
extraEntry.push(createExtraEntry(quality, lv, extraEntrys, coefficient));
2 months ago
}
return new Equip(type, lv, qualityBean, base, extraEntry);
};
export const armorSamples = createSamples(armorCategorys, armorUniqueCategorys, armorColorfulCategorys, 'armor', coefficient);