装备:升品

This commit is contained in:
luying
2022-02-16 10:05:12 +08:00
parent f25d44e391
commit db31f3344f
12 changed files with 4187 additions and 50722 deletions
+23
View File
@@ -170,6 +170,9 @@ export function calPlayerCe(hero: HeroType, update: HeroUpdate, type: number, ar
case HERO_SYSTEM_TYPE.EQUIP_STRENGTH:
heroAttrs = calEquipStrengthIncAttr(hero, update, args);
break;
case HERO_SYSTEM_TYPE.EQUIP_QUALITY:
heroAttrs = calEquipQualityIncAttr(hero, update, args);
break;
case HERO_SYSTEM_TYPE.EQUIP: //
heroAttrs = calEquipPutOnOffIncAttr(hero, args, addSeidList, removeSeidList);
break;
@@ -635,6 +638,26 @@ export function calEquipStrengthIncAttr(hero: HeroType, update: HeroUpdate, epla
return heroAttrs
}
export function calEquipQualityIncAttr(hero: HeroType, update: HeroUpdate, eplaceIds: number[]) {
let { attr: heroAttrs, ePlace: oldEplace } = hero;
let { ePlace: newEplace } = update;
for(let eplaceId of eplaceIds) {
let oldEquip = oldEplace.find(cur => cur.id == eplaceId);
let newEquip = newEplace.find(cur => cur.id == eplaceId);
if(newEquip && oldEquip) {
let dicOldEquipQuality = gameData.equipQuality.get(oldEquip.equipId);
let dicNewEquipQuality = gameData.equipQuality.get(oldEquip.equipId);
for(let attr of dicOldEquipQuality.attribute) {
updateHeroAttr(heroAttrs, attr.id, { inc: { fixUp: -1 * attr.num * HERO_CE_RATIO } });
}
for(let attr of dicNewEquipQuality.attribute) {
updateHeroAttr(heroAttrs, attr.id, { inc: { fixUp: attr.num * HERO_CE_RATIO } });
}
}
}
return heroAttrs
}
/**
* 穿脱, removeSeidList原来身上穿着的所有装备的seid,包括套装的
* @param {HeroType} hero 武将