Skip to content

Commit

Permalink
Re-added OP loot nerf
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackJar72 committed Dec 18, 2018
1 parent 21521d0 commit 14dd1e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
11 changes: 7 additions & 4 deletions java/jaredbgreat/dldungeons/pieces/chests/LootCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ public static ItemStack getLoot(LootType type, int level, Random random) {
if(level > 6) level = 6;
return heal.levels[level].getLoot(random).getStack(random);
case LOOT:
if(level > 6 && random.nextBoolean()) {
return LootList.special.getLoot(random).getStack(random);
} else if(level > 6){
level = 6;
if(level > 6) {
if(level > random.nextInt(100)) {
return LootList.special.getLoot(random).getStack(random);
} else {
level = 6;
}
}
if(random.nextInt(10) == 0) {
return getEnchantedBook(level, random);
Expand Down Expand Up @@ -185,3 +187,4 @@ private static ItemStack getEnchantedBook(int level, Random random) {
return out;
}
}

15 changes: 12 additions & 3 deletions java/jaredbgreat/dldungeons/pieces/chests/TreasureChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,19 @@ public void place(World world, int x, int y, int z, Random random) {
if(random.nextInt(7) < level) {
if(level >= 6) {
treasure = LootList.special.getLoot(random).getStack(random);
contents.setInventorySlotContents(slots.get(slot).intValue(), treasure);
slot++;
if(random.nextBoolean()) {
treasure = LootList.discs.getLoot(random).getStack(random);
contents.setInventorySlotContents(slots.get(slot).intValue(), treasure);
slot++;
}
}
else {
treasure = LootList.discs.getLoot(random).getStack(random);
contents.setInventorySlotContents(slots.get(slot).intValue(), treasure);
slot++;
}
else treasure = LootList.discs.getLoot(random).getStack(random);
contents.setInventorySlotContents(slots.get(slot).intValue(), treasure);
slot++;
}
}

Expand Down

0 comments on commit 14dd1e8

Please sign in to comment.