fix fight hero passskill

wangyuan 2019-10-27 11:33:27 +08:00
parent 9c9af49df7
commit d1f50fddf7
10 changed files with 44 additions and 59 deletions

View File

@ -38,11 +38,11 @@ public class CommonStaticConfig extends AbstractClassStaticConfig {
registConfigs.add(SGlobalSystemConfig.class.getAnnotation(Table.class).name());
registConfigs.add(SGuildSetting.class.getAnnotation(Table.class).name());
registConfigs.add(SWorkShopSetting.class.getAnnotation(Table.class).name());
registConfigs.add(SWorkShopSetting.class.getAnnotation(Table.class).name());
}
@Override
public void figureConfigs() {
gameSetting = new SGameSetting();
try {
Map<Integer, SGameSetting> config = STableManager.getConfig(SGameSetting.class);
@ -59,14 +59,14 @@ public class CommonStaticConfig extends AbstractClassStaticConfig {
notDelete.add(Global.STAMINA);
notDelete.addAll(gameSetting.getItemRecoveryMap().keySet());
} catch (Exception e) {
LOGGER.error("gamesetting init fail");
LOGGER.error("gamesetting init fail",e);
}
try {
SChallengeMapConfig sChallengeMapConfig = STableManager.getConfig(SChallengeMapConfig.class).get(11);
initPos = CellUtil.xy2Pos(sChallengeMapConfig.getPosition()[0], sChallengeMapConfig.getPosition()[1]);
} catch (Exception e) {
LOGGER.error("sChallengeMapConfig init fail");
LOGGER.error("sChallengeMapConfig init fail",e);
}
try {
@ -108,7 +108,7 @@ public class CommonStaticConfig extends AbstractClassStaticConfig {
sGlobalSystemConfigMapByTypeAndConditionMap = sGlobalSystemConfigMapByTypeAndConditionMapTmp;
} catch (Exception e) {
LOGGER.error("SGlobalSystemConfig init fail");
LOGGER.error("SGlobalSystemConfig init fail",e);
}
try {
@ -167,7 +167,7 @@ public class CommonStaticConfig extends AbstractClassStaticConfig {
}
} catch (Exception e) {
LOGGER.error("SWorkShopTechnology init fail");
LOGGER.error("SWorkShopTechnology init fail",e);
}

View File

@ -157,7 +157,7 @@ public class HandlerLogicThread extends Thread{
transaction.commit();
if (msgId != MessageTypeProto.MessageType.GET_CHAT_MESSAGE_REQUEST_VALUE) {
long useTime = System.nanoTime() - curTimeMillis;
LOGGER.info("doWork->uid={},mType={},useTime={},;end", userId, MessageTypeProto.MessageType.valueOf(msgId), useTime);
LOGGER.info("doWork->uid={},mType={},useTime={},;end", userId, MessageTypeProto.MessageType.valueOf(msgId), useTime/1000_000);
}
}

View File

@ -227,13 +227,12 @@ public class BehaviorUtil {
.build();
heroFightInfos.add(heroFightInfo);
}
CommonProto.FightTeamInfo fightTeamInfo = CommonProto.FightTeamInfo.
return CommonProto.FightTeamInfo.
newBuilder()
.addAllFightUnitList(heroFightInfos)
.setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
.build();
return fightTeamInfo;
}
public static CommonProto.FightTeamInfo getRobotFightTeamInfo(SArenaRobotConfig sArenaRobotConfig) {
@ -245,7 +244,7 @@ public class BehaviorUtil {
Integer heroTid = item.getKey();
Integer heroStar = item.getValue();
SCHero scHero = SCHero.getsCHero().get(heroTid);
List<Integer> skillIds = scHero.getSkillListByStar().get(heroStar);
List<Integer> skillIds = scHero.getSkillListByStar(heroStar);
String heroSkill = HeroLogic.getInstance().getRobotHeroSkills(skillIds,skillSb).toString();
String property = HeroLogic.getInstance().getRobotHeroProperty(sArenaRobotConfig,scHero,propertySb).toString();
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
@ -257,12 +256,12 @@ public class BehaviorUtil {
heroFightInfos.add(heroFightInfo);
}
CommonProto.FightTeamInfo fightTeamInfo = CommonProto.FightTeamInfo.
return CommonProto.FightTeamInfo.
newBuilder()
.addAllFightUnitList(heroFightInfos)
.setTeamSkillList(HeroLogic.getInstance().getRobotPokenmonSkills(sArenaRobotConfig))
.build();
return fightTeamInfo;
}
/**

View File

@ -13,9 +13,7 @@ import manager.STableManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Hero extends MongoBase {
@ -30,8 +28,6 @@ public class Hero extends MongoBase {
private int star;
private List<Integer> skillList;
private Map<Integer,String> equipByPositionMap;
private Map<Integer,String> soulEquipByPositionMap;
@ -63,14 +59,9 @@ public class Hero extends MongoBase {
this.templateId = scHero.getId();
this.level = 1;
this.star = initStar;
this.skillList = new ArrayList<>();
this.equipByPositionMap = new HashMap<>();
this.soulEquipByPositionMap = new HashMap<>();
this.especialEquip = "";
List<Integer> skillIds = scHero.getSkillListByStar().get(star);
if(skillIds!=null && !skillIds.isEmpty()){
this.skillList.addAll(skillIds);
}
if(initStar!=scHero.getStar()){
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
@ -89,17 +80,7 @@ public class Hero extends MongoBase {
public void upStar(int upStar) throws Exception {
SCHero scHero = SCHero.getsCHero().get(templateId);
this.star += upStar;
List<Integer> skillIds = scHero.getSkillListByStar().get(star);
if(skillIds!=null && !skillIds.isEmpty()){
if(this.skillList!=null){
skillList.clear();
}else{
this.skillList = new ArrayList<>();
}
this.skillList.addAll(skillIds);
}
updateString("star",star);
updateString("skillList",skillList);
}
@ -143,10 +124,6 @@ public class Hero extends MongoBase {
return star;
}
public List<Integer> getSkillList() {
return skillList;
}
public Map<Integer, String> getEquipByPositionMap() {
return equipByPositionMap;
}

View File

@ -68,7 +68,7 @@ public class MainLevelManager extends MongoBase {
updateString("lastTime",lastTime);
}
public void afterTakeStateReward(int hadTakeTimes,boolean needReset,int lastTakes){
public void afterTakeStateReward(boolean needReset,int lastTakes){
fightStateInfo.clear();
int now = (int)(System.currentTimeMillis()/1000);
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();

View File

@ -257,9 +257,9 @@ public class CombatLogic {
int times = (now - lastTime)/STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getAdventureRefresh();
int maxTimes = adventureOffline - takeTimes;
int lastTimeTakes=0;
boolean reset = maxTimes<times;
if(maxTimes>0){
times = times > maxTimes?maxTimes:times;
takeTimes+=times;
int[] randomRewardMin = targetMainLevelConfig.getRandomRewardMin();
ItemUtil.combineReward(user,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap);
int timesTemp =times;
@ -280,10 +280,10 @@ public class CombatLogic {
}
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,now,Global.MAIL_EFFECTIVE_TIME);
}
mainLevelManager.afterTakeStateReward(takeTimes,true,0);
mainLevelManager.afterTakeStateReward(true,0);
return null;
}
mainLevelManager.afterTakeStateReward(takeTimes,maxTimes<=0,lastTimeTakes);
mainLevelManager.afterTakeStateReward(reset,lastTimeTakes);
ItemUtil.drop(user,baseBuilder,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
ItemUtil.drop(user,randomBuilder,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
Map<Integer, CommonProto.Drop> result = new HashMap<>(2);

View File

@ -862,7 +862,8 @@ public class HeroLogic {
public StringBuilder getHeroSkills(User user,Hero hero, StringBuilder sb){
for (Integer skillId : hero.getSkillList()) {
SCHero tempHero = SCHero.getsCHero().get(hero.getTemplateId());
for (Integer skillId : tempHero.getSkillListByStar(hero.getStar())) {
sb.append(skillId).append(DIVISION);
}
Map<Integer, String> equipByPositionMap = hero.getEquipByPositionMap();
@ -878,7 +879,6 @@ public class HeroLogic {
sb.append(skillId).append(DIVISION);
}
}
return sb;
}
//法宝技能
String especialEquipId = hero.getEspecialEquip();
@ -888,7 +888,7 @@ public class HeroLogic {
for(int skill:sEquipTalismana.getOpenSkillRules()){
sb.append(skill).append(DIVISION);
}
SCHero tempHero = SCHero.getsCHero().get(hero.getTemplateId());
int[][] specialSkill = sEquipTalismana.getSpecialSkill();
for(int i = 0 ; i < specialSkill.length;i++){
if(tempHero.getProfession()==specialSkill[i][0]){
@ -897,6 +897,8 @@ public class HeroLogic {
}
}
return sb;
}

View File

@ -99,7 +99,6 @@ public class CBean2Proto {
.setBreakId(hero.getBreakId())
.setStarBreakId(hero.getStarBreakId())
.setCreateTime(hero.getCreateTime())
.addAllSkillIdList(hero.getSkillList())
.addAllEquipIdList(equipList)
.addEspecialEquip(hero.getEspecialEquip())
.addAllSoulPos(soulPoss)

View File

@ -273,7 +273,7 @@ public class FightDataUtil {
private static LuaValue getSkill(String skillId,String...args) {
LuaValue skill = new LuaTable();
if (skillId==null || skillId.equals("") ){
if (StringUtil.isEmpty(skillId)){
return skill;
}
SSkillLogicVo sSkillLogicVo = SSkillLogicConfig.getsSkillLogicVo(Integer.valueOf(skillId));

View File

@ -104,8 +104,8 @@ public class SCHero implements BaseConfig{
}
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++){
@ -121,24 +121,32 @@ public class SCHero implements BaseConfig{
}
scHero.setConsumeMaterialInfoOfPositionByStar(consumeMaterialInfoByStarTmp);
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(!skillListByStarTmp.containsKey(star)){
skillListByStarTmp.put(star,new ArrayList<>());
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);
}
skillListByStarTmp.get(star).add(skillId);
}
for(int[] openSkillRule : scHero.getOpenPassiveSkillRules()){
int star = openSkillRule[0];
int skillId = openSkillRule[1];
if(!skillListByStarTmp.containsKey(star)){
skillListByStarTmp.put(star,new ArrayList<>());
if(!skillTmp.containsKey(star)){
skillTmp.put(star,new ArrayList<>());
}
skillListByStarTmp.get(star).add(skillId);
skillTmp.get(star).add(skillId);
}
scHero.setSkillListByStar(skillTmp);
}
sCHero = integerSCHeroMap;
@ -217,14 +225,6 @@ public class SCHero implements BaseConfig{
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;
}
@ -252,4 +252,12 @@ public class SCHero implements BaseConfig{
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;
}
}