灵兽战斗数据组装
parent
d054d48907
commit
8a1c93570d
|
@ -3019,7 +3019,7 @@ public class HeroLogic{
|
||||||
SSpiritAnimal animalConfig = STableManager.getConfig(SSpiritAnimal.class).get(tmpId);
|
SSpiritAnimal animalConfig = STableManager.getConfig(SSpiritAnimal.class).get(tmpId);
|
||||||
Map<Integer, Integer> costMap = new HashMap<>();
|
Map<Integer, Integer> costMap = new HashMap<>();
|
||||||
costMap.put(animalConfig.getReturnCost()[0], animalConfig.getReturnCost()[1]);
|
costMap.put(animalConfig.getReturnCost()[0], animalConfig.getReturnCost()[1]);
|
||||||
if (ItemUtil.checkCost(user, costMap)) {
|
if (!ItemUtil.checkCost(user, costMap)) {
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
Map<Integer, Integer> returnMap = new HashMap<>();
|
Map<Integer, Integer> returnMap = new HashMap<>();
|
||||||
|
@ -3033,6 +3033,8 @@ public class HeroLogic{
|
||||||
returnMap.put(tmpId, returnMap.getOrDefault(tmpId, 0) + sumItemNum);
|
returnMap.put(tmpId, returnMap.getOrDefault(tmpId, 0) + sumItemNum);
|
||||||
}
|
}
|
||||||
ItemUtil.itemCost(user, costMap, BIReason.SPECIAL_BACK_CONSUME, 1);
|
ItemUtil.itemCost(user, costMap, BIReason.SPECIAL_BACK_CONSUME, 1);
|
||||||
|
pokemonManager.updatePokemonLevel(pokemonId,1);
|
||||||
|
pokemonManager.updatePokemonStar(pokemonId,0);
|
||||||
|
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, ItemUtil.mapToArray(returnMap), BIReason.SPECIAL_MONSTER_REWARD);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, ItemUtil.mapToArray(returnMap), BIReason.SPECIAL_MONSTER_REWARD);
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class FightDataUtil {
|
||||||
|
|
||||||
enemyData.rawset(i+1, unitData);
|
enemyData.rawset(i+1, unitData);
|
||||||
}
|
}
|
||||||
enemyData.set("teamSkill", getTeamSkill(data.getTeamSkillList().trim()));
|
enemyData.set("monsterList", getTeamSkill(data.getTeamSkillList().trim(),1));
|
||||||
enemyData.set("teamPassive", new LuaTable());
|
enemyData.set("teamPassive", new LuaTable());
|
||||||
|
|
||||||
return enemyData;
|
return enemyData;
|
||||||
|
@ -190,9 +190,10 @@ public class FightDataUtil {
|
||||||
for (int i = 1; i <= heroTeam.getFightUnitListCount(); i++) {
|
for (int i = 1; i <= heroTeam.getFightUnitListCount(); i++) {
|
||||||
playerData.rawset(i, getHeroFightUnit(heroTeam.getFightUnitList(i - 1),position));
|
playerData.rawset(i, getHeroFightUnit(heroTeam.getFightUnitList(i - 1),position));
|
||||||
}
|
}
|
||||||
playerData.set("teamSkill", getTeamSkill(heroTeam.getTeamSkillList()));
|
playerData.set("teamSkill","");
|
||||||
playerData.set("teamPassive", getTeamPassive(heroTeam.getTeamPassiveList()));
|
playerData.set("teamPassive", getTeamPassive(heroTeam.getTeamPassiveList()));
|
||||||
playerData.set("outData",heroTeam.getSpecialPassive());
|
playerData.set("outData",heroTeam.getSpecialPassive());
|
||||||
|
playerData.set("monsterList", getTeamSkill(heroTeam.getTeamSkillList(),0));
|
||||||
playerData.set("firstCamp",first?1:0);
|
playerData.set("firstCamp",first?1:0);
|
||||||
return playerData;
|
return playerData;
|
||||||
}
|
}
|
||||||
|
@ -234,18 +235,54 @@ public class FightDataUtil {
|
||||||
return passivityData;
|
return passivityData;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static LuaValue getTeamSkill(String pokemonSkill) {
|
//组装灵兽技能数据 camp=0 自己 1 对方
|
||||||
|
private static LuaValue getTeamSkill(String pokemonSkill,int camp) {
|
||||||
LuaValue teamSkill = new LuaTable();
|
LuaValue teamSkill = new LuaTable();
|
||||||
if (StringUtil.isEmpty(pokemonSkill)){
|
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++) {
|
||||||
String skillAndPos = skills[i];
|
String skillAndPos = skills[i];
|
||||||
String[] skillAndPosItem = skillAndPos.split("#");
|
if(skillAndPos.equals("0")){
|
||||||
if (Integer.parseInt(skillAndPosItem[1])>0){
|
continue;
|
||||||
teamSkill.rawset(i + 1, getSkill(skillAndPosItem[1],skillAndPosItem[0]));
|
|
||||||
}
|
}
|
||||||
|
SSpiritAnimalSkill sSpiritAnimalSkill = STableManager.getConfig(SSpiritAnimalSkill.class).get(Integer.valueOf(skillAndPos));
|
||||||
|
LuaValue monster = new LuaTable();
|
||||||
|
monster.set("id",sSpiritAnimalSkill.getSpiritAnimalMatch());
|
||||||
|
monster.set("star",sSpiritAnimalSkill.getStarMatch());
|
||||||
|
monster.set("camp",camp);
|
||||||
|
monster.set("position",i+1);
|
||||||
|
LuaValue skill= new LuaTable();
|
||||||
|
int[] skillIDList = sSpiritAnimalSkill.getSkillIDList();
|
||||||
|
for(int j = 0 ; j <skillIDList.length;j++){
|
||||||
|
LuaValue oneSkill = new LuaTable();
|
||||||
|
oneSkill.rawset("triggerId",sSpiritAnimalSkill.getReleasePoint()[j]);
|
||||||
|
int[][] releaseLimit = sSpiritAnimalSkill.getReleaseLimit();
|
||||||
|
LuaValue triggerCondition = new LuaTable();
|
||||||
|
if(releaseLimit!=null&&releaseLimit.length>0&&releaseLimit[0].length>0){
|
||||||
|
for(int l = 0 ; l<releaseLimit[j].length;l++){
|
||||||
|
triggerCondition.rawset(l+1, LuaValue.valueOf(releaseLimit[j][l]));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
triggerCondition.rawset(1,LuaValue.valueOf(0));
|
||||||
|
}
|
||||||
|
oneSkill.set("effect",getSkill(String.valueOf(skillIDList[j])));
|
||||||
|
oneSkill.set("triggerCondition",triggerCondition);
|
||||||
|
|
||||||
|
oneSkill.set("maxCount",sSpiritAnimalSkill.getWarEffectCount()[j]);
|
||||||
|
|
||||||
|
oneSkill.set("maxRoundCount",sSpiritAnimalSkill.getTurnEffectCount()[j]);
|
||||||
|
|
||||||
|
skill.rawset(j+1,oneSkill);
|
||||||
|
}
|
||||||
|
monster.rawset("skill",skill);
|
||||||
|
|
||||||
|
// String[] skillAndPosItem = skillAndPos.split("#");
|
||||||
|
// if (Integer.parseInt(skillAndPosItem[1])>0){
|
||||||
|
// teamSkill.rawset(i + 1, getSkill(skillAndPosItem[1],skillAndPosItem[0]));
|
||||||
|
// }
|
||||||
|
teamSkill.rawset(i+1,monster);
|
||||||
}
|
}
|
||||||
return teamSkill;
|
return teamSkill;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue