寻宝掉落
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user