Merge branch 'master_test_gn' into master_test_gn_mcz2
commit
29ae290630
|
@ -120,7 +120,10 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
remainHp.add(checkResult[i]);
|
remainHp.add(checkResult[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//如果是第三层更新下圣物状态
|
||||||
|
if(expeditionManager.getExpeditionLeve()>2){
|
||||||
|
ExpeditionLogic.getInstance().thirdFight(user);
|
||||||
|
}
|
||||||
//更新节点状态 节点
|
//更新节点状态 节点
|
||||||
final int oldlay = nodeInfo.getLay();
|
final int oldlay = nodeInfo.getLay();
|
||||||
Set<String> ids = new HashSet<>();
|
Set<String> ids = new HashSet<>();
|
||||||
|
@ -182,14 +185,13 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
Expedition.EndExpeditionBattleResponse.Builder response = Expedition.EndExpeditionBattleResponse.newBuilder();
|
Expedition.EndExpeditionBattleResponse.Builder response = Expedition.EndExpeditionBattleResponse.newBuilder();
|
||||||
response.setResult(resultCode);
|
response.setResult(resultCode);
|
||||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_END_BATTLE_RESONSE_VALUE, response.build(), true);
|
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_END_BATTLE_RESONSE_VALUE, response.build(), true);
|
||||||
|
|
||||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),user.getExpeditionManager().getExpeditionLeve(),oldlay-1,nodeInfo.getType(),"失败");
|
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),user.getExpeditionManager().getExpeditionLeve(),oldlay-1,nodeInfo.getType(),"失败");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//胜利更新胜利圣物次数
|
//胜利更新胜利圣物次数
|
||||||
user.getExpeditionManager().victory();
|
ExpeditionLogic.getInstance().victory(user);
|
||||||
//节点血量更新
|
//节点血量更新
|
||||||
nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->
|
nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->
|
||||||
nodeInfo.getBossHP().put(s, 0d)
|
nodeInfo.getBossHP().put(s, 0d)
|
||||||
|
|
|
@ -82,8 +82,8 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
|
||||||
// ids.add(hero.getId());
|
// ids.add(hero.getId());
|
||||||
// }
|
// }
|
||||||
//使用判官笔更新圣物次数
|
//使用判官笔更新圣物次数
|
||||||
expeditionManager.useJudgePen();
|
|
||||||
|
|
||||||
|
ExpeditionLogic.getInstance().useJudgePen(user);
|
||||||
expeditionManager.getHeroHPWithChange().clear();
|
expeditionManager.getHeroHPWithChange().clear();
|
||||||
expeditionManager.setReliveItemTime(expeditionManager.getReliveItemTime()+1);
|
expeditionManager.setReliveItemTime(expeditionManager.getReliveItemTime()+1);
|
||||||
//更新节点
|
//更新节点
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.ljsd.jieling.handler.Expedition.expedtionItem;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.ExpeditionItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lvxinran
|
||||||
|
* @date 2021/4/12
|
||||||
|
* @discribe
|
||||||
|
*/
|
||||||
|
public class DefaultExpedtionItemHandler implements ExpedtionItemHandler{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void victory(ExpeditionItem item){
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void usejudgePen(ExpeditionItem item){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void thirdFight(ExpeditionItem item) {
|
||||||
|
item.setThirdFloorFighted(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ljsd.jieling.handler.Expedition.expedtionItem;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.ExpeditionItem;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lvxinran
|
||||||
|
* @date 2021/4/12
|
||||||
|
* @discribe
|
||||||
|
*/
|
||||||
|
public interface ExpedtionItemHandler {
|
||||||
|
|
||||||
|
void victory(ExpeditionItem item);
|
||||||
|
|
||||||
|
void usejudgePen(ExpeditionItem item);
|
||||||
|
|
||||||
|
void thirdFight(ExpeditionItem item);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.ljsd.jieling.handler.Expedition.expedtionItem;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.ExpeditionItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lvxinran
|
||||||
|
* @date 2021/4/12
|
||||||
|
* @discribe
|
||||||
|
*/
|
||||||
|
public class FiveCountVictoryHandler extends DefaultExpedtionItemHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void victory(ExpeditionItem item) {
|
||||||
|
if(item.getCountVictory()>=5){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.setCountVictory(item.getCountVictory()+1);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.ljsd.jieling.handler.Expedition.expedtionItem;
|
||||||
|
|
||||||
|
import config.SExpeditionHolyConfig;
|
||||||
|
import manager.STableManager;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lvxinran
|
||||||
|
* @date 2021/4/12
|
||||||
|
* @discribe 需要特殊处理的圣物
|
||||||
|
*/
|
||||||
|
public enum HolyEnum {
|
||||||
|
COMMON(0,new DefaultExpedtionItemHandler()),
|
||||||
|
CHANG_SHENG_KAI(16,new SixCountVictoryHandler()),
|
||||||
|
LI_ZHAN_JIAN(17,new FiveCountVictoryHandler()),
|
||||||
|
FU_SU_YIN(43,new ThreeCountJudgePenHandler());
|
||||||
|
|
||||||
|
|
||||||
|
private int effectType;
|
||||||
|
private ExpedtionItemHandler handler;
|
||||||
|
|
||||||
|
private static Map<Integer,HolyEnum> holyEnumMapByEffect = new HashMap<>();
|
||||||
|
private static Map<Integer,HolyEnum> holyEnumMapById = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
//提前注册
|
||||||
|
for (HolyEnum item:HolyEnum.values()) {
|
||||||
|
holyEnumMapByEffect.put(item.getEffectType(),item);
|
||||||
|
}
|
||||||
|
Map<Integer, SExpeditionHolyConfig> config = STableManager.getConfig(SExpeditionHolyConfig.class);
|
||||||
|
config.forEach((k,v)-> holyEnumMapById.put(k,holyEnumMapByEffect.getOrDefault(v.geteffect(),holyEnumMapByEffect.get(0))));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
HolyEnum(int effectType,ExpedtionItemHandler handler){
|
||||||
|
this.effectType = effectType;
|
||||||
|
this.handler = handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEffectType() {
|
||||||
|
return effectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExpedtionItemHandler getHandler() {
|
||||||
|
return handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ExpedtionItemHandler getOptionalHandler(int equipId){
|
||||||
|
|
||||||
|
return holyEnumMapById.get(equipId).getHandler();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ljsd.jieling.handler.Expedition.expedtionItem;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.ExpeditionItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lvxinran
|
||||||
|
* @date 2021/4/12
|
||||||
|
* @discribe 长生铠,如果生效了5次之后要给前端传6过去,告诉其不能再出发回血
|
||||||
|
*/
|
||||||
|
public class SixCountVictoryHandler extends DefaultExpedtionItemHandler {
|
||||||
|
@Override
|
||||||
|
public void victory(ExpeditionItem item) {
|
||||||
|
if(item.getCountVictory()>=6){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.setCountVictory(item.getCountVictory()+1);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ljsd.jieling.handler.Expedition.expedtionItem;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.logic.dao.ExpeditionItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lvxinran
|
||||||
|
* @date 2021/4/12
|
||||||
|
* @discribe
|
||||||
|
*/
|
||||||
|
public class ThreeCountJudgePenHandler extends DefaultExpedtionItemHandler{
|
||||||
|
@Override
|
||||||
|
public void usejudgePen(ExpeditionItem item) {
|
||||||
|
if(item.getJudgePen()>=3){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.setJudgePen(item.getJudgePen()+1);
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,6 +45,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
SWorldBossSetting sWorldBossSetting = STableManager.getConfig(SWorldBossSetting.class).get(1);
|
SWorldBossSetting sWorldBossSetting = STableManager.getConfig(SWorldBossSetting.class).get(1);
|
||||||
GuildInfo guildInfo=null;
|
GuildInfo guildInfo=null;
|
||||||
|
int privilege;
|
||||||
if(type == 1 || type == 2){
|
if(type == 1 || type == 2){
|
||||||
guildInfo = GuilidManager.guildInfoMap.get(user.getPlayerInfoManager().getGuildId());
|
guildInfo = GuilidManager.guildInfoMap.get(user.getPlayerInfoManager().getGuildId());
|
||||||
if(guildInfo == null){
|
if(guildInfo == null){
|
||||||
|
@ -65,8 +66,8 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int privilege = sWorldBossSetting.getPrivilege()[type - 1];
|
privilege = sWorldBossSetting.getPrivilege()[type - 1];
|
||||||
boolean b = PlayerLogic.getInstance().checkAndUpdate(user, privilege, 1);
|
boolean b = PlayerLogic.getInstance().check(user, privilege, 1);
|
||||||
if(!b){
|
if(!b){
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
}
|
}
|
||||||
|
@ -85,6 +86,9 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
||||||
int monsterId = STableManager.getConfig(SWorldBossConfig.class).get(GuildFightLogic.carDelayProgressIndication.getBossIndexId()).getMonsterId();
|
int monsterId = STableManager.getConfig(SWorldBossConfig.class).get(GuildFightLogic.carDelayProgressIndication.getBossIndexId()).getMonsterId();
|
||||||
PVEFightEvent pvpFightEvent = new PVEFightEvent(uid,GlobalsDef.CAR_DELAY_TEAM, battleRound,"", GameFightType.CarBossChallenge,monsterId,3);
|
PVEFightEvent pvpFightEvent = new PVEFightEvent(uid,GlobalsDef.CAR_DELAY_TEAM, battleRound,"", GameFightType.CarBossChallenge,monsterId,3);
|
||||||
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
|
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
|
||||||
|
if(fightResult.getCheckResult()[0]==-1){
|
||||||
|
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||||
|
}
|
||||||
hurt = (int) fightResult.getCheckResult()[1];
|
hurt = (int) fightResult.getCheckResult()[1];
|
||||||
fightData = fightResult.getFightData();
|
fightData = fightResult.getFightData();
|
||||||
gainScore = (int) (hurt*(sWorldBossSetting.getScorePercent()/10000F));
|
gainScore = (int) (hurt*(sWorldBossSetting.getScorePercent()/10000F));
|
||||||
|
@ -106,6 +110,10 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
||||||
PlayerManager playerInfoManager = UserManager.getUser(challeageId).getPlayerInfoManager();
|
PlayerManager playerInfoManager = UserManager.getUser(challeageId).getPlayerInfoManager();
|
||||||
String challengeName = playerInfoManager.getNickName();
|
String challengeName = playerInfoManager.getNickName();
|
||||||
|
|
||||||
|
if(fight==-1){
|
||||||
|
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||||
|
}
|
||||||
|
|
||||||
if(fight == 1){
|
if(fight == 1){
|
||||||
int challenegScore = RedisUtil.getInstence().getZSetScore(RankEnum.CAR_DEALY_RANK.getRedisKey(), "", String.valueOf(challeageId)).intValue();
|
int challenegScore = RedisUtil.getInstence().getZSetScore(RankEnum.CAR_DEALY_RANK.getRedisKey(), "", String.valueOf(challeageId)).intValue();
|
||||||
if(challenegScore !=-1){
|
if(challenegScore !=-1){
|
||||||
|
@ -142,6 +150,9 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
||||||
// 记录战报
|
// 记录战报
|
||||||
FightRecordLogic.getInstance().addRecordMap(user,fightData);
|
FightRecordLogic.getInstance().addRecordMap(user,fightData);
|
||||||
|
|
||||||
|
//扣除次数
|
||||||
|
PlayerLogic.getInstance().check(user, privilege, 1);
|
||||||
|
|
||||||
guildInfo.addCarFightSb(uid);
|
guildInfo.addCarFightSb(uid);
|
||||||
user.getGuildMyInfo().setCarPlayTime(TimeUtils.nowInt());
|
user.getGuildMyInfo().setCarPlayTime(TimeUtils.nowInt());
|
||||||
user.getGuildMyInfo().setCarPlayProgress(GuildFightLogic.carDelayProgressIndication.getProgress());
|
user.getGuildMyInfo().setCarPlayProgress(GuildFightLogic.carDelayProgressIndication.getProgress());
|
||||||
|
|
|
@ -3170,24 +3170,24 @@ public class MapLogic {
|
||||||
* @param messageType
|
* @param messageType
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void saveTrailTeam(ISession session,List<String> heroIds ,MessageTypeProto.MessageType messageType) throws Exception {
|
public void saveTrailTeam(ISession session, List<MapInfoProto.TrialSaveHero> heroes , MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
MapManager mapManager = user.getMapManager();
|
MapManager mapManager = user.getMapManager();
|
||||||
TrialInfo trialInfo = mapManager.getTrialInfo();
|
TrialInfo trialInfo = mapManager.getTrialInfo();
|
||||||
Map<String, TrailHero> heroInfo = trialInfo.getHeroInfo();
|
Map<String, TrailHero> heroInfo = trialInfo.getHeroInfo();
|
||||||
//校验保存条件
|
//校验保存条件
|
||||||
if(!heroInfo.isEmpty()||heroIds.isEmpty()||heroIds.size()>5){
|
if(!heroInfo.isEmpty()||heroes.isEmpty()||heroes.size()>5){
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
HeroManager heroManager = user.getHeroManager();
|
HeroManager heroManager = user.getHeroManager();
|
||||||
for(String id:heroIds){
|
for(MapInfoProto.TrialSaveHero saveHero:heroes){
|
||||||
Hero hero = heroManager.getHero(id);
|
Hero hero = heroManager.getHero(saveHero.getHeroId());
|
||||||
if(hero==null){
|
if(hero==null){
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(String id:heroIds){
|
for(MapInfoProto.TrialSaveHero saveHero:heroes){
|
||||||
Hero hero = heroManager.getHero(id);
|
Hero hero = heroManager.getHero(saveHero.getHeroId());
|
||||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,new StringBuilder()).toString();
|
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,new StringBuilder()).toString();
|
||||||
int skinTime = heroManager.getSkinInfo().getOrDefault(hero.getSkin(), 0);
|
int skinTime = heroManager.getSkinInfo().getOrDefault(hero.getSkin(), 0);
|
||||||
int skinId = hero.getSkin();
|
int skinId = hero.getSkin();
|
||||||
|
@ -3199,7 +3199,8 @@ public class MapLogic {
|
||||||
TrailHero trailHero = new TrailHero(hero.getTemplateId(),HeroLogic.getInstance().calHeroNotBufferAttribute(user,hero,false,0),hero.getStar(),heroSkill,hero.getLevel(user.getHeroManager()));
|
TrailHero trailHero = new TrailHero(hero.getTemplateId(),HeroLogic.getInstance().calHeroNotBufferAttribute(user,hero,false,0),hero.getStar(),heroSkill,hero.getLevel(user.getHeroManager()));
|
||||||
trailHero.setSkinId(skinId);
|
trailHero.setSkinId(skinId);
|
||||||
trailHero.setSkinTime(skinTime);
|
trailHero.setSkinTime(skinTime);
|
||||||
heroInfo.put(id,trailHero);
|
trailHero.setPosition(saveHero.getPosition());
|
||||||
|
heroInfo.put(saveHero.getHeroId(),trailHero);
|
||||||
}
|
}
|
||||||
|
|
||||||
MapInfoProto.TrialHeroInfoSaveResponse.Builder response = MapInfoProto.TrialHeroInfoSaveResponse.newBuilder();
|
MapInfoProto.TrialHeroInfoSaveResponse.Builder response = MapInfoProto.TrialHeroInfoSaveResponse.newBuilder();
|
||||||
|
@ -3215,6 +3216,7 @@ public class MapLogic {
|
||||||
.setStar(trailHero.getStar())
|
.setStar(trailHero.getStar())
|
||||||
.setLevel(trailHero.getLevel())
|
.setLevel(trailHero.getLevel())
|
||||||
.setSkinId(trailHero.getSkinId())
|
.setSkinId(trailHero.getSkinId())
|
||||||
|
.setPosition(trailHero.getPosition())
|
||||||
.build();
|
.build();
|
||||||
response.addHeroes(info);
|
response.addHeroes(info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ public class TrailHero extends MongoBase {
|
||||||
|
|
||||||
private int skinTime;
|
private int skinTime;
|
||||||
|
|
||||||
|
private int position;
|
||||||
|
|
||||||
public int getTmpId() {
|
public int getTmpId() {
|
||||||
return tmpId;
|
return tmpId;
|
||||||
}
|
}
|
||||||
|
@ -88,4 +90,12 @@ public class TrailHero extends MongoBase {
|
||||||
public void setSkinTime(int skinTime) {
|
public void setSkinTime(int skinTime) {
|
||||||
this.skinTime = skinTime;
|
this.skinTime = skinTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPosition() {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPosition(int position) {
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,6 @@ public class TrailSaveHeroesHandler extends BaseHandler<MapInfoProto.TrialHeroIn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processWithProto(ISession iSession, MapInfoProto.TrialHeroInfoSaveRequest proto) throws Exception {
|
public void processWithProto(ISession iSession, MapInfoProto.TrialHeroInfoSaveRequest proto) throws Exception {
|
||||||
MapLogic.getInstance().saveTrailTeam(iSession,proto.getHeroIdsList(), MessageTypeProto.MessageType.TRIAL_HERO_INFO_SAVE_RESPONSE);
|
MapLogic.getInstance().saveTrailTeam(iSession,proto.getHeroesList(), MessageTypeProto.MessageType.TRIAL_HERO_INFO_SAVE_RESPONSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,7 @@ public class TowerMap extends AbstractMap {
|
||||||
.setStar(trailHero.getStar())
|
.setStar(trailHero.getStar())
|
||||||
.setLevel(trailHero.getLevel())
|
.setLevel(trailHero.getLevel())
|
||||||
.setSkinId(trailHero.getSkinId())
|
.setSkinId(trailHero.getSkinId())
|
||||||
|
.setPosition(trailHero.getPosition())
|
||||||
.build();
|
.build();
|
||||||
mapEnterResponse.addInfos(info);
|
mapEnterResponse.addInfos(info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,8 @@ public class ExpeditionItem extends MongoBase {
|
||||||
|
|
||||||
private int judgePen;
|
private int judgePen;
|
||||||
|
|
||||||
|
private boolean thirdFloorFighted;
|
||||||
|
|
||||||
public ExpeditionItem(String id, int equipId, int level, String heroId, Map<Integer, Integer> propertyValueByIdMap, Map<Integer, Integer> secondValueByIdMap, int createTime, int skill, int isLocked) {
|
public ExpeditionItem(String id, int equipId, int level, String heroId, Map<Integer, Integer> propertyValueByIdMap, Map<Integer, Integer> secondValueByIdMap, int createTime, int skill, int isLocked) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.equipId = equipId;
|
this.equipId = equipId;
|
||||||
|
@ -111,7 +113,6 @@ public class ExpeditionItem extends MongoBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSecondValueByIdMap(Map<Integer, Integer> secondValueByIdMap) {
|
public void setSecondValueByIdMap(Map<Integer, Integer> secondValueByIdMap) {
|
||||||
updateString("secondValueByIdMap",secondValueByIdMap);
|
|
||||||
this.secondValueByIdMap = secondValueByIdMap;
|
this.secondValueByIdMap = secondValueByIdMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +121,6 @@ public class ExpeditionItem extends MongoBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateTime(int createTime) {
|
public void setCreateTime(int createTime) {
|
||||||
updateString("createTime", createTime);
|
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,6 @@ public class ExpeditionItem extends MongoBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSkill(int skill) {
|
public void setSkill(int skill) {
|
||||||
updateString("skill", skill);
|
|
||||||
|
|
||||||
this.skill = skill;
|
this.skill = skill;
|
||||||
}
|
}
|
||||||
|
@ -155,24 +154,14 @@ public class ExpeditionItem extends MongoBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateIsLocked(int isLocked) {
|
public void updateIsLocked(int isLocked) {
|
||||||
updateString("isLocked", isLocked);
|
|
||||||
this.isLocked = isLocked;
|
this.isLocked = isLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void victory(){
|
public boolean isThirdFloorFighted() {
|
||||||
if(equipId == 16 || equipId == 17 || equipId == 53 || equipId == 54 ||
|
return thirdFloorFighted;
|
||||||
equipId == 95 || equipId == 96){
|
|
||||||
if(countVictory<5){
|
|
||||||
countVictory++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void usejudgePen(){
|
public void setThirdFloorFighted(boolean thirdFloorFighted) {
|
||||||
if(equipId == 79 || equipId == 120){
|
this.thirdFloorFighted = thirdFloorFighted;
|
||||||
if(judgePen<3){
|
|
||||||
judgePen++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,6 +120,9 @@ public class ExpeditionManager extends MongoBase {
|
||||||
updateString("propertyItems", this.propertyItems);
|
updateString("propertyItems", this.propertyItems);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public void updateAllPropertyItems() {
|
||||||
|
updateString("propertyItems", this.propertyItems);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -279,18 +282,6 @@ public class ExpeditionManager extends MongoBase {
|
||||||
this.getHolyTiem = getHolyTiem;
|
this.getHolyTiem = getHolyTiem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void victory(){
|
|
||||||
for(ExpeditionItem propertyItem : propertyItems){
|
|
||||||
propertyItem.victory();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void useJudgePen(){
|
|
||||||
for(ExpeditionItem propertyItem : propertyItems){
|
|
||||||
propertyItem.usejudgePen();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExpeditionItem getExpeditionItem(int id){
|
public ExpeditionItem getExpeditionItem(int id){
|
||||||
for(ExpeditionItem propertyItem : propertyItems){
|
for(ExpeditionItem propertyItem : propertyItems){
|
||||||
if(propertyItem.getEquipId() == id){
|
if(propertyItem.getEquipId() == id){
|
||||||
|
|
|
@ -9,6 +9,8 @@ import com.ljsd.jieling.core.HandlerLogicThread;
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
|
import com.ljsd.jieling.handler.Expedition.expedtionItem.ExpedtionItemHandler;
|
||||||
|
import com.ljsd.jieling.handler.Expedition.expedtionItem.HolyEnum;
|
||||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
|
@ -66,6 +68,11 @@ public class ExpeditionLogic {
|
||||||
public static final int NODETYPE_GREED= 10;//贪婪节点
|
public static final int NODETYPE_GREED= 10;//贪婪节点
|
||||||
public static final int NODETYPE_REWARD= 11;//奖励节点
|
public static final int NODETYPE_REWARD= 11;//奖励节点
|
||||||
|
|
||||||
|
|
||||||
|
private static final int VICTORY = 1;
|
||||||
|
private static final int USE_JUDGEPEN =2;
|
||||||
|
private static final int THIRD_FIGHT = 3;
|
||||||
|
|
||||||
private ExpeditionLogic() {
|
private ExpeditionLogic() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,8 +856,8 @@ public class ExpeditionLogic {
|
||||||
}
|
}
|
||||||
int oper = skillModify[i][1];
|
int oper = skillModify[i][1];
|
||||||
if(oper == 1 || oper == 2){
|
if(oper == 1 || oper == 2){
|
||||||
String beReplace = skillModify[i][2]+"";
|
String beReplace = skillModify[i][2]+"#";
|
||||||
String replace = skillModify[i][3]+"";
|
String replace = skillModify[i][3]+"#";
|
||||||
int index = skillSb.indexOf(beReplace);
|
int index = skillSb.indexOf(beReplace);
|
||||||
if(index!=-1){
|
if(index!=-1){
|
||||||
skillSb.replace(index,index+beReplace.length(),replace);
|
skillSb.replace(index,index+beReplace.length(),replace);
|
||||||
|
@ -858,10 +865,41 @@ public class ExpeditionLogic {
|
||||||
}else if(oper == 3){
|
}else if(oper == 3){
|
||||||
int add = skillModify[i][3];
|
int add = skillModify[i][3];
|
||||||
skillSb.append(add).append("#");
|
skillSb.append(add).append("#");
|
||||||
}else{
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void victory(User user) {
|
||||||
|
doOptional(user,VICTORY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void useJudgePen(User user){
|
||||||
|
doOptional(user,USE_JUDGEPEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void thirdFight(User user){
|
||||||
|
doOptional(user,THIRD_FIGHT);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doOptional(User user,int type){
|
||||||
|
|
||||||
|
for(ExpeditionItem propertyItem : user.getExpeditionManager().getPropertyItems()){
|
||||||
|
int equipId = propertyItem.getEquipId();
|
||||||
|
ExpedtionItemHandler optionalHandler = HolyEnum.getOptionalHandler(equipId);
|
||||||
|
switch (type){
|
||||||
|
case VICTORY:
|
||||||
|
optionalHandler.victory(propertyItem);
|
||||||
|
break;
|
||||||
|
case USE_JUDGEPEN:
|
||||||
|
optionalHandler.usejudgePen(propertyItem);
|
||||||
|
break;
|
||||||
|
case THIRD_FIGHT:
|
||||||
|
optionalHandler.thirdFight(propertyItem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
user.getExpeditionManager().updateAllPropertyItems();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,8 +23,9 @@ public class ExpetionSpecialProcessor implements SpecialBuildProcessor{
|
||||||
private final int HP_INCREASE = 16;
|
private final int HP_INCREASE = 16;
|
||||||
private final int DAMAGE_INCREASE = 17;
|
private final int DAMAGE_INCREASE = 17;
|
||||||
private final int HOLY_INCREASE = 35;
|
private final int HOLY_INCREASE = 35;
|
||||||
private final int JUDGE_INCREASE = 43;
|
private final int HOLY_UNKNOWN = 36;
|
||||||
private final int HOLY_QUALITY = 37;
|
private final int HOLY_QUALITY = 37;
|
||||||
|
private final int JUDGE_INCREASE = 43;
|
||||||
@Override
|
@Override
|
||||||
public String getSpecialParm(User user) {
|
public String getSpecialParm(User user) {
|
||||||
Map<Integer, SExpeditionHolyConfig> config = STableManager.getConfig(SExpeditionHolyConfig.class);
|
Map<Integer, SExpeditionHolyConfig> config = STableManager.getConfig(SExpeditionHolyConfig.class);
|
||||||
|
@ -79,6 +80,15 @@ public class ExpetionSpecialProcessor implements SpecialBuildProcessor{
|
||||||
ExpeditionItem item = expeditionManager.getExpeditionItem(con43.getId());
|
ExpeditionItem item = expeditionManager.getExpeditionItem(con43.getId());
|
||||||
result.append(item==null?0:item.getJudgePen());
|
result.append(item==null?0:item.getJudgePen());
|
||||||
}
|
}
|
||||||
|
SExpeditionHolyConfig con36 = expeditionManager.getEffectItems().get(HOLY_UNKNOWN);
|
||||||
|
if(con36 != null&&user.getExpeditionManager().getExpeditionLeve()>2){
|
||||||
|
if(result.length()>0){
|
||||||
|
result.append("|");
|
||||||
|
}
|
||||||
|
result.append(con36.getPassiveSkillId()).append("#");
|
||||||
|
ExpeditionItem item = expeditionManager.getExpeditionItem(con36.getId());
|
||||||
|
result.append(item==null?0:(item.isThirdFloorFighted()?1:0));
|
||||||
|
}
|
||||||
SExpeditionHolyConfig con37 = expeditionManager.getEffectItems().get(HOLY_QUALITY);
|
SExpeditionHolyConfig con37 = expeditionManager.getEffectItems().get(HOLY_QUALITY);
|
||||||
if(con37 != null){
|
if(con37 != null){
|
||||||
if(result.length()>0){
|
if(result.length()>0){
|
||||||
|
|
|
@ -1265,7 +1265,7 @@ public class HeroLogic{
|
||||||
// 聚合:根据openlevel倒叙排序,输出成list
|
// 聚合:根据openlevel倒叙排序,输出成list
|
||||||
List<SCHeroRankUpConfig> collect = rankUpConfigs.stream().sorted(Comparator.comparing(SCHeroRankUpConfig::getOpenLevel).reversed()).collect(Collectors.toList());
|
List<SCHeroRankUpConfig> collect = rankUpConfigs.stream().sorted(Comparator.comparing(SCHeroRankUpConfig::getOpenLevel).reversed()).collect(Collectors.toList());
|
||||||
for(SCHeroRankUpConfig scHeroRankUpConfig : collect){
|
for(SCHeroRankUpConfig scHeroRankUpConfig : collect){
|
||||||
if (heroLevel >= scHeroRankUpConfig.getOpenLevel()){
|
if (heroLevel >= scHeroRankUpConfig.getLimitLevel()){
|
||||||
return scHeroRankUpConfig.getId();
|
return scHeroRankUpConfig.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1306,7 +1306,7 @@ public class HeroLogic{
|
||||||
// 聚合:根据openlevel倒叙排序,输出成list
|
// 聚合:根据openlevel倒叙排序,输出成list
|
||||||
List<SCHeroRankUpConfig> collect = rankUpBreak.stream().sorted(Comparator.comparing(SCHeroRankUpConfig::getOpenLevel).reversed()).collect(Collectors.toList());
|
List<SCHeroRankUpConfig> collect = rankUpBreak.stream().sorted(Comparator.comparing(SCHeroRankUpConfig::getOpenLevel).reversed()).collect(Collectors.toList());
|
||||||
for(SCHeroRankUpConfig val : collect){
|
for(SCHeroRankUpConfig val : collect){
|
||||||
if (heroLevel >= val.getOpenLevel()){
|
if (heroLevel >= val.getLimitLevel()){
|
||||||
return val.getOpenStar()>10?10:val.getOpenStar();
|
return val.getOpenStar()>10?10:val.getOpenStar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue