无尽提交

lvxinran 2021-06-09 03:46:51 +08:00
parent dfd2bdc968
commit de1432222f
11 changed files with 73 additions and 32 deletions

View File

@ -46,6 +46,7 @@ public class EndlessFunction implements FunctionManager {
MapInfoProto.EndlessMapChange info = MapInfoProto.EndlessMapChange.newBuilder().setMapId(mapId).build();
for(Map.Entry<Integer, ISession> entry:onlineUserMap.entrySet()){
System.out.println("无尽推送"+ entry.getKey()+":"+mapId);
MessageUtil.sendIndicationMessage(entry.getValue(),1, MessageTypeProto.MessageType.ENDLESS_MAP_CHANGE_INDICATION_VALUE,info,true);
}
}

View File

@ -27,11 +27,6 @@ public class EndlessTreasureReward extends MongoBase {
setIsBuy(0);
}
@Override
public void init(int id, String mongoKey) {
super.init(id, mongoKey);
}
public int getCreateTime() {
return createTime;
}

View File

@ -68,10 +68,8 @@ public class GetEndlessHeroInfoListHandler extends BaseHandler<HeroInfoProto.Get
MapManager mapManager = user.getMapManager();
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
//更新行动力
MapManager.getTimesRecoveryTicket(user,1);
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
if(endlessMapInfo.getSeason()!=openTimeOfFuntionCacheByType.getTimes()){
if(openTimeOfFuntionCacheByType!=null&&endlessMapInfo.getSeason()!=openTimeOfFuntionCacheByType.getTimes()){
// StoreLogic.initOnsStoereWithTime(user, SEndlessMapConfig.sEndlessMapConfigMap.get(4001).getMapStoreId(),openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime());
mapManager.updateEndlessSeason(openTimeOfFuntionCacheByType.getTimes());
mapManager.updateEndlessMapId(0);
@ -82,8 +80,6 @@ public class GetEndlessHeroInfoListHandler extends BaseHandler<HeroInfoProto.Get
mapManager.removeEndlessMonsterHp();
// 清理无尽副本道具
MapLogic.getInstance().clearEndLessDrop(iSession.getUid());
//新创建地图
// enterNewMap(user,4001,GlobalsDef.ENDLESS_TEAM,mapEnterResponse);
MapLogic.getInstance().getMap(2).initMap(user.getMapManager(), user);
user.getUserMissionManager().onGameEvent(user, GameEvent.ENDLESS_MISSION_REFRESH);
}

View File

@ -718,14 +718,18 @@ public class MapLogic {
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapUpdateResponse.build(), true);
}
private Set<Integer> getOpenCells(List<Integer> cells){
int[] offset = new int[]{-256,-512,256,512,-1,-2,1,2,-257,257,-255,255,0};
int square = 3;//范围是3
Set<Integer> openCells= new HashSet<>();
for(int cell:cells){
for(int off:offset){
if(!endlessMapCell.contains(cell+off)){
continue;
for(int i =-square;i<=square;i++){
int yOff = square - Math.abs(i);
for(int j = -yOff;j<=yOff;j++){
int openCell = cell + 256 * i + j;
if(!endlessMapCell.contains(openCell)){
continue;
}
openCells.add(openCell);
}
openCells.add(cell+off);
}
}
return openCells;
@ -1192,7 +1196,7 @@ public class MapLogic {
if(user.getMapManager().getCurMapId()!=0&&SChallengeConfig.sChallengeConfigs.get(user.getMapManager().getCurMapId()).getType()==4){
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
if(user.getMapManager().getEndlessMapInfo().getSeason()!=openTimeOfFuntionCacheByType.getTimes()){
if(openTimeOfFuntionCacheByType!=null&&user.getMapManager().getEndlessMapInfo().getSeason()!=openTimeOfFuntionCacheByType.getTimes()){
onlyLevelMap(user,false);
user.getMapManager().setEndlessMapInfo(new EndlessMapInfo());
}
@ -3112,7 +3116,7 @@ public class MapLogic {
/**
*
* @param session
* @param heroIds
* @param heroes
* @param messageType
* @throws Exception
*/

View File

@ -271,11 +271,13 @@ public class MapManager extends MongoBase {
//行动力回复
if(itemId==1){
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
if(user.getMapManager().endlessMapInfo.getSeason()!=openTimeOfFuntionCacheByType.getTimes()){
if(openTimeOfFuntionCacheByType!=null&&user.getMapManager().endlessMapInfo.getSeason()!=openTimeOfFuntionCacheByType.getTimes()){
long startTime = openTimeOfFuntionCacheByType.getStartTime();
recoveryTimes = (updateTime - (int)(startTime/1000))/recoveryItemInfo[2];
item.setItemNum(200);
itemNum=200;
item.setEndingTime((int)(startTime/1000));
lastUpdateEnergyTime = (int)(startTime/1000);
}
}
if( recoveryTimes>0){

View File

@ -0,0 +1,36 @@
package com.ljsd.jieling.handler.map.behavior;
import com.ljsd.jieling.handler.map.EventType;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.GameEvent;
import org.springframework.stereotype.Component;
import rpc.protocols.FightInfoProto;
import rpc.protocols.MapInfoProto;
/**
* @author lvxinran
* @date 2021/5/30
* @discribe
*/
@Component
public class FiftyFourBehavior extends BaseBehavior {
@Override
public int getBehaviorType() {
return EventType.fiftyFour;
}
@Override
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
String readyInfo = behaviorTypeValues[0][0] + "#" + Integer.toString(optionId);
BehaviorUtil.fightReady(user.getId(), readyInfo);
return true;
}
@Override
public boolean afterFight(User user, int[][] behaviorTypeValues, FightInfoProto.FightEndResponse.Builder fightEndResponse) throws Exception {
BehaviorUtil.destoryPoint(user, behaviorTypeValues[0][1]);
user.getUserMissionManager().onGameEvent(user, GameEvent.ENDLESS_KILL_LAST_BOSS);
return true;
}
}

View File

@ -31,7 +31,7 @@ public class FiftyThreeBehavior extends BaseBehavior {
Map<String,Integer> newHpMap = new HashMap<>();
endlessHeroInfo.forEach((k,v)-> newHpMap.put(k,v==0?0: Math.min(v+behaviorTypeValues[0][0],10000)));
endlessHeroInfo.forEach((k,v)-> newHpMap.put(k,Math.min(v+behaviorTypeValues[0][0],10000)));
user.getMapManager().updateEndlessHero(newHpMap);

View File

@ -85,6 +85,7 @@ public class User {
this.itemManager.init(id, MongoKey.itemManager);
this.heroManager.init(id, MongoKey.heroManager);
this.mapManager.init(id, MongoKey.mapManager);
mapManager.getEndlessTreasureReward().init(id,MongoKey.mapManager+"."+"endlessTreasureReward");
this.teamPosManager.init(id, MongoKey.teamPosManager);
this.mailManager.init(id, MongoKey.mailManager);
this.equipManager.init(id, MongoKey.equipManager);

View File

@ -343,13 +343,17 @@ public class FightUtil {
int moraleLevel = user.getMapManager().getEndlessMapInfo().getMoraleLevel();
StringBuilder moraleSkillBuilder = new StringBuilder();
Map<Integer,Integer> moraleMap = new HashMap<>();
if(moraleLevel!=1){
if(moraleLevel!=0){
Map<Integer, SEndlessMorale> config = STableManager.getConfig(SEndlessMorale.class);
SEndlessMorale levelMorale = config.get(moraleLevel+1);
//士气属性
for(int[] prop:levelMorale.getProps()){
moraleMap.put(prop[0],moraleMap.getOrDefault(prop[0],0)+prop[1]);
}
for(int i = 2;i<moraleLevel+1;i++){
SEndlessMorale morale = config.get(i);
for(int[] prop:morale.getProps()){
moraleMap.put(prop[0],moraleMap.getOrDefault(prop[0],0)+prop[1]);
}
if(morale.getSkill()!=0) {
moraleSkillBuilder.append(morale.getSkill());
moraleSkillBuilder.append("#");

View File

@ -753,9 +753,9 @@ public class HeroLogic{
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
int templateId = hero.getTemplateId();
// if(!heroManager.getHeroHandBook().containsKey(templateId)){
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
// }
if(!heroManager.getHeroHandBook().containsKey(templateId)){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
}
heroIds.forEach(heroId->set.add(heroManager.getEndlessHeroInfo().get(heroId.getHeroId()).getTemplateId()));
}else{

View File

@ -83,13 +83,15 @@ public class DailyMissionIdsType extends AbstractMissionType{
MissionStateChangeInfo doingInfo = new MissionStateChangeInfo(missionId,
MissionState.DOING, null);
boolean flag = false;
for (MissionStateChangeInfo missionStateChangeInfo : missionStateChangeInfos) {
if (missionStateChangeInfo.getMissionId() == missionId) {
flag = true;
if(missionStateChangeInfos!=null){
for (MissionStateChangeInfo missionStateChangeInfo : missionStateChangeInfos) {
if (missionStateChangeInfo.getMissionId() == missionId) {
flag = true;
}
}
if (!flag) {
missionStateChangeInfos.add(doingInfo);
}
}
if (!flag) {
missionStateChangeInfos.add(doingInfo);
}
continue;
}