天晶随机:恢复为左闭右开

This commit is contained in:
luying
2022-04-24 12:20:22 +08:00
parent 8943db4550
commit 55bb294b54

View File

@@ -418,12 +418,16 @@ export async function getAddJewelInfo(roleId: string, roleName: string, jewel: {
*/
export function getJewelRandSe(id: number, seid: number) {
let dicRandom = gameData.randomEffectPool.get(seid)
// console.log('#### dicRandom', dicRandom)
let rand = 0;
if (dicRandom.id > 0) {
let randRange = getRandEelmWithWeight(dicRandom.rate);
// console.log('#### randRange', randRange)
let randResult = getRandValueByMinMax(randRange.dic.min, randRange.dic.max, getDecimalCnt(dicRandom.gap));
let n = Math.ceil((randResult - dicRandom.Min)/dicRandom.gap);
// console.log('#### randResult', randResult)
let n = Math.floor((randResult - dicRandom.Min)/dicRandom.gap);
rand = dicRandom.Min + n * dicRandom.gap;
// console.log('#### n', n, rand)
}
return new RandSe(id, dicRandom.id, rand);
}