388 lines
10 KiB
Java
388 lines
10 KiB
Java
package config;
|
|
|
|
import manager.STableManager;
|
|
import manager.Table;
|
|
|
|
import java.util.*;
|
|
|
|
@Table(name = "HeroConfig")
|
|
public class SCHero implements BaseConfig{
|
|
|
|
public static Map<Integer, SCHero> sCHero;
|
|
|
|
private int id;
|
|
|
|
private int piecesId;
|
|
|
|
private int piecesCount;
|
|
|
|
private String readingName;
|
|
|
|
private int propertyName; //角色属性
|
|
|
|
private int profession; //角色职业
|
|
|
|
private int maxRank; //角色最高星级
|
|
|
|
private int star;
|
|
|
|
private float hp;
|
|
|
|
private float attack; //攻击力
|
|
|
|
private float physicalDefence; //护甲
|
|
|
|
private float magicDefence; //魔抗
|
|
|
|
private float speed; //速度
|
|
|
|
private int actionPower;
|
|
|
|
private int[][] rankupConsumeMaterial;
|
|
|
|
private int[][] openSkillRules;
|
|
|
|
private int[][] awaken;
|
|
|
|
private int[][] openPassiveSkillRules;
|
|
|
|
private int[] equipTalismana;
|
|
|
|
private int[][] secondaryFactor;
|
|
|
|
private int quality;
|
|
|
|
private int natural;
|
|
|
|
private int[] growthSwitch;
|
|
|
|
private int job;
|
|
|
|
private int maxLevel;
|
|
|
|
private int weight;
|
|
|
|
private int joinWishDay;
|
|
|
|
private int[][] soul;
|
|
|
|
private int[][] soulSkill;
|
|
|
|
private int isSoulOpen;
|
|
|
|
private Map<Integer,Integer> secondaryFactorMap;
|
|
|
|
private Map<Integer, List<Integer>> skillListByStar;
|
|
|
|
private int[][] returnBook;
|
|
|
|
// 觉醒增加的技能属性
|
|
private Map<Integer,TreeMap<Integer,List<Integer>>> awakSkillMap;
|
|
|
|
private Map<Integer, Map<Integer, ConsumeMaterialInfo>> consumeMaterialInfoOfPositionByStar;
|
|
|
|
private Map<Integer,TreeMap<Integer,List<Integer>>> passiveSkillMap;
|
|
|
|
private static Map<Integer,SCHero> piecesMap;
|
|
|
|
public static class ConsumeMaterialInfo{
|
|
private int groupID;
|
|
private int nums;
|
|
|
|
public ConsumeMaterialInfo(int groupID, int nums) {
|
|
this.groupID = groupID;
|
|
this.nums = nums;
|
|
}
|
|
|
|
public int getGroupID() {
|
|
return groupID;
|
|
}
|
|
|
|
public void setGroupID(int groupID) {
|
|
this.groupID = groupID;
|
|
}
|
|
|
|
public int getNums() {
|
|
return nums;
|
|
}
|
|
|
|
public void setNums(int nums) {
|
|
this.nums = nums;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
public void init() throws Exception {
|
|
|
|
Map<Integer, SCHero> integerSCHeroMap = STableManager.getConfig(SCHero.class);
|
|
for(SCHero scHero : integerSCHeroMap.values()){
|
|
|
|
int[][] secondaryFactor = scHero.getSecondaryFactor();
|
|
if(secondaryFactor!=null && secondaryFactor.length>0){
|
|
Map<Integer,Integer> secondaryFactorMapTmp = new HashMap<>(secondaryFactor.length);
|
|
for(int[] secondaryFactorItem : secondaryFactor){
|
|
int property = secondaryFactorItem[0];
|
|
int propertyValue = secondaryFactorItem[1];
|
|
secondaryFactorMapTmp.put(property, propertyValue);
|
|
scHero.setSecondaryFactorMap(secondaryFactorMapTmp);
|
|
}
|
|
}
|
|
Map<Integer, Map<Integer, ConsumeMaterialInfo>> consumeMaterialInfoByStarTmp = new HashMap<>();
|
|
|
|
int[][] rankupConsumeMaterial = scHero.getRankupConsumeMaterial();
|
|
|
|
for(int j=0;j<rankupConsumeMaterial.length;j++){
|
|
int[] ints = rankupConsumeMaterial[j];
|
|
int star = ints[0];
|
|
int position = ints[1];
|
|
int groupID = ints[2];
|
|
int nums = ints[3];
|
|
if(!consumeMaterialInfoByStarTmp.containsKey(star)){
|
|
consumeMaterialInfoByStarTmp.put(star,new HashMap<>());
|
|
}
|
|
consumeMaterialInfoByStarTmp.get(star).put(position,new ConsumeMaterialInfo(groupID,nums));
|
|
}
|
|
scHero.setConsumeMaterialInfoOfPositionByStar(consumeMaterialInfoByStarTmp);
|
|
|
|
int[][] openSkillRules = scHero.getOpenSkillRules();
|
|
// 技能
|
|
Map<Integer, List<Integer>> skillTmp = new HashMap<>();
|
|
|
|
for(int i=0;i<openSkillRules.length;i++){
|
|
int[] openSkillRule = openSkillRules[i];
|
|
int star = openSkillRule[0];
|
|
int skillId = openSkillRule[1];
|
|
if(!skillTmp.containsKey(star)){
|
|
skillTmp.put(star,new ArrayList<>());
|
|
}
|
|
skillTmp.get(star).add(skillId);
|
|
}
|
|
for(List<Integer> items : skillTmp.values()){
|
|
if(items.size() <2){
|
|
items.add(0);
|
|
}
|
|
}
|
|
scHero.setSkillListByStar(skillTmp);
|
|
|
|
Map<Integer,TreeMap<Integer,List<Integer>>> passiveSkillMapTmp = new HashMap<>();
|
|
passiveSkillMapTmp.put(1,new TreeMap<>());
|
|
passiveSkillMapTmp.put(2,new TreeMap<>());
|
|
|
|
for(int[] openSkillRule : scHero.getOpenPassiveSkillRules()){
|
|
int type = openSkillRule[0];
|
|
int starOrBreakId = openSkillRule[1];
|
|
int skillId = openSkillRule[2];
|
|
|
|
passiveSkillMapTmp.get(type).computeIfAbsent(starOrBreakId,a->{
|
|
return new ArrayList<>(passiveSkillMapTmp.get(type).getOrDefault(a-1,new ArrayList<>()));
|
|
});
|
|
passiveSkillMapTmp.get(type).get(starOrBreakId).add(skillId);
|
|
}
|
|
scHero.setPassiveSkillMap(passiveSkillMapTmp);
|
|
|
|
// 大于10星为 觉醒技能
|
|
int[][] awakens = scHero.getAwaken();
|
|
Map<Integer, TreeMap<Integer, List<Integer>>> awakSkillMapTmp = new HashMap<>();
|
|
if (awakens != null && awakens.length > 0&&awakens[0].length>0) {
|
|
awakSkillMapTmp.put(1, new TreeMap<>());
|
|
awakSkillMapTmp.put(2, new TreeMap<>());
|
|
for (int[] openSkillRule : awakens) {
|
|
int type = openSkillRule[0];
|
|
int starOrBreakId = openSkillRule[1];
|
|
int skillId = openSkillRule[2];
|
|
awakSkillMapTmp.get(type).computeIfAbsent(starOrBreakId, a -> {
|
|
return new ArrayList<>(awakSkillMapTmp.get(type).getOrDefault(a - 1, new ArrayList<>()));
|
|
});
|
|
awakSkillMapTmp.get(type).get(starOrBreakId).add(skillId);
|
|
}
|
|
}
|
|
scHero.setAwakSkillMap(awakSkillMapTmp);
|
|
}
|
|
sCHero = integerSCHeroMap;
|
|
piecesMap = new HashMap<>();
|
|
for(Map.Entry<Integer,SCHero> hero:sCHero.entrySet()){
|
|
piecesMap.put(hero.getValue().getPiecesId(),hero.getValue());
|
|
}
|
|
}
|
|
|
|
public static SCHero getHeroByPieceId(int piecesId){
|
|
return piecesMap.get(piecesId);
|
|
}
|
|
|
|
public Map<Integer, ConsumeMaterialInfo> getConsumeMaterialInfoOfPositionByStar(int star) {
|
|
return consumeMaterialInfoOfPositionByStar.get(star);
|
|
}
|
|
|
|
public void setConsumeMaterialInfoOfPositionByStar(Map<Integer, Map<Integer, ConsumeMaterialInfo>> consumeMaterialInfoOfPositionByStar) {
|
|
this.consumeMaterialInfoOfPositionByStar = consumeMaterialInfoOfPositionByStar;
|
|
}
|
|
|
|
public static Map<Integer, SCHero> getsCHero() {
|
|
return sCHero;
|
|
}
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public int getPiecesId() {
|
|
return piecesId;
|
|
}
|
|
|
|
public int getPiecesCount() {
|
|
return piecesCount;
|
|
}
|
|
|
|
public int getProfession() {
|
|
return profession;
|
|
}
|
|
|
|
public int getMaxRank() {
|
|
return maxRank;
|
|
}
|
|
|
|
public float getHp() {
|
|
return hp;
|
|
}
|
|
|
|
public float getAttack() {
|
|
return attack;
|
|
}
|
|
|
|
public float getPhysicalDefence() {
|
|
return physicalDefence;
|
|
}
|
|
|
|
public float getMagicDefence() {
|
|
return magicDefence;
|
|
}
|
|
|
|
public float getSpeed() {
|
|
return speed;
|
|
}
|
|
|
|
public int getPropertyName() {
|
|
return propertyName;
|
|
}
|
|
|
|
public int getActionPower() {
|
|
return actionPower;
|
|
}
|
|
|
|
public int[][] getRankupConsumeMaterial() {
|
|
return rankupConsumeMaterial;
|
|
}
|
|
|
|
public int[][] getOpenSkillRules() {
|
|
return openSkillRules;
|
|
}
|
|
|
|
public int getStar() {
|
|
return star;
|
|
}
|
|
|
|
public int[][] getSecondaryFactor() {
|
|
return secondaryFactor;
|
|
}
|
|
|
|
public Map<Integer, Integer> getSecondaryFactorMap() {
|
|
return secondaryFactorMap;
|
|
}
|
|
|
|
public void setSecondaryFactorMap(Map<Integer, Integer> secondaryFactorMap) {
|
|
this.secondaryFactorMap = secondaryFactorMap;
|
|
}
|
|
|
|
public int getQuality() {
|
|
return quality;
|
|
}
|
|
|
|
public int getNatural() {
|
|
return natural;
|
|
}
|
|
|
|
public String getReadingName() {
|
|
return readingName;
|
|
}
|
|
|
|
public int[][] getOpenPassiveSkillRules() {
|
|
return openPassiveSkillRules;
|
|
}
|
|
|
|
public List<Integer> getSkillListByStar(int star) {
|
|
return skillListByStar.get(star);
|
|
}
|
|
|
|
public void setSkillListByStar(Map<Integer, List<Integer>> skillListByStar) {
|
|
this.skillListByStar = skillListByStar;
|
|
}
|
|
|
|
public int[] getGrowthSwitch() {
|
|
return growthSwitch;
|
|
}
|
|
|
|
public int[] getEquipTalismana() {
|
|
return equipTalismana;
|
|
}
|
|
|
|
|
|
public List<Integer> getPassiveSkills(int type,int id){
|
|
if( passiveSkillMap.get(type).floorEntry(id)==null){
|
|
return new ArrayList<>(0);
|
|
}
|
|
return passiveSkillMap.get(type).floorEntry(id).getValue();
|
|
}
|
|
|
|
public List<Integer> getAwakSkills(int type, int id) {
|
|
if (awakSkillMap.get(type)==null||awakSkillMap.get(type).floorEntry(id) == null) {
|
|
return new ArrayList<>(0);
|
|
}
|
|
return awakSkillMap.get(type).floorEntry(id).getValue();
|
|
}
|
|
|
|
public void setPassiveSkillMap(Map<Integer, TreeMap<Integer, List<Integer>>> passiveSkillMap) {
|
|
this.passiveSkillMap = passiveSkillMap;
|
|
}
|
|
|
|
public void setAwakSkillMap(Map<Integer, TreeMap<Integer, List<Integer>>> awakSkillMap) {
|
|
this.awakSkillMap = awakSkillMap;
|
|
}
|
|
|
|
public int[][] getAwaken() {
|
|
return awaken;
|
|
}
|
|
|
|
public int getJob() {
|
|
return job;
|
|
}
|
|
|
|
public int getMaxLevel() {
|
|
return maxLevel;
|
|
}
|
|
|
|
public int getWeight() {
|
|
return weight;
|
|
}
|
|
|
|
public int getJoinWishDay() {
|
|
return joinWishDay;
|
|
}
|
|
|
|
public int[][] getSoul() {
|
|
return soul;
|
|
}
|
|
|
|
public int[][] getSoulSkill() {
|
|
return soulSkill;
|
|
}
|
|
|
|
public int getIsSoulOpen() {
|
|
return isSoulOpen;
|
|
}
|
|
|
|
public int[][] getReturnBook() {
|
|
return returnBook;
|
|
}
|
|
}
|