功绩类型修改

back_recharge
lvxinran 2019-08-06 18:01:47 +08:00
parent db1471aa13
commit 9f91ab0331
3 changed files with 57 additions and 29 deletions

View File

@ -186,8 +186,10 @@ public class MapLogic {
return;
}
MapInfoProto.MapEnterResponse.Builder mapEnterResponse = MapInfoProto.MapEnterResponse.newBuilder();
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapManager.getCurMapId());
mapEnterResponse.setCurXY(CellUtil.xy2Pos(sChallengeMapConfig.getPosition()[0],sChallengeMapConfig.getPosition()[1]));
if(type ==4){
mapManager.updateEndlessMapId(mapId);
List<TeamPosHeroInfo> teamPosForHero = user.getTeamPosManager().getTeamPosForHero().get(teamId);
for (int i = 0; i <teamPosForHero.size() ; i++) {
String endlessHeroId = teamPosForHero.get(i).getHeroId();
@ -195,8 +197,13 @@ public class MapLogic {
mapManager.addEndlessHero(teamPosForHero.get(i).getHeroId(),maxHp);
}
if(mapManager.getEndlessMapInfo().getCurCell()!=0){
mapManager.setCurXY(mapManager.getEndlessMapInfo().getCurCell());
if(mapManager.getEndlessMapInfo().getCurMapId()==mapId) {
mapEnterResponse.setCurXY(mapManager.getEndlessMapInfo().getCurCell());
}
}
mapManager.updateEndlessMapId(mapId);
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
for(Map.Entry<Integer,Map<Integer,String>> entry :endlessMapInfo.getMapSign().entrySet()){
int curMapId = entry.getKey();
@ -238,14 +245,9 @@ public class MapLogic {
}
mapEnterResponse.addAllBuf(towerBuffs);
}
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapManager.getCurMapId());
mapEnterResponse.setDieCount(mapManager.getDieCount());
mapEnterResponse.addAllMapList(cells);
if(type==4&&mapManager.getEndlessMapInfo().getCurCell()!=0){
mapEnterResponse.setCurXY(mapManager.getEndlessMapInfo().getCurCell());
}else{
mapEnterResponse.setCurXY(CellUtil.xy2Pos(sChallengeMapConfig.getPosition()[0],sChallengeMapConfig.getPosition()[1]));
}
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
if (mapManager.getTemporaryItems() != null) {
mapEnterResponse.setTemporaryItems(CBean2Proto.getDrop(mapManager.getTemporaryItems()));
@ -1138,6 +1140,8 @@ public class MapLogic {
mapManager.updateEndlessFightCount(1+mapManager.getEndlessMapInfo().getFightCount());
}
if (resultCode == 0) {
//无尽副本复活消耗
reviveConsumeExecution(user);
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
@ -1350,20 +1354,8 @@ public class MapLogic {
}
mapManager.setLastFightResult(resultCode);
if (resultCode == 0) {
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
mapManager.updateEndlessFightCount(mapManager.getEndlessMapInfo().getFightCount()+1);
//消耗行动力
int [][] cost = new int[1][];
int costId = SChallengeSetting.getChallengeSetting().getActionPowerId();
int costNum = SEndlessMapConfig.sEndlessMapConfigMap.get(mapManager.getCurMapId()).getDeathCost();
mapManager.updateEndlessConsumeExecution(mapManager.getEndlessMapInfo().getConsumeExecution()+costNum);
int [] cost1 = new int[]{costId,costNum};
cost[0] = cost1;
if(ItemUtil.itemCost(user,cost,BIReason.ENDLESS_CONSUME_EXECUTION,1)) {
costNum = user.getItemManager().getItem(costId).getItemNum();
ItemUtil.itemCost(user,cost,BIReason.ENDLESS_CONSUME_EXECUTION,1);
}
}
//无尽副本复活消耗
reviveConsumeExecution(user);
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
@ -2839,7 +2831,7 @@ public class MapLogic {
continue;
}
if(calHp!=entry.getValue().getMaxHp()){
int tempHp = calHp*entry.getValue().getCurHp()/entry.getValue().getMaxHp();
int tempHp = (int)(entry.getValue().getCurHp()/entry.getValue().getMaxHp()*1.0F*calHp);
endlessHeroInfo.put(entry.getKey(),new EndlessHero(calHp,tempHp));
calHp = tempHp;
}else{
@ -2972,4 +2964,30 @@ public class MapLogic {
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
}
/**
*
* @param user
* @throws Exception
*/
private void reviveConsumeExecution(User user) throws Exception {
MapManager mapManager = user.getMapManager();
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()!=4){
return;
}
mapManager.updateEndlessFightCount(mapManager.getEndlessMapInfo().getFightCount()+1);
//消耗行动力
int [][] cost = new int[1][];
int costId = SChallengeSetting.getChallengeSetting().getActionPowerId();
int costNum = SEndlessMapConfig.sEndlessMapConfigMap.get(mapManager.getCurMapId()).getDeathCost();
mapManager.updateEndlessConsumeExecution(mapManager.getEndlessMapInfo().getConsumeExecution()+costNum);
int [] cost1 = new int[]{costId,costNum};
cost[0] = cost1;
if(!ItemUtil.itemCost(user,cost,BIReason.ENDLESS_CONSUME_EXECUTION,1)) {
costNum = user.getItemManager().getItem(costId).getItemNum();
cost1[1]= costNum;
cost[0] = cost1;
ItemUtil.itemCost(user,cost,BIReason.ENDLESS_CONSUME_EXECUTION,1);
}
}
}

View File

@ -13,18 +13,21 @@ public class KillMonsterAccProcessor implements BaseMissionProcesor{
int[][] configValues = sAccomplishmentConfig.getValues();
MapManager mapManager = user.getMapManager();
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
if(sChallengeConfig.getDifficultType()!=configValues[0][0]){
return GlobalsDef.MAP_MISSION_RETURN;
}
if(missionValue==configValues[1][0]){
if(configValues[0][0]!=0 && sChallengeConfig.getDifficultType()!=configValues[0][0]){
return GlobalsDef.MAP_MISSION_RETURN;
}
if(configValues[0].length<2){
return GlobalsDef.MAP_MISSION_RETURN;
}
if(missionValue==configValues[1][0]){
missionValue = -1;
}
if(missionValue==-1){
return missionValue;
}
for(int i = 1 ; i <configValues.length;i++){
if(eventId!=configValues[0][i]){
return GlobalsDef.MAP_MISSION_RETURN;
continue;
}
missionValue++;
}

View File

@ -37,7 +37,14 @@ public class NotEventFinishEventDifficultMapProcessor implements BaseMissionProc
if(flag){
for(int i = 0 ; i < finishEvent.length;i++){
if(eventId==finishEvent[i]){
missionValue = -1;
if(missionValue<0){
if(missionValue==-1){
break;
}
missionValue = missionValue/2;
}else{
missionValue =0-1<<(configValues[1][1]-1);
}
}
}
}