Search in sources :

Example 31 with FACING_DIRECTION

use of main.game.bf.Coordinates.FACING_DIRECTION in project Eidolons by IDemiurge.

the class AttackAnim method getRotateAction.

protected RotateByAction getRotateAction(float angle, float duration) {
    RotateByAction mainRotate = new RotateByAction();
    // angle += targetAngleOffset;
    FACING_DIRECTION facing = getFacing();
    // add default offset
    boolean offhand = getActive().isOffhand();
    Boolean left = PositionMaster.isToTheLeftOr(getOriginCoordinates(), getDestinationCoordinates());
    Boolean above = PositionMaster.isAboveOr(getOriginCoordinates(), getDestinationCoordinates());
    Boolean add = null;
    if (facing.isVertical()) {
        add = above;
    } else {
        add = left;
    }
    FACING_SINGLE relativeFacing = FacingMaster.getSingleFacing(facing, getOriginCoordinates(), getDestinationCoordinates());
    // increase angle?
    int addAngle = 0;
    switch(relativeFacing) {
        case IN_FRONT:
            break;
        case BEHIND:
            break;
        case TO_THE_SIDE:
            if (getActive().isOffhand()) {
                if (left) {
                    break;
                }
            }
        case NONE:
            // TODO on the same cell?
            break;
    }
    angle += addAngle;
    // pixel collision for impact!
    mainRotate.setDuration(duration);
    mainRotate.setAmount(angle);
    return mainRotate;
}
Also used : FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) RotateByAction(com.badlogic.gdx.scenes.scene2d.actions.RotateByAction) FACING_SINGLE(main.content.enums.entity.UnitEnums.FACING_SINGLE)

Aggregations

FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)31 Coordinates (main.game.bf.Coordinates)17 Unit (eidolons.entity.obj.unit.Unit)5 ArrayList (java.util.ArrayList)5 Ref (main.entity.Ref)5 ObjType (main.entity.type.ObjType)5 Obj (main.entity.obj.Obj)4 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)3 DC_UnitModel (eidolons.entity.obj.unit.DC_UnitModel)3 ObjAtCoordinate (main.entity.type.ObjAtCoordinate)3 TemplateSelectiveTargeting (eidolons.ability.targeting.TemplateSelectiveTargeting)2 UnitLevelManager (eidolons.client.cc.logic.UnitLevelManager)2 DC_UnitAction (eidolons.entity.active.DC_UnitAction)2 MapBlock (eidolons.game.battlecraft.logic.dungeon.location.building.MapBlock)2 FACING_SINGLE (main.content.enums.entity.UnitEnums.FACING_SINGLE)2 Conditions (main.elements.conditions.Conditions)2 AutoTargeting (main.elements.targeting.AutoTargeting)2 MultiTargeting (main.elements.targeting.MultiTargeting)2 SelectiveTargeting (main.elements.targeting.SelectiveTargeting)2 Targeting (main.elements.targeting.Targeting)2