From cdd746e0df5497911b708a13802920ebca88af44 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 30 Mar 2024 12:44:12 -0400 Subject: [PATCH] Removed extra squigglies --- src/engine/gameManager/LootManager.java | 38 ++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 564112e2..6da78e72 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -159,14 +159,16 @@ public enum LootManager { return null; //gets the 1-320 roll for this mob + int itemTableRoll = 0; - int objectType = mob.getObjectType().ordinal(); - if (mob.getObjectType().ordinal() == 52) { //52 = player character + + if (mob.getObjectType().ordinal() == 52) //52 = player character itemTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1); - } else { + else itemTableRoll = TableRoll(mob.level, inHotzone); - } + ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, itemTableRoll); + if (tableRow == null) return null; @@ -182,22 +184,22 @@ public enum LootManager { outItem = new MobLoot(mob, ItemTemplate.templates.get(itemUUID), false); - if (selectedRow.pModTable != 0) { + if (selectedRow.pModTable != 0) try { outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone); outItem.flags.remove(Enum.ItemFlags.Identified); } catch (Exception e) { Logger.error("Failed to GeneratePrefix for item: " + outItem.getName()); } - } - if (selectedRow.sModTable != 0) { + + if (selectedRow.sModTable != 0) try { outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone); outItem.flags.remove(Enum.ItemFlags.Identified); } catch (Exception e) { Logger.error("Failed to GenerateSuffix for item: " + outItem.getName()); } - } + return outItem; } @@ -214,12 +216,14 @@ public enum LootManager { if (prefixTable == null) return inItem; + int prefixTableRoll = 0; - if (mob.getObjectType().ordinal() == 52) { + + if (mob.getObjectType().ordinal() == 52) prefixTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1); - } else { + else prefixTableRoll = TableRoll(mob.level, inHotzone); - } + ModTableEntry prefixMod = ModTableEntry.rollTable(prefixTable.modTableID, prefixTableRoll); if (prefixMod == null) @@ -246,12 +250,14 @@ public enum LootManager { if (suffixTable == null) return inItem; - int suffixTableRoll = 0; - if (mob.getObjectType().ordinal() == 52) { + + int suffixTableRoll; + + if (mob.getObjectType().ordinal() == 52) suffixTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1); - } else { + else suffixTableRoll = TableRoll(mob.level, inHotzone); - } + ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll); if (suffixMod == null) @@ -336,6 +342,7 @@ public enum LootManager { return; // safehold guards don't drop their equipment //do equipment here int dropCount = 0; + if (mob.charItemManager.equipped.isEmpty() == false) for (Item item : mob.charItemManager.equipped.values()) { @@ -447,7 +454,6 @@ public enum LootManager { winnings.addPermanentEnchantment(suffix.action, 0, suffix.level, true); } winnings.flags.add(Enum.ItemFlags.Identified); - ; //remove gift from inventory