装备:强化
This commit is contained in:
@@ -167,19 +167,22 @@ export function calPlayerCe(hero: HeroType, update: HeroUpdate, type: number, ar
|
||||
case HERO_SYSTEM_TYPE.COMPOSE_EQUIP:
|
||||
heroAttrs = calComposeEquipIncAttr(hero, update, args[0]);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.EQUIP:
|
||||
case HERO_SYSTEM_TYPE.EQUIP_STRENGTH:
|
||||
heroAttrs = calEquipStrengthIncAttr(hero, update, args);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.EQUIP: //
|
||||
heroAttrs = calEquipPutOnOffIncAttr(hero, args, addSeidList, removeSeidList);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.EQUIP_BASE:
|
||||
case HERO_SYSTEM_TYPE.EQUIP_BASE: //
|
||||
heroAttrs = calHeroEquipIncAttr(hero);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.RESTRENGTHEN:
|
||||
case HERO_SYSTEM_TYPE.RESTRENGTHEN: //
|
||||
heroAttrs = calRestrengthenIncAttr(hero, args.shift(), args, addSeidList, removeSeidList);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.JEWEL_ON:
|
||||
case HERO_SYSTEM_TYPE.JEWEL_ON: //
|
||||
heroAttrs = calHeroCeWhenJewelOnOrOff(hero, args[0], args[1]);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.JEWEL_OFF:
|
||||
case HERO_SYSTEM_TYPE.JEWEL_OFF: //
|
||||
heroAttrs = calHeroCeWhenJewelOnOrOff(hero, 0, args[0]);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.SCROLL:
|
||||
@@ -616,6 +619,22 @@ export function calComposeEquipIncAttr(hero: HeroType, update: HeroUpdate, eplac
|
||||
return heroAttrs;
|
||||
}
|
||||
|
||||
export function calEquipStrengthIncAttr(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 dicEquip = gameData.equipById.get(oldEquip.equipId);
|
||||
for(let attr of dicEquip.attributeUp) {
|
||||
updateHeroAttr(heroAttrs, attr.id, { inc: { fixUp: attr.num * (newEquip.lv - oldEquip.lv) * HERO_CE_RATIO } });
|
||||
}
|
||||
}
|
||||
}
|
||||
return heroAttrs
|
||||
}
|
||||
|
||||
/**
|
||||
* 穿脱, removeSeidList原来身上穿着的所有装备的seid,包括套装的
|
||||
* @param {HeroType} hero 武将
|
||||
|
||||
Reference in New Issue
Block a user