Search in sources :

Example 66 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class DC_GameManager method select.

@Override
public Integer select(Set<Obj> selectingSet, Ref ref) {
    Pair<Set<Obj>, TargetRunnable> p = new ImmutablePair<>(selectingSet, (t) -> {
        if (ref.getActive() instanceof DC_ActiveObj) {
            // TODO CLICK ON ANY OTHER OBJ MUST RESULT IN SELECTION STOP!
            // ((DC_ActiveObj) ref.getActive()).activateOn(t);
            // WaitMaster.receiveInput(WAIT_OPERATIONS.SELECT_BF_OBJ, t.getId());
            t.invokeClicked();
        }
    });
    GuiEventManager.trigger(SELECT_MULTI_OBJECTS, p);
    for (Obj obj : new ArrayList<>(selectingSet)) {
        if (obj instanceof DC_Obj) {
            DC_Obj unit = (DC_Obj) obj;
            if (getActiveObj() != null) {
                if (getActiveObj().getZ() != unit.getZ()) {
                    selectingSet.remove(unit);
                }
            }
        }
    }
    this.selectingSet = selectingSet;
    if (selectingSet.isEmpty()) {
        // getGame().getToolTipMaster().addTooltip(SCREEN_POSITION.ACTIVE_UNIT_BOTTOM,
        // "No targets available!");
        DC_SoundMaster.playStandardSound(STD_SOUNDS.ACTION_CANCELLED);
        return null;
    }
    setSelecting(true);
    for (Obj obj : selectingSet) {
        DrawMasterStatic.getObjImageCache().remove(obj);
    }
    Integer id = selectAwait();
    if (id == null) {
        if (ref.getTarget() != null) {
            return ref.getTarget();
        }
    }
    return id;
}
Also used : DC_Obj(eidolons.entity.obj.DC_Obj) Set(java.util.Set) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) MicroObj(main.entity.obj.MicroObj) ActiveObj(main.entity.obj.ActiveObj) BuffObj(main.entity.obj.BuffObj) Obj(main.entity.obj.Obj) PassiveAbilityObj(main.ability.PassiveAbilityObj) ArrayList(java.util.ArrayList) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) TargetRunnable(eidolons.libgdx.bf.TargetRunnable)

Example 67 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class BuffMaster method atbTimeElapsed.

public void atbTimeElapsed(Float time) {
    for (Obj sub : getBuffs()) {
        BuffObj buff = ((BuffObj) sub);
        if (buff.isDead())
            continue;
        buff.timeElapsed(time);
    }
}
Also used : DC_BuffObj(eidolons.entity.obj.attach.DC_BuffObj) BuffObj(main.entity.obj.BuffObj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) DC_BuffObj(eidolons.entity.obj.attach.DC_BuffObj) BuffObj(main.entity.obj.BuffObj)

Example 68 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class LE_PlanPanel method handleObjControl.

public void handleObjControl(OBJ_CONTROLS control) {
    Obj obj = LevelEditor.getMouseMaster().getSelectedObj();
    switch(control) {
        case GROUP:
            newGroup();
            break;
        case AI:
            LE_AiMaster.editAI(obj);
            break;
        case POSITIONING:
            if (obj instanceof Unit) {
                LE_ObjMaster.setDirection((Unit) obj, obj.getCoordinates());
                LE_ObjMaster.setFlip((Unit) obj, obj.getCoordinates());
                LevelEditor.getMainPanel().getMapViewComp().getMinigrid().resetOverlayingComp(obj);
            }
            break;
        case PALETTE:
            LevelEditor.getMainPanel().getPalette().checkRemoveOrAddToPalette(obj.getType());
            break;
        default:
            break;
    }
}
Also used : Obj(main.entity.obj.Obj) Unit(eidolons.entity.obj.unit.Unit)

Example 69 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class ChoiceEffect method applyThis.

@Override
public boolean applyThis() {
    // ref.getGroup().getObjects()
    // ref.setTarget(id);
    Obj obj = ref.getSourceObj();
    if (listData == null) {
        if (listTypeData == null && TYPE != null) {
            /**
             * how to choose from a custom obj pool? ref.getGroup()
             */
            listTypeData = DataManager.getTypes(TYPE);
        }
        listData = DataManager.toStringList(listTypeData);
    }
    String input = null;
    if (!getGame().isOffline()) {
    // getGame().getCommunicator().getChoiceData();
    } else {
        input = ListChooser.chooseType(listData, TYPE);
    }
    if (input == null) {
        return false;
    }
    WaitMaster.receiveInput(operation, input);
    if (!getGame().isOffline()) {
        if (obj.isMine()) {
        // getGame().getCommunicator().sendChoiceData(input);
        }
    }
    return true;
}
Also used : Obj(main.entity.obj.Obj)

Example 70 with Obj

use of main.entity.obj.Obj in project Eidolons by IDemiurge.

the class LE_MapMaster method moveBlock.

public void moveBlock(MapBlock block, int offsetX, int offsetY) {
    for (Obj obj : block.getObjects()) {
    // moveObj(obj, offsetX, offsetY);
    }
    List<Coordinates> coordinates = new ArrayList<>();
    for (Coordinates c : block.getCoordinates()) {
        coordinates.add(new Coordinates(c.x + offsetX, c.y + offsetY));
    }
    block.setCoordinates(coordinates);
}
Also used : Obj(main.entity.obj.Obj) Coordinates(main.game.bf.Coordinates) ArrayList(java.util.ArrayList)

Aggregations

Obj (main.entity.obj.Obj)127 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)34 DC_Obj (eidolons.entity.obj.DC_Obj)30 Coordinates (main.game.bf.Coordinates)27 Unit (eidolons.entity.obj.unit.Unit)24 ArrayList (java.util.ArrayList)19 Ref (main.entity.Ref)15 DC_SpellObj (eidolons.entity.active.DC_SpellObj)14 BuffObj (main.entity.obj.BuffObj)13 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)12 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)11 ActiveObj (main.entity.obj.ActiveObj)10 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)9 PassiveAbilityObj (main.ability.PassiveAbilityObj)9 ObjType (main.entity.type.ObjType)8 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)7 DC_BuffObj (eidolons.entity.obj.attach.DC_BuffObj)7 PARAMETER (main.content.values.parameters.PARAMETER)7 Conditions (main.elements.conditions.Conditions)6 MicroObj (main.entity.obj.MicroObj)6