Search in sources :

Example 1 with SPELL_ANIMS

use of eidolons.libgdx.anims.std.SpellAnim.SPELL_ANIMS in project Eidolons by IDemiurge.

the class AnimMultiplicator method filterCoordinates.

private Collection<Coordinates> filterCoordinates(SPELL_ANIMS template, Set<Coordinates> coordinates) {
    if (template != null) {
        FACING_DIRECTION facing = getActive().getOwnerObj().getFacing();
        List<Coordinates> filtered = new ArrayList<>(coordinates);
        Coordinates farthest = CoordinatesMaster.getFarmostCoordinateInDirection(facing.getDirection(), new ArrayList<>(coordinates), null);
        switch(template) {
            // template.getNumberOfEmitters(getActive())
            case RAY:
                anim.setForcedDestinationForAll(farthest);
                return Arrays.asList(farthest);
            case BLAST:
                break;
            case WAVE:
            case SPRAY:
                {
                    boolean xOrY = !facing.isVertical();
                    filtered.removeIf(c -> farthest.getXorY(xOrY) != c.getXorY(xOrY));
                    while (filtered.size() < template.getNumberOfEmitters(getActive())) {
                        List<Coordinates> list = new ArrayList<>(coordinates);
                        list.removeAll(filtered);
                        list.removeIf(c -> farthest.getXorY(!xOrY) == c.getXorY(!xOrY));
                        Coordinates c = CoordinatesMaster.getFarmostCoordinateInDirection(facing.getDirection(), list, null);
                        if (c != null)
                            filtered.add(c);
                    }
                    if (ListMaster.isNotEmpty(filtered))
                        return filtered;
                    else
                        return coordinates;
                }
            case RING:
                break;
            case NOVA:
                break;
        }
    }
    return coordinates;
}
Also used : LogMaster(main.system.auxiliary.log.LogMaster) java.util(java.util) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) ListMaster(main.system.auxiliary.data.ListMaster) SpellAnim(eidolons.libgdx.anims.std.SpellAnim) SPELL_ANIMS(eidolons.libgdx.anims.std.SpellAnim.SPELL_ANIMS) FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) Action(com.badlogic.gdx.scenes.scene2d.Action) MoveByAction(com.badlogic.gdx.scenes.scene2d.actions.MoveByAction) EmitterPools(eidolons.libgdx.anims.particles.EmitterPools) GridMaster(eidolons.libgdx.bf.GridMaster) G_PARAMS(main.content.values.parameters.G_PARAMS) GridMaster.getCenteredPos(eidolons.libgdx.bf.GridMaster.getCenteredPos) SequenceAction(com.badlogic.gdx.scenes.scene2d.actions.SequenceAction) EmitterActor(eidolons.libgdx.anims.particles.EmitterActor) Entity(main.entity.Entity) Ref(main.entity.Ref) Vector2(com.badlogic.gdx.math.Vector2) Coordinates(main.game.bf.Coordinates) CoordinatesMaster(eidolons.game.battlecraft.logic.battlefield.CoordinatesMaster) ZONE_ANIM_MODS(eidolons.libgdx.anims.std.SpellAnim.ZONE_ANIM_MODS) GeometryMaster(main.system.auxiliary.secondary.GeometryMaster) FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) Coordinates(main.game.bf.Coordinates)

Aggregations

Vector2 (com.badlogic.gdx.math.Vector2)1 Action (com.badlogic.gdx.scenes.scene2d.Action)1 MoveByAction (com.badlogic.gdx.scenes.scene2d.actions.MoveByAction)1 SequenceAction (com.badlogic.gdx.scenes.scene2d.actions.SequenceAction)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 CoordinatesMaster (eidolons.game.battlecraft.logic.battlefield.CoordinatesMaster)1 EmitterActor (eidolons.libgdx.anims.particles.EmitterActor)1 EmitterPools (eidolons.libgdx.anims.particles.EmitterPools)1 SpellAnim (eidolons.libgdx.anims.std.SpellAnim)1 SPELL_ANIMS (eidolons.libgdx.anims.std.SpellAnim.SPELL_ANIMS)1 ZONE_ANIM_MODS (eidolons.libgdx.anims.std.SpellAnim.ZONE_ANIM_MODS)1 GridMaster (eidolons.libgdx.bf.GridMaster)1 GridMaster.getCenteredPos (eidolons.libgdx.bf.GridMaster.getCenteredPos)1 java.util (java.util)1 G_PARAMS (main.content.values.parameters.G_PARAMS)1 Entity (main.entity.Entity)1 Ref (main.entity.Ref)1 Coordinates (main.game.bf.Coordinates)1 FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)1 ListMaster (main.system.auxiliary.data.ListMaster)1