寻宝战场同步加入单个敌军血量
This commit is contained in:
@@ -96,6 +96,7 @@ export const STATUS = {
|
||||
COM_BATTLE_CAN_NOT_RM: { code: 20622, simStr: '没有移除成员的权限' },
|
||||
COM_BATTLE_DISSMISS_ERR: { code: 20623, simStr: '解散队伍异常' },
|
||||
COM_BATTLE_NO_RECENT_REC: { code: 20624, simStr: '没有最近的寻宝记录' },
|
||||
COM_BATTLE_HURT_NUM_ERR: { code: 20625, simStr: '血量计算错误' },
|
||||
|
||||
// 共斗藏宝图合成
|
||||
COM_BLUEPRT_QUALITY_CANNOT_COMPOSE: { code: 20630, simStr: '该品质藏宝图不可合成' },
|
||||
|
||||
@@ -18,8 +18,9 @@ const seidInfo = new Map<number, any>();
|
||||
const olySeidInfo = new Map<number, any>();
|
||||
const expeditionInfo = new Map<number, any> ();
|
||||
const comBtlInfo = new Map<number, {quality: number, name: string, assistanceTime: number, assistanceLevel: number}>();
|
||||
const btlBossHp = new Map<number, number>();
|
||||
const blueprtBossHp = new Map<number, number>();
|
||||
const btlBossHpSum = new Map<number, number>();
|
||||
const btlBossHp = new Map<number, Array<{dataId: number, hp: number}>>();
|
||||
const blueprtToWar = new Map<number, number>();
|
||||
const goodInfo = new Map<number, any>();
|
||||
const blueprt = new Map<number, Array<number>>();
|
||||
const blueprtCompose = new Map<number, any>();
|
||||
@@ -357,37 +358,45 @@ export function getComBtlSetByQuality(quality: number) {
|
||||
}
|
||||
|
||||
export function getBossHpByWarId(warId: number) {
|
||||
let bossHp = btlBossHp.get(warId) || 0;
|
||||
if (!bossHp) {
|
||||
let bossHpSum = btlBossHpSum.get(warId) || 0;
|
||||
let bossHpArr = btlBossHp.get(warId) || [];
|
||||
if (!bossHpSum || !bossHpArr) {
|
||||
const warInfo = getWarJsons(warId).json;
|
||||
if (warInfo && warInfo.length) {
|
||||
warInfo.forEach(hero => {
|
||||
if (hero.relation === 2) {
|
||||
let { attribute } = hero;
|
||||
let { attribute, dataId, relation } = hero;
|
||||
if (relation === 2) {
|
||||
let attriData = decodeIdCntArrayStr(attribute, 1);
|
||||
const hp = parseInt(attriData.get('1'));
|
||||
if (hp > 0) {
|
||||
bossHp += hp;
|
||||
bossHpArr.push({dataId, hp});
|
||||
bossHpSum += hp;
|
||||
}
|
||||
}
|
||||
})
|
||||
btlBossHp.set(warId, bossHpArr);
|
||||
btlBossHpSum.set(warId, bossHpSum);
|
||||
}
|
||||
btlBossHp.set(warId, bossHp);
|
||||
}
|
||||
return bossHp;
|
||||
return { bossHpSum, bossHpArr };
|
||||
}
|
||||
|
||||
export function getWarIdByBlueprtId(blueprtId: number) {
|
||||
let warId = blueprtToWar.get(blueprtId);
|
||||
if (!warId) {
|
||||
const { specialAttr } = getGoodById(blueprtId);
|
||||
const attrData = decodeIdCntArrayStr(specialAttr, 1);
|
||||
warId = parseInt(attrData.get('1'));
|
||||
blueprtToWar.set(blueprtId, warId);
|
||||
}
|
||||
return warId;
|
||||
}
|
||||
|
||||
export function getBossHpByBlueprtId(blueprtId: number) {
|
||||
let bossHp = blueprtBossHp.get(blueprtId) || 0;
|
||||
if (!bossHp) {
|
||||
const { specialAttr } = getGoodById(blueprtId);
|
||||
const attrData = decodeIdCntArrayStr(specialAttr, 1);
|
||||
const warId = parseInt(attrData.get('1'));
|
||||
bossHp = getBossHpByWarId(warId);
|
||||
blueprtBossHp.set(blueprtId, bossHp);
|
||||
}
|
||||
return bossHp;
|
||||
let bossHpInfo = getBossHpByWarId(getWarIdByBlueprtId(blueprtId));
|
||||
return bossHpInfo;
|
||||
}
|
||||
|
||||
export function hasExpeditionById(id: number) {
|
||||
return expeditionInfo.has(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user