|
@@ -134,30 +134,18 @@ public class EquipTemplateService {
|
|
|
fixedCount);
|
|
|
}
|
|
|
}
|
|
|
- if(equipPropertyFixedList!=null&&!equipPropertyFixedList.isEmpty()) {
|
|
|
- //生成准确的固定属性
|
|
|
- equipEntryTemplateService.propertyDetail(
|
|
|
- equipTemplate.getLevel(),
|
|
|
- equipPropertyFixedList);
|
|
|
- }
|
|
|
- //随机属性的条数
|
|
|
- int randomCount = RandomKit.randomFromInt(
|
|
|
- equipTemplate.getEquipPropertyRandomMin(),
|
|
|
- equipTemplate.getEquipPropertyRandomMax()+1);
|
|
|
+ //随机固定属性的具体值
|
|
|
+ resetFixedEntryValue(equipTemplate.getLevel(), equipPropertyFixedList);
|
|
|
+
|
|
|
//生成随机属性
|
|
|
- List<EquipEntry> equipEntryList = new ArrayList<>();
|
|
|
- if(randomCount>0) {
|
|
|
- equipEntryList = equipEntryTemplateService.randomEntryBatch(
|
|
|
- equipTemplate.getLevel(),
|
|
|
- equipTemplate.getPosition(),
|
|
|
- randomCount);
|
|
|
- }
|
|
|
- if(equipEntryList!=null&&!equipEntryList.isEmpty()) {
|
|
|
- //生成准确的随机属性
|
|
|
- equipEntryTemplateService.propertyDetail(
|
|
|
- equipTemplate.getLevel(),
|
|
|
- equipEntryList);
|
|
|
- }
|
|
|
+ List<EquipEntry> equipEntryList =
|
|
|
+ resetRandomEntryList(
|
|
|
+ equipTemplate.getEquipPropertyRandomMin(),
|
|
|
+ equipTemplate.getEquipPropertyRandomMax(),
|
|
|
+ equipTemplate.getLevel(),
|
|
|
+ equipTemplate.getPosition()
|
|
|
+ );
|
|
|
+
|
|
|
return Equip.builder()
|
|
|
.itemTypeId(equipTemplate.getItemTypeId())
|
|
|
.position(equipTemplate.getPosition())
|
|
@@ -179,4 +167,49 @@ public class EquipTemplateService {
|
|
|
.equipPropertyRandomList(equipEntryList)
|
|
|
.build();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 重新随机固定属性的具体值
|
|
|
+ * @param level 装备要求等级
|
|
|
+ * @param equipPropertyFixedList 固定属性词条
|
|
|
+ * @return List<EquipEntry> 装备词条列表
|
|
|
+ */
|
|
|
+ public void resetFixedEntryValue(int level,List<EquipEntry> equipPropertyFixedList){
|
|
|
+ if(equipPropertyFixedList!=null&&!equipPropertyFixedList.isEmpty()) {
|
|
|
+ //生成准确的固定属性
|
|
|
+ equipEntryTemplateService.propertyDetail(
|
|
|
+ level,
|
|
|
+ equipPropertyFixedList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 重新生成随机属性
|
|
|
+ * @param numMin 最少条数
|
|
|
+ * @param numMax 最大条数
|
|
|
+ * @param level 装备要求等级
|
|
|
+ * @param position 部位
|
|
|
+ * @return List<EquipEntry> 装备词条列表
|
|
|
+ */
|
|
|
+ public List<EquipEntry> resetRandomEntryList(int numMin,int numMax,int level,String position){
|
|
|
+ //随机属性的条数
|
|
|
+ int randomCount = RandomKit.randomFromInt(
|
|
|
+ numMin,
|
|
|
+ numMax+1);
|
|
|
+ //生成随机属性
|
|
|
+ List<EquipEntry> equipEntryList = new ArrayList<>();
|
|
|
+ if(randomCount>0) {
|
|
|
+ equipEntryList = equipEntryTemplateService.randomEntryBatch(
|
|
|
+ level,
|
|
|
+ position,
|
|
|
+ randomCount);
|
|
|
+ }
|
|
|
+ if(equipEntryList!=null&&!equipEntryList.isEmpty()) {
|
|
|
+ //生成准确的随机属性
|
|
|
+ equipEntryTemplateService.propertyDetail(
|
|
|
+ level,
|
|
|
+ equipEntryList);
|
|
|
+ }
|
|
|
+ return equipEntryList;
|
|
|
+ }
|
|
|
}
|