装备:随机属性

This commit is contained in:
luying
2022-05-07 14:55:22 +08:00
parent f7e92c8c89
commit 5122558f40
7 changed files with 17724 additions and 250 deletions
@@ -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);
}