ソースを参照

根据装备库随机新的装备返回客户端的类的封装

toby 1 年間 前
コミット
437050b08a

+ 4 - 25
one-client/src/main/java/com/iohao/mmo/client/input/EquipInputCommandRegion.java

@@ -79,31 +79,10 @@ public class EquipInputCommandRegion extends AbstractInputCommandRegion {
             log.info("装备信息 : {}", value);
         }).setDescription("查询装备信息").setInputRequestData(inputRequestData);
 
-        // 10-3 分配装备属性信息
-        inputRequestData = () -> {
-            ScannerKit.log(() -> log.info("请输入装备id"));
-            String id = ScannerKit.nextLine();
-            ScannerKit.log(() -> log.info("请输入体质、魔力、力量、耐力、敏捷,格式[体质-魔力-力量-耐力-敏捷]"));
-            String inputValue = ScannerKit.nextLine("1-1-1-1-1");
-            SplitParam param = new SplitParam(inputValue);
-            int constitution = param.getInt(0, 0);
-            int magicPower = param.getInt(1, 0);
-            int power = param.getInt(2, 0);
-            int endurance = param.getInt(3, 0);
-            int agile = param.getInt(4, 0);
-
-            ElseEquipPropertyMessage elseEquipPropertyMessage =
-                    new ElseEquipPropertyMessage(constitution, magicPower, power, endurance, agile);
-            EquipMessage equipMessage = new EquipMessage();
-            equipMessage.elseEquipProperty = elseEquipPropertyMessage;
-            equipMessage.id = id;
-            return equipMessage;
-        };
-
-        ofCommand(EquipCmd.allotEquip).callback(EquipMessage.class, result -> {
-            EquipMessage value = result.getValue();
-            log.info("装备属性信息 : {}", value);
-        }).setDescription("分配装备属性信息").setInputRequestData(inputRequestData);
+//        ofCommand(EquipCmd.allotEquip).callback(EquipMessage.class, result -> {
+//            EquipMessage value = result.getValue();
+//            log.info("装备属性信息 : {}", value);
+//        }).setDescription("分配装备属性信息").setInputRequestData(inputRequestData);
 
         // 10-4 重新随机总属性点(鉴定装备)
         inputRequestData = () -> {

+ 10 - 23
provide/equip-provide/src/main/java/com/iohao/mmo/equip/proto/FixedEquipPropertyMessage.java → provide/equip-provide/src/main/java/com/iohao/mmo/equip/proto/EquipEntryMessage.java

@@ -22,6 +22,7 @@ import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
 import lombok.AccessLevel;
 import lombok.ToString;
 import lombok.experimental.FieldDefaults;
+import java.util.List;
 
 /**
  * 装备固定属性
@@ -33,27 +34,13 @@ import lombok.experimental.FieldDefaults;
 @ToString
 @ProtobufClass
 @FieldDefaults(level = AccessLevel.PUBLIC)
-public class FixedEquipPropertyMessage {
-    /** 生命值 */
-    int hp;
-    /** 魔法值 */
-    int mp;
-    /** 物理攻击 */
-    int physicsAttack;
-    /** 物理防御 */
-    int physicsDefense;
-    /** 魔法攻击 */
-    int magicAttack;
-    /** 魔法防御 */
-    int magicDefense;
-    /** 治疗强度 */
-    int treatAttack;
-    /** 封印强度 */
-    int sealAttack;
-    /** 封印防御(抵抗封印) */
-    int sealDefense;
-    /** 速度 */
-    int speed;
-    /** 怒气 */
-    int anger;
+public class EquipEntryMessage {
+    /** 名称 */
+    String name;
+    /** 编号 */
+    String code;
+    /** 描述 */
+    String description;
+    /** 装备属性 */
+    List<EquipEntryPropertyMessage> entryPropertyList;
 }

+ 54 - 0
provide/equip-provide/src/main/java/com/iohao/mmo/equip/proto/EquipEntryPropertyMessage.java

@@ -0,0 +1,54 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.equip.proto;
+
+import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
+import lombok.AccessLevel;
+import lombok.ToString;
+import lombok.experimental.FieldDefaults;
+import java.math.BigDecimal;
+
+/**
+ * 装备固定属性
+ *
+ * @author 唐斌
+ * @date 2023-07-30
+ * @description:
+ */
+@ToString
+@ProtobufClass
+@FieldDefaults(level = AccessLevel.PUBLIC)
+public class EquipEntryPropertyMessage {
+    /** 等级最小值 */
+    int levelMin;
+    /** 等级最大值 */
+    int levelMax;
+    /** 属性计算方式(1装备加,2装备增加百分比,3全身增加百分比) */
+    int countType;
+    /** 显示方式(1原值显示,2小数转百分比) */
+    int showType;
+    /** 影响属性 */
+    String effectPropertyName;
+    /** 属性范围最小值 */
+    BigDecimal propertyValueMin;
+    /** 属性范围最大值 */
+    BigDecimal propertyValueMax;
+    /** 随机属性结果值 */
+    BigDecimal propertyValue;
+}

+ 16 - 24
provide/equip-provide/src/main/java/com/iohao/mmo/equip/proto/EquipMessage.java

@@ -23,6 +23,8 @@ import lombok.AccessLevel;
 import lombok.ToString;
 import lombok.experimental.FieldDefaults;
 
+import java.util.List;
+
 /**
  * @author 唐斌
  * @date 2023-07-30
@@ -34,36 +36,26 @@ import lombok.experimental.FieldDefaults;
 public class EquipMessage{
     /** 装备id */
     String id;
-    /** itemTypeId */
-    String itemTypeId;
     /** 玩家 */
     long userId;
-    /** 装备名 */
-    String name;
-    /** 总属性点 */
-    int attrTotal;
-    /** 未分配属性点 */
-    int undistributedAttr;
     /** 部位(wuqi武器,maozi帽子,yifu衣服,kuzi裤子,xiezi鞋子,huwan护腕,xianglain项链,shouzhuo手镯,jiezhi戒指,yaopei腰佩) */
     String position;
     /** 要求等级 */
     int level;
-    /** 鉴定次数 */
-    int identifyCount;
-    /** 装备固定属性最小值 */
-    FixedEquipPropertyMessage fixedEquipPropertyMin;
-    /** 装备固定属性最大值 */
-    FixedEquipPropertyMessage fixedEquipPropertyMax;
-    /** 装备固定属性 */
-    FixedEquipPropertyMessage fixedEquipProperty;
     /** 品质 1白色,2黄色,3绿色,4蓝色,5紫色,6鬼装*/
     String quality;
-    /** 自定义属性随机范围最小值 */
-    int totalAttrMin;
-    /** 自定义属性随机范围最大值 */
-    int totalAttrMax;
-    /** 装备库id */
-    String equipTemplateId;
-    /** 额外属性 */
-    ElseEquipPropertyMessage elseEquipProperty;
+    /** 耐久度 */
+    int durability;
+    /** 当前耐久度 */
+    int nowDurability;
+    /** 基础属性鉴定次数 */
+    int identifyBasicCount;
+    /** 词条属性鉴定次数 */
+    int identifyEntryCount;
+    /** 装备基础属性 */
+    EquipPropertyBasicMessage equipPropertyBasic;
+    /** 装备固定属性 */
+    List<EquipEntryMessage> equipPropertyFixedList;
+    /** 装备随机属性 */
+    List<EquipEntryMessage> equipPropertyRandomList;
 }

+ 72 - 0
provide/equip-provide/src/main/java/com/iohao/mmo/equip/proto/EquipPropertyBasicMessage.java

@@ -0,0 +1,72 @@
+/*
+ * ioGame
+ * Copyright (C) 2021 - 2023  渔民小镇 (262610965@qq.com、luoyizhu@gmail.com) . All Rights Reserved.
+ * # iohao.com . 渔民小镇
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ */
+package com.iohao.mmo.equip.proto;
+
+import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
+import lombok.AccessLevel;
+import lombok.ToString;
+import lombok.experimental.FieldDefaults;
+
+/**
+ * 装备固定属性
+ *
+ * @author 唐斌
+ * @date 2023-07-30
+ * @description:
+ */
+@ToString
+@ProtobufClass
+@FieldDefaults(level = AccessLevel.PUBLIC)
+public class EquipPropertyBasicMessage {
+    /** 物理攻击最小值 */
+    Integer physicsAttackMin;
+    /** 物理攻击最大值 */
+    Integer physicsAttackMax;
+    /** 法术攻击最小值 */
+    Integer magicAttackMin;
+    /** 法术攻击最大值 */
+    Integer magicAttackMax;
+    /** 物理攻击速度 */
+    Double physicsAttackSpeed;
+    /** 法术攻击速度 */
+    Double magicAttackSpeed;
+
+    /** 物理防御 */
+    Integer physicsDefense;
+    /** 法术防御 */
+    Integer magicDefense;
+
+    /** 物理命中 */
+    Integer physicsHit;
+    /** 法术命中 */
+    Integer magicHit;
+
+    /** 物理躲避 */
+    Integer physicsDodge;
+    /** 法术躲避 */
+    Integer magicDodge;
+
+    /** 生命值 */
+    Integer hp;
+    /** 能量值 */
+    Integer mp;
+
+    /** 基础属性增加百分比 */
+    Integer basicAllPct;
+}

+ 29 - 8
provide/equip-provide/src/main/java/com/iohao/mmo/equip/proto/EquipTemplateMessage.java

@@ -23,6 +23,8 @@ import lombok.AccessLevel;
 import lombok.ToString;
 import lombok.experimental.FieldDefaults;
 
+import java.util.List;
+
 /**
  * @author 唐斌
  * @date 2023-07-30
@@ -36,16 +38,35 @@ public class EquipTemplateMessage{
      * id
      */
     String id;
+    /** itemTypeId */
+    String itemTypeId;
     /** 部位(wuqi武器,maozi帽子,yifu衣服,kuzi裤子,xiezi鞋子,huwan护腕,xianglain项链,shouzhuo手镯,jiezhi戒指,yaopei腰佩) */
     String position;
     /** 要求等级 */
     int level;
-    /** 装备固定属性最小值 */
-    FixedEquipPropertyMessage fixedEquipPropertyMin;
-    /** 装备固定属性最大值 */
-    FixedEquipPropertyMessage fixedEquipPropertyMax;
-    /** 自定义属性随机范围最小值 */
-    int totalAttrMin;
-    /** 自定义属性随机范围最大值 */
-    int totalAttrMax;
+    /** 品质 white白色,yellow黄色,green绿色,blue蓝色,red红色,purple紫色,ghost鬼装*/
+    String quality;
+    /** 耐久度 */
+    int durability;
+    /** 出现权重 */
+    int prizeWeight;
+    /** 初始数量 */
+    Integer initCount;
+    /** 剩余数量 */
+    Integer residualCount;
+
+    /** 装备基础属性最小值 */
+    EquipPropertyBasicMessage equipPropertyBasicMin;
+    /** 装备基础属性最大值 */
+    EquipPropertyBasicMessage equipPropertyBasicMax;
+    /** 固定属性最小条数 */
+    int equipPropertyFixedMin;
+    /** 固定属性最大条数 */
+    int equipPropertyFixedMax;
+    /** 装备固定属性 */
+    List<EquipEntryMessage> equipPropertyFixedList;
+    /** 随机属性最小条数 */
+    int equipPropertyRandomMin;
+    /** 随机属性最大条数 */
+    int equipPropertyRandomMax;
 }