天晶随机:恢复为左闭右开
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user