Search in sources :

Example 11 with FACING_SINGLE

use of main.content.enums.entity.UnitEnums.FACING_SINGLE 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_SINGLE (main.content.enums.entity.UnitEnums.FACING_SINGLE)11 ArrayList (java.util.ArrayList)3 Coordinates (main.game.bf.Coordinates)3 FacingCondition (eidolons.ability.conditions.FacingCondition)2 CellCondition (eidolons.ability.conditions.req.CellCondition)2 DC_UnitAction (eidolons.entity.active.DC_UnitAction)2 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)2 DC_Obj (eidolons.entity.obj.DC_Obj)2 Action (eidolons.game.battlecraft.ai.elements.actions.Action)2 DIRECTION (main.game.bf.Coordinates.DIRECTION)2 FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)2 RotateByAction (com.badlogic.gdx.scenes.scene2d.actions.RotateByAction)1 StatusCheckCondition (eidolons.ability.conditions.StatusCheckCondition)1 VisibilityCondition (eidolons.ability.conditions.VisibilityCondition)1 StdPassiveCondition (eidolons.ability.conditions.shortcut.StdPassiveCondition)1 DC_HeroSlotItem (eidolons.entity.item.DC_HeroSlotItem)1 DC_UnitModel (eidolons.entity.obj.unit.DC_UnitModel)1 Unit (eidolons.entity.obj.unit.Unit)1 TreeMap (java.util.TreeMap)1 Condition (main.elements.conditions.Condition)1