Browse Source

hotfix mob roll finalized

master
FatBoy-DOTC 1 year ago
parent
commit
07c64f9b46
  1. 6
      src/engine/loot/LootManager.java

6
src/engine/loot/LootManager.java

@ -95,10 +95,11 @@ public class LootManager {
} }
for (BootySetEntry bse : entries) { for (BootySetEntry bse : entries) {
int roll; int roll;
float dropChance = bse.dropChance * multiplier;
switch (bse.bootyType) { switch (bse.bootyType) {
case "GOLD": case "GOLD":
roll = ThreadLocalRandom.current().nextInt(101); roll = ThreadLocalRandom.current().nextInt(101);
if (roll > (bse.dropChance * multiplier)) { if (roll > dropChance) {
//early exit, failed to hit minimum chance roll OR booty was generated from mob's death //early exit, failed to hit minimum chance roll OR booty was generated from mob's death
break; break;
} }
@ -111,8 +112,7 @@ public class LootManager {
break; break;
case "LOOT": case "LOOT":
roll = ThreadLocalRandom.current().nextInt(101); roll = ThreadLocalRandom.current().nextInt(101);
float dropChance = bse.dropChance * multiplier; if (roll > dropChance) {
if (roll > (bse.dropChance * multiplier)) {
//early exit, failed to hit minimum chance roll //early exit, failed to hit minimum chance roll
break; break;
} }

Loading…
Cancel
Save