🐞 fix(gm): 优化代码
This commit is contained in:
@@ -143,32 +143,25 @@ export class GmRoleHandler {
|
||||
* 装备信息:
|
||||
* dic_zyz_equip.json
|
||||
*/
|
||||
const MAX_LV = 100;
|
||||
const MAX_STAR = 12;
|
||||
const MAX_QUALITY = 5;
|
||||
// EPLACE_ID 分别代表4个部位
|
||||
const EPLACE_IDS = [1, 2, 3, 4];
|
||||
// 装备升级、升星、升品(注意升级限制)
|
||||
let ePlaceIds: number[] = [];
|
||||
|
||||
// 装备未满 - 补全 - 并升至满级
|
||||
let doNotGetEPlaceIds = new Set(EPLACE_IDS);
|
||||
for (let ePlaceId of EPLACE_IDS) {
|
||||
hero.ePlace.forEach((ePlaceItem) => {
|
||||
if (ePlaceItem.id === ePlaceId) {
|
||||
doNotGetEPlaceIds.delete(ePlaceId);
|
||||
// 该装备已拥有 - 升级、品、星
|
||||
// 升级 - 最大等级100
|
||||
ePlaceItem.lv = hero.lv; // 英雄等级肯定小于MAX_LV
|
||||
// 升品 - 金
|
||||
ePlaceItem.quality = MAX_QUALITY;
|
||||
ePlaceItem.qualityStage = 0;
|
||||
// 生星 - 最高12
|
||||
ePlaceItem.star = MAX_STAR;
|
||||
ePlaceItem.starStage = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
hero.ePlace.forEach((ePlaceItem) => {
|
||||
doNotGetEPlaceIds.delete(ePlaceItem.id);
|
||||
// 该装备已拥有 - 升级、品、星
|
||||
// 升级 - 最大等级100
|
||||
ePlaceItem.lv = hero.lv; // 英雄等级肯定小于MAX_LV
|
||||
// 升品 - 金
|
||||
ePlaceItem.quality = MAX_QUALITY;
|
||||
ePlaceItem.qualityStage = 0;
|
||||
// 生星 - 最高12
|
||||
ePlaceItem.star = MAX_STAR;
|
||||
ePlaceItem.starStage = 0;
|
||||
});
|
||||
// 装备补全
|
||||
let dicHero = gameData.hero.get(hero.skinId);
|
||||
doNotGetEPlaceIds.forEach((ePlaceId) => {
|
||||
|
||||
Reference in New Issue
Block a user