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();
}
Aggregations