Search in sources :

Example 1 with ACTION_TYPE

use of main.content.enums.entity.ActionEnums.ACTION_TYPE in project Eidolons by IDemiurge.

the class HeroObjectModifyingEffect method getIdList.

protected List<Integer> getIdList(Unit hero) {
    List<Integer> list = new ArrayList<>();
    if (hero == null) {
        return list;
    }
    switch(type) {
        case ACTIONS:
            for (ACTION_TYPE a : ActionEnums.ACTION_TYPE.values()) {
                if (hero.getActionMap().get(a) != null) {
                    for (DC_UnitAction action : hero.getActionMap().get(a)) {
                        list.add(action.getId());
                    }
                }
            }
            break;
        case ARMOR:
            list = new ArrayList<>(new ListMaster<Integer>().getList(hero.getArmor().getId()));
            break;
        case ITEMS:
            for (Obj i : hero.getQuickItems()) // if (i.getOBJ_TYPE_ENUM() != OBJ_TYPES.WEAPONS)
            // non-weapon QI???
            {
                list.add(i.getId());
            }
            break;
        case SPELLS:
            for (Obj i : hero.getSpells()) {
                list.add(i.getId());
            }
            // hero.getGame().getManager().getSpells(hero)
            break;
        case WEAPONS:
            Integer id = null;
            if (hero.getActiveWeapon(true) != null) {
                id = hero.getActiveWeapon(true).getId();
            }
            Integer id2 = 0;
            if (hero.getActiveWeapon(false) != null) {
                id2 = hero.getActiveWeapon(false).getId();
            }
            list = new ArrayList<>(new ListMaster<Integer>().getList(id2, id));
            List<? extends Obj> l = new ArrayList<>(hero.getQuickItems());
            for (Obj i : l) {
                if (i.getOBJ_TYPE_ENUM() == DC_TYPE.WEAPONS) {
                    list.add(i.getId());
                }
            }
            break;
    }
    // ListMaster.removeNullElements(list);
    FilterMaster.filter(list, conditions, game);
    return list;
}
Also used : Obj(main.entity.obj.Obj) ArrayList(java.util.ArrayList) DC_UnitAction(eidolons.entity.active.DC_UnitAction) ACTION_TYPE(main.content.enums.entity.ActionEnums.ACTION_TYPE)

Example 2 with ACTION_TYPE

use of main.content.enums.entity.ActionEnums.ACTION_TYPE in project Eidolons by IDemiurge.

the class DC_ActionManager method constructActionMaps.

public void constructActionMaps(Unit unit) {
    for (ACTION_TYPE sub : unit.getActionMap().keySet()) {
        unit.getActionMap().put(sub, new DequeImpl<>());
    }
    for (ActiveObj active : unit.getActives()) {
        DC_UnitAction action = (DC_UnitAction) active;
        ACTION_TYPE type = action.getActionType();
        if (type == null) {
            type = action.getActionType();
        }
        DequeImpl<DC_UnitAction> list = unit.getActionMap().get(type);
        if (!hiddenActions.contains(action.getType())) {
            list.add(action);
        }
    }
}
Also used : ActiveObj(main.entity.obj.ActiveObj) ACTION_TYPE(main.content.enums.entity.ActionEnums.ACTION_TYPE)

Aggregations

ACTION_TYPE (main.content.enums.entity.ActionEnums.ACTION_TYPE)2 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 ArrayList (java.util.ArrayList)1 ActiveObj (main.entity.obj.ActiveObj)1 Obj (main.entity.obj.Obj)1