Search in sources :

Example 1 with SearchMaster

use of main.system.auxiliary.SearchMaster in project Eidolons by IDemiurge.

the class RestCondition method check.

@Override
public boolean check(Ref ref) {
    // check whole party!
    // check anyone has food
    List<Unit> allies = getGame().getMetaMaster().getPartyManager().getParty().getMembers();
    boolean hasFood = false;
    for (Unit sub : allies) {
        int distance = getGame().getAiManager().getAnalyzer().getClosestEnemyDistance(sub);
        // return false;
        if (new SearchMaster<DC_HeroItemObj>().find(FOOD_ITEM, sub.getInventory(), true) != null)
            hasFood = true;
    }
    if (true)
        return true;
    return hasFood;
}
Also used : SearchMaster(main.system.auxiliary.SearchMaster) Unit(eidolons.entity.obj.unit.Unit)

Aggregations

Unit (eidolons.entity.obj.unit.Unit)1 SearchMaster (main.system.auxiliary.SearchMaster)1