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;
}
Aggregations