装备:随机属性
This commit is contained in:
@@ -420,14 +420,14 @@ 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));
|
||||
// console.log('#### randResult', randResult)
|
||||
let planPool = gameData.randomEffectPoolPlan.get(dicRandom.planId);
|
||||
if(planPool && planPool.length > 0) {
|
||||
let result = getRandEelmWithWeight(planPool);
|
||||
if(result) rand = result.dic.num;
|
||||
} else {
|
||||
let randResult = getRandValueByMinMax(dicRandom.Min, dicRandom.Max, getDecimalCnt(dicRandom.gap));
|
||||
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