public static int getEquipScore(RoleGoods roleGoods) { GoodsBase goodsBase = GameContext.getGoodsApp().getGoodsBase(roleGoods.getGoodsId()); if (null == goodsBase || !goodsBase.isEquipment()) { return 0; } AttriBuffer buffer = getAttriBuffer(roleGoods); if (null == buffer || buffer.isEmpty()) { return 0; } return GameContext.getAttriApp().getAttriBattleScore(buffer); }
/** * 获得道具全部属性,包含模板属性 * * @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; }
public static int get(AttributeType attriType, AttriBuffer buffer) { AttriItem item = buffer.getAttriItem(attriType); if (null == item) { return 0; } return (int) item.getValue(); }