|
|
|
@ -1,157 +1,90 @@
@@ -1,157 +1,90 @@
|
|
|
|
|
import { Entry, Quality, EquipBase, Equip } from './bean'; |
|
|
|
|
import { qualitys, entry_initor, extra_entry_num } from './constant'; |
|
|
|
|
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', 'atkPercent', 'defPercent', 'hpPercent', 'dmgPercent']; |
|
|
|
|
const coefficient = { shabby: 0.7, ordinary: 1, artifact: 1.5, epic: 1.8, unique: 2, colorful: 2 }; |
|
|
|
|
|
|
|
|
|
export const weaponColorfulCategorys = [ |
|
|
|
|
{ |
|
|
|
|
name: 'qiuai', |
|
|
|
|
icon: 'weapon/求爱.png', |
|
|
|
|
entry: [ |
|
|
|
|
export const weaponColorfulCategorys: Categorys[] = [ |
|
|
|
|
new Categorys( |
|
|
|
|
'qiuai', |
|
|
|
|
'weapon/求爱.png', |
|
|
|
|
[ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.8 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 1.5 }, |
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.3 }, |
|
|
|
|
], |
|
|
|
|
skill: 'IceBlade,SeeRed', |
|
|
|
|
}, |
|
|
|
|
'IceBlade,SeeRed' |
|
|
|
|
), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
export const weaponUniqueCategorys = [ |
|
|
|
|
{ |
|
|
|
|
name: 'creation', |
|
|
|
|
icon: 'U_Sword01.png', |
|
|
|
|
entry: [ |
|
|
|
|
export const weaponUniqueCategorys: Categorys[] = [ |
|
|
|
|
new Categorys('creation', 'U_Sword01.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.8 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 1.5 }, |
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.3 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'nameless', |
|
|
|
|
icon: 'U_Sword02.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('nameless', 'U_Sword02.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 2.7 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 2.5 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'scarlet', |
|
|
|
|
icon: 'U_Sword03.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('scarlet', 'U_Sword03.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.8 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 1.5 }, |
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.3 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'death', |
|
|
|
|
icon: 'U_Sword04.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('death', 'U_Sword04.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.8 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 1.5 }, |
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.3 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'frostDragon', |
|
|
|
|
icon: 'U_Sword05.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('frostDragon', 'U_Sword05.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.8 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 1.5 }, |
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.3 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'dragon', |
|
|
|
|
icon: 'U_Sword06.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('dragon', 'U_Sword06.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 2.8 }, |
|
|
|
|
{ type: 'critDmg', valCoefficient: 2.2 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'adventurer', |
|
|
|
|
icon: 'U_Sword07.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('adventurer', 'U_Sword07.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 2.4 }, |
|
|
|
|
{ type: 'hp', valCoefficient: 1.8 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'seraphim', |
|
|
|
|
icon: 'U_Sword08.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('seraphim', 'U_Sword08.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 2.6 }, |
|
|
|
|
{ type: 'def', valCoefficient: 1.8 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'shuzhuwan', |
|
|
|
|
icon: 'U_Sword09.png', |
|
|
|
|
entry: [{ type: 'atk', valCoefficient: 3.9 }], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'leibse', |
|
|
|
|
icon: 'U_Sword10.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('shuzhuwan', 'U_Sword09.png', [{ type: 'atk', valCoefficient: 3.9 }]), |
|
|
|
|
new Categorys('leibse', 'U_Sword10.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.9 }, |
|
|
|
|
{ type: 'def', valCoefficient: 1.2 }, |
|
|
|
|
{ type: 'bloc', valCoefficient: 0.4 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
]), |
|
|
|
|
]; |
|
|
|
|
export const weaponCategorys = [ |
|
|
|
|
{ |
|
|
|
|
name: 'hellrock', |
|
|
|
|
icon: 'W_Sword016.png', |
|
|
|
|
entry: [ |
|
|
|
|
export const weaponCategorys: Categorys[] = [ |
|
|
|
|
new Categorys('hellrock', 'W_Sword016.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.2 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 1.3 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'warrior', |
|
|
|
|
icon: 'W_Sword007.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('warrior', 'W_Sword007.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.2 }, |
|
|
|
|
{ type: 'def', valCoefficient: 0.5 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'redWillow', |
|
|
|
|
icon: 'W_Sword019.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('redWillow', 'W_Sword019.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.3 }, |
|
|
|
|
{ type: 'hp', valCoefficient: 1.1 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'sword', |
|
|
|
|
icon: 'W_Sword001.png', |
|
|
|
|
entry: [{ type: 'atk', valCoefficient: 1.7 }], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'waveBlade', |
|
|
|
|
icon: 'W_Sword021.png', |
|
|
|
|
entry: [{ type: 'atk', valCoefficient: 1.7 }], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'furryPaw', |
|
|
|
|
icon: 'W_Fist003.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('sword', 'W_Sword001.png', [{ type: 'atk', valCoefficient: 1.7 }]), |
|
|
|
|
new Categorys('waveBlade', 'W_Sword021.png', [{ type: 'atk', valCoefficient: 1.7 }]), |
|
|
|
|
new Categorys('furryPaw', 'W_Fist003.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 2 }, |
|
|
|
|
{ type: 'crit', valCoefficient: 0.7 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: 'iceCrystals', |
|
|
|
|
icon: 'W_Sword018.png', |
|
|
|
|
entry: [ |
|
|
|
|
]), |
|
|
|
|
new Categorys('iceCrystals', 'W_Sword018.png', [ |
|
|
|
|
{ type: 'atk', valCoefficient: 1.4 }, |
|
|
|
|
{ type: 'critDmg', valCoefficient: 1.3 }, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
]), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
export const initialWeapon = () => { |
|
|
|
@ -165,68 +98,14 @@ export const initialWeapon = () => {
@@ -165,68 +98,14 @@ export const initialWeapon = () => {
|
|
|
|
|
export const createWeapon = (quality, lv) => { |
|
|
|
|
const type = 'weapon'; |
|
|
|
|
const qualityBean = new Quality(quality, coefficient[quality]); |
|
|
|
|
const category = getCategory(quality); |
|
|
|
|
const base = createBase(quality, lv, category); |
|
|
|
|
const category = getCategory(quality, weaponCategorys, weaponUniqueCategorys, weaponColorfulCategorys); |
|
|
|
|
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(weaponExtraEntry(quality, lv)); |
|
|
|
|
extraEntry.push(createExtraEntry(quality, lv, extraEntrys, coefficient)); |
|
|
|
|
} |
|
|
|
|
return new Equip(type, lv, qualityBean, base, extraEntry); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export const weaponExtraEntry = (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 = weaponCategorys; |
|
|
|
|
switch (quality) { |
|
|
|
|
case qualitys[4]: |
|
|
|
|
categorys = weaponUniqueCategorys; |
|
|
|
|
break; |
|
|
|
|
case qualitys[5]: |
|
|
|
|
categorys = weaponColorfulCategorys; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
return categorys[Math.floor(Math.random() * categorys.length)]; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const weaponSample = (quality, category): Equip => { |
|
|
|
|
const type = 'weapon'; |
|
|
|
|
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 weaponSamples = { |
|
|
|
|
colorful: new Array(), |
|
|
|
|
unique: new Array(), |
|
|
|
|
epic: new Array(), |
|
|
|
|
artifact: new Array(), |
|
|
|
|
}; |
|
|
|
|
weaponColorfulCategorys.forEach((item) => { |
|
|
|
|
weaponSamples.colorful.push(weaponSample('colorful', item)); |
|
|
|
|
}); |
|
|
|
|
weaponUniqueCategorys.forEach((item) => { |
|
|
|
|
weaponSamples.unique.push(weaponSample('unique', item)); |
|
|
|
|
}); |
|
|
|
|
weaponCategorys.forEach((item) => { |
|
|
|
|
weaponSamples.epic.push(weaponSample('epic', item)); |
|
|
|
|
weaponSamples.artifact.push(weaponSample('artifact', item)); |
|
|
|
|
}); |
|
|
|
|
export { weaponSamples }; |
|
|
|
|
export const weaponSamples = createSamples(weaponCategorys, weaponUniqueCategorys, weaponColorfulCategorys, 'weapon', coefficient); |
|
|
|
|