Search in sources :

Example 1 with ITEM_MATERIAL_GROUP

use of main.content.enums.entity.ItemEnums.ITEM_MATERIAL_GROUP 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

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