use of main.content.enums.rules.ArcadeEnums.LOOT_GROUP in project Eidolons by IDemiurge.
the class LootMaster method generateLoot.
private static List<Entity> generateLoot(int lootValue, Dungeon dungeon) {
int min = 0;
// dungeon.getIntParam(PARAMS.MIN_ITEMS_LOOT);
if (min <= 0) {
min = DEFAULT_ITEM_MINIMUM;
}
int max = min * 3 / 2;
List<Entity> loot = new ArrayList<>();
Loop.startLoop(max);
int total = 0;
while (!Loop.loopEnded()) {
if (total >= lootValue) {
break;
}
LOOT_GROUP group = getLootGroup(dungeon);
int value = lootValue / min;
ObjType type = generateLootItem(value, group);
loot.add(type);
total += getItemValue(type);
}
return loot;
}
Aggregations