2019-09-06 11:04:28 +08:00
|
|
|
package config;
|
|
|
|
|
|
|
|
import manager.STableManager;
|
|
|
|
import manager.Table;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@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;
|
|
|
|
|
2019-10-18 10:13:39 +08:00
|
|
|
private int[][] openPassiveSkillRules;
|
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
private int[][] secondaryFactor;
|
|
|
|
|
|
|
|
private int quality;
|
|
|
|
|
|
|
|
private int natural;
|
|
|
|
|
|
|
|
private Map<Integer,Integer> secondaryFactorMap;
|
|
|
|
|
|
|
|
private Map<Integer, List<Integer>> skillListByStar;
|
|
|
|
|
|
|
|
private Map<Integer, Map<Integer, ConsumeMaterialInfo>> consumeMaterialInfoOfPositionByStar;
|
|
|
|
|
|
|
|
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[][] openSkillRules = scHero.getOpenSkillRules();
|
|
|
|
Map<Integer, List<Integer>> skillListByStarTmp = new HashMap<>();
|
|
|
|
scHero.setSkillListByStar(skillListByStarTmp);
|
|
|
|
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);
|
|
|
|
|
|
|
|
for(int i=0;i<openSkillRules.length;i++){
|
|
|
|
int[] openSkillRule = openSkillRules[i];
|
|
|
|
int star = openSkillRule[0];
|
|
|
|
int skillId = openSkillRule[1];
|
|
|
|
if(!skillListByStarTmp.containsKey(star)){
|
|
|
|
skillListByStarTmp.put(star,new ArrayList<>());
|
|
|
|
}
|
|
|
|
skillListByStarTmp.get(star).add(skillId);
|
|
|
|
}
|
|
|
|
|
2019-10-18 10:13:39 +08:00
|
|
|
for(int[] openSkillRule : scHero.getOpenPassiveSkillRules()){
|
|
|
|
int star = openSkillRule[0];
|
|
|
|
int skillId = openSkillRule[1];
|
|
|
|
if(!skillListByStarTmp.containsKey(star)){
|
|
|
|
skillListByStarTmp.put(star,new ArrayList<>());
|
|
|
|
}
|
|
|
|
skillListByStarTmp.get(star).add(skillId);
|
|
|
|
}
|
|
|
|
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|
|
|
|
sCHero = integerSCHeroMap;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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 void setSkillListByStar(Map<Integer, List<Integer>> skillListByStar) {
|
|
|
|
this.skillListByStar = skillListByStar;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Map<Integer, List<Integer>> getSkillListByStar() {
|
|
|
|
return skillListByStar;
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2019-10-18 10:13:39 +08:00
|
|
|
|
|
|
|
public int[][] getOpenPassiveSkillRules() {
|
|
|
|
return openPassiveSkillRules;
|
|
|
|
}
|
2019-09-06 11:04:28 +08:00
|
|
|
}
|