装备:镶嵌天晶石

This commit is contained in:
luying
2022-02-16 16:51:23 +08:00
parent 862c3f4d65
commit 29e66fc844
17 changed files with 277 additions and 144 deletions
+17
View File
@@ -8,6 +8,7 @@ import { dicGoods, DicGoods } from '../pubUtils/dictionary/DicGoods';
import { QuenchLogParam } from '../domain/roleField/equip';
import { QUENCH } from '../pubUtils/dicParam';
import { DicQuenchQuality } from '../pubUtils/dictionary/DicQuenchQuality';
import { JewelType } from '../db/Jewel';
/**
* 校验前端传入的消耗数量是否准确,并返回消耗的道具并加上特殊材料needConsumes
@@ -225,4 +226,20 @@ export function updateEplaces(eplace: EPlace[], update: Map<number, Partial<EPla
}
}
return {newEplace, updatedEplace};
}
/**
* 检查天晶石能否装备上这个装备
* @param equip
* @param jewel
*/
export function checkJewelCanPutOnEquip(equip: EPlace, jewel: JewelType) {
// 位置是否满足
let dicJewel = gameData.jewel.get(jewel.id);
console.log('####', dicJewel, dicJewel.eplaceId, equip.id)
if(!dicJewel || dicJewel.eplaceId != equip.id) return false;
// 品质是否满足
let dicEquipQualityExtra = gameData.equipQualityExtra.get(equip.quality);
if(!dicEquipQualityExtra || dicEquipQualityExtra.jewelCnt == 0) return false;
return true
}