feat(稷下学宫): 更新同角色不可安装相同id特性卡

This commit is contained in:
zhangxk
2023-09-08 15:04:04 +08:00
parent cb24736482
commit ebca4730ab
2 changed files with 9 additions and 3 deletions

View File

@@ -963,8 +963,15 @@ export class RougeHandler {
newCardsMap.set(cardCode, update);
}
}
// 如果卸下之后技能卡需要的被动卡不够,需要把技能卡卸下
let newCards = Array.from(dbCharaCardsMap.values());
let tempCards = new Map<number, number>();
for (let { cardId } of newCards) {
if (!cardId) continue;
if (tempCards.has(cardId)) return resResult(STATUS.ROUGE_NO_CAN_PUT_SAME_ID);
tempCards.set(cardId, cardId);
}
// 如果卸下之后技能卡需要的被动卡不够,需要把技能卡卸下
let { apSkill, roundSkill } = dbChara;
if (apSkill > 0 && !await checkCanChooseSkillCard(roleId, gameCode, apSkill, newCards)) apSkill = 0;
if (roundSkill > 0 && !await checkCanChooseSkillCard(roleId, gameCode, roundSkill, newCards)) roundSkill = 0;

View File

@@ -772,9 +772,7 @@ export const STATUS = {
NO_CARD: { code: 80004, simStr: '卡不存在' },
SLOT_UNLOCK: { code: 80005, simStr: '卡槽未解锁' },
NO_PASSIVE: { code: 80006, simStr: '非特性卡不能安装' },
ROUGELIKE_GAME_PLAYING: { code: 80007, simStr: '有一场试炼正在进行中' },
NO_TYPE_GRADE: { code: 80008, simStr: '不存在这样的试炼' },
LIMIT_LV: { code: 80008, simStr: '未达到等级限制' },
NO_ROUGELIKE_GAME: { code: 80009, simStr: '该场游戏无效' },
@@ -793,6 +791,7 @@ export const STATUS = {
ROUGELIKE_TAKEOUT_CNT_NOT_ENOUGH: { code: 80022, simStr: '本周外带次数不足' },
BATTLE_ABNORMAL_CHARA: { code: 80023, simStr: '上阵学员数量异常' },
ROUGE_RE_RANDOM_CNT_OVER: { code: 80024, simStr: '已重新随机过' },
ROUGE_NO_CAN_PUT_SAME_ID: { code: 80025, simStr: '不能安装相同特性卡' },
ROUGE_TECH_SCORE_NOT_ENOUGH: { code: 80101, simStr: '科技点不足' },
ROUGE_TECH_HAS_UNLOCKED: { code: 80102, simStr: '科技点已解锁' },