无尽修改N。。。

lvxinran 2019-09-12 18:44:46 +08:00
parent 4f39ea2210
commit b52d314375
10 changed files with 76 additions and 18 deletions

View File

@ -1,8 +1,8 @@
package com.ljsd.jieling.globals;
public interface Global {
int EXECUTION = 1;//行动力id
int STAMINA = 2; // 体力id
int EXECUTION = 3;//行动力id
int DROP = 53;//水滴
int HEROSTORY_TICKET = 28; //精英入场券
int GENERALSTORY_TICKET = 27; //普通入场券

View File

@ -1553,19 +1553,19 @@ public class MapLogic {
cacheRemove.add(hero.getId());
}
}
if(!cacheRemove.isEmpty()){
Iterator<TeamPosHeroInfo> iterator = team.iterator();
while (iterator.hasNext()){
TeamPosHeroInfo next = iterator.next();
if(cacheRemove.contains(next.getHeroId())){
if(mapManager.getHeroAllAttributeMap().containsKey(next.getHeroId())){
mapManager.removeOneHeroAttribute(next.getHeroId());
}
iterator.remove();
}
}
user.getTeamPosManager().updateTeamPosByTeamId(teamId,team);
}
// if(!cacheRemove.isEmpty()){
// Iterator<TeamPosHeroInfo> iterator = team.iterator();
// while (iterator.hasNext()){
// TeamPosHeroInfo next = iterator.next();
// if(cacheRemove.contains(next.getHeroId())){
// if(mapManager.getHeroAllAttributeMap().containsKey(next.getHeroId())){
// mapManager.removeOneHeroAttribute(next.getHeroId());
// }
// iterator.remove();
// }
// }
// user.getTeamPosManager().updateTeamPosByTeamId(teamId,team);
// }
}else{
for (TeamPosHeroInfo teamPosHeroInfo : team) {
mapManager.updateHeroOneAttribute(teamPosHeroInfo.getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[teamPosHeroInfo.getPosition()+1]);
@ -3139,8 +3139,31 @@ public class MapLogic {
}
endlessMapInfo.setEndlessHeroInfo(endlessHeroInfo);
mapManager.setEndlessMapInfo(endlessMapInfo);
// List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(401);
// if(team!=null&&team.size()>0){
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(401);
if(team!=null&&team.size()>0){
Set<String> cacheRemove = new HashSet<>();
Map<String, Map<Integer, Integer>> heroAllAttributeMap = mapManager.getHeroAllAttributeMap();
if(heroAllAttributeMap !=null){
for(Map.Entry<String, Map<Integer, Integer>> entry:heroAllAttributeMap.entrySet()){
if(entry.getValue().get(HeroAttributeEnum.CurHP.getPropertyId())==0){
cacheRemove.add(entry.getKey());
}
}
}
if(!cacheRemove.isEmpty()){
Iterator<TeamPosHeroInfo> iterator = team.iterator();
while (iterator.hasNext()){
TeamPosHeroInfo next = iterator.next();
if(cacheRemove.contains(next.getHeroId())){
if(heroAllAttributeMap.containsKey(next.getHeroId())){
mapManager.removeOneHeroAttribute(next.getHeroId());
}
iterator.remove();
}
}
user.getTeamPosManager().updateTeamPosByTeamId(401,team);
}
}
// Iterator<TeamPosHeroInfo> iterator = team.iterator();
// while(iterator.hasNext()){
// TeamPosHeroInfo teamInfo = iterator.next();

View File

@ -111,6 +111,8 @@ public class CumulationData {
public int monsterAttackTimes;
public int consumeAction;//无尽消耗行动力
//任务重置
@ -158,6 +160,7 @@ public class CumulationData {
friendNums=0;
monsterAttackTimes = 0;
toBeStronger = 0;
consumeAction = 0;
}
private void clearArray(int[] source){

View File

@ -306,7 +306,12 @@ public class GuildFightLogic {
continue;
}
GuildInfo enemyInfo = GuilidManager.guildInfoMap.get(enemyFamily);
Family.EnemyFamily familyInfo = Family.EnemyFamily.newBuilder().setId(enemyInfo.getId()).setLevel(enemyInfo.getLevel()).setName(enemyInfo.getName()).setPictureId(1).build();
Family.EnemyFamily familyInfo = Family.EnemyFamily.newBuilder().setId(enemyInfo.getId())
.setLevel(enemyInfo.getLevel())
.setName(enemyInfo.getName())
.setPictureId(1)
.setTotalStar(redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_TOTAL_STAR,"",String.valueOf(enemyFamily),Integer.class))
.build();
GuildLogic.sendIndicationToMember(guildInfo, MessageTypeProto.MessageType.FAMILY_FIGHT_MATCHING_SUCCESS_INDICATION, familyInfo);
}

View File

@ -21,6 +21,7 @@ import com.ljsd.jieling.network.server.ProtocolsManager;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.HeroInfoProto;
import com.ljsd.jieling.protocols.MapInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.util.*;
import org.slf4j.Logger;
@ -426,6 +427,7 @@ public class HeroLogic {
if(teamPosHeroInfos!=null){
List<String> heroes = new ArrayList<>(teamPosHeroInfos.size());
Map<String, Map<Integer, Integer>> heroAllAttributeMap = new HashMap<>(teamPosHeroInfos.size());
List<MapInfoProto.HeroInfo> indiHeros = new ArrayList<>();
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
@ -442,11 +444,23 @@ public class HeroLogic {
}
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
heroes.add(heroInfo.getHeroId());
MapInfoProto.HeroInfo indiInfo = MapInfoProto.HeroInfo.newBuilder().setHeroId(heroInfo.getHeroId())
.setHeroHp(heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()))
.setHeroMaxHp(heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId()))
.build();
indiHeros.add(indiInfo);
}
user.getMapManager().setHeroAllAttributeMap(heroAllAttributeMap);
if(user.getMapManager().getCurMapId()!=0){
MapInfoProto.EndlessSetTeamIndication response = MapInfoProto.EndlessSetTeamIndication.newBuilder().addAllInfo(indiHeros).build();
MessageUtil.sendIndicationMessage(iSession,1, MessageTypeProto.MessageType.ENDLESS_MAP_SET_TEAM_INDICATION_VALUE,response,true);
}
}else{
user.getTeamPosManager().changeTeamInfo(teamId,heroIds,pokemonoIds);
}
}
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_IN_TEAM,heroIds.size());
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.TEAM_POS_SAVE_RESPONSE_VALUE,null,true);

View File

@ -628,6 +628,9 @@ public class MissionLoigc {
case BLOODY_KILL_NUMS:
count = user.getBloodyInfo().getKillNums();
break;
case ENDLESS_CONSUME_ACTION:
count = cumulationData.consumeAction;
break;
default:
count = 0;
break;

View File

@ -78,7 +78,7 @@ public enum MissionType {
MONSTER_ATTACK_LEVEL(57),//兽潮来袭到达x层
TO_BE_STRONGER(58),//我要变强点击:%s次
BLOODY_KILL_NUMS(59),// 血战每日击杀人数
ENDLESS_CONSUME_ACTION(60)//无尽消耗行动力
;
private int missionType;
@ -211,6 +211,8 @@ public enum MissionType {
return TO_BE_STRONGER;
case 59:
return BLOODY_KILL_NUMS;
case 60:
return ENDLESS_CONSUME_ACTION;
default:
return null;
}

View File

@ -25,6 +25,12 @@ public class ConsumerMaterialDataManager implements BaseDataManager{
data.consumerStamina+=count;
result = new CumulationData.Result(missionType);
}
}else if(missionType==MissionType.ENDLESS_CONSUME_ACTION){
count = consumeMaterialMapTmp.get(Global.EXECUTION);
if(count!=null){
data.consumeAction+=count;
result = new CumulationData.Result(missionType);
}
}

View File

@ -31,6 +31,7 @@ public class DataManagerDistributor {
judges.put(MissionType.USER_CONSUMER_GEM,new ConsumerMaterialDataManager());
judges.put(MissionType.USER_CONSUMER_STAMINA,new ConsumerMaterialDataManager());
judges.put(MissionType.ENDLESS_CONSUME_ACTION,new ConsumerMaterialDataManager());
judges.put(MissionType.USER_WORKSHOP_LEVEL,new DefaultDataManager());

View File

@ -101,6 +101,7 @@ public class MissionEventDistributor {
typeList = new ArrayList<>();
typeList.add(MissionType.USER_CONSUMER_GEM);
typeList.add(MissionType.USER_CONSUMER_STAMINA);
typeList.add(MissionType.ENDLESS_CONSUME_ACTION);
eventEnumListMap.put(GameEvent.CONSUMER_MATERIAL,typeList);
eventProcessor.put(GameEvent.CONSUMER_MATERIAL,new CumulationDataEventProcessor());