Search in sources :

Example 1 with LOOT_GROUP

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;
}
Also used : Entity(main.entity.Entity) ObjType(main.entity.type.ObjType) LOOT_GROUP(main.content.enums.rules.ArcadeEnums.LOOT_GROUP) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 LOOT_GROUP (main.content.enums.rules.ArcadeEnums.LOOT_GROUP)1 Entity (main.entity.Entity)1 ObjType (main.entity.type.ObjType)1