装备:镶嵌或卸载地玉石
This commit is contained in:
@@ -26,6 +26,7 @@ export enum HERO_SYSTEM_TYPE {
|
||||
EQUIP_QUALITY = 23, // 装备升品
|
||||
EQUIP_STAR = 24, // 装备升星
|
||||
EQUIP_JEWEL = 25, // 装备装上or卸下天晶石
|
||||
EQUIP_STONE = 26, // 装备装上or卸下地玉石
|
||||
};
|
||||
|
||||
// 武将上限
|
||||
|
||||
@@ -318,6 +318,9 @@ export const STATUS = {
|
||||
EQUIP_STARSTAGE_IS_MAX: { code: 30522, simStr: '该装备已到该星级下最高,请升星' },
|
||||
JEWEL_HAS_SUIT: { code: 30523, simStr: '该装备已镶嵌该天晶石了' },
|
||||
JEWEL_NOT_SUIT: { code: 30524, simStr: '该装备未镶嵌天晶石' },
|
||||
STONE_HAS_SUIT: { code: 30525, simStr: '该装备该槽已镶嵌相同的地玉石了' },
|
||||
STONE_NOT_SUIT: { code: 30526, simStr: '该装备该槽未镶嵌地玉石' },
|
||||
STONE_CANNOT_SUIT: { code: 30527, simStr: '该装备不可装备该地玉石' },
|
||||
|
||||
//全局养成30600-30699
|
||||
ROLE_REACH_MAX_TITLE_LEVEL: { code: 30600, simStr: '玩家已达到最高的爵位' },
|
||||
|
||||
@@ -180,6 +180,9 @@ export async function calPlayerCe(hero: HeroType, update: HeroUpdate, type: numb
|
||||
case HERO_SYSTEM_TYPE.EQUIP_JEWEL:
|
||||
heroAttrs = await calEquipPutOnOrOffJewelIncAttr(hero, update, args, addSeidList, removeSeidList);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.EQUIP_STONE:
|
||||
heroAttrs = await calEquipPutOnOrOffStoneIncAttr(hero, update, args, addSeidList, removeSeidList);
|
||||
break;
|
||||
case HERO_SYSTEM_TYPE.EQUIP: //
|
||||
heroAttrs = calEquipPutOnOffIncAttr(hero, args, addSeidList, removeSeidList);
|
||||
break;
|
||||
@@ -753,6 +756,32 @@ function isRandSeUnLock(jewelId: number, randSeId: number, stones: Stone[]) {
|
||||
return stoneCnt >= dicJewelCondition.stoneCnt && stoneLv >= dicJewelCondition.stoneLv;
|
||||
}
|
||||
|
||||
export async function calEquipPutOnOrOffStoneIncAttr(hero: HeroType, update: HeroUpdate, eplaceIds: number[], addSeidList: number[], removeSeidList: number[]) {
|
||||
let { attr: heroAttrs, ePlace: oldEplace } = hero;
|
||||
let { ePlace: newEplace } = update;
|
||||
for(let eplaceId of eplaceIds) {
|
||||
let oldEquip = oldEplace.find(cur => cur.id == eplaceId);
|
||||
updateHeroAttrOfStone(heroAttrs, oldEquip, -1);
|
||||
await setRandSeToSeidList(oldEquip, removeSeidList);
|
||||
let newEquip = newEplace.find(cur => cur.id == eplaceId);
|
||||
updateHeroAttrOfStone(heroAttrs, newEquip, 1);
|
||||
await setRandSeToSeidList(newEquip, addSeidList); // 地玉石阶数变化可能导致属性词条解锁变化
|
||||
}
|
||||
return heroAttrs;
|
||||
}
|
||||
|
||||
function updateHeroAttrOfStone(heroAttrs: CeAttrData[], equip: EPlace, ratio: number) {
|
||||
for(let { stone } of equip.stones) {
|
||||
let dicStone = gameData.stone.get(stone);
|
||||
if(dicStone) {
|
||||
for(let attr of dicStone.attribute) {
|
||||
updateHeroAttr(heroAttrs, attr.id, { inc: { fixUp: ratio * attr.num * HERO_CE_RATIO } });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 穿脱, removeSeidList原来身上穿着的所有装备的seid,包括套装的
|
||||
* @param {HeroType} hero 武将
|
||||
|
||||
Reference in New Issue
Block a user