Merge branch 'master_test'

back_recharge
lvxinran 2020-08-03 18:06:05 +08:00
commit 6895ec3444
16 changed files with 118 additions and 57 deletions

View File

@ -40,6 +40,7 @@ end
--被动技能表
local passivityList = {
--发动技能时,[a]的概率将[b]*[c]算作[d]计算
@ -1562,7 +1563,7 @@ local passivityList = {
-- buff.cover = true -- 可以叠加
-- buff.clear = false -- 不可驱散
-- role:AddBuff(buff)
if skill and not skill.isAdd and defRole:IsDead() then
if skill and not skill.isAdd and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then
role:AddRage(i1, CountTypeName.Add)
end
end
@ -1780,7 +1781,7 @@ local passivityList = {
local ct = args[3]
-- 释放技能后
local onRoleHit = function(defRole)
if defRole:IsDead() then
if defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then
local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct)
-- buff.cover = true
role:AddBuff(buff)
@ -1984,7 +1985,8 @@ local passivityList = {
local i1 = args[1]
-- 释放技能后
local onRoleHit = function(target)
if target:IsDead() and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false then
-- LogError("target "..target.roleId .. " ".. target.star)
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
for i = 1, i1 do
role:AddSkill(BattleSkillType.Normal, false, true, nil)
end
@ -2030,7 +2032,7 @@ local passivityList = {
local f1 = args[1]
-- 释放技能后
local onRoleHit = function(target)
if target:IsDead() then
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1))
BattleUtil.CalTreat(role, role, treat)
end
@ -2219,7 +2221,7 @@ local passivityList = {
local f1 = args[1]
-- 释放技能后
local onRoleHit = function(target)
if target:IsDead() then
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add)
role:AddBuff(buff)
end
@ -2374,7 +2376,7 @@ local passivityList = {
-- 击杀数量累加
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
if skill and defRole:IsDead() then
if skill and defRole:IsDead() and BattleUtil.CheckIsNoDead(defRole) then
killNum = killNum + 1
end
end
@ -2753,7 +2755,7 @@ local passivityList = {
local dot = args[1]
local f1 = args[2]
local function onHit(target)
if target:IsDead() then
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
local maxHp = role:GetRoleData(RoleDataName.MaxHp)
local value = floor(BattleUtil.ErrorCorrection(maxHp* f1))
BattleUtil.ApplyTreat(role, role, value)
@ -2888,7 +2890,7 @@ local passivityList = {
local i1 = args[1]
local onHit = function(target, damage, bCrit, finalDmg)
if target:IsDead() then
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
role:AddRage(i1, CountTypeName.Add)
end
end
@ -3209,7 +3211,7 @@ local passivityList = {
local dt = args[2]
-- 直接伤害后
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
if skill and not skill.isAdd and target:IsDead() then
if skill and not skill.isAdd and target:IsDead() and BattleUtil.CheckIsNoDead(target) then
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
BattleUtil.SortByHpFactor(list, 1)
local index = 0
@ -3483,7 +3485,7 @@ local passivityList = {
local f1 = args[1]
local onRoleHit = function(target)
if target:IsDead() then
if target:IsDead() and BattleUtil.CheckIsNoDead(target) then
local target = RoleManager.GetAliveAggro(role)
BattleUtil.CalDamage(nil, role, target, 1, f1)
end
@ -3767,7 +3769,7 @@ local passivityList = {
[197] = function(role, args)
local f1 = args[1]
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
if skill and skill.type == BattleSkillType.Special and target:IsDead() then
if skill and skill.type == BattleSkillType.Special and target:IsDead() and BattleUtil.CheckIsNoDead(target) then
BattleUtil.RandomAction(f1, function()
role:AddRage(target.Rage, CountTypeName.Add)
end)

View File

@ -1,6 +1,6 @@
BattleLogManager = {}
local this = BattleLogManager
local isLog = false
local isLog = true
local function pairsByKeys(t)
local a = {}
@ -72,9 +72,13 @@ function this.PrintBattleTable(tb)
return indent_str
end
--
function this.Init(fightdata)
function this.Init(fightdata, userdata)
this.timestamp = Random.GetSeed()
this.fightdata = fightdata
if userdata then
this.userId = userdata.uid
end
this.logList = {}
end
@ -104,17 +108,17 @@ function this.WriteFile()
local platform
-- linux
if not file then
file = io.open("../luafight/BattleRecord/log-"..time..".txt", "a")
file = io.open("../luafight/BattleRecord/log-"..(this.userId or time)..".txt", "a")
platform = "Linux"
end
-- local window server
if not file then
file = io.open("luafight/BattleRecord/log-"..time..".txt", "a")
file = io.open("luafight/BattleRecord/log-"..(this.userId or time)..".txt", "a")
platform = "Local Windows Server"
end
-- local
if not file then
file = io.open("BattleRecord/log-"..time..".txt", "a")
file = io.open("BattleRecord/log-"..(this.userId or time)..".txt", "a")
platform = "Local"
end

View File

@ -23,7 +23,7 @@ local _IsDebug
local fightData
local record
local optionRecord
local userData
--是否开启战斗日志
BattleLogic.IsOpenBattleRecord = false
@ -48,17 +48,13 @@ local rolePool = BattleObjectPool.New(function ()
return RoleLogic.New()
end)
function BattleLogic.Init(data, optionData, maxRound)
function BattleLogic.Init(data, _userData, maxRound)
if BattleLogic.IsOpenBattleRecord then
record = {}
end
fightData = data
if optionData then
optionRecord = optionData
else
optionRecord = {}
end
userData = _userData
BattleLogic.CurOrder = 0
BattleLogic.TotalOrder = #data.enemyData
@ -81,7 +77,7 @@ function BattleLogic.Init(data, optionData, maxRound)
SkillManager.Init()
OutDataManager.Init(fightData)
PassiveManager.Init()
BattleLogManager.Init(fightData)
BattleLogManager.Init(fightData, userData)
end
-- 检测先手阵营

View File

@ -341,6 +341,17 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy
return BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)
end
--检测是否有是金翅大鹏有不灭效果
function BattleUtil.CheckIsNoDead(target)
if target then
return target:IsAssignHeroAndHeroStar(10086,10)==false and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false
end
return false
end
function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageType, dotType)
if damage < 0 then damage = 0 end
local finalDmg = defRole.data:SubValue(RoleDataName.Hp, damage)

View File

@ -27,7 +27,7 @@ function RoleLogic:Init(uid, data, position)
self.uid = uid
self.position = position
self.roleData = data
self.roleId=data.roleId
self.data:Init(self, data.property)
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
self.isRealDead = self.isDead
@ -37,7 +37,7 @@ function RoleLogic:Init(uid, data, position)
self.element = data.element
self.professionId = data.professionId
self.star = data.star or 1
-- LogError("英雄uid".. self.roleId .." " .. self.star)
self.shield:Clear() --护盾列表
self.exCalDmgList:Clear() --额外计算伤害列表
self.buffFilter:Clear() --buff屏蔽列表
@ -219,8 +219,13 @@ function RoleLogic:RemovePropertyTransfer(index, tran)
end
end
-- 是否为指定id指定星级的英雄 by:王振兴 2020/07/29
function RoleLogic:IsAssignHeroAndHeroStar(id,star)
if self.roleId==id and self.star==star then
return true
end
return false
end
function RoleLogic:AddBuff(buff)

View File

@ -110,7 +110,7 @@ public class EndConfirmExpeditionBattleRequestHandler extends BaseHandler<Expedi
getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo);
}
LuaValue getOptionData = FightDataUtil.getOptionData("");
LuaValue getOptionData = FightDataUtil.getOptionData(uid+"");
int[] checkResult = CheckFight.getInstance().checkFight(seed, maxTime, getFightData, getOptionData, GameFightType.Expediton.getFightType());
int resultCode = checkResult[0];

View File

@ -102,7 +102,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo);
}
LuaValue getOptionData = FightDataUtil.getOptionData("");
LuaValue getOptionData = FightDataUtil.getOptionData(uid+"");
int[] checkResult = CheckFight.getInstance().checkFight(seed, maxTime, getFightData, getOptionData, GameFightType.Expediton.getFightType());
int resultCode = checkResult[0];

View File

@ -92,8 +92,8 @@ public class FamilyFeteRequestHandler extends BaseHandler<Family.FamilyFeteReque
user.getUserMissionManager().onGameEvent(user, GameEvent.GUILD_GIVE,1);
Map<Integer, SGuildLevelConfig> levelConfigMap = STableManager.getConfig(SGuildLevelConfig.class);
if (guildInfo.getExp() + addexp >= levelConfigMap.get(guildInfo.getLevel()).getExp()) {
guildInfo.updateLevel(guildInfo.getLevel() + 1);
guildInfo.updateExp(guildInfo.getExp() + addexp - levelConfigMap.get(guildInfo.getLevel()).getExp());
guildInfo.updateLevel(guildInfo.getLevel() + 1);
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_INFO, "", String.valueOf(guildInfo.getId()), new GuildCache(GameApplication.serverId, guildInfo.getIcon(), guildInfo.getLevel(), guildInfo.getName()));
} else {
guildInfo.updateExp(guildInfo.getExp() + addexp);

View File

@ -172,12 +172,12 @@ public class MapManager extends MongoBase {
}
public void addWalkCells(Set<Integer> walkCells) throws Exception {
updateString( "walkCells", walkCells);
if (this.walkCells == null) {
this.walkCells = walkCells;
} else {
this.walkCells.addAll(walkCells);
}
updateString( "walkCells", this.walkCells);
}
public int getTriggerXY() {

View File

@ -171,6 +171,9 @@ public class TowerMap extends AbstractMap {
return;
}
int floor = mapManager.getTrialInfo().getFloor();
if(floor>=101&&floor<=200){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
STrialConfig sTrialConfig;
if(floor>10000){
TreeMap<Integer,STrialConfig> sTrialConfigMap = (TreeMap<Integer,STrialConfig>) STrialConfig.sTrialConfigMap;
@ -272,7 +275,7 @@ public class TowerMap extends AbstractMap {
int i = 0;
int[] monster = MathUtils.randomFromWeightWithTaking(sTrialConfig.getMonsterPoint(),4);
while (cellMap4.size() < 4 ) {
if (i >= 10000) {
if (i >= 100) {
break;
}
int cellLength = scMap1.getGroups().length;
@ -284,13 +287,13 @@ public class TowerMap extends AbstractMap {
int y = scMap1.getGroups()[i][1];
int xy = CellUtil.xy2Pos(x, y);
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(monster[i]);
i++;
if (mapPointConfig == null) {
LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}", scMap1.getEvent());
LOGGER.info("====initTrialMap()====mapPointConfig == null======>{}",monster[i]);
continue;
}
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
cellMap4.put(xy, cellValue);
i++;
}
}
else {

View File

@ -0,0 +1,36 @@
package com.ljsd.jieling.kefu;
import com.ljsd.jieling.core.HandlerLogicThread;
import com.ljsd.jieling.network.server.ProtocolsManager;
//restart
public class Cmd_restart extends GmRoleAbstract{
@Override
public boolean exec(String[] args) throws Exception {
// User user = getUser();
// user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), user.getId(), User.class);
// if (user == null) {
// return false;
// }
// UserManager.addUser(user);
// HeroLogic.getInstance().calTeamTotalForce(user,1,true);
// BuyGoodsLogic.initOwernBagInfo(user);
if(args.length!=1){
return true;
}
String name = ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].getName();
LOGGER.error("Exception to change thread name"+ name);
System.out.println("name = " + name);
try {
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].interrupt();
}catch (Exception e){LOGGER.error(e.toString());}
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])]= new HandlerLogicThread();
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].setPriority(9);//优先级最高
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].setName("h-n" + Integer.valueOf(args[0]));
ProtocolsManager.handlerThreads[Integer.valueOf(args[0])].start();
LOGGER.error("Exception new change thread ok");
return true;
}
}

View File

@ -194,9 +194,9 @@ public class ChampionshipLogic {
// }
if(schedule==2){
if(fightTime!=0||realTimes!=1){
// if(fightTime!=0||realTimes!=1){
if(ChampionshipLogic.fightTime!=3) return;
}
// }
}
//胜利者积分排名
@ -1202,6 +1202,7 @@ public class ChampionshipLogic {
}
if (schedule == 1) { // 刚开始进入决赛,选拔出选手
scoreToRedis();
realTimes=1;
fightTime=0;
schedule = 2;

View File

@ -536,7 +536,7 @@ public class CombatLogic {
//设置战斗随机种子
int seed = (int)(System.currentTimeMillis()/1000);
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterGroupList);
LuaValue getOptionData = FightDataUtil.getOptionData("");
LuaValue getOptionData = FightDataUtil.getOptionData(uid+"");
FightInfoProto.AdventurenBossChallengeResponse.Builder builder = FightInfoProto.AdventurenBossChallengeResponse.newBuilder();
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(adventureBoss.getArenaId());
int totalHurt=0;

View File

@ -92,7 +92,7 @@ public class FightUtil {
int fightSeed =getFightSeed();
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = makeMonsterFightData(pveFightEvent.getMonsterGroupId(), pveFightEvent.getNums());
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterfightTeamInfos);
LuaValue getOptionData = FightDataUtil.getOptionData(fightEvent.getFrames());
LuaValue getOptionData = FightDataUtil.getOptionData(pveFightEvent.getAttackUid()+"");
int[] fightResult = CheckFight.getInstance().checkFight(fightSeed, fightEvent.getMostTime(), getFightData, getOptionData, fightEvent.getFightType().getFightType());
FightResult.Builder builder = FightResult.newBuilder();
@ -146,7 +146,7 @@ public class FightUtil {
}else {
getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo);
}
LuaValue getOptionData = FightDataUtil.getOptionData(fightEvent.getFrames());
LuaValue getOptionData = FightDataUtil.getOptionData(pvpFightEvent.getAttackUid()+"");
int[] fightResult = CheckFight.getInstance().checkFight(fightSeed, fightEvent.getMostTime(), getFightData, getOptionData, fightEvent.getFightType().getFightType());
FightResult.Builder builder = FightResult.newBuilder();
@ -184,7 +184,7 @@ public class FightUtil {
CommonProto.FightTeamInfo fightTeamInfo = builder.build();
List<CommonProto.FightTeamInfo> monsterTeamList = BehaviorUtil.getFightTeamInfos(valueMap);
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterTeamList);
LuaValue getOptionData = FightDataUtil.getOptionData(frames);
LuaValue getOptionData = FightDataUtil.getOptionData(playerId+"");
FightResult.Builder fightResult = FightResult.newBuilder();
int[] fightResultInfo = CheckFight.getInstance().checkFight(seed, fightTime, getFightData, getOptionData, fightType.getFightType());

View File

@ -20,20 +20,25 @@ public class FightDataUtil {
* @return
*/
public static LuaValue getOptionData(String data) {
if (data.equals("") || data==null){
return new LuaTable();
}
String[] tempData1 = data.split("\\|");
LuaValue tableA = new LuaTable();
for (int i = 0; i < tempData1.length; i++) {
String[] tempData2 = tempData1[i].split("#");
LuaValue tableB = new LuaTable();
for (int j = 0; j < tempData2.length; j++) {
tableB.rawset(j + 1, LuaValue.valueOf(Integer.parseInt(tempData2[j])));
}
tableA.rawset(i + 1, tableB);
}
return tableA;
LuaValue LuaTable = new LuaTable();
LuaTable.set("uid",data);
// LuaTable.set("enemyData", getEnemyData(monsterTeamList));
//
// if (data.equals("") || data==null){
// return new LuaTable();
// }
// String[] tempData1 = data.split("\\|");
// LuaValue tableA = new LuaTable();
// for (int i = 0; i < tempData1.length; i++) {
// String[] tempData2 = tempData1[i].split("#");
// LuaValue tableB = new LuaTable();
// for (int j = 0; j < tempData2.length; j++) {
// tableB.rawset(j + 1, LuaValue.valueOf(Integer.parseInt(tempData2[j])));
// }
// tableA.rawset(i + 1, tableB);
// }
return LuaTable;
}
public static LuaValue getFinalFightData(CommonProto.FightTeamInfo heroTeam, List<CommonProto.FightTeamInfo> monsterTeamList) {

View File

@ -5,8 +5,6 @@ include 'hotfix'
include 'common'
include 'test'
include 'test'
include 'matchserver'
include 'bloodybattle'
include 'tablemanager'
include 'fightmanager'
include 'gamecommon'