pokemon skill
parent
d3158986b2
commit
b9b8eaba39
|
@ -1003,16 +1003,22 @@ public class HeroLogic {
|
||||||
public String getPokenmonSkills(User user,int teamId){
|
public String getPokenmonSkills(User user,int teamId){
|
||||||
StringBuilder pokenSkillResult = new StringBuilder();
|
StringBuilder pokenSkillResult = new StringBuilder();
|
||||||
List<TeamPosForPokenInfo> teamPosForPokenInfos = user.getTeamPosManager().getTeamPosForPoken().get(teamId);
|
List<TeamPosForPokenInfo> teamPosForPokenInfos = user.getTeamPosManager().getTeamPosForPoken().get(teamId);
|
||||||
if (teamPosForPokenInfos==null){
|
if (teamPosForPokenInfos==null || teamPosForPokenInfos.isEmpty()){
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
Map<Integer, Pokemon> pokemonMap = user.getPokemonManager().getPokemonMap();
|
Map<Integer, Pokemon> pokemonMap = user.getPokemonManager().getPokemonMap();
|
||||||
Collections.sort(teamPosForPokenInfos);
|
Collections.sort(teamPosForPokenInfos);
|
||||||
for(TeamPosForPokenInfo teamPosForPokenInfo:teamPosForPokenInfos){
|
int size = teamPosForPokenInfos.size();
|
||||||
|
for(int i=0;i<size;i++){
|
||||||
|
TeamPosForPokenInfo teamPosForPokenInfo = teamPosForPokenInfos.get(i);
|
||||||
int pokemonId = teamPosForPokenInfo.getPokenId();
|
int pokemonId = teamPosForPokenInfo.getPokenId();
|
||||||
|
int position = teamPosForPokenInfo.getPosition();
|
||||||
Pokemon pokemon = pokemonMap.get(pokemonId);
|
Pokemon pokemon = pokemonMap.get(pokemonId);
|
||||||
SDifferDemonsStageConfig sDifferDemonsStageConfig = SDifferDemonsStageConfig.getsDifferDemonsStageConfigMap(pokemonId*100 + pokemon.getAllStage());
|
SDifferDemonsStageConfig sDifferDemonsStageConfig = SDifferDemonsStageConfig.getsDifferDemonsStageConfigMap(pokemonId*100 + pokemon.getAllStage());
|
||||||
pokenSkillResult.append(sDifferDemonsStageConfig.getSkillId()).append("#");
|
pokenSkillResult.append(position).append("#").append(sDifferDemonsStageConfig.getSkillId());
|
||||||
|
if(i!=size-1){
|
||||||
|
pokenSkillResult.append("|");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return pokenSkillResult.toString();
|
return pokenSkillResult.toString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,13 +217,15 @@ public class FightDataUtil {
|
||||||
|
|
||||||
private static LuaValue getTeamSkill(String pokemonSkill) {
|
private static LuaValue getTeamSkill(String pokemonSkill) {
|
||||||
LuaValue teamSkill = new LuaTable();
|
LuaValue teamSkill = new LuaTable();
|
||||||
if (pokemonSkill.equals("") || pokemonSkill==null){
|
if (StringUtil.isEmpty(pokemonSkill)){
|
||||||
return teamSkill;
|
return teamSkill;
|
||||||
}
|
}
|
||||||
String[] skills = pokemonSkill.trim().split("#");
|
String[] skills = pokemonSkill.trim().split("\\|");
|
||||||
for (int i = 0; i < skills.length; i++) {
|
for (int i = 0; i < skills.length; i++) {
|
||||||
if (Integer.parseInt(skills[i])>0){
|
String skillAndPos = skills[i];
|
||||||
teamSkill.rawset(i + 1, getSkill(skills[i]));
|
String[] skillAndPosItem = skillAndPos.split("#");
|
||||||
|
if (Integer.parseInt(skillAndPosItem[1])>0){
|
||||||
|
teamSkill.rawset(i + 1, getSkill(skillAndPosItem[1],skillAndPosItem[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return teamSkill;
|
return teamSkill;
|
||||||
|
@ -269,14 +271,18 @@ public class FightDataUtil {
|
||||||
return property;
|
return property;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static LuaValue getSkill(String skillId) {
|
private static LuaValue getSkill(String skillId,String...args) {
|
||||||
LuaValue skill = new LuaTable();
|
LuaValue skill = new LuaTable();
|
||||||
if (skillId==null || skillId.equals("") ){
|
if (skillId==null || skillId.equals("") ){
|
||||||
return skill;
|
return skill;
|
||||||
}
|
}
|
||||||
SSkillLogicVo sSkillLogicVo = SSkillLogicConfig.getsSkillLogicVo(Integer.valueOf(skillId));
|
SSkillLogicVo sSkillLogicVo = SSkillLogicConfig.getsSkillLogicVo(Integer.valueOf(skillId));
|
||||||
if (sSkillLogicVo != null && sSkillLogicVo.getSkillTargetVoList().size()>0) {
|
if (sSkillLogicVo != null && sSkillLogicVo.getSkillTargetVoList().size()>0) {
|
||||||
skill.rawset(1, LuaValue.valueOf(sSkillLogicVo.getCd()));
|
float cd = sSkillLogicVo.getCd();
|
||||||
|
if(args!=null&&args.length>0){
|
||||||
|
cd+=Integer.parseInt(args[0]);
|
||||||
|
}
|
||||||
|
skill.rawset(1, LuaValue.valueOf(cd));
|
||||||
List<LuaValue> effectList = getEffect(sSkillLogicVo);
|
List<LuaValue> effectList = getEffect(sSkillLogicVo);
|
||||||
int size = effectList.size();
|
int size = effectList.size();
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
|
|
Loading…
Reference in New Issue