🐞 fix(稷下学宫): 点亮法阵更新最大hp
This commit is contained in:
@@ -938,17 +938,17 @@ 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) {
|
||||
export async function updateMaxHp(roleId: string, gameCode: string, type: number, grade: number, updateCharasMap?: Map<string,RougelikeCharaType[]>) {
|
||||
let dbCharas = await RougelikeCharaModel.findByGameCode(gameCode);
|
||||
if (dbCharas.length == 0) return [];
|
||||
|
||||
let result: RougelikeCharaType[] = [];
|
||||
for (let val of dbCharas) {
|
||||
if (updateCharasMap.has(val.charaCode)) {
|
||||
if (updateCharasMap && updateCharasMap.has(val.charaCode)) {
|
||||
val = { ...val, ...updateCharasMap.get(val.charaCode) }
|
||||
}
|
||||
let tempMaxHp = await getMaxHp(roleId, gameCode, val.charaId, type, grade);
|
||||
if (tempMaxHp == val.maxHp && !updateCharasMap.has(val.charaCode)) continue;
|
||||
if (tempMaxHp == val.maxHp && updateCharasMap && !updateCharasMap.has(val.charaCode)) continue;
|
||||
val.maxHp = tempMaxHp;
|
||||
result.push(val);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user