use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class EffectAnimCreator method getEffectAnimDelay.
public static float getEffectAnimDelay(Effect e, Animation anim, ANIM_PART part) {
Anim subAnim;
if (anim instanceof CompositeAnim) {
subAnim = ((CompositeAnim) anim).getMap().get(part);
} else {
subAnim = (Anim) anim;
}
Coordinates destination = null;
if (anim instanceof Anim) {
destination = ((Anim) anim).getDestinationCoordinates();
}
Float distance = GridMaster.getDistance(destination, // TODO from parent anim's origin!
e.getActiveObj().getOwnerObj().getCoordinates());
float delay = distance / subAnim.getPixelsPerSecond();
return delay;
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class PathingManager method checkCoordinatesForObj.
public void checkCoordinatesForObj(List<Obj> list, Coordinates c, int i, int j, boolean cell) {
Coordinates c1 = new Coordinates(c.x + i, c.y + j);
Obj obj = null;
try {
obj = (cell) ? getCell(c1) : getObj(c1);
} catch (Exception e) {
}
if (obj != null) {
list.add(obj);
}
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class PathingManager method initNodeGrid.
private void initNodeGrid() {
nodeGrid = new PathNode[GuiManager.getBF_CompDisplayedCellsX()][GuiManager.getBF_CompDisplayedCellsY()];
for (Coordinates c : grid.getCoordinatesList()) {
PathNode node = new PathNode(c);
nodeGrid[c.x][c.y] = node;
getNodeList().add(node);
}
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class SpecialRequirements method check.
@Override
public boolean check(Ref ref) {
Coordinates c;
DC_UnitModel unit;
switch(template) {
case FREE_CELL:
break;
case FREE_CELL_RANGE:
break;
case HAS_ITEM:
break;
case ITEM:
break;
case NOT_FREE_CELL:
break;
case NOT_ITEM:
break;
default:
break;
}
return false;
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class InstantAttackRule method getInstantAttackType.
private static INSTANT_ATTACK_TYPE getInstantAttackType(Unit unit, DC_ActiveObj action) {
Coordinates c = DC_MovementManager.getMovementDestinationCoordinate(action);
Coordinates c1 = action.getOwnerObj().getCoordinates();
if (c.equals(c1)) {
return INSTANT_ATTACK_TYPE.ENGAGEMENT;
}
FACING_SINGLE singleFacing = FacingMaster.getSingleFacing(unit.getFacing(), c, c1);
if (singleFacing == UnitEnums.FACING_SINGLE.BEHIND) {
return INSTANT_ATTACK_TYPE.PASSAGE;
}
if (singleFacing == UnitEnums.FACING_SINGLE.IN_FRONT) {
singleFacing = FacingMaster.getSingleFacing(action.getOwnerObj().getFacing(), c1, c);
if (singleFacing == UnitEnums.FACING_SINGLE.BEHIND) {
// 'turned your back on the
return INSTANT_ATTACK_TYPE.FLIGHT;
}
// controlled retreat
return INSTANT_ATTACK_TYPE.DISENGAGEMENT;
// backwards, facing
// forward
}
return INSTANT_ATTACK_TYPE.STUMBLE;
}
Aggregations