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