|
@@ -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();
|
|
|
}
|
|
|
}
|