Search in sources :

Example 1 with AnimContext

use of eidolons.libgdx.anims.AnimContext in project Eidolons by IDemiurge.

the class Executor method activate.

public boolean activate() {
    reset();
    syncActionRefWithSource();
    getTargeter().initTarget();
    if ((isCancelled()) != null) {
        cancelled();
        return false;
    }
    if (isInterrupted()) {
        return interrupted();
    }
    Obj target = getAction().getTargetObj();
    AnimContext animContext = new AnimContext(getAction());
    animContext.setTarget(target);
    boolean gameLog = getAction().getLogger().isActivationLogged();
    String targets = " ";
    if (getAction().getLogger().isTargetLogged())
        if (target != null) {
            if (game.isDebugMode())
                targets = getAction().getTargetObj().getNameAndCoordinate();
            else
                targets = getAction().getTargetObj().getNameIfKnown();
        } else if (getAction().getTargetGroup() != null) {
            targets = getAction().getTargetGroup().toString();
        }
    log(getAction().getOwnerObj().getNameAndCoordinate() + " activates " + getAction().getName() + " " + targets, false);
    if (gameLog)
        log(getAction().getOwnerObj().getNameIfKnown() + " activates " + getAction().getNameIfKnown() + " " + targets, true);
    beingActivated();
    if (isInterrupted()) {
        return interrupted();
    }
    initActivation();
    if (isInterrupted()) {
        return interrupted();
    }
    resolve();
    if (!BooleanMaster.isTrue(cancelled)) {
        payCosts();
    }
    if (AnimMaster.isOn())
        if (!AnimMaster.getInstance().getConstructor().isReconstruct())
            AnimMaster.getInstance().getConstructor().preconstruct(getAction());
    GuiEventManager.trigger(GuiEventType.ACTION_RESOLVES, new ActionInput(getAction(), animContext));
    actionComplete();
    return isResult();
}
Also used : ActionInput(eidolons.game.core.ActionInput) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) AnimContext(eidolons.libgdx.anims.AnimContext)

Aggregations

DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 ActionInput (eidolons.game.core.ActionInput)1 AnimContext (eidolons.libgdx.anims.AnimContext)1 Obj (main.entity.obj.Obj)1