Search in sources :

Example 26 with Coordinates

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;
}
Also used : Coordinates(main.game.bf.Coordinates)

Example 27 with Coordinates

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);
    }
}
Also used : Obj(main.entity.obj.Obj) Coordinates(main.game.bf.Coordinates)

Example 28 with Coordinates

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);
    }
}
Also used : Coordinates(main.game.bf.Coordinates)

Example 29 with Coordinates

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;
}
Also used : DC_UnitModel(eidolons.entity.obj.unit.DC_UnitModel) Coordinates(main.game.bf.Coordinates)

Example 30 with Coordinates

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;
}
Also used : Coordinates(main.game.bf.Coordinates) FACING_SINGLE(main.content.enums.entity.UnitEnums.FACING_SINGLE)

Aggregations

Coordinates (main.game.bf.Coordinates)226 Unit (eidolons.entity.obj.unit.Unit)49 ObjType (main.entity.type.ObjType)30 ArrayList (java.util.ArrayList)29 Obj (main.entity.obj.Obj)28 DC_Obj (eidolons.entity.obj.DC_Obj)22 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)21 FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)21 DIRECTION (main.game.bf.Coordinates.DIRECTION)20 Ref (main.entity.Ref)15 MapBlock (eidolons.game.battlecraft.logic.dungeon.location.building.MapBlock)13 DC_Cell (eidolons.entity.obj.DC_Cell)12 Action (eidolons.game.battlecraft.ai.elements.actions.Action)11 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)9 BufferedImage (java.awt.image.BufferedImage)8 DequeImpl (main.system.datatypes.DequeImpl)8 Vector2 (com.badlogic.gdx.math.Vector2)7 DC_UnitAction (eidolons.entity.active.DC_UnitAction)7 ZCoordinates (main.game.bf.ZCoordinates)6 ObjAtCoordinate (main.entity.type.ObjAtCoordinate)5