toby 1 жил өмнө
parent
commit
93c80c3407

+ 1 - 1
logic/a-logic-common/src/main/java/com/iohao/mmo/common/kit/RandomKit.java

@@ -41,7 +41,7 @@ public class RandomKit {
      * @param rangeMax 限定范围的上限
      * @return boolean
      */
-    public static BigDecimal randomFromArr(BigDecimal rangeMin,BigDecimal rangeMax) {
+    public static BigDecimal randomFromBigDecimal(BigDecimal rangeMin,BigDecimal rangeMax) {
         Random random = new Random();
         return rangeMin.add(
                         rangeMax.subtract(rangeMin)

+ 0 - 4
logic/equip-logic/src/main/java/com/iohao/mmo/equip/entity/ElseEquipProperty.java

@@ -36,10 +36,6 @@ import org.springframework.data.mongodb.core.mapping.Document;
 @Document
 @FieldDefaults(level = AccessLevel.PRIVATE)
 public class ElseEquipProperty {
-    /** 体质 */
-    int constitution;
-    /** 魔力 */
-    int magicPower;
     /** 力量 */
     int power;
     /** 耐力 */

+ 0 - 4
logic/equip-logic/src/main/java/com/iohao/mmo/equip/entity/Equip.java

@@ -42,10 +42,6 @@ public class Equip {
     String itemTypeId;
     /** 玩家 */
     long userId;
-    /** 总属性点 */
-    int attrTotal;
-    /** 未分配属性点 */
-    int undistributedAttr;
     /** 部位(0帽子,1衣服,2武器,3手镯,4裤子,5鞋子) */
     int position;
     /** 要求等级 */

+ 60 - 31
logic/equip-logic/src/main/java/com/iohao/mmo/equip/entity/FixedEquipProperty.java

@@ -24,6 +24,7 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.experimental.FieldDefaults;
 import org.springframework.data.mongodb.core.mapping.Document;
+import java.math.BigDecimal;
 
 /**
  * 装备固定属性
@@ -39,52 +40,80 @@ import org.springframework.data.mongodb.core.mapping.Document;
 @Document
 @FieldDefaults(level = AccessLevel.PRIVATE)
 public class FixedEquipProperty {
-    /** 生命值 */
-    int hp;
-    /** 魔法值 */
-    int mp;
-    /** 物理攻击 */
-    int physicsAttack;
+
+    /** 物理攻击最小值 */
+    int physicsAttackMin;
+    /** 物理攻击最大值 */
+    int physicsAttackMax;
+    /** 法术攻击最小值 */
+    int magicAttackMin;
+    /** 法术攻击最大值 */
+    int magicAttackMax;
+
     /** 物理防御 */
     int physicsDefense;
-    /** 魔法攻击 */
-    int magicAttack;
-    /** 魔法防御 */
+    /** 法术防御 */
     int magicDefense;
-    /** 速度 */
-    int speed;
-    /** 怒气 */
-    int anger;
+
+    /** 物理命中 */
+    int physicsHit;
+    /** 物理闪避 */
+    int physicsDodge;
+    /** 法术命中 */
+    int magicHit;
+    /** 法术闪避 */
+    int magicDodge;
+
+    /** 生命值百分比 */
+    BigDecimal hpPct;
+
+    /** 耐久度 */
+    int durability;
 
     public static FixedEquipProperty randomFixed(FixedEquipProperty fixedEquipPropertyMin,
                                                  FixedEquipProperty fixedEquipPropertyMax){
         if(fixedEquipPropertyMin==null || fixedEquipPropertyMax == null)
             return FixedEquipProperty.builder().build();
         return FixedEquipProperty.builder()
-                .hp(
-                        RandomKit.randomFromInt(fixedEquipPropertyMin.getHp(),
-                                fixedEquipPropertyMax.getHp()))
-                .mp(
-                        RandomKit.randomFromInt(fixedEquipPropertyMin.getMp(),
-                                fixedEquipPropertyMax.getMp()))
-                .physicsAttack(
-                        RandomKit.randomFromInt(fixedEquipPropertyMin.getPhysicsAttack(),
-                                fixedEquipPropertyMax.getPhysicsAttack()))
+                .physicsAttackMin(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getPhysicsAttackMin(),
+                                fixedEquipPropertyMax.getPhysicsAttackMin()))
+                .physicsAttackMax(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getPhysicsAttackMax(),
+                                fixedEquipPropertyMax.getPhysicsAttackMax()))
+                .magicAttackMin(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getMagicAttackMin(),
+                                fixedEquipPropertyMax.getMagicAttackMin()))
+                .magicAttackMax(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getMagicAttackMax(),
+                                fixedEquipPropertyMax.getMagicAttackMax()))
                 .physicsDefense(
                         RandomKit.randomFromInt(fixedEquipPropertyMin.getPhysicsDefense(),
+                                fixedEquipPropertyMax.getPhysicsDefense()))
+                .magicDefense(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getMagicDefense(),
                                 fixedEquipPropertyMax.getMagicDefense()))
-                .magicAttack(
-                        RandomKit.randomFromInt(fixedEquipPropertyMin.getMagicAttack(),
-                                fixedEquipPropertyMax.getMagicAttack()))
                 .magicDefense(
                         RandomKit.randomFromInt(fixedEquipPropertyMin.getMagicDefense(),
                                 fixedEquipPropertyMax.getMagicDefense()))
-                .speed(
-                        RandomKit.randomFromInt(fixedEquipPropertyMin.getSpeed(),
-                                fixedEquipPropertyMax.getSpeed()))
-                .anger(
-                        RandomKit.randomFromInt(fixedEquipPropertyMin.getAnger(),
-                                fixedEquipPropertyMax.getAnger()))
+                .physicsHit(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getPhysicsHit(),
+                                fixedEquipPropertyMax.getPhysicsHit()))
+                .physicsDodge(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getPhysicsDodge(),
+                                fixedEquipPropertyMax.getPhysicsDodge()))
+                .magicHit(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getMagicHit(),
+                                fixedEquipPropertyMax.getMagicHit()))
+                .magicDodge(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getMagicDodge(),
+                                fixedEquipPropertyMax.getMagicDodge()))
+                .hpPct(
+                        RandomKit.randomFromBigDecimal(fixedEquipPropertyMin.getHpPct(),
+                                fixedEquipPropertyMax.getHpPct()))
+                .durability(
+                        RandomKit.randomFromInt(fixedEquipPropertyMin.getDurability(),
+                                fixedEquipPropertyMax.getDurability()))
                 .build();
     }
 }