🐞 fix(稷下学宫): 选择题奖励随机剔除条件圣物
This commit is contained in:
@@ -14,7 +14,7 @@ import { RougelikeCollectionModel } from '../../../db/RougelikeCollection';
|
||||
import { RougelikeLayerModel, RougelikeLayerType } from '../../../db/RougelikeLayer';
|
||||
import { RoleModel } from '../../../db/Role';
|
||||
import { gameData } from '../../../pubUtils/data';
|
||||
import { chooseNode, getGame, getInitCharaCard, getLayerNodeReward, getLayerRewardOneData, getMap, getMaxHp, getRandomSpirit, getRougeData, repaireSendScoreReward, updateChalleng, updateMaxHp } from '../../../services/battle/rougeService';
|
||||
import { chooseNode, getCardCount, getGame, getInitCharaCard, getLayerNodeReward, getLayerRewardOneData, getMap, getMaxHp, getRandomSpirit, getRougeData, repaireSendScoreReward, updateChalleng, updateMaxHp } from '../../../services/battle/rougeService';
|
||||
import { checkPreRougeTech, getCurTechData, updateEffectId } from '../../../services/battle/rougeTechService';
|
||||
import { BattleRecordModel } from '../../../db/BattleRecord';
|
||||
import { HeroModel } from '../../../db/Hero';
|
||||
@@ -751,11 +751,21 @@ export class RougeHandler {
|
||||
question.EventOptions.push(id);
|
||||
checkAfterGroup = afterGroup;
|
||||
|
||||
let cardId = 0;
|
||||
const rougeHolyCardPlanData = gameData.rougeHolyCardPlan.get(holyCardPlan);
|
||||
if (!rougeHolyCardPlanData || rougeHolyCardPlanData.length == 0) continue;
|
||||
if (rougeHolyCardPlanData.length == 1) cardId = rougeHolyCardPlanData[0].cardId;
|
||||
else cardId = getRandEelmWithWeight(rougeHolyCardPlanData).dic.cardId;
|
||||
let newCards = [];
|
||||
let cardsMap = await getCardCount(gameCode, ROUGE_LIKE_CARD_TYPE.HOLY);
|
||||
for (let obj of rougeHolyCardPlanData) {
|
||||
let holyCardData = gameData.rougeHolyCard.get(obj.cardId);
|
||||
if (!holyCardData) continue;
|
||||
const getLimit = cardsMap.get(obj.cardId) || 0;
|
||||
if (getLimit >= (holyCardData?.getLimit || 0)) continue; //处理限制获取数量
|
||||
newCards.push(obj);
|
||||
}
|
||||
let cardId = 0;
|
||||
if (newCards.length > 0) {
|
||||
cardId = getRandEelmWithWeight(newCards).dic.cardId;
|
||||
}
|
||||
|
||||
handleAddFun.pushHolyCard(cardId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user