/** * 获得道具全部属性,包含模板属性 * * @return */ public static AttriBuffer getAttriBuffer(RoleGoods roleGoods) { AttriBuffer buffer = AttriBuffer.createAttriBuffer(); // 模板属性 int goodsId = roleGoods.getGoodsId(); GoodsBase goodsBase = GameContext.getGoodsApp().getGoodsBase(goodsId); if (goodsBase == null) { return buffer; } buffer.append(goodsBase.getAttriItemList()); if (GoodsType.GoodsRune.getType() == goodsBase.getGoodsType()) { buffer.append(buildRandomAttri(roleGoods)); return buffer; } if (!goodsBase.isEquipment()) { // 非装备 return buffer; } buffer.append( GameContext.getEquipApp() .getBaseAttriBuffer(goodsId, roleGoods.getQuality(), roleGoods.getStar())); // 获得强化属性 buffer.append( GameContext.getEquipApp() .getStrengthenAttriBuffer( goodsId, roleGoods.getQuality(), roleGoods.getStar(), roleGoods.getStrengthenLevel())); buffer.append(buildRandomAttri(roleGoods)); // 获得镶嵌宝石属性 buffer.append(getMosaicArrti(roleGoods)); return buffer; }
/** * 统计洗练属性品质>=quality的个数 * * @param roleGoods * @param quality * @return */ public static int countRecastingAttribute(RoleGoods roleGoods, int quality) { int total = 0; for (AttriItem ai : roleGoods.getAttrVarList()) { if (null == ai) { continue; } byte attriType = ai.getAttriTypeValue(); EquipRecatingAttrWeightConfig awc = GameContext.getGoodsApp() .getEquipRecatingAttrWeightConfig( attriType, roleGoods.getQuality(), roleGoods.getStar()); if (null == awc) { continue; } int value = (int) ai.getValue(); RecatingBoundBean bean = awc.getRecatingBoundBean(value); if (null == bean) { continue; } if (bean.getQualityType() < quality) { continue; } total++; } return total; }