🐞 fix(稷下学宫): 修复hp,maxhp, 休整点强化更新已安装特性卡id,权重展示
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { clone, result } from "underscore";
|
||||
import { ROUGE_CHARA_INITIAL, ROUGE_CHARA_TYPE, ROUGE_EFFECT_TYPE, ROUGE_LIKE_CARD_TYPE, ROUGE_LIKE_CHOOSE_REWARD, ROUGE_LIKE_NODE_TYPE, ROUGE_LIKE_STATUS, SHOP_REFRESH_TYPE } from "../../consts";
|
||||
import { Card, RougelikeCharaModel, RougelikeCharaType } from "../../db/RougelikeChara";
|
||||
import { Card, RougelikeCharaModel, RougelikeCharaPara, RougelikeCharaType } from "../../db/RougelikeChara";
|
||||
import { RougelikeLayerModel, RougelikeLayerType } from "../../db/RougelikeLayer";
|
||||
import { RougelikeRecordModel, RougelikeRecordType } from "../../db/RougelikeRecord";
|
||||
import { gameData } from "../../pubUtils/data";
|
||||
@@ -299,8 +299,8 @@ export async function chooseNode(dbRecord: RougelikeRecordType, layerChooseNode:
|
||||
reward = result;
|
||||
dbPara.rewards = result.rewards;
|
||||
}
|
||||
|
||||
if(isDevelopEnv){
|
||||
|
||||
if (isDevelopEnv) {
|
||||
weightRecords = dbPara.weightRecords = (result?.weightRecords || []);
|
||||
}
|
||||
}
|
||||
@@ -311,7 +311,7 @@ export async function chooseNode(dbRecord: RougelikeRecordType, layerChooseNode:
|
||||
let { coin, score, tech } = layerRewardData;
|
||||
reward = { rewards: dbDetail.rewards || [], score: score || 0, techScore: tech || 0, takeoutReward: layerPlanData.takeoutReward || [] };
|
||||
|
||||
if(isDevelopEnv){
|
||||
if (isDevelopEnv) {
|
||||
weightRecords = dbDetail.weightRecords
|
||||
}
|
||||
}
|
||||
@@ -603,7 +603,7 @@ export async function getPassiveCardPlan(passiveCardPlan: number, passiveCardRan
|
||||
if (!passiveCardData) continue;
|
||||
const getLimit = cardsMap.get(cardId) || 0;
|
||||
if (getLimit >= (passiveCardData?.getLimit || 0)) continue; //处理限制获取数量
|
||||
|
||||
|
||||
weightRecord.originalWight = weight;
|
||||
|
||||
if (chooseCardsMap.has(cardId)) {
|
||||
@@ -739,12 +739,14 @@ export async function getHolyCardPlan(holyCardPlan: number, holyCardRandomNum: n
|
||||
}
|
||||
if (!holyCardData.label) {
|
||||
newCards.push({ ...obj });
|
||||
weightRecord.finalWeight = weight;
|
||||
continue;
|
||||
};
|
||||
|
||||
let labelNum = lableMap.get(holyCardData.label) || 0;
|
||||
if (labelNum < ROUGELIKE.HOLY_LABLE_NUM || ROUGELIKE.HOLY_LABLE_NUM == 0) {
|
||||
newCards.push({ ...obj });
|
||||
weightRecord.finalWeight = weight;
|
||||
continue;
|
||||
};
|
||||
|
||||
@@ -938,7 +940,7 @@ export async function getMaxHp(roleId: string, gameCode: string, charaId: number
|
||||
return Math.floor(maxHp);
|
||||
}
|
||||
|
||||
export async function updateMaxHp(roleId: string, gameCode: string, type: number, grade: number, updateCharasMap?: Map<string,RougelikeCharaType[]>) {
|
||||
export async function updateMaxHp(roleId: string, gameCode: string, type: number, grade: number, updateCharasMap?: Map<string, RougelikeCharaPara>) {
|
||||
let dbCharas = await RougelikeCharaModel.findByGameCode(gameCode);
|
||||
if (dbCharas.length == 0) return [];
|
||||
|
||||
@@ -949,7 +951,9 @@ export async function updateMaxHp(roleId: string, gameCode: string, type: number
|
||||
}
|
||||
let tempMaxHp = await getMaxHp(roleId, gameCode, val.charaId, type, grade);
|
||||
if (tempMaxHp == val.maxHp && updateCharasMap && !updateCharasMap.has(val.charaCode)) continue;
|
||||
let preMaxHp = val.maxHp;
|
||||
val.maxHp = tempMaxHp;
|
||||
val.hp = Math.min(val.hp + tempMaxHp - preMaxHp, tempMaxHp);
|
||||
result.push(val);
|
||||
}
|
||||
await RougelikeCharaModel.bulkWriteUpdate(result);
|
||||
|
||||
Reference in New Issue
Block a user