寻宝掉落

This commit is contained in:
liangtongchuan
2020-12-02 00:16:07 +08:00
parent 15cf434d73
commit cdd889f1aa
9 changed files with 116 additions and 13 deletions

View File

@@ -393,10 +393,18 @@ export function getWarIdByBlueprtId(blueprtId: number) {
}
export function getBossHpByBlueprtId(blueprtId: number) {
let bossHpInfo = getBossHpByWarId(getWarIdByBlueprtId(blueprtId));
let warId = getWarIdByBlueprtId(blueprtId);
let { dispatchJsonId } = getWarById(warId);
let bossHpInfo = getBossHpByWarId(dispatchJsonId);
return bossHpInfo;
}
export function getRewardByBlueprtId(blueprtId: number) {
let warId = getWarIdByBlueprtId(blueprtId);
let { fixReward } = getWarById(warId);
return fixReward;
}
export function hasExpeditionById(id: number) {
return expeditionInfo.has(id);
}

View File

@@ -133,7 +133,7 @@ export function decodeIdCntArrayStr(str: string, multi: number) {
const strMap = new Map();
strArr.forEach(item => {
const kv = item.split('&');
strMap.set(kv[0], multi? parseInt(kv[1]) * multi: kv[1]);
strMap.set(kv[0], multi? Math.ceil(parseInt(kv[1]) * multi): kv[1]);
});
return strMap;
}
@@ -383,3 +383,12 @@ export async function updateCe(roleId: string, hero: any ) {
await HeroModel.updateCe(roleId, hid, ce, oldCe, historyCe);
}
}
export function ratioReward(rewardStr: string, ratio: number): string {
let rewards = decodeIdCntArrayStr(rewardStr, ratio);
let res = '';
for (let [k, v] of rewards) {
res += `${k}&${v}|`;
}
return res.substring(0, res.length - 1);
}