Search in sources :

Example 6 with UNIT_VISION

use of main.content.enums.rules.VisionEnums.UNIT_VISION 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

UNIT_VISION (main.content.enums.rules.VisionEnums.UNIT_VISION)6 DC_Cell (eidolons.entity.obj.DC_Cell)2 DC_Obj (eidolons.entity.obj.DC_Obj)2 PLAYER_VISION (main.content.enums.rules.VisionEnums.PLAYER_VISION)2 Structure (eidolons.entity.obj.Structure)1 Unit (eidolons.entity.obj.unit.Unit)1 DC_Game (eidolons.game.core.game.DC_Game)1 VISIBILITY_LEVEL (main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL)1 BfObj (main.entity.obj.BfObj)1 Obj (main.entity.obj.Obj)1 Coordinates (main.game.bf.Coordinates)1