Search in sources :

Example 1 with OBJECT_ARMOR_TYPE

use of main.content.CONTENT_CONSTS.OBJECT_ARMOR_TYPE in project Eidolons by IDemiurge.

the class BfObjPropGenerator method generateBfObjStatProps.

public static void generateBfObjStatProps(ObjType t) {
    // TODO theme from group!
    BF_OBJECT_SIZE size = new EnumMaster<BF_OBJECT_SIZE>().retrieveEnumConst(BF_OBJECT_SIZE.class, t.getProperty(PROPS.BF_OBJECT_SIZE));
    BF_OBJ_MATERIAL material = new EnumMaster<BF_OBJ_MATERIAL>().retrieveEnumConst(BF_OBJ_MATERIAL.class, t.getProperty(PROPS.BF_OBJ_MATERIAL));
    OBJECT_ARMOR_TYPE armorType = new EnumMaster<OBJECT_ARMOR_TYPE>().retrieveEnumConst(OBJECT_ARMOR_TYPE.class, t.getProperty(PROPS.OBJECT_ARMOR_TYPE));
    DIMENSION dimension = new EnumMaster<DIMENSION>().retrieveEnumConst(DIMENSION.class, t.getProperty(PROPS.DIMENSION));
    List<BF_OBJ_QUALITY> qualities = new EnumMaster<BF_OBJ_QUALITY>().getEnumList(BF_OBJ_QUALITY.class, t.getProperty(PROPS.BF_OBJ_QUALITY));
    BF_OBJECT_GROUP group = new EnumMaster<BF_OBJECT_GROUP>().retrieveEnumConst(BF_OBJECT_GROUP.class, t.getProperty(G_PROPS.BF_OBJECT_GROUP));
    if (group == null) {
        switch(group) {
            case COLUMNS:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.TOUGH_II);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.ARMORED);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.THICK);
                }
                // later from material/armor types
                if (dimension == null) {
                    dimension = DIMENSION.T1_10;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.STONE;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.MARBLE;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.LARGE;
                }
                // weight as girth*height*material*coef ?
                break;
            case CONSTRUCT:
                if (dimension == null) {
                    dimension = DIMENSION.W2_1;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.STONE;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.GRANITE;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.LARGE;
                }
                break;
            case TREASURE:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.RESISTANT);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.DURABLE);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.ARMORED);
                }
                if (dimension == null) {
                    dimension = DIMENSION.W3_1;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.WOOD;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.RED_OAK;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.SMALL;
                }
                break;
            case CONTAINER:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.RESISTANT);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.BRITTLE);
                }
                if (dimension == null) {
                    dimension = DIMENSION.W3_1;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.WOOD;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.RED_OAK;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.SMALL;
                }
                break;
            case CRYSTAL:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.RESISTANT);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.BRITTLE);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.ARMORED);
                }
                if (dimension == null) {
                    dimension = DIMENSION.T1_4;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.CRYSTAL;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.CRYSTAL;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.MEDIUM;
                }
                break;
            case DOOR:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.TOUGH);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.DURABLE);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.THICK);
                }
                if (dimension == null) {
                    dimension = DIMENSION.T1_4;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.WOOD;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.IRONWOOD;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.MEDIUM;
                }
                break;
            case DUNGEON:
                break;
            case ENTRANCE:
                break;
            case GATEWAY:
                break;
            case GRAVES:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.TOUGH);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.BRITTLE);
                }
                if (dimension == null) {
                    dimension = DIMENSION.T1_3;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.STONE;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.GRANITE;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.MEDIUM;
                }
                break;
            case HANGING:
                break;
            case INTERIOR:
                break;
            case LIGHT_EMITTER:
                break;
            case MAGICAL:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.BRITTLE_II);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.RESISTANT_II);
                }
                break;
            case REMAINS:
                break;
            case ROCKS:
                if (dimension == null) {
                    dimension = DIMENSION.W2_1;
                }
                if (armorType == null) {
                    armorType = OBJECT_ARMOR_TYPE.STONE;
                }
                if (material == null) {
                    material = BfObjEnums.BF_OBJ_MATERIAL.GRANITE;
                }
                if (size == null) {
                    size = BfObjEnums.BF_OBJECT_SIZE.MEDIUM;
                }
                break;
            case RUINS:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.CRUMBLING_II);
                }
                break;
            case STATUES:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.TOUGH);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.ARMORED);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.RESISTANT);
                }
                break;
            case TRAP:
                break;
            case TREES:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.TOUGH);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.DURABLE_II);
                }
                break;
            case VEGETATION:
                break;
            case WALL:
                if (qualities.isEmpty()) {
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.TOUGH_III);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.ARMORED_II);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.THICK_II);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.RESISTANT);
                    qualities.add(BfObjEnums.BF_OBJ_QUALITY.DURABLE_II);
                }
                break;
            case WATER:
                break;
            case WINDOWS:
                break;
            default:
                break;
        }
    }
    if (size != null) {
        t.setProperty(PROPS.BF_OBJECT_SIZE, StringMaster.getWellFormattedString(size.name()));
    }
    if (material != null) {
        t.setProperty(PROPS.BF_OBJ_MATERIAL, StringMaster.getWellFormattedString(material.name()));
    }
    if (dimension != null) {
        t.setProperty(PROPS.DIMENSION, StringMaster.getWellFormattedString(dimension.name()));
    }
    if (armorType != null) {
        t.setProperty(PROPS.OBJECT_ARMOR_TYPE, StringMaster.getWellFormattedString(armorType.name()));
    }
}
Also used : OBJECT_ARMOR_TYPE(main.content.CONTENT_CONSTS.OBJECT_ARMOR_TYPE) DIMENSION(main.content.CONTENT_CONSTS.DIMENSION)

Example 2 with OBJECT_ARMOR_TYPE

use of main.content.CONTENT_CONSTS.OBJECT_ARMOR_TYPE in project Eidolons by IDemiurge.

the class ContentGenerator method getGradeForUnitType.

private static RESIST_GRADE getGradeForUnitType(ObjType t, DAMAGE_TYPE dmg_type) {
    OBJECT_ARMOR_TYPE armor_type = getObjectArmorTypeForUnit(new Unit(t));
    ITEM_MATERIAL_GROUP group = armor_type.getGroup();
    if (group == null) {
        return GenericEnums.RESIST_GRADE.Normal;
    }
    return getDefaultResistMap(group).get(dmg_type);
}
Also used : Unit(eidolons.entity.obj.unit.Unit) OBJECT_ARMOR_TYPE(main.content.CONTENT_CONSTS.OBJECT_ARMOR_TYPE)

Example 3 with OBJECT_ARMOR_TYPE

use of main.content.CONTENT_CONSTS.OBJECT_ARMOR_TYPE in project Eidolons by IDemiurge.

the class HitAnim method getSpriteType.

private SPRITE_TYPE getSpriteType(BattleFieldObject targetObj) {
    Obj block = getActive().getRef().getObj(KEYS.BLOCK);
    if (block != null) {
        ITEM_MATERIAL_GROUP group = new EnumMaster<ITEM_MATERIAL_GROUP>().retrieveEnumConst(ITEM_MATERIAL_GROUP.class, block.getProperty(G_PROPS.ITEM_MATERIAL_GROUP));
        if (group == ITEM_MATERIAL_GROUP.METAL || group == ITEM_MATERIAL_GROUP.CRYSTAL)
            return SPRITE_TYPE.SPARKS;
        if (group == ITEM_MATERIAL_GROUP.STONE)
            return SPRITE_TYPE.STONE;
    }
    OBJECT_ARMOR_TYPE type = new EnumMaster<OBJECT_ARMOR_TYPE>().retrieveEnumConst(OBJECT_ARMOR_TYPE.class, targetObj.getProperty(PROPS.OBJECT_ARMOR_TYPE));
    if (type == OBJECT_ARMOR_TYPE.METAL) {
        return SPRITE_TYPE.SPARKS;
    }
    if (type == OBJECT_ARMOR_TYPE.STONE) {
        return SPRITE_TYPE.STONE;
    }
    if (type == OBJECT_ARMOR_TYPE.FLESH) {
        return SPRITE_TYPE.BLOOD;
    }
    if (type == OBJECT_ARMOR_TYPE.BONE) {
        return SPRITE_TYPE.BONE;
    }
    if (targetObj instanceof Structure) {
        if (targetObj.isWall())
            return SPRITE_TYPE.STONE;
        return SPRITE_TYPE.DUST;
    } else {
        if (targetObj instanceof Unit) {
            if (!((Unit) targetObj).getChecker().isLiving()) {
                return SPRITE_TYPE.DUST;
            }
        }
    }
    return SPRITE_TYPE.BLOOD;
}
Also used : DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) Structure(eidolons.entity.obj.Structure) Unit(eidolons.entity.obj.unit.Unit) ITEM_MATERIAL_GROUP(main.content.enums.entity.ItemEnums.ITEM_MATERIAL_GROUP) OBJECT_ARMOR_TYPE(main.content.CONTENT_CONSTS.OBJECT_ARMOR_TYPE)

Aggregations

OBJECT_ARMOR_TYPE (main.content.CONTENT_CONSTS.OBJECT_ARMOR_TYPE)3 Unit (eidolons.entity.obj.unit.Unit)2 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 Structure (eidolons.entity.obj.Structure)1 DIMENSION (main.content.CONTENT_CONSTS.DIMENSION)1 ITEM_MATERIAL_GROUP (main.content.enums.entity.ItemEnums.ITEM_MATERIAL_GROUP)1 Obj (main.entity.obj.Obj)1