diff --git a/luafight/Modules/Battle/Logic/Base/Passivity.lua b/luafight/Modules/Battle/Logic/Base/Passivity.lua index 0860b251c..eb07f0012 100644 --- a/luafight/Modules/Battle/Logic/Base/Passivity.lua +++ b/luafight/Modules/Battle/Logic/Base/Passivity.lua @@ -1984,7 +1984,7 @@ local passivityList = { local i1 = args[1] -- 释放技能后 local onRoleHit = function(target) - if target:IsDead() then + if target:IsDead() and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false then for i = 1, i1 do role:AddSkill(BattleSkillType.Normal, false, true, nil) end @@ -4398,8 +4398,18 @@ local passivityList = { end, -- - [225] = function() + [225] = function(role, args) + --王振兴添加 + local f1 = args[1] + local pro1 = args[2] + local ct1 = args[3] + local maxNum = args[4] + -- 紫+橙 + local num = OutDataManager.GetOutData(role.camp, OutDataName.MisteryLiquidUsedTimes) + num = min(maxNum, num) + BattleUtil.AddProp(role, pro1, f1 * num, ct1) + end, -- 斩杀生命低于[a]的敌人 @@ -4656,6 +4666,7 @@ local passivityList = { -- 紫+橙 local num = OutDataManager.GetOutData(role.camp, OutDataName.MisteryLiquidUsedTimes) + num = min(maxNum, num) BattleUtil.AddProp(role, pro1, f1 * num, ct1) end, diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index fd90ae87c..df98bd70a 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -31,7 +31,7 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage) --type 0 异 self.owner = role self.isTeamSkill = isTeamSkill self.teamSkillType = isTeamSkill and floor(effectData[1] / 100) or 0 - self.id = effectData[1] -- 技能ID + self.id = effectData[1] -- 技能ID self.hitTime = effectData[2] -- 效果命中需要的时间 self.continueTime = effectData[3] -- 命中后伤害持续时间 self.attackCount = effectData[4] -- 伤害持续时间内伤害次数 @@ -43,7 +43,7 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage) --type 0 异 for i=5, #effectData do local v = effectData[i] local effectGroup = effectGroupPool:Get() -- chooseId, {effect1, effect2, ...} - effectGroup.chooseId = v[1] --chooseId + effectGroup.chooseId = v[1] -- chooseId for j=2, #v do -- effectList local effect = effectPool:Get() -- type, {args, ...} effect.type = v[j][1] @@ -73,33 +73,34 @@ function Skill:Dispose() end local function DoEffect(caster, target, eff, duration, skill) - local e = {type = 0, args = {}} + local e = {type = 0, args = {}} e.type = eff.type for i=1, #eff.args do e.args[i] = eff.args[i] - end + end - -- 检测被动技能对技能参数的影响 - local function _PassiveCheck(pe) - if pe then - e = pe - end - end - caster.Event:DispatchEvent(BattleEventName.SkillEffectBefore, skill, e, _PassiveCheck) - target.Event:DispatchEvent(BattleEventName.BeSkillEffectBefore, skill, e, _PassiveCheck) - - -- - if effect[e.type] then - effect[e.type](caster, target, e.args, duration, skill) - - BattleLogManager.Log( - "Take Effect", - "tcamp", target.camp, - "tpos", target.position, - "type", e.type - ) + -- 检测被动技能对技能参数的影响 + local function _PassiveCheck(pe) + if pe then + e = pe end end + caster.Event:DispatchEvent(BattleEventName.SkillEffectBefore, skill, e, _PassiveCheck) + target.Event:DispatchEvent(BattleEventName.BeSkillEffectBefore, skill, e, _PassiveCheck) + + -- + if effect[e.type] then + effect[e.type](caster, target, e.args, duration, skill) + + BattleLogManager.Log( + "Take Effect", + "tcamp", target.camp, + "tpos", target.position, + "type", e.type + ) + end +end + function Skill:takeEffect(caster, target, effects, effectIndex, duration, skill) for k=1, #effects do -- 如果不是第一个效果对列的第一个效果则判断是否命中 @@ -162,7 +163,7 @@ function Skill:Cast(func) local chooseId = effectGroup.chooseId local arr = self.effectTargets[i] if arr and #arr > 0 then - --效果延迟1帧生效 + -- 效果延迟1帧生效 BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function() local effects = effectGroup.effects local weight = floor(chooseId % 10000 / 100) @@ -172,7 +173,7 @@ function Skill:Cast(func) end -- 全部同时生效 for j=1, count do - if arr[j] and not arr[j]:IsRealDead() then + if arr[j] and not arr[j]:IsRealDead() then -- 检测是否命中 if i == 1 then self.targetIsHit[arr[j]] = BattleUtil.CheckIsHit(self.owner, arr[j]) @@ -244,6 +245,7 @@ function Skill:GetMaxTargetNum() end return BattleUtil.GetMaxTargetNum(mainEffect.chooseId) end + -- 判断是否命中 function Skill:CheckTargetIsHit(role) return self.targetIsHit[role] @@ -261,4 +263,3 @@ function Skill:EndSkill() -- self.effectTargets = {} end - diff --git a/luafight/Modules/Battle/Logic/BattleLogic.lua b/luafight/Modules/Battle/Logic/BattleLogic.lua index bec28611f..abbbfe554 100644 --- a/luafight/Modules/Battle/Logic/BattleLogic.lua +++ b/luafight/Modules/Battle/Logic/BattleLogic.lua @@ -228,8 +228,11 @@ function BattleLogic.TurnRound(debugTurn) -- buff计算 BattleLogic.BuffMgr:TurnUpdate(1) -- 计算恢复血量 BattleLogic.BuffMgr:TurnUpdate(2) -- 计算持续伤害(除去流血) + -- 如果角色无法释放技能 - if not SkillRole:IsAvailable() then + if not SkillRole:IsAvailable() -- 角色不能释放技能 + or (SkillRole:IsDead() and not BattleLogic.BuffMgr:HasBuff(SkillRole,BuffName.NoDead)) --将死但没有不死buff + then BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血) BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数 diff --git a/luafight/Modules/Battle/Logic/Buff/Shield.lua b/luafight/Modules/Battle/Logic/Buff/Shield.lua index b26b15d00..e3cb675ce 100644 --- a/luafight/Modules/Battle/Logic/Buff/Shield.lua +++ b/luafight/Modules/Battle/Logic/Buff/Shield.lua @@ -26,7 +26,7 @@ function Shield:OnStart() self.target.buffFilter:Add(immune0) -- 清除所有负面buff BattleLogic.BuffMgr:ClearBuff(self.target, function (buff) - return buff.type == BuffName.Control or buff.type == BuffName.Dot + return buff.type == BuffName.Control or buff.type == BuffName.DOT end) end end diff --git a/luafight/Modules/Battle/Logic/Misc/BattleDefine.lua b/luafight/Modules/Battle/Logic/Misc/BattleDefine.lua index 65b7122ec..29f9dbe5c 100644 --- a/luafight/Modules/Battle/Logic/Misc/BattleDefine.lua +++ b/luafight/Modules/Battle/Logic/Misc/BattleDefine.lua @@ -52,6 +52,7 @@ BattleEventName = { HitMiss = indexAdd(), BeHitMiss = indexAdd(), + CritDamageReduceFactor = indexAdd(), -- 暴击伤害减免系数 SkillCast = indexAdd(), -- 技能攻击前 diff --git a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua index dec6fc17c..2e1657fde 100644 --- a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -394,7 +394,6 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i if atkRole.isTeam and not defRole:IsDead() then return BattleUtil.ApplyDamage(skill, atkRole, defRole, damageType), false end - -- 计算技能额外伤害系数加成 baseFactor = baseFactor or 1 local factorFunc = function(exFactor) baseFactor = baseFactor + exFactor end @@ -544,6 +543,9 @@ function BattleUtil.CheckIsHit(atkRole, defRole) return isHit end + + + function BattleUtil.RandomAction(rand, action) if Random.Range01() <= rand and action then action() diff --git a/serverlogic/src/main/java/com/ljsd/jieling/core/function/ChampionFunction.java b/serverlogic/src/main/java/com/ljsd/jieling/core/function/ChampionFunction.java index bc6fe8491..ce0beb289 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/core/function/ChampionFunction.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/core/function/ChampionFunction.java @@ -6,10 +6,14 @@ import com.ljsd.jieling.logic.activity.event.FunctionRefreshEvent; import com.ljsd.jieling.logic.activity.event.Poster; import com.ljsd.jieling.logic.championship.ChampionshipLogic; import com.ljsd.jieling.logic.dao.TimeControllerOfFunction; +import util.TimeUtils; public class ChampionFunction implements FunctionManager { @Override public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception { + if(TimeUtils.now() - timeControllerOfFunction.getStartTime()>1000*60*3 ){ + return; + } ChampionshipLogic.start(); Poster.getPoster().dispatchEvent(new FunctionRefreshEvent(FunctionIdEnum.Arena.getFunctionType(),-1)); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/GameGM/GMRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/GameGM/GMRequestHandler.java index 023dea487..88e2a9733 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/GameGM/GMRequestHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/GameGM/GMRequestHandler.java @@ -1,6 +1,8 @@ package com.ljsd.jieling.handler.GameGM; import com.ljsd.GameApplication; +import com.ljsd.GmService; +import com.ljsd.jieling.chat.logic.ChatLogic; import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig; import com.ljsd.jieling.config.clazzStaticCfg.HeroStaticConfig; import com.ljsd.jieling.core.GlobalsDef; @@ -35,7 +37,10 @@ import org.springframework.stereotype.Component; import util.StringUtil; import util.TimeUtils; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.PrintWriter; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.ConcurrentHashMap; @@ -56,13 +61,26 @@ public class GMRequestHandler extends BaseHandler{ byte[] message = netData.parseClientProtoNetData(); CommonProto.GMCommand gmCommand = CommonProto.GMCommand.parseFrom(message); String command = gmCommand.getCommand(); - LOGGER.info("gm commond is {}",command); + int uid = iSession.getUid(); + LOGGER.error("gm commond is {}",command); + if(command.startsWith("//")){ + PrintWriter printWriter = new PrintWriter(new FileOutputStream( new File(SysUtil.getPath("conf/check_fight" + uid + ".txt")))); + printWriter.print(command); + printWriter.flush(); + printWriter.close(); + CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder(); + MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true); + return; + } + if(!GameApplication.serverProperties.isDebug()){ + CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder(); + MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true); + } if (!command.contains("#") || command.split("#").length < 3) { LOGGER.error("wrong command :" + command); return; } String[] commandArray = command.split("#"); - int uid = iSession.getUid(); int gmCommandType = Integer.parseInt(commandArray[0]);// 1:道具(type#数量) 2: 卡牌 int prarm1 = 0, prarm2 = 0; String prarm3 = ""; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampinGetHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampinGetHandler.java index 433cd74d9..7d84bdcc4 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampinGetHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampinGetHandler.java @@ -1,20 +1,24 @@ package com.ljsd.jieling.handler.champion; import com.google.gson.Gson; +import com.ljsd.jieling.core.GlobalsDef; import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.handler.BaseHandler; import com.ljsd.jieling.logic.championship.ChampionshipLogic; -import com.ljsd.jieling.logic.dao.ArenaRecord; -import com.ljsd.jieling.logic.dao.UserManager; +import com.ljsd.jieling.logic.dao.*; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.player.PlayerLogic; import com.ljsd.jieling.netty.cocdex.PacketNetData; import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.protocols.ArenaInfoProto; import com.ljsd.jieling.protocols.CommonProto; import com.ljsd.jieling.protocols.MessageTypeProto; import com.ljsd.jieling.util.MessageUtil; +import config.SArenaRobotConfig; import java.util.List; +import java.util.Map; /** * * 告知前端基本信息 @@ -129,12 +133,89 @@ public class ChampinGetHandler extends BaseHandler { } - - builder.setProcess(state); + + SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(arenaRecord.getAttackId()); + if (sArenaRobotConfig != null) { + builder1.setMyInfo( PlayerLogic.getInstance().getRobotTeamInfo(sArenaRobotConfig)) ; + }else { + ChampionshipLogic.MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(arenaRecord.getAttackId()), ChampionshipLogic.MemberInfo.class); + FamilyFightInfo fightInfo = memberInfo.getFightInfo(); + if(fightInfo == null){ + builder1.setMyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getAttackId(), GlobalsDef.CHAMPION_TEAM)); + }else { + //fix 整个过程都不能调整编队 + + User user = UserManager.getUser(arenaRecord.getAttackId()); + PlayerManager playerManager = user.getPlayerInfoManager(); + CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder() + .setHead(playerManager.getHead()) + .setHeadFrame(playerManager.getHeadFrame()) + .setLevel(playerManager.getLevel()) + .setName(playerManager.getNickName()).setUid(arenaRecord.getAttackId()); + CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder(); + teamInfo.setTotalForce(fightInfo.getForce()); + if (!fightInfo.getPokenmonIds().isEmpty()) { + teamInfo.addAllPokemonInfos(fightInfo.getPokenmonIds()); + } + + // int i = 1; + for (Map.Entry entry : fightInfo.getHeroAttribute().entrySet()) { + FamilyHeroInfo familyHeroInfo = entry.getValue(); + teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder() + .setHeroid(entry.getKey()) + .setHeroTid(familyHeroInfo.getTempleteId()) + .setStar(familyHeroInfo.getStar()) + .setLevel(familyHeroInfo.getLevel()) + .setPosition(familyHeroInfo.getPosition()) + .build() + ); + } + oneInfo.setTeam(teamInfo); + builder1.setMyInfo(oneInfo); + } + } + + sArenaRobotConfig= SArenaRobotConfig.getsArenaRobotConfigById(arenaRecord.getDefUid()); + if (sArenaRobotConfig != null) { + builder1.setEnemyInfo( PlayerLogic.getInstance().getRobotTeamInfo(sArenaRobotConfig)) ; + }else { + ChampionshipLogic.MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(arenaRecord.getDefUid()), ChampionshipLogic.MemberInfo.class); + FamilyFightInfo fightInfo = memberInfo.getFightInfo(); + if(fightInfo == null){ + builder1.setEnemyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getDefUid(), GlobalsDef.CHAMPION_TEAM)); + }else { + //fix 整个过程都不能调整编队 + + User user = UserManager.getUser(arenaRecord.getDefUid()); + PlayerManager playerManager = user.getPlayerInfoManager(); + CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder() + .setHead(playerManager.getHead()) + .setHeadFrame(playerManager.getHeadFrame()) + .setLevel(playerManager.getLevel()) + .setName(playerManager.getNickName()).setUid(arenaRecord.getDefUid()); + CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder(); + teamInfo.setTotalForce(fightInfo.getForce()); + if (!fightInfo.getPokenmonIds().isEmpty()) { + teamInfo.addAllPokemonInfos(fightInfo.getPokenmonIds()); + } + + // int i = 1; + for (Map.Entry entry : fightInfo.getHeroAttribute().entrySet()) { + FamilyHeroInfo familyHeroInfo = entry.getValue(); + teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder() + .setHeroid(entry.getKey()) + .setHeroTid(familyHeroInfo.getTempleteId()) + .setStar(familyHeroInfo.getStar()) + .setLevel(familyHeroInfo.getLevel()) + .setPosition(familyHeroInfo.getPosition()) + .build() + ); + } + oneInfo.setTeam(teamInfo); + builder1.setEnemyInfo(oneInfo); + }} builder.setChampionBattleInfo(builder1 - .setMyInfo(ChampionshipLogic.getChampionBattleInfo(attackId)) - .setEnemyInfo(ChampionshipLogic.getChampionBattleInfo(enemyId)) .setResult(fightResult) .build()); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampionBetInfoHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampionBetInfoHandler.java index 5e221caae..8c2d50c5f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampionBetInfoHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/champion/ChampionBetInfoHandler.java @@ -1,17 +1,21 @@ package com.ljsd.jieling.handler.champion; +import com.ljsd.jieling.core.GlobalsDef; import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.exception.ErrorCode; import com.ljsd.jieling.exception.ErrorCodeException; import com.ljsd.jieling.handler.BaseHandler; import com.ljsd.jieling.logic.championship.ChampionshipLogic; -import com.ljsd.jieling.logic.dao.ArenaRecord; +import com.ljsd.jieling.logic.dao.*; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.player.PlayerLogic; import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.protocols.ArenaInfoProto; import com.ljsd.jieling.protocols.CommonProto; import com.ljsd.jieling.protocols.MessageTypeProto; import com.ljsd.jieling.util.MessageUtil; +import config.SArenaRobotConfig; import util.StringUtil; import java.util.List; @@ -41,18 +45,19 @@ public class ChampionBetInfoHandler extends BaseHandler entry : fightInfo.getHeroAttribute().entrySet()) { + FamilyHeroInfo familyHeroInfo = entry.getValue(); + teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder() + .setHeroid(entry.getKey()) + .setHeroTid(familyHeroInfo.getTempleteId()) + .setStar(familyHeroInfo.getStar()) + .setLevel(familyHeroInfo.getLevel()) + .setPosition(familyHeroInfo.getPosition()) + .build() + ); + } + oneInfo.setTeam(teamInfo); + builder1.setMyInfo(oneInfo); + } + } + sArenaRobotConfig= SArenaRobotConfig.getsArenaRobotConfigById(arenaRecord.getDefUid()); + if (sArenaRobotConfig != null) { + builder1.setEnemyInfo( PlayerLogic.getInstance().getRobotTeamInfo(sArenaRobotConfig)) ; + }else { + ChampionshipLogic.MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(arenaRecord.getDefUid()), ChampionshipLogic.MemberInfo.class); + FamilyFightInfo fightInfo = memberInfo.getFightInfo(); + if(fightInfo == null){ + builder1.setEnemyInfo( PlayerLogic.getInstance().getUserTeamOneInfo(arenaRecord.getDefUid(), GlobalsDef.CHAMPION_TEAM)); + }else { + //fix 整个过程都不能调整编队 + User user = UserManager.getUser(arenaRecord.getDefUid()); + PlayerManager playerManager = user.getPlayerInfoManager(); + CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder() + .setHead(playerManager.getHead()) + .setHeadFrame(playerManager.getHeadFrame()) + .setLevel(playerManager.getLevel()) + .setName(playerManager.getNickName()).setUid(arenaRecord.getDefUid()); + CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder(); + teamInfo.setTotalForce(fightInfo.getForce()); + if (!fightInfo.getPokenmonIds().isEmpty()) { + teamInfo.addAllPokemonInfos(fightInfo.getPokenmonIds()); + } + + // int i = 1; + for (Map.Entry entry : fightInfo.getHeroAttribute().entrySet()) { + FamilyHeroInfo familyHeroInfo = entry.getValue(); + teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder() + .setHeroid(entry.getKey()) + .setHeroTid(familyHeroInfo.getTempleteId()) + .setStar(familyHeroInfo.getStar()) + .setLevel(familyHeroInfo.getLevel()) + .setPosition(familyHeroInfo.getPosition()) + .build() + ); + } + oneInfo.setTeam(teamInfo); + builder1.setEnemyInfo(oneInfo); + } + } + builder1.setResult(fightResult); + if(thisRecord!=null&&thisRecord.getFightData()!=null){ + CommonProto.FightData fightDataProto = CommonProto.FightData.parseFrom(thisRecord.getFightData()); + builder1.setFightData(fightDataProto); + } builder.setProcess(state); builder.setChampionBattleInfo(builder1 .build()); builder.setWinUid(myGuessID); builder.setMyBetCoins(mineBetCoins); + + + + } } MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHAMPION_BET_INFO_RESPONSE_VALUE,builder.build(),true); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java index 13ce739e3..42a371422 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java @@ -481,7 +481,11 @@ public class ChampionshipLogic { public static CommonProto.TeamOneInfo.Builder getChampionBattleInfo(int uid) throws Exception { SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(uid); if (sArenaRobotConfig != null) { - return PlayerLogic.getInstance().getRobotTeamInfo(sArenaRobotConfig); + return CommonProto.TeamOneInfo.newBuilder() + .setLevel(sArenaRobotConfig.getRobotLevel()) + .setName(sArenaRobotConfig.getRobotName()) + .setUid(sArenaRobotConfig.getId()); + // return PlayerLogic.getInstance().getRobotTeamInfo(sArenaRobotConfig); } MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(uid), MemberInfo.class); FamilyFightInfo fightInfo = memberInfo.getFightInfo(); @@ -497,25 +501,25 @@ public class ChampionshipLogic { .setHeadFrame(playerManager.getHeadFrame()) .setLevel(playerManager.getLevel()) .setName(playerManager.getNickName()).setUid(uid); - CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder(); - teamInfo.setTotalForce(fightInfo.getForce()); - if (!fightInfo.getPokenmonIds().isEmpty()) { - teamInfo.addAllPokemonInfos(fightInfo.getPokenmonIds()); - } - -// int i = 1; - for (Map.Entry entry : fightInfo.getHeroAttribute().entrySet()) { - FamilyHeroInfo familyHeroInfo = entry.getValue(); - teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder() - .setHeroid(entry.getKey()) - .setHeroTid(familyHeroInfo.getTempleteId()) - .setStar(familyHeroInfo.getStar()) - .setLevel(familyHeroInfo.getLevel()) - .setPosition(familyHeroInfo.getPosition()) - .build() - ); - } - oneInfo.setTeam(teamInfo); +// CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder(); +// teamInfo.setTotalForce(fightInfo.getForce()); +// if (!fightInfo.getPokenmonIds().isEmpty()) { +// teamInfo.addAllPokemonInfos(fightInfo.getPokenmonIds()); +// } +// +//// int i = 1; +// for (Map.Entry entry : fightInfo.getHeroAttribute().entrySet()) { +// FamilyHeroInfo familyHeroInfo = entry.getValue(); +// teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder() +// .setHeroid(entry.getKey()) +// .setHeroTid(familyHeroInfo.getTempleteId()) +// .setStar(familyHeroInfo.getStar()) +// .setLevel(familyHeroInfo.getLevel()) +// .setPosition(familyHeroInfo.getPosition()) +// .build() +// ); +// } +// oneInfo.setTeam(teamInfo); return oneInfo; } @@ -869,6 +873,7 @@ public class ChampionshipLogic { arenaRecord.setAttackId(attackUid); arenaRecord.setDefUid(defUid); arenaRecord.setType(type); + arenaRecord.setTurn(ChampionshipLogic.fightTime); arenaRecord.setRoundTims(roundTimes); arenaRecordMap.put(arenaRecord.getId(), arenaRecord); } @@ -1139,11 +1144,15 @@ public class ChampionshipLogic { public static void minuteCheck(boolean isServerStart) throws Exception { TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.TopBattle); + if (null == timeControllerOfFunction) { progress = -1; return; } - + Map joinMembers = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_JOIN, "", Integer.class, MemberInfo.class); + if(joinMembers.size()==0){ + return; + } if(progress == -2){ return; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java index 012d0e05b..892feb14b 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/PlayerManager.java @@ -701,7 +701,7 @@ public class PlayerManager extends MongoBase { public void setMaxforceHero(String maxforceHero) { this.maxforceHero = maxforceHero; - updateString("maxforceHero",maxforceHero); + updateString("maxforceHero",this.maxforceHero); } public Set getProudInfo() { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java index c0ac6dc10..2cc9726f1 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/FightDataUtil.java @@ -134,6 +134,9 @@ public class FightDataUtil { LuaValue detail = new LuaTable(); int passivityId = Integer.parseInt(unitSkill[i]); SPassiveSkillLogicConfig sPassiveSkillLogicConfig = SPassiveSkillLogicConfig.getConfig(passivityId); + if(sPassiveSkillLogicConfig.getEffectiveRange()!=1){ + continue; + } detail.rawset(1, LuaValue.valueOf(sPassiveSkillLogicConfig.getType())); List effectList = parseArraayToLuaValues(sPassiveSkillLogicConfig.getValue()); int size = effectList.size(); diff --git a/tablemanager/src/main/java/config/SArenaSetting.java b/tablemanager/src/main/java/config/SArenaSetting.java index 1c117eaf6..a35b71859 100644 --- a/tablemanager/src/main/java/config/SArenaSetting.java +++ b/tablemanager/src/main/java/config/SArenaSetting.java @@ -3,6 +3,8 @@ package config; import manager.STableManager; import manager.Table; +import java.util.Map; + @Table(name ="ArenaSetting") public class SArenaSetting implements BaseConfig { @@ -18,6 +20,8 @@ public class SArenaSetting implements BaseConfig { private int battleFree; + private int[] cost; + private int item; private int[] price; @@ -26,14 +30,16 @@ public class SArenaSetting implements BaseConfig { private int pveNum; - private int[] cost; - private int mostTime; - private static SArenaSetting config; + private int battleWinReward; - - @Override + private int battleLoseReward; + + private static SArenaSetting config; + + + @Override public void init() throws Exception { config = STableManager.getConfig(SArenaSetting.class).get(1); } @@ -42,7 +48,8 @@ public class SArenaSetting implements BaseConfig { return config; } - public int getId() { + + public int getId() { return id; } @@ -66,6 +73,10 @@ public class SArenaSetting implements BaseConfig { return battleFree; } + public int[] getCost() { + return cost; + } + public int getItem() { return item; } @@ -82,11 +93,17 @@ public class SArenaSetting implements BaseConfig { return pveNum; } - public int[] getCost() { - return cost; - } - - public int getMostTime() { + public int getMostTime() { return mostTime; } + + public int getBattleWinReward() { + return battleWinReward; + } + + public int getBattleLoseReward() { + return battleLoseReward; + } + + } \ No newline at end of file