🐞 fix(稷下学宫): 圣物解锁特性槽(仅解锁上阵学员)

This commit is contained in:
zhangxk
2023-09-09 17:31:57 +08:00
parent c8ac249c7a
commit 53ab4ce19b
2 changed files with 17 additions and 4 deletions

View File

@@ -285,6 +285,8 @@ export class RougeHandler {
* @param session
*/
async chooseNode(msg: { gameCode: string, layer: number, detailCode: string }, session: BackendSession) {
let chooseNodeStartTime = Date.now();
let roleId = session.get('roleId');
const { gameCode, layer, detailCode } = msg;
@@ -321,7 +323,13 @@ export class RougeHandler {
if (dbCurLayerChooseNode.preNodeIndexs.indexOf(dbPreLayerChooseNode.index) == -1) return resResult(STATUS.NODE_NO_CHOOSE);
}
return resResult(STATUS.SUCCESS, { detailCode, layer, curNode: await chooseNode(dbRecord, dbCurLayerChooseNode, layer) })
let chooseNodeEndTime = Date.now();
const curNode = await chooseNode(dbRecord, dbCurLayerChooseNode, layer)
console.log('*********************************nodeType=%s, chooseNodeTime=%s', curNode?.nodeType, chooseNodeEndTime - chooseNodeStartTime);
return resResult(STATUS.SUCCESS, { detailCode, layer, curNode })
}
// 挑战关卡

View File

@@ -170,7 +170,12 @@ export class RougeEffect {
if (!getHolyCardIsUse(this.holyMap.get(cardCode))) continue;
const randomNum = effectParam[0] || 0;
let unlockNum = effectParam[1] || 0;
let charas = getRandEelm(this.dbCharas.filter(cur => cur.cards.length < ROUGE_SLOT_LIMIT), randomNum);
this.dbCharas.sort((a, b) => {
if (a.seqId < b.seqId) return -1;
if (a.seqId > b.seqId) return 1;
return 0;
});
let charas = getRandEelm(this.dbCharas.slice(0, 6).filter(cur => cur.cards.length < ROUGE_SLOT_LIMIT), randomNum);
for (let val of charas) {
unlockNum = effectParam[1] || 0;
let { charaCode, cards = [] } = val;
@@ -212,7 +217,7 @@ export class RougeEffect {
this.updateHolyMapUseCount(this.holyMap.get(cardCode));
}
}
if(pushCards.length > 0){
if (pushCards.length > 0) {
await sendMessageToUserWithSuc(this.roleId, PUSH_ROUTE.ROUGE_PASSIVE_CARD_UP_LV, { upLvCards: pushCards }, this.sid);
}
}
@@ -254,7 +259,7 @@ export class RougeEffect {
}
if (isUseCount) this.updateHolyMapUseCount(this.holyMap.get(cardCode));
}
if(pushCards.length > 0){
if (pushCards.length > 0) {
await sendMessageToUserWithSuc(this.roleId, PUSH_ROUTE.ROUGE_PASSIVE_CARD_UP_LV, { upLvCards: pushCards }, this.sid);
}
}