Search in sources :

Example 1 with VISIBILITY_LEVEL

use of main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL in project Eidolons by IDemiurge.

the class DefaultActionHandler method doDebugStuff.

private static boolean doDebugStuff(Unit source, BattleFieldObject target) {
    target.getGame().getVisionMaster().getVisionController().log(source, target);
    target.getGame().getVisionMaster().getVisionController().logFor(target);
    OUTLINE_TYPE outlineType = source.getGame().getVisionMaster().getOutlineMaster().getOutlineType(target, source);
    VISIBILITY_LEVEL vl = source.getGame().getVisionMaster().getVisibilityLevel(source, target);
    target.getPlayerVisionStatus(true);
    target.getGamma();
    source.getGame().getVisionMaster().getIlluminationMaster().getIllumination(target);
    target.getGame().getVisionMaster().getGammaMaster().clearCache();
    target.getGame().getVisionMaster().getIlluminationMaster().clearCache();
    int g = target.getGame().getVisionMaster().getGammaMaster().getGamma(source, target);
    outlineType = source.getGame().getVisionMaster().getOutlineMaster().getOutlineType(target, source);
    vl = source.getGame().getVisionMaster().getVisibilityLevel(source, target);
    ClearShotCondition.clearCache();
    Ref ref = new Ref(source);
    ref.setMatch(target.getId());
    source.getGame().getVisionMaster().getSightMaster().getClearShotCondition().preCheck(ref);
    return false;
}
Also used : OUTLINE_TYPE(main.content.enums.rules.VisionEnums.OUTLINE_TYPE) VISIBILITY_LEVEL(main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL) Ref(main.entity.Ref)

Example 2 with VISIBILITY_LEVEL

use of main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL in project Eidolons by IDemiurge.

the class DrawMaster method drawCellImage.

private void drawCellImage(Graphics g) {
    Image img = cellComp.getGame().getVisionMaster().getVisibilityMaster().getDisplayImageForUnit(cellComp.getTerrainObj());
    if (img == null) {
        if (cellComp.getTerrainObj().isTargetHighlighted()) {
            img = ImageManager.getHighlightedCellIcon().getImage();
        } else {
            VISIBILITY_LEVEL vl = cellComp.getTerrainObj().getVisibilityLevel(false);
            PLAYER_VISION ds = cellComp.getTerrainObj().getPlayerVisionStatus(false);
            // + cellComp.getTerrainObj().getNameAndCoordinate());
            if (cellComp.getGame().getVisionMaster().getVisibilityMaster().isZeroVisibility(cellComp.getTerrainObj())) {
                if (ds == PLAYER_VISION.KNOWN || ds == PLAYER_VISION.DETECTED) {
                    img = (ImageManager.getHiddenCellIcon().getImage());
                } else {
                    img = ImageManager.getUnknownCellIcon().getImage();
                }
            } else if (vl == VISIBILITY_LEVEL.CLEAR_SIGHT) // TODO darken image based on CvsIl
            // if (cellComp.getTerrainObj().getUnitVisionStatus() ==
            // UNIT_TO_UNIT_VISION.BEYOND_SIGHT) {
            // if (ds == UNIT_TO_PLAYER_VISION.DETECTED) {
            // img = (ImageManager.getHiddenCellIcon().getEmitterPath());
            // } else
            // img = ImageManager.getUnknownCellIcon().getEmitterPath();
            // } else
            {
                img = ImageManager.getEmptyCellIcon().getImage();
            } else {
                img = ImageManager.getHiddenCellIcon().getImage();
            }
            if (zoom != 100 || !isFramePaintZoom()) {
                img = ImageManager.getSizedVersion(img, new Dimension(getObjCompWidth(), getObjCompHeight()), true);
            }
            if (vl == VISIBILITY_LEVEL.VAGUE_OUTLINE) {
            // g.drawImage(img, 0, 0, null);
            }
        }
    }
    g.drawImage(img, 0, 0, null);
}
Also used : PLAYER_VISION(main.content.enums.rules.VisionEnums.PLAYER_VISION) VISIBILITY_LEVEL(main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL) BufferedImage(java.awt.image.BufferedImage)

Example 3 with VISIBILITY_LEVEL

use of main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL in project Eidolons by IDemiurge.

the class MiniObjComp method applyVisibility.

private void applyVisibility() {
    // TODO inter-dependence of the four...?
    PLAYER_VISION detection = obj.getActivePlayerVisionStatus();
    UNIT_VISION vision = obj.getUnitVisionStatus();
    VISIBILITY_LEVEL visibility = obj.getVisibilityLevel();
    // PERCEPTION_STATUS perception = obj.getPerceptionStatus();
    // ++ TARGETING HL
    // draw image / info icons
    boolean hidden = false;
    if (detection == PLAYER_VISION.UNKNOWN) {
        image = (ImageManager.getHiddenCellIcon()).getImage();
        obj.setImage("UI//cells//Hidden Cell v" + 1 + ".png");
        return;
    }
    // ImageManager.getOutlineImage(obj);
    // ImageTransformer.getTransparent(image, trasparency);
    // // ImageManager.STD_IMAGES.DEEPER_DARKNESS
    // PerceptionRule.getHints(obj, perception, visibility);
    // TO BE USED WHEN UNIT ACTS -
    // "something huge/monstrous/humanoid/mechanical/ghostly/demonic..." etc
    // if (vision == UNIT_TO_UNIT_VISION.IN_SIGHT) -> negate other effects?
    // which status has priority? -> VISIBILITY!
    /*
         * perception:
		 *
		 *
		 *
		 */
    boolean terrain = (obj instanceof DC_Cell);
    if (vision != UNIT_VISION.IN_PLAIN_SIGHT) {
        if (detection == PLAYER_VISION.DETECTED) {
            image = !terrain ? ImageManager.applyBorder(image, ImageManager.BORDER_BEYOND_SIGHT) : (ImageManager.getHiddenCellIcon()).getImage();
        } else {
            image = !terrain ? ImageManager.applyBorder(image, ImageManager.BORDER_UNKNOWN) : (ImageManager.getUnknownCellIcon()).getImage();
        }
    } else {
    // if (visibility == VISIBILITY_LEVEL.DEEPER_DARKNESS) {
    // 
    // }
    }
}
Also used : PLAYER_VISION(main.content.enums.rules.VisionEnums.PLAYER_VISION) UNIT_VISION(main.content.enums.rules.VisionEnums.UNIT_VISION) VISIBILITY_LEVEL(main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL) DC_Cell(eidolons.entity.obj.DC_Cell)

Aggregations

VISIBILITY_LEVEL (main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL)3 PLAYER_VISION (main.content.enums.rules.VisionEnums.PLAYER_VISION)2 DC_Cell (eidolons.entity.obj.DC_Cell)1 BufferedImage (java.awt.image.BufferedImage)1 OUTLINE_TYPE (main.content.enums.rules.VisionEnums.OUTLINE_TYPE)1 UNIT_VISION (main.content.enums.rules.VisionEnums.UNIT_VISION)1 Ref (main.entity.Ref)1