Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
9b40fd7e62
|
@ -0,0 +1,5 @@
|
|||
Id OpenLevel RecommendForce RecommendHeroIds MinNum BaseReward RandomRewardGroup RecommendRewardGroup
|
||||
int int int mut,int#int,1 int mut,int#int,2 mut,int#int,1 mut,int#int,1
|
||||
1 10 1000 10001#10002 2 1#100|2#100 1001#1002 2001#2002#2003
|
||||
2 11 2000 10001 2 1#100|2#100 1001#1002 2001#2002#2003
|
||||
3 12 3000 10001 2 1#100|2#100 1001#1002 2001#2002#2003
|
|
@ -0,0 +1,4 @@
|
|||
Id LimitHour ConsumeGemRatio BaseRewardRatio RandomRewardRatio PerMapMaxHour HourRewardRatio
|
||||
int int mut,int#int,1 mut,int#int,2 mut,int#int,2 int mut,int#int,2
|
||||
1 12 0#0#10#100 0.8#0.5|0.9#0.8 0.8#0.5|0.9#0.8 12 0.8#0.5|0.9#0.8
|
||||
2 20 0#0#10#200 0.8#0.8|0.9#0.9 0.8#0.8|0.9#0.9 14 0.8#0.5|0.9#0.8
|
|
@ -0,0 +1,4 @@
|
|||
Id ProfessionLimit Position PropertyMin PropertyMax Pool SecondNumMin SecondNumMax SkillId IfClear
|
||||
int int int mut,int#int,1 mut,int#int,1 int int int int int
|
||||
3001 0 1 1#100 1#200 1 1 1 0 1
|
||||
3002 0 0 null null 0 0 0 0 0
|
|
@ -0,0 +1,3 @@
|
|||
id PropertyId Min Max PoolNum Weight
|
||||
int int int int int int
|
||||
1 101 100 200 1 100
|
|
@ -0,0 +1,58 @@
|
|||
Id PropertyId Name Info
|
||||
int int string string
|
||||
1 1 Hp 生命值
|
||||
2 2 Attack 攻击力
|
||||
3 3 PhysicalDefence 护甲
|
||||
4 4 MagicDefence 魔抗
|
||||
5 5 Speed 速度
|
||||
6 51 DamageBocusFactor 伤害加成百分比
|
||||
7 52 DamageReduceFactor 伤害减免百分比
|
||||
8 53 Hit 效果命中率
|
||||
9 54 Dodge 效果抵抗率
|
||||
10 55 CritFactor 暴击率
|
||||
11 56 CritDamageFactor 暴伤
|
||||
12 57 TreatFacter 回复系数
|
||||
13 101 FireDamageBonusFactor 火攻(%)
|
||||
14 102 WindDamageBonusFactor 风攻(%)
|
||||
15 103 WaterDamageBonusFactor 水攻(%)
|
||||
16 104 LandDamageBonusFactor 地攻(%)
|
||||
17 105 LightDamageBonusFactor 光攻(%)
|
||||
18 106 DarkDamageBonusFactor 暗攻(%)
|
||||
19 107 FireDamageReduceFactor 火抗(%)
|
||||
20 108 WindDamageReduceFactor 风抗(%)
|
||||
21 109 WaterDamageReduceFactor 水抗(%)
|
||||
22 110 LandDamageReduceFactor 地抗(%)
|
||||
23 111 LightDamageReduceFactor 光抗(%)
|
||||
24 112 DarkDamageReduceFactor 暗抗(%)
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
||||
0 null
|
|
@ -0,0 +1,67 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="AdventureConfig")
|
||||
public class SAdventureConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int openLevel;
|
||||
|
||||
private int recommendForce;
|
||||
|
||||
private int[] recommendHeroIds;
|
||||
|
||||
private int minNum;
|
||||
|
||||
private int[][] baseReward;
|
||||
|
||||
private int[] randomRewardGroup;
|
||||
|
||||
private int[] recommendRewardGroup;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getOpenLevel() {
|
||||
return openLevel;
|
||||
}
|
||||
|
||||
public int getRecommendForce() {
|
||||
return recommendForce;
|
||||
}
|
||||
|
||||
public int[] getRecommendHeroIds() {
|
||||
return recommendHeroIds;
|
||||
}
|
||||
|
||||
public int getMinNum() {
|
||||
return minNum;
|
||||
}
|
||||
|
||||
public int[][] getBaseReward() {
|
||||
return baseReward;
|
||||
}
|
||||
|
||||
public int[] getRandomRewardGroup() {
|
||||
return randomRewardGroup;
|
||||
}
|
||||
|
||||
public int[] getRecommendRewardGroup() {
|
||||
return recommendRewardGroup;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="AdventureSetting")
|
||||
public class SAdventureSetting implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int limitHour;
|
||||
|
||||
private int[] consumeGemRatio;
|
||||
|
||||
private int[][] baseRewardRatio;
|
||||
|
||||
private int[][] randomRewardRatio;
|
||||
|
||||
private int perMapMaxHour;
|
||||
|
||||
private int[][] hourRewardRatio;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getLimitHour() {
|
||||
return limitHour;
|
||||
}
|
||||
|
||||
public int[] getConsumeGemRatio() {
|
||||
return consumeGemRatio;
|
||||
}
|
||||
|
||||
public int[][] getBaseRewardRatio() {
|
||||
return baseRewardRatio;
|
||||
}
|
||||
|
||||
public int[][] getRandomRewardRatio() {
|
||||
return randomRewardRatio;
|
||||
}
|
||||
|
||||
public int getPerMapMaxHour() {
|
||||
return perMapMaxHour;
|
||||
}
|
||||
|
||||
public int[][] getHourRewardRatio() {
|
||||
return hourRewardRatio;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="EquipConfig")
|
||||
public class SEquipConfig implements BaseConfig {
|
||||
|
||||
private static Map<Integer,SEquipConfig> sEquipConfigByIdMap;
|
||||
|
||||
private int id;
|
||||
|
||||
private int professionLimit;
|
||||
|
||||
private int position;
|
||||
|
||||
private int[] propertyMin;
|
||||
|
||||
private int[] propertyMax;
|
||||
|
||||
private int pool;
|
||||
|
||||
private int secondNumMin;
|
||||
|
||||
private int secondNumMax;
|
||||
|
||||
private int skillId;
|
||||
|
||||
private int ifClear;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sEquipConfigByIdMap = STableManager.getConfig(SEquipConfig.class);
|
||||
}
|
||||
|
||||
public static SEquipConfig getsEquipConfigByI(int equipTid) {
|
||||
return sEquipConfigByIdMap.get(equipTid);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getProfessionLimit() {
|
||||
return professionLimit;
|
||||
}
|
||||
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public int[] getPropertyMin() {
|
||||
return propertyMin;
|
||||
}
|
||||
|
||||
public int[] getPropertyMax() {
|
||||
return propertyMax;
|
||||
}
|
||||
|
||||
public int getPool() {
|
||||
return pool;
|
||||
}
|
||||
|
||||
public int getSecondNumMin() {
|
||||
return secondNumMin;
|
||||
}
|
||||
|
||||
public int getSecondNumMax() {
|
||||
return secondNumMax;
|
||||
}
|
||||
|
||||
public int getSkillId() {
|
||||
return skillId;
|
||||
}
|
||||
|
||||
public int getIfClear() {
|
||||
return ifClear;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="EquipPropertyPool")
|
||||
public class SEquipPropertyPool implements BaseConfig {
|
||||
|
||||
private static Map<Integer, List<SEquipPropertyPool>> SEquipPropertyPoolByIdMap;
|
||||
|
||||
private int id;
|
||||
|
||||
private int propertyId;
|
||||
|
||||
private int min;
|
||||
|
||||
private int max;
|
||||
|
||||
private int poolNum;
|
||||
|
||||
private int weight;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, List<SEquipPropertyPool>> sEquipPropertyPoolByIdMapTmp = new HashMap<>();
|
||||
Map<Integer, SEquipPropertyPool> config = STableManager.getConfig(SEquipPropertyPool.class);
|
||||
for(SEquipPropertyPool sEquipPropertyPool : config.values()){
|
||||
int poolNum = sEquipPropertyPool.getPoolNum();
|
||||
if(!sEquipPropertyPoolByIdMapTmp.containsKey(poolNum)){
|
||||
sEquipPropertyPoolByIdMapTmp.put(poolNum,new ArrayList<>());
|
||||
}
|
||||
sEquipPropertyPoolByIdMapTmp.get(poolNum).add(sEquipPropertyPool);
|
||||
}
|
||||
SEquipPropertyPoolByIdMap = sEquipPropertyPoolByIdMapTmp;
|
||||
}
|
||||
|
||||
public static List<SEquipPropertyPool> getSEquipPropertyPool(int poolId) {
|
||||
return SEquipPropertyPoolByIdMap.get(poolId);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getPropertyId() {
|
||||
return propertyId;
|
||||
}
|
||||
|
||||
public int getMin() {
|
||||
return min;
|
||||
}
|
||||
|
||||
public int getMax() {
|
||||
return max;
|
||||
}
|
||||
|
||||
public int getPoolNum() {
|
||||
return poolNum;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="PropertyConfig")
|
||||
public class SPropertyConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int propertyId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String info;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getPropertyId() {
|
||||
return propertyId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,6 +1,15 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.config.SEquipConfig;
|
||||
import com.ljsd.jieling.config.SEquipPropertyPool;
|
||||
import com.ljsd.jieling.util.KeyGenUtils;
|
||||
import com.ljsd.jieling.util.MathUtils;
|
||||
import com.ljsd.jieling.util.UUIDEnum;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Equip extends MongoBase {
|
||||
|
||||
|
@ -12,6 +21,62 @@ public class Equip extends MongoBase {
|
|||
|
||||
private int star;
|
||||
|
||||
private Map<Integer,Integer> propertyValueByIdMap; //主属性 key 对应PropertyConfig id
|
||||
|
||||
private Map<Integer,Integer> secondValueByIdMap; //副属性
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Equip(){
|
||||
|
||||
}
|
||||
|
||||
public Equip(String uid,int equipTid){
|
||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.EQUIP,uid);
|
||||
this.equipId = equipTid;
|
||||
this.propertyValueByIdMap = new HashMap<>();
|
||||
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigByI(equipTid);
|
||||
int properTyId = sEquipConfig.getPropertyMin()[0];
|
||||
int properMinNum = sEquipConfig.getPropertyMin()[1];
|
||||
int properMaxNum = sEquipConfig.getPropertyMax()[1];
|
||||
int finalProperValue = MathUtils.random(properMinNum, properMaxNum);
|
||||
this.propertyValueByIdMap.put(properTyId,finalProperValue);
|
||||
int secondNumMin = sEquipConfig.getSecondNumMin();
|
||||
int secondNumMax = sEquipConfig.getSecondNumMax();
|
||||
int secondValue = MathUtils.random(secondNumMin, secondNumMax);
|
||||
this.secondValueByIdMap = getSecondValue(sEquipConfig.getPool(),secondValue);
|
||||
}
|
||||
|
||||
public Map<Integer,Integer> getSecondValue(int poolId,int nums){
|
||||
Map<Integer,Integer> result = new HashMap<>();
|
||||
List<SEquipPropertyPool> sEquipPropertyPoolList = SEquipPropertyPool.getSEquipPropertyPool(poolId);
|
||||
int totalWeight = 0;
|
||||
for(SEquipPropertyPool sEquipPropertyPool : sEquipPropertyPoolList){
|
||||
totalWeight+=sEquipPropertyPool.getWeight();
|
||||
}
|
||||
while (result.size()<nums){
|
||||
int weight = 0;
|
||||
int randomWeight = MathUtils.randomInt(totalWeight) +1;
|
||||
for(SEquipPropertyPool sEquipPropertyPool : sEquipPropertyPoolList){
|
||||
weight+=sEquipPropertyPool.getWeight();
|
||||
if(randomWeight<weight){
|
||||
int random = MathUtils.random(sEquipPropertyPool.getMin(), sEquipPropertyPool.getMax());
|
||||
result.put(sEquipPropertyPool.getId(),random);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getEquipId() {
|
||||
return equipId;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class EquipManager extends MongoBase {
|
||||
|
||||
private Map<String,Equip> equipMap;
|
||||
|
||||
public void addEquip(Equip equip) throws Exception {
|
||||
updateString("equipMap." + equip.getId(),equip);
|
||||
equipMap.put(equip.getId(),equip);
|
||||
}
|
||||
|
||||
public void remove(String equipId){
|
||||
removeString("equipMap." + equipId);
|
||||
equipMap.remove(equipId);
|
||||
}
|
||||
}
|
|
@ -19,6 +19,8 @@ public class User extends MongoRoot {
|
|||
|
||||
private MailManager mailManager;
|
||||
|
||||
private EquipManager equipManager;
|
||||
|
||||
|
||||
|
||||
public User(int uid, PlayerManager playerManager, ItemManager itemManager,
|
||||
|
@ -31,14 +33,16 @@ public class User extends MongoRoot {
|
|||
this.mapManager = mapManager;
|
||||
this.teamPosManager = new TeamPosManager();
|
||||
this.mailManager = new MailManager();
|
||||
this.equipManager = new EquipManager();
|
||||
|
||||
//綁定关系
|
||||
playerManager.init(this, "playerManager", false);
|
||||
itemManager.init(this, "itemManager", false);
|
||||
heroManager.init(this, "heroManager", false);
|
||||
mapManager.init(this, "mapManager", false);
|
||||
teamPosManager.init(this,"teamPosManager",false);
|
||||
mailManager.init(this,"mailManager",false);
|
||||
this.playerManager.init(this, "playerManager", false);
|
||||
this.itemManager.init(this, "itemManager", false);
|
||||
this.heroManager.init(this, "heroManager", false);
|
||||
this.mapManager.init(this, "mapManager", false);
|
||||
this.teamPosManager.init(this,"teamPosManager",false);
|
||||
this.mailManager.init(this,"mailManager",false);
|
||||
this.equipManager.init(this,"equipManager",false);
|
||||
}
|
||||
|
||||
public User(){
|
||||
|
@ -47,11 +51,13 @@ public class User extends MongoRoot {
|
|||
this.itemManager = new ItemManager();
|
||||
this.heroManager = new HeroManager();
|
||||
this.mapManager = new MapManager();
|
||||
this.equipManager = new EquipManager();
|
||||
//綁定关系
|
||||
playerManager.init(this, "playerManager", false);
|
||||
itemManager.init(this, "itemManager", false);
|
||||
heroManager.init(this, "heroManager", false);
|
||||
mapManager.init(this, "mapManager", false);
|
||||
equipManager.init(this,"equipManager",false);
|
||||
}
|
||||
|
||||
public static void init(LjsdMongoTemplate ljsdMongoTemplate) {
|
||||
|
|
Loading…
Reference in New Issue