Ejemplo n.º 1
0
 /** 获得物品类型 */
 public static GoodsType getGoodsType(RoleGoods roleGoods) {
   GoodsBase goodsBase = getGoodsBase(roleGoods);
   if (goodsBase == null) {
     return GoodsType.GoodsDefault;
   }
   return GoodsType.get(goodsBase.getGoodsType());
 }
Ejemplo n.º 2
0
 /**
  * 获得道具全部属性,包含模板属性
  *
  * @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;
 }