change weight
parent
a1e84b5a16
commit
78df2af776
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Reference in New Issue