change weight

back_recharge
wangyuan 2019-03-14 11:13:05 +08:00
parent a1e84b5a16
commit 78df2af776
3 changed files with 4 additions and 4 deletions

View File

@ -107,7 +107,7 @@ public class Equip extends MongoBase {
int randomWeight = MathUtils.randomInt(totalWeight) +1;
for(SRunesPoolConfig sRunesPoolConfig : sRunesPoolConfigs){
weight+=sRunesPoolConfig.getWeight();
if(randomWeight<weight){
if(randomWeight<=weight){
int random = MathUtils.random(sRunesPoolConfig.getMin(), sRunesPoolConfig.getMax());
result.put(sRunesPoolConfig.getPropertyId(),random);
break;
@ -137,7 +137,7 @@ public class Equip extends MongoBase {
int randomWeight = MathUtils.randomInt(totalWeight) +1;
for(SEquipPropertyPool sEquipPropertyPool : sEquipPropertyPoolList){
weight+=sEquipPropertyPool.getWeight();
if(randomWeight<weight){
if(randomWeight<=weight){
int random = MathUtils.random(sEquipPropertyPool.getMin(), sEquipPropertyPool.getMax());
result.put(sEquipPropertyPool.getPropertyId(),random);
break;

View File

@ -171,7 +171,7 @@ public class HeroLogic {
for(int i=0;i<diamondBoxContain.length;i++){
int[] poolWeightInfo = diamondBoxContain[i];
weight += poolWeightInfo[1];
if(randWeight<weight){
if(randWeight<=weight){
pooId = poolWeightInfo[0];
break;
}

View File

@ -88,7 +88,7 @@ public class WorkShopLogic {
int weight=0;
for(int[] poolWeightInfo : poolWeight){
weight+=poolWeightInfo[1];
if(randomWeight>weight){
if(randomWeight>=weight){
SMysteryFoodPoolConfig sMysteryFoodPoolConfig = randomFromFoodPool(poolWeightInfo[0]);
int itemId = sMysteryFoodPoolConfig.getItemId();
drop[i++] = new int[]{itemId,1};