From e227cefbad0f06464fb767143e44f4566068b6da Mon Sep 17 00:00:00 2001 From: mashiyu Date: Fri, 22 Mar 2019 11:00:12 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luafight/Modules/Battle/Logic/BattleLogic.lua | 17 +++---- .../jieling/config/SSkillLogicConfig.java | 47 +++++++++++++++---- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/luafight/Modules/Battle/Logic/BattleLogic.lua b/luafight/Modules/Battle/Logic/BattleLogic.lua index 618a4d4fb..6c648309a 100644 --- a/luafight/Modules/Battle/Logic/BattleLogic.lua +++ b/luafight/Modules/Battle/Logic/BattleLogic.lua @@ -165,7 +165,6 @@ end function BattleLogic.AddRole(roleData) curUid = curUid + 1 local data = rolePool:Get() - --rolePool:Get(curUid, roleData) data:Init(curUid, roleData) objList:Add(curUid, data) BattleLogic.Event:DispatchEvent(BattleEventName.AddRole, data) @@ -310,24 +309,20 @@ function BattleLogic.BattleEnd(result) end function BattleLogic.Clear() - local index = 1 - while index <= objList.size do - BattleLogic.RemoveObj(objList.vList[index].uid) + while objList.size > 0 do + BattleLogic.RemoveObj(objList.vList[objList.size].uid) end - index = 1 - while index <= tbActionList.size do - actionPool:Put(tbActionList.buffer[index]) - tbActionList:Remove(index) + while tbActionList.size > 0 do + actionPool:Put(tbActionList.buffer[tbActionList.size]) + tbActionList:Remove(tbActionList.size) end end function BattleLogic.ClearOrder() local index = 1 - local count = objList.size - while index <= count do + while index <= objList.size do if objList.vList[index].camp == 1 then BattleLogic.RemoveObj(objList.vList[index].uid) - count = count - 1 else index = index + 1 end diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java index 0e2469e38..d0875544d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java @@ -14,18 +14,18 @@ import java.util.concurrent.CopyOnWriteArrayList; public class SSkillLogicConfig implements BaseConfig { public static Map sSkillLogicConfigMap; public static Map sSkillLogicVoMap; - private int id; + private int id; - private float[][] target; + private float[][] target; - private int[][] effect; + private int[][] effect; - private float[][] effectValue; + private float[][] effectValue; - private float cd; + private float cd; - - @Override + + @Override public void init() throws Exception { sSkillLogicConfigMap = STableManager.getConfig(SSkillLogicConfig.class); Map skillLogicVoMap = new ConcurrentHashMap<>(); @@ -57,6 +57,32 @@ public class SSkillLogicConfig implements BaseConfig { return effect; } + public int getEffectValueIndex (int[][] effectArr,int value){ + StringBuilder effectStr = new StringBuilder(); + for (int[] effects :effectArr){ + for (int eff :effects){ + if (effectStr.length() == 0){ + effectStr = new StringBuilder(String.valueOf(eff)); + }else{ + effectStr.append("#").append(eff); + } + } + } + int[] ints = StringUtil.parseFiledInt(effectStr.toString()); + Map map = new ConcurrentHashMap<>(); + for (int i =0 ; i < ints.length; i++){ + map.put(i,ints[i]); + } + int index = 0; + for (Map.Entry entry : map.entrySet()){ + if (entry.getValue() == value){ + index = entry.getKey(); + break; + } + } + return index; + } + public float[][] getEffectValue() { return effectValue; } @@ -76,7 +102,7 @@ public class SSkillLogicConfig implements BaseConfig { SkillTargetVo skillTargetVo = new SkillTargetVo(); skillTargetVo.setTargetId((int) targets[i][0]); skillTargetVo.setContinuedTime(targets[i][1]); - skillTargetVo.setEffectVale(getEffectVal(effect[i],effectValue,i)); + skillTargetVo.setEffectVale(getEffectVal(effect[i],effectValue,effect)); skillTargetVos.add(skillTargetVo); } SSkillLogicVo sSkillLogicVo = new SSkillLogicVo(); @@ -86,7 +112,7 @@ public class SSkillLogicConfig implements BaseConfig { return sSkillLogicVo; } - private float[][] getEffectVal(int[] effects, float[][] effectValues,int index) { + private float[][] getEffectVal(int[] effects, float[][] effectValues,int[][] effect) { StringBuilder effectInfo = new StringBuilder(); for (int i = 0; i < effects.length; i++) { if (effectInfo.length() == 0){ @@ -94,7 +120,8 @@ public class SSkillLogicConfig implements BaseConfig { }else { effectInfo.append("|").append(effects[i]); } - float[] effectValue = effectValues[i +index]; + int index = getEffectValueIndex(effect, effects[i]); + float[] effectValue = effectValues[index]; for (float effectVal : effectValue) { effectInfo.append("#").append(effectVal); } From 1dca447d0c2ca431c0633c6588e095e89223eeb2 Mon Sep 17 00:00:00 2001 From: jiahuiwen <1024696487@qq.com> Date: Fri, 22 Mar 2019 14:28:13 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E7=A9=BA=E6=8E=89=E8=90=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java index b8c0ab1e0..8d22a453a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java @@ -154,6 +154,9 @@ public class ItemUtil { Map equipMap,Map randomMap ,float dropRatio) { for (int i = 0 ; i < randomItemNum;i++){ int index = MathUtils.randomForStrArray(weightArr); + if (index == -1) { + continue; + } int id = Integer.parseInt(rewardArr[index]); SRewardItem sRewardItem = SRewardItem.getsDropMap().get(id); int itemNum = getItemNum(sRewardItem); From 6c70934842a20bec3b35976c4454983855b3cebc Mon Sep 17 00:00:00 2001 From: jiahuiwen <1024696487@qq.com> Date: Fri, 22 Mar 2019 14:29:22 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A1=A8=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/server/EventPointConfig.txt | 2 + conf/server/MissionEventsConfig.txt | 3 +- conf/server/OptionConfig.txt | 4 +- conf/server/RewardGroup.txt | 121 +++++++++--- conf/server/RewardItemConfig.txt | 291 ++++++++++++++++++++++++++++ 5 files changed, 391 insertions(+), 30 deletions(-) diff --git a/conf/server/EventPointConfig.txt b/conf/server/EventPointConfig.txt index 497fd47a1..23dce0285 100644 --- a/conf/server/EventPointConfig.txt +++ b/conf/server/EventPointConfig.txt @@ -32,6 +32,8 @@ int mut,int#int,1 100030 100032 100031 100033 100032 100034 +100033 100035 +100034 100036 101001 10101 101002 10102 101003 10110 diff --git a/conf/server/MissionEventsConfig.txt b/conf/server/MissionEventsConfig.txt index 4abd4702b..5ddd19a9c 100644 --- a/conf/server/MissionEventsConfig.txt +++ b/conf/server/MissionEventsConfig.txt @@ -1,6 +1,6 @@ Id Type MissionNum Reward int int int int -1 1 2 0 +1 1 2 2001 2 1 5 2001 3 1 6 2002 4 1 3 2003 @@ -10,3 +10,4 @@ int int int int 8 1 2 2007 9 1 1 2008 10 1 2 2009 +101 2 4 2002 diff --git a/conf/server/OptionConfig.txt b/conf/server/OptionConfig.txt index d69cd885e..fc61ee4a8 100644 --- a/conf/server/OptionConfig.txt +++ b/conf/server/OptionConfig.txt @@ -29,11 +29,13 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 100027 0 0 null null 1 100026 100028 0 0 null null 1 100027 100029 0 0 null null 1 100028 -100030 0 27 2 null 1 100029 +100030 0 27 2#101 null 1 100029 100031 0 19 1#100#20#29 null 4 null 100032 0 0 null null 1 null 100033 0 0 null null 1 null 100034 0 26 2 null 4 null +100035 0 0 null null 1 null +100036 0 26 101 null 4 null 101001 1 2 1503#1 1001#1101#1201#1301 4 null 101002 0 0 null null 4 null 101003 0 19 2#0 null 4 null diff --git a/conf/server/RewardGroup.txt b/conf/server/RewardGroup.txt index f5c1bb280..c8b52e8bd 100644 --- a/conf/server/RewardGroup.txt +++ b/conf/server/RewardGroup.txt @@ -5,11 +5,76 @@ int int mut,int#int,1 int int 103 1 50003#50013#50023 2 0 104 1 50004#50014#50024 2 0 105 1 50005#50015#50025 2 0 -111 1 100#101#102#103#104#105#106#107#108#109#110#111#112#113#114#115#116#117#118 2 0 -112 1 100#101#102#103#104#105#106#107#108#109#110#111#112#113#114#115#116#117#118 2 0 -113 1 100#101#102#103#104#105#106#107#108#109#110#111#112#113#114#115#116#117#118 2 0 -114 1 100#101#102#103#104#105#106#107#108#109#110#111#112#113#114#115#116#117#118 2 0 -115 1 100#101#102#103#104#105#106#107#108#109#110#111#112#113#114#115#116#117#118 2 0 +111 2 100#101#102#103#104#105#106#107#108#109#110#111#112#113#114#115#116#117#118 1 0 +112 2 101#102#103#104#105#106#107#108#109#110#111#112#113#114#115#116#117#118#51001#51002#51003#51004#51005#51006#51007#51008#51009#51010#51011#51012#51013#51014#51015#51016#51017#51018 1 0 +113 2 51019#51020#51021#51022#51023#51024#51025#51026#51027#51028#51029#51030#51031#51032#51033#51034#51035#51036#51037#51038#51039#51040#51041#51042#51043#51044#51045#51046#51047#51048#51049#51050#51051#51052#51053#51054#51055#51056#51057#51058#51059#51060#51061#51062#51063#51064#51065#51066#51067#51068#51069#51070#51071#51072 1 0 +114 2 51073#51074#51075#51076#51077#51078#51079#51080#51081#51082#51083#51084#51085#51086#51087#51088#51089#51090#51091#51092#51093#51094#51095#51096#51097#51098#51099#51100#51101#51102#51103#51104#51105#51106#51107#51108#51109#51110#51111#51112#51113#51114#51115#51116#51117#51118#51119#51120#51121#51122#51123#51124#51125#51126#51127#51128#51129#51130#51131#51132#51133#51134#51135#51136#51137#51138#51139#51140#51141#51142#51143#51144 1 0 +115 2 51145#51146#51147#51148#51149#51150#51151#51152#51153#51154#51155#51156#51157#51158#51159#51160#51161#51162#51163#51164#51165#51166#51167#51168#51169#51170#51171#51172#51173#51174#51175#51176#51177#51178#51179#51180#51181#51182#51183#51184#51185#51186#51187#51188#51189#51190#51191#51192#51193#51194#51195#51196#51197#51198#51199#51200#51201#51202#51203#51204#51205#51206#51207#51208#51209#51210#51211#51212#51213#51214#51215#51216 1 0 +501 2 20047#20048#20049#20050#20051#20052 1 0 +502 2 20036#20037#20039#20043 1 0 +503 2 20025#20038#20040#20041 1 0 +504 2 20029#20031#20032#20033 1 0 +505 2 20024#20030#20042#20045 1 0 +506 2 20026#20027#20028#20046 1 0 +507 2 20034#20035#20044 1 0 +508 2 20001#20007#20010#20021 1 0 +509 2 20006#20012#20016#20020 1 0 +510 2 20003#20005#20011#20013 1 0 +511 2 20002#20004#20019#20022 1 0 +512 2 20023#20024#20025#20026#20027#20028#20029#20030#20031#20032#20033#20034#20035#20036#20037#20038#20039#20040#20041#20042#20043#20044#20045#20046 1 0 +513 2 20001#20002#20003#20004#20005#20006#20007#20008#20009#20010#20011#20012#20013#20014#20015#20016#20017#20018#20019#20020#20021#20022 1 0 +701 1 20001 1 0 +702 1 20002 1 0 +703 1 20003 1 0 +704 1 20004 1 0 +705 1 20005 1 0 +706 1 20006 1 0 +707 1 20007 1 0 +708 1 20008 1 0 +709 1 20009 1 0 +710 1 20010 1 0 +711 1 20011 1 0 +712 1 20012 1 0 +713 1 20013 1 0 +714 1 20014 1 0 +715 1 20015 1 0 +716 1 20016 1 0 +717 1 20017 1 0 +718 1 20018 1 0 +719 1 20019 1 0 +720 1 20020 1 0 +721 1 20021 1 0 +722 1 20022 1 0 +723 1 20023 1 0 +724 1 20024 1 0 +725 1 20025 1 0 +726 1 20026 1 0 +727 1 20027 1 0 +728 1 20028 1 0 +729 1 20029 1 0 +730 1 20030 1 0 +731 1 20031 1 0 +732 1 20032 1 0 +733 1 20033 1 0 +734 1 20034 1 0 +735 1 20035 1 0 +736 1 20036 1 0 +737 1 20037 1 0 +738 1 20038 1 0 +739 1 20039 1 0 +740 1 20040 1 0 +741 1 20041 1 0 +742 1 20042 1 0 +743 1 20043 1 0 +744 1 20044 1 0 +745 1 20045 1 0 +746 1 20046 1 0 +747 1 20047 1 0 +748 1 20048 1 0 +749 1 20049 1 0 +750 1 20050 1 0 +751 1 20051 1 0 +752 1 20052 1 0 1001 1 10001 1 0 1002 1 10002 1 0 1003 1 10003 1 0 @@ -102,29 +167,29 @@ int int mut,int#int,1 int int 1321 2 100 1 0 1322 2 100 1 0 1323 2 100 1 0 -2001 1 6001#6005#6007#6008 4 0 -2002 1 6002#6006#6007#6008 4 0 -2003 1 6003#6005#6007#6008 4 0 -2004 1 6004#6006#6007#6008 4 0 -2005 1 6009#6014#6016#6017 4 0 -2006 1 6010#6015#6016#6017 4 0 -2007 1 6011#6014#6016#6017 4 0 -2008 1 6012#6015#6016#6017 4 0 -2009 1 6013#6014#6016#6017 4 0 -2010 1 6018#6023#6025#6026 4 0 -2011 1 6019#6024#6025#6026 4 0 -2012 1 6020#6023#6025#6026 4 0 -2013 1 6021#6024#6025#6026 4 0 -2014 1 6022#6023#6025#6026 4 0 -2015 1 6027#6032 4 0 -2016 1 6034#6035 4 0 -2017 1 6028#6033 4 0 -2018 1 6034#6035 4 0 -2019 1 6029#6032 4 0 -2020 1 6034#6035 4 0 -2021 1 6030#6033 4 0 -2022 1 6034#6035 4 0 -2023 1 6031#6032#6034#6035 4 0 +2001 1 6001#6005#6007#6008#6036 5 0 +2002 1 6002#6006#6007#6008#6037 5 0 +2003 1 6003#6005#6007#6008#6038 5 0 +2004 1 6004#6006#6007#6008#6039 5 0 +2005 1 6009#6014#6016#6017#6040 5 0 +2006 1 6010#6015#6016#6017#6041 5 0 +2007 1 6011#6014#6016#6017#6042 5 0 +2008 1 6012#6015#6016#6017#6043 5 0 +2009 1 6013#6014#6016#6017#6044 5 0 +2010 1 6018#6023#6025#6026#6045 5 0 +2011 1 6019#6024#6025#6026#6046 5 0 +2012 1 6020#6023#6025#6026#6047 5 0 +2013 1 6021#6024#6025#6026#6048 5 0 +2014 1 6022#6023#6025#6026#6049 5 0 +2015 1 6027#6032#6050 5 0 +2016 1 6034#6035#6051 5 0 +2017 1 6028#6033#6052 5 0 +2018 1 6034#6035#6053 5 0 +2019 1 6029#6032#6054 5 0 +2020 1 6034#6035#6055 5 0 +2021 1 6030#6033#6056 5 0 +2022 1 6034#6035#6057 5 0 +2023 1 6031#6032#6034#6035#6058 5 0 10001 1 1000#2000#103 3 0 10101 1 1000#2000 2 0 10102 1 1001#2001 2 0 diff --git a/conf/server/RewardItemConfig.txt b/conf/server/RewardItemConfig.txt index dd733fead..74f3524a8 100644 --- a/conf/server/RewardItemConfig.txt +++ b/conf/server/RewardItemConfig.txt @@ -248,6 +248,29 @@ int int int float int int 6033 3313 100 1.0 1 1 6034 3315 100 1.0 1 1 6035 3317 100 1.0 1 1 +6036 4 100 1.0 100 100 +6037 4 100 1.0 200 200 +6038 4 100 1.0 300 300 +6039 4 100 1.0 400 400 +6040 4 100 1.0 500 500 +6041 4 100 1.0 600 600 +6042 4 100 1.0 700 700 +6043 4 100 1.0 800 800 +6044 4 100 1.0 900 900 +6045 4 100 1.0 1000 1000 +6046 4 100 1.0 1200 1200 +6047 4 100 1.0 1400 1400 +6048 4 100 1.0 1600 1600 +6049 4 100 1.0 1800 1800 +6050 4 100 1.0 2000 2000 +6051 4 100 1.0 2200 2200 +6052 4 100 1.0 2400 2400 +6053 4 100 1.0 2600 2600 +6054 4 100 1.0 2800 2800 +6055 4 100 1.0 3000 3000 +6056 4 100 1.0 3200 3200 +6057 4 100 1.0 3400 3400 +6058 4 100 1.0 3600 3600 10001 1001 100 1.0 12 20 10002 1001 100 1.0 24 30 10003 1001 100 1.0 35 39 @@ -356,3 +379,271 @@ int int int float int int 50023 4 100 1.0 3 3 50024 4 100 1.0 5 5 50025 4 100 1.0 7 7 +51001 3101 33 1.0 1 1 +51002 3102 33 1.0 1 1 +51003 3103 33 1.0 1 1 +51004 3104 33 1.0 1 1 +51005 3105 33 1.0 1 1 +51006 3106 33 1.0 1 1 +51007 3107 33 1.0 1 1 +51008 3108 33 1.0 1 1 +51009 3109 33 1.0 1 1 +51010 3110 33 1.0 1 1 +51011 3111 33 1.0 1 1 +51012 3112 33 1.0 1 1 +51013 3113 33 1.0 1 1 +51014 3114 33 1.0 1 1 +51015 3115 33 1.0 1 1 +51016 3116 33 1.0 1 1 +51017 3117 33 1.0 1 1 +51018 3118 33 1.0 1 1 +51019 3001 200 1.0 1 1 +51020 3002 200 1.0 1 1 +51021 3003 200 1.0 1 1 +51022 3004 200 1.0 1 1 +51023 3005 200 1.0 1 1 +51024 3006 200 1.0 1 1 +51025 3007 200 1.0 1 1 +51026 3008 200 1.0 1 1 +51027 3009 200 1.0 1 1 +51028 3010 200 1.0 1 1 +51029 3011 200 1.0 1 1 +51030 3012 200 1.0 1 1 +51031 3013 200 1.0 1 1 +51032 3014 200 1.0 1 1 +51033 3015 200 1.0 1 1 +51034 3016 200 1.0 1 1 +51035 3017 200 1.0 1 1 +51036 3018 200 1.0 1 1 +51037 3101 300 1.0 1 1 +51038 3102 300 1.0 1 1 +51039 3103 300 1.0 1 1 +51040 3104 300 1.0 1 1 +51041 3105 300 1.0 1 1 +51042 3106 300 1.0 1 1 +51043 3107 300 1.0 1 1 +51044 3108 300 1.0 1 1 +51045 3109 300 1.0 1 1 +51046 3110 300 1.0 1 1 +51047 3111 300 1.0 1 1 +51048 3112 300 1.0 1 1 +51049 3113 300 1.0 1 1 +51050 3114 300 1.0 1 1 +51051 3115 300 1.0 1 1 +51052 3116 300 1.0 1 1 +51053 3117 300 1.0 1 1 +51054 3118 300 1.0 1 1 +51055 3201 1000 1.0 1 1 +51056 3202 1000 1.0 1 1 +51057 3203 1000 1.0 1 1 +51058 3204 1000 1.0 1 1 +51059 3205 1000 1.0 1 1 +51060 3206 1000 1.0 1 1 +51061 3207 1000 1.0 1 1 +51062 3208 1000 1.0 1 1 +51063 3209 1000 1.0 1 1 +51064 3210 1000 1.0 1 1 +51065 3211 1000 1.0 1 1 +51066 3212 1000 1.0 1 1 +51067 3213 1000 1.0 1 1 +51068 3214 1000 1.0 1 1 +51069 3215 1000 1.0 1 1 +51070 3216 1000 1.0 1 1 +51071 3217 1000 1.0 1 1 +51072 3218 1000 1.0 1 1 +51073 3001 800 1.0 1 1 +51074 3002 800 1.0 1 1 +51075 3003 800 1.0 1 1 +51076 3004 800 1.0 1 1 +51077 3005 800 1.0 1 1 +51078 3006 800 1.0 1 1 +51079 3007 800 1.0 1 1 +51080 3008 800 1.0 1 1 +51081 3009 800 1.0 1 1 +51082 3010 800 1.0 1 1 +51083 3011 800 1.0 1 1 +51084 3012 800 1.0 1 1 +51085 3013 800 1.0 1 1 +51086 3014 800 1.0 1 1 +51087 3015 800 1.0 1 1 +51088 3016 800 1.0 1 1 +51089 3017 800 1.0 1 1 +51090 3018 800 1.0 1 1 +51091 3101 1000 1.0 1 1 +51092 3102 1000 1.0 1 1 +51093 3103 1000 1.0 1 1 +51094 3104 1000 1.0 1 1 +51095 3105 1000 1.0 1 1 +51096 3106 1000 1.0 1 1 +51097 3107 1000 1.0 1 1 +51098 3108 1000 1.0 1 1 +51099 3109 1000 1.0 1 1 +51100 3110 1000 1.0 1 1 +51101 3111 1000 1.0 1 1 +51102 3112 1000 1.0 1 1 +51103 3113 1000 1.0 1 1 +51104 3114 1000 1.0 1 1 +51105 3115 1000 1.0 1 1 +51106 3116 1000 1.0 1 1 +51107 3117 1000 1.0 1 1 +51108 3118 1000 1.0 1 1 +51109 3201 2000 1.0 1 1 +51110 3202 2000 1.0 1 1 +51111 3203 2000 1.0 1 1 +51112 3204 2000 1.0 1 1 +51113 3205 2000 1.0 1 1 +51114 3206 2000 1.0 1 1 +51115 3207 2000 1.0 1 1 +51116 3208 2000 1.0 1 1 +51117 3209 2000 1.0 1 1 +51118 3210 2000 1.0 1 1 +51119 3211 2000 1.0 1 1 +51120 3212 2000 1.0 1 1 +51121 3213 2000 1.0 1 1 +51122 3214 2000 1.0 1 1 +51123 3215 2000 1.0 1 1 +51124 3216 2000 1.0 1 1 +51125 3217 2000 1.0 1 1 +51126 3218 2000 1.0 1 1 +51127 3301 200 1.0 1 1 +51128 3302 200 1.0 1 1 +51129 3303 200 1.0 1 1 +51130 3304 200 1.0 1 1 +51131 3305 200 1.0 1 1 +51132 3306 200 1.0 1 1 +51133 3307 200 1.0 1 1 +51134 3308 200 1.0 1 1 +51135 3309 200 1.0 1 1 +51136 3310 200 1.0 1 1 +51137 3311 200 1.0 1 1 +51138 3312 200 1.0 1 1 +51139 3313 200 1.0 1 1 +51140 3314 200 1.0 1 1 +51141 3315 200 1.0 1 1 +51142 3316 200 1.0 1 1 +51143 3317 200 1.0 1 1 +51144 3318 200 1.0 1 1 +51145 3001 600 1.0 1 1 +51146 3002 600 1.0 1 1 +51147 3003 600 1.0 1 1 +51148 3004 600 1.0 1 1 +51149 3005 600 1.0 1 1 +51150 3006 600 1.0 1 1 +51151 3007 600 1.0 1 1 +51152 3008 600 1.0 1 1 +51153 3009 600 1.0 1 1 +51154 3010 600 1.0 1 1 +51155 3011 600 1.0 1 1 +51156 3012 600 1.0 1 1 +51157 3013 600 1.0 1 1 +51158 3014 600 1.0 1 1 +51159 3015 600 1.0 1 1 +51160 3016 600 1.0 1 1 +51161 3017 600 1.0 1 1 +51162 3018 600 1.0 1 1 +51163 3101 600 1.0 1 1 +51164 3102 600 1.0 1 1 +51165 3103 600 1.0 1 1 +51166 3104 600 1.0 1 1 +51167 3105 600 1.0 1 1 +51168 3106 600 1.0 1 1 +51169 3107 600 1.0 1 1 +51170 3108 600 1.0 1 1 +51171 3109 600 1.0 1 1 +51172 3110 600 1.0 1 1 +51173 3111 600 1.0 1 1 +51174 3112 600 1.0 1 1 +51175 3113 600 1.0 1 1 +51176 3114 600 1.0 1 1 +51177 3115 600 1.0 1 1 +51178 3116 600 1.0 1 1 +51179 3117 600 1.0 1 1 +51180 3118 600 1.0 1 1 +51181 3201 400 1.0 1 1 +51182 3202 400 1.0 1 1 +51183 3203 400 1.0 1 1 +51184 3204 400 1.0 1 1 +51185 3205 400 1.0 1 1 +51186 3206 400 1.0 1 1 +51187 3207 400 1.0 1 1 +51188 3208 400 1.0 1 1 +51189 3209 400 1.0 1 1 +51190 3210 400 1.0 1 1 +51191 3211 400 1.0 1 1 +51192 3212 400 1.0 1 1 +51193 3213 400 1.0 1 1 +51194 3214 400 1.0 1 1 +51195 3215 400 1.0 1 1 +51196 3216 400 1.0 1 1 +51197 3217 400 1.0 1 1 +51198 3218 400 1.0 1 1 +51199 3301 200 1.0 1 1 +51200 3302 200 1.0 1 1 +51201 3303 200 1.0 1 1 +51202 3304 200 1.0 1 1 +51203 3305 200 1.0 1 1 +51204 3306 200 1.0 1 1 +51205 3307 200 1.0 1 1 +51206 3308 200 1.0 1 1 +51207 3309 200 1.0 1 1 +51208 3310 200 1.0 1 1 +51209 3311 200 1.0 1 1 +51210 3312 200 1.0 1 1 +51211 3313 200 1.0 1 1 +51212 3314 200 1.0 1 1 +51213 3315 200 1.0 1 1 +51214 3316 200 1.0 1 1 +51215 3317 200 1.0 1 1 +51216 3318 200 1.0 1 1 +20001 10001 100 1.0 1 1 +20002 10002 100 1.0 1 1 +20003 10003 100 1.0 1 1 +20004 10004 100 1.0 1 1 +20005 10005 100 1.0 1 1 +20006 10006 100 1.0 1 1 +20007 10007 100 1.0 1 1 +20008 10008 100 1.0 1 1 +20009 10009 100 1.0 1 1 +20010 10010 100 1.0 1 1 +20011 10011 100 1.0 1 1 +20012 10012 100 1.0 1 1 +20013 10013 100 1.0 1 1 +20014 10014 100 1.0 1 1 +20015 10015 100 1.0 1 1 +20016 10016 100 1.0 1 1 +20017 10017 100 1.0 1 1 +20018 10018 100 1.0 1 1 +20019 10019 100 1.0 1 1 +20020 10020 100 1.0 1 1 +20021 10021 100 1.0 1 1 +20022 10022 100 1.0 1 1 +20023 10023 100 1.0 1 1 +20024 10024 100 1.0 1 1 +20025 10025 100 1.0 1 1 +20026 10026 100 1.0 1 1 +20027 10027 100 1.0 1 1 +20028 10028 100 1.0 1 1 +20029 10029 100 1.0 1 1 +20030 10030 100 1.0 1 1 +20031 10031 100 1.0 1 1 +20032 10032 100 1.0 1 1 +20033 10033 100 1.0 1 1 +20034 10034 100 1.0 1 1 +20035 10035 100 1.0 1 1 +20036 10036 100 1.0 1 1 +20037 10037 100 1.0 1 1 +20038 10038 100 1.0 1 1 +20039 10039 100 1.0 1 1 +20040 10040 100 1.0 1 1 +20041 10041 100 1.0 1 1 +20042 10042 100 1.0 1 1 +20043 10043 100 1.0 1 1 +20044 10044 100 1.0 1 1 +20045 10045 100 1.0 1 1 +20046 10046 100 1.0 1 1 +20047 10047 100 1.0 1 1 +20048 10048 100 1.0 1 1 +20049 10049 100 1.0 1 1 +20050 10050 100 1.0 1 1 +20051 10051 100 1.0 1 1 +20052 10052 100 1.0 1 1 From 1793ddffd975cf3cc593cc69b782238ebcc76f13 Mon Sep 17 00:00:00 2001 From: mashiyu Date: Fri, 22 Mar 2019 15:00:06 +0800 Subject: [PATCH 04/16] test --- luafight/BattleMain.lua | 96 ++++++++++++++++--- luafight/Modules/Battle/Logic/Base/Buff.lua | 14 +-- luafight/Modules/Battle/Logic/Base/Effect.lua | 18 ++++ luafight/Modules/Battle/Logic/BattleLogic.lua | 12 +-- luafight/Modules/Battle/Logic/RoleLogic.lua | 20 +--- .../handler/map/behavior/BehaviorUtil.java | 3 +- .../ljsd/jieling/logic/fight/CheckFight.java | 1 + 7 files changed, 111 insertions(+), 53 deletions(-) diff --git a/luafight/BattleMain.lua b/luafight/BattleMain.lua index 7d2f3476d..5264cac1d 100644 --- a/luafight/BattleMain.lua +++ b/luafight/BattleMain.lua @@ -25,14 +25,62 @@ local Random = Random local _fightData local _optionData -function PrintTable(tb) +local function newPairs(tbl, func) + if func == nil then + return pairs(tbl) + end + + local ary = {} + local lastUsed = 0 + for key --[[, val--]] in pairs(tbl) do + if (lastUsed == 0) then + ary[1] = key + else + local done = false + for j=1,lastUsed do -- 进行插入排序 + if (func(key, ary[j]) == true) then + arrayInsert( ary, key, j ) + done = true + break + end + end + if (done == false) then + ary[lastUsed + 1] = key + end + end + lastUsed = lastUsed + 1 + end + + -- 定义并返回迭代器 + local i = 0 + local iter = function () + i = i + 1 + if ary[i] == nil then + return nil + else + return ary[i], tbl[ary[i]] + end + end + return iter +end + +local function PrintTable(tb) local indent_str = "{" - for k,v in pairs(tb) do - indent_str = string.format("%s%s=%s", indent_str, - type(k) == "number" and string.format("[%d]",k) or tostring(k), - type(v) == "table" and "" or tostring(v)..",") + for k=1, #tb do + local v = tb[k] if type(v) == "table" then indent_str = indent_str .. PrintTable(v) + else + indent_str = indent_str .. tostring(v).."," + end + end + for k,v in newPairs(tb) do + if type(k) ~= "number" then + if type(v) == "table" then + indent_str = string.format("%s%s=%s", indent_str, tostring(k), PrintTable(v)) + else + indent_str = string.format("%s%s=%s", indent_str, tostring(k), tostring(v)..",") + end end end indent_str = indent_str .. "}," @@ -48,17 +96,34 @@ local function error( err ) os.date("%H"), os.date("%M"), os.date("%S")) - local file = io.open("LogError/"..time..".txt", "a") - file:write("fightData:\n"..PrintTable(_fightData).."\n") - file:write("optionData:\n"..PrintTable(_optionData).."\n") + local file = io.open("luafight/LogError/"..time..".txt", "a") + --file:write("fightData:\n"..PrintTable(_fightData).."\n") + --file:write("optionData:\n"..PrintTable(_optionData).."\n") file:write("error:\n"..debug.traceback(err).."\n") io.close(file) end +local function generateRecordFile() + local time = string.format("%d-%d-%d-%d-%d-%d", + os.date("%Y"), + os.date("%m"), + os.date("%d"), + os.date("%H"), + os.date("%M"), + os.date("%S")) + local file = io.open("luafight/BattleRecord/"..time..".txt", "a") + local record = BattleLogic.GetRecord() + for i=1, #record do + file:write(record[i].."\n") + end + io.close(file) +end + function BattleMain.Execute(seed, fightData, optionData) _fightData = fightData _optionData = optionData + print(PrintTable(fightData)) --该开关用于输出战斗过程中的日志,用于验证前后端是否出现战斗不同步 BattleLogic.IsOpenBattleRecord = false @@ -86,18 +151,21 @@ function BattleMain.Execute(seed, fightData, optionData) resultList.result = BattleLogic.Result if BattleLogic.IsOpenBattleRecord then - BattleLogic.GenerateRecordFile() + generateRecordFile() end -- print ----------------------------------------- - --for i=1, #resultList do - -- print("hp:"..resultList[i]) - --end - --print("最终运行帧数:"..BattleLogic.CurFrame()) - --print("result:"..BattleLogic.Result) + for i=1, #resultList do + print("hp:"..resultList[i]) + end + print("最终运行帧数:"..BattleLogic.CurFrame()) + print("result:"..BattleLogic.Result) + return resultList end return { result = -1 } end +--BattleMain.Execute(1553167956, {enemyData={{{passivity={},skill={0,{20011,0.7,{1,1,1,},{3,0.3,1,3,},},},roleId=5,property={0,772,772,260,61,61,80,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,2,2,},type=2,professionId=0,quality=1,camp=1,},{passivity={},skill={0,{20011,0.7,{1,0.8,1,},{13,1,0.1,2,5,},},},roleId=3,property={0,772,772,260,61,61,240,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},type=2,professionId=0,quality=1,camp=1,},{passivity={},skill={0,{20011,0.7,{1,0.8,1,},{13,1,0.1,2,5,},},},roleId=3,property={0,772,772,260,61,61,7,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},type=2,professionId=0,quality=1,camp=1,},teamSkill={},},},playerData={{passivity={},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,10,0.2,4,1,},},},camp=0,roleId=10022,type=1,professionId=3,quality=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={3,{20000,0.7,{2,1.06,2,},{3,0.6,1,4,},},},skill={0,{40001,0.7,{11,0.93,2,2,0.2,},},},camp=0,roleId=10008,type=1,professionId=5,quality=0,property={1,2206,2208,221,193,232,130,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={2.5,{20000,0.7,{14,1.55,2,1,10023,0.2,},},},skill={0,{40001,0.7,{1,1.35,2,},},{30011,0.7,{3,0,0,5,},},},camp=0,roleId=10023,type=1,professionId=4,quality=0,property={1,1439,1441,284,131,157,168,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={2.3,{20312,0.7,{19,1.35,1,0.5,5,},},},skill={0,{40001,0.7,{1,1,1,},},{30011,0.7,{4,9,0.1,5,1,},{4,10,0.1,5,1,},},},camp=0,roleId=10013,type=1,professionId=1,quality=0,property={1,1678,1680,246,194,162,163,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,10,0.2,4,1,},},},camp=0,roleId=10022,type=1,professionId=3,quality=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},teamSkill={{3,{20012,0.7,{26,600,},{27,100,4,},},{10014,0.7,{25,2,0.1,4,},},},},},}) +BattleMain.Execute(1553167956, {playerData={{professionId=4,passivity={},type=1,skill={0,{40001,0.7,{1,1.35,2,},},{30011,0.7,{3,0,0,5,},},},superSkill={2.5,{20000,0.7,{14,1.55,2,1,10023,0.2,},},},roleId=10023,camp=0,property={1,1439,1441,284,131,157,168,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=3,passivity={},type=1,skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,9,0.2,4,1,},},},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},roleId=10022,camp=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=2,passivity={},type=1,skill={0,{40001,0.7,{1,1.05,2,},{4,4,5,5,3,},},},superSkill={2.3,{20000,0.7,{2,1.89,2,},},{20012,0.7,{3,1,5,5,},},},roleId=10021,camp=0,property={1,1920,1922,209,170,204,178,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=5,passivity={},type=1,skill={0,{40001,0.7,{11,0.93,2,2,0.2,},},},superSkill={3,{20000,0.7,{2,1.06,2,},{3,0.6,1,4,},},},roleId=10008,camp=0,property={1,2206,2208,221,193,232,130,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=1,passivity={},type=1,skill={0,{40001,0.7,{1,1,1,},},{30011,0.7,{4,9,0.1,5,1,},{4,9,0.1,5,1,},},},superSkill={2.3,{20312,0.7,{19,1.35,1,0.5,5,},},},roleId=10013,camp=0,property={1,1678,1680,246,194,162,163,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={{3,{20012,0.7,{26,600,},{27,100,4,},},{10014,0.7,{25,2,0.1,4,},},},},},enemyData={{{professionId=0,passivity={},type=2,skill={0,{20011,0.7,{1,1,1,},{3,0.3,1,3,},},},superSkill={},roleId=14,camp=1,property={0,772,772,260,61,61,80,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,2,2,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=1,camp=1,property={0,483,483,260,61,61,240,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=3,camp=1,property={0,483,483,260,61,61,7,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={},},},}) return BattleMain \ No newline at end of file diff --git a/luafight/Modules/Battle/Logic/Base/Buff.lua b/luafight/Modules/Battle/Logic/Base/Buff.lua index f8210d3c9..37d352664 100644 --- a/luafight/Modules/Battle/Logic/Base/Buff.lua +++ b/luafight/Modules/Battle/Logic/Base/Buff.lua @@ -42,30 +42,18 @@ function Buff.Create(caster, type, duration, ...) return buff end -local queuePool = BattleObjectPool.New(function () - return BattleQueue.New() -end) -local dicPool = BattleObjectPool.New(function () - return BattleDictionary.New() -end) BuffManager = {} BuffManager.__index = BuffManager function BuffManager.New() - local instance = {owner=0, buffQueue = queuePool:Get(), buffList = dicPool:Get()} + local instance = {owner=0, buffQueue = BattleQueue.New(), buffList = BattleDictionary.New()} setmetatable(instance, BuffManager) return instance end function BuffManager:Init(owner) - self.owner = owner -end - -function BuffManager:Dispose(owner) self.buffQueue:Clear() self.buffList:Clear() - queuePool:Put(self.buffQueue) - dicPool:Put(self.buffList) self.owner = owner end diff --git a/luafight/Modules/Battle/Logic/Base/Effect.lua b/luafight/Modules/Battle/Logic/Base/Effect.lua index d000992ee..867159bfb 100644 --- a/luafight/Modules/Battle/Logic/Base/Effect.lua +++ b/luafight/Modules/Battle/Logic/Base/Effect.lua @@ -486,6 +486,24 @@ local effectList = { target:AddBuff(Buff.Create(caster, BuffName.DOT, d2, 1, 0, d1, 1)) end) end, + --造成[a]%的[b]伤害,对[c]造成额外[d]%伤害 + --a[float],b[伤害类型,]c[持续伤害状态],d[float] + [28] = function(caster, target, args, interval) + local f1 = args[1] + local dt = args[2] + local dot = args[3] + local f2 = args[4] + caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval) + if caster.camp == 0 and target.camp == 1 then + BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval) + end + BattleLogic.WaitForTrigger(interval, function () + if target.BuffMgr:HasBuff(BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then + f1 = f1 + f2 + end + BattleUtil.CalDamage(caster, target, dt, f1) + end) + end, } return effectList \ No newline at end of file diff --git a/luafight/Modules/Battle/Logic/BattleLogic.lua b/luafight/Modules/Battle/Logic/BattleLogic.lua index 6c648309a..f88ec7ed4 100644 --- a/luafight/Modules/Battle/Logic/BattleLogic.lua +++ b/luafight/Modules/Battle/Logic/BattleLogic.lua @@ -1,10 +1,10 @@ BattleLogic = {} local floor = math.floor +local min = math.min +local max = math.min local objList = BattleDictionary.New() -local skillList - local curUid local curBuffId local curFrame @@ -74,8 +74,6 @@ function BattleLogic.Init(data, optionData) BattleLogic.Clear() - skillList = {} - curUid = 0 curBuffId = 0 curFrame = 0 @@ -147,9 +145,9 @@ end function BattleLogic.AddMP(camp, mp) if camp == 0 then - playerMP = math.min(playerMP + mp, 100) + playerMP = min(playerMP + mp, 100) else - enemyMP = math.min(playerMP + mp, 100) + enemyMP = min(playerMP + mp, 100) end end @@ -190,7 +188,7 @@ function BattleLogic.SetAggro(role, duration) if playerAggroChangable then playerAggro = role if enemySkillUsable then - BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, role, math.max(duration/2, 0.3)) + BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, role, max(duration/2, 0.3)) end playerAggroChangable = false BattleLogic.WaitForTrigger(duration-BattleLogic.GameDeltaTime, function () --减去一帧避免卡点 diff --git a/luafight/Modules/Battle/Logic/RoleLogic.lua b/luafight/Modules/Battle/Logic/RoleLogic.lua index c63c26e88..ef549287f 100644 --- a/luafight/Modules/Battle/Logic/RoleLogic.lua +++ b/luafight/Modules/Battle/Logic/RoleLogic.lua @@ -11,19 +11,10 @@ local Passivity = require("Modules/Battle/Logic/Base/Passivity") local skillPool = BattleObjectPool.New(function () return Skill:New() end) -local buffPool = BattleObjectPool.New(function () - return BuffManager.New() -end) -local eventPool = BattleObjectPool.New(function () - return BattleEvent:New() -end) -local dataPool = BattleObjectPool.New(function () - return RoleData.New() -end) function RoleLogic.New() - local instance = {uid=0,roleData=0,data=0,camp=0,name=0,roleType=0,shield=BattleList.New(),exCalDmgList=BattleList.New(), - BuffMgr=0,Event=0,passiveList=0,isDead=false,Auto=false,IsDebug=false,enable=false} + local instance = {uid=0,roleData=0,data=RoleData.New(),camp=0,name=0,roleType=0,shield=BattleList.New(),exCalDmgList=BattleList.New(), + BuffMgr=BuffManager.New(),Event=BattleEvent:New(),passiveList=0,isDead=false,Auto=false,IsDebug=false,enable=false} setmetatable(instance, RoleLogic) return instance end @@ -32,7 +23,6 @@ function RoleLogic:Init(uid, data) self.uid = uid self.roleData = data - self.data = dataPool:Get() self.data:Init(self, data.property) self.camp = data.camp --阵营 0:我方 1:敌方 @@ -42,10 +32,7 @@ function RoleLogic:Init(uid, data) self.shield:Clear() --护盾列表 self.exCalDmgList:Clear() --额外计算伤害列表 - self.BuffMgr = buffPool:Get() self.BuffMgr:Init(self) - - self.Event = eventPool:Get() self.Event:ClearEvent() self.passiveList = {} @@ -84,9 +71,6 @@ function RoleLogic:AddBuff(buff) end function RoleLogic:Dispose() - eventPool:Put(self.Event) - dataPool:Put(self.data) - buffPool:Put(self.BuffMgr) if self.skill then self.skill:Dispose() skillPool:Put(self.skill) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java index 450bd4bad..33bc9fe60 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java @@ -132,7 +132,8 @@ public class BehaviorUtil { fightData.addAllMonsterList(monsterGroupList); //设置战斗随机种子 - int seed = (int)(System.currentTimeMillis()/1000); +// int seed = (int)(System.currentTimeMillis()/1000); + int seed = 1553167956; fightData.setFightSeed(seed); fightStartRespons.setFightData(fightData); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java index 09670f0c5..32c1548f5 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java @@ -68,6 +68,7 @@ public class CheckFight { /** * 单线程执行每次用时50ms,目前支持并发100以内,再大用线程池异步处理 + * http://www.luaj.org/luaj/3.0/examples/jse/SampleMultiThreaded.java * @param seed * @param fightData * @param optionData From 65f2bd569295d3b8025098193230568a589bf568 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Fri, 22 Mar 2019 16:16:12 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E5=A6=96=E7=81=B5=E5=B8=88=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/common/mogodb/MongoUpdateCache.java | 19 +- conf/server/AdventureConfig.txt | 12 +- conf/server/EventPointConfig.txt | 52 ++++- conf/server/MissionEventsConfig.txt | 4 +- conf/server/OptionConfig.txt | 98 +++++++--- conf/server/RewardItemConfig.txt | 2 +- conf/server/SkillLogicConfig.txt | 180 +++++++++--------- .../ljsd/jieling/config/SAdventureConfig.java | 31 +-- .../ljsd/jieling/config/SVipLevelConfig.java | 7 + .../ljsd/jieling/logic/fight/CombatLogic.java | 22 ++- .../ljsd/jieling/logic/hero/HeroLogic.java | 1 + 11 files changed, 265 insertions(+), 163 deletions(-) diff --git a/common/src/main/java/com/ljsd/common/mogodb/MongoUpdateCache.java b/common/src/main/java/com/ljsd/common/mogodb/MongoUpdateCache.java index 615b52e64..7a3048beb 100644 --- a/common/src/main/java/com/ljsd/common/mogodb/MongoUpdateCache.java +++ b/common/src/main/java/com/ljsd/common/mogodb/MongoUpdateCache.java @@ -35,11 +35,17 @@ public class MongoUpdateCache { Map.Entry entry = it.next(); String key1 = entry.getKey(); if(!fullKey.equals(key1)){ + //解决类似 item.1 item.11 问题 if (fullKey.contains(key1)) { - return; + if(checkOverride(key1,fullKey)){ + return; + } + continue; } if (key1.contains(fullKey)) { - it.remove(); + if(checkOverride(key1,fullKey)){ + it.remove(); + } } } @@ -49,6 +55,15 @@ public class MongoUpdateCache { listRequest.put(fullKey, request); } + public boolean checkOverride(String key1,String key2){ + String[] fullKeyArray = key1.split("."); + String[] key1Array = key2.split("."); + if(fullKeyArray.length == key1Array.length && !fullKeyArray[fullKeyArray.length -1].equals(key1Array[key1Array.length -1])){ + return false; + } + return true; + } + protected void update(LjsdMongoTemplate ljsdMongoTemplate) throws IllegalAccessException { diff --git a/conf/server/AdventureConfig.txt b/conf/server/AdventureConfig.txt index 73a907456..c06af043f 100644 --- a/conf/server/AdventureConfig.txt +++ b/conf/server/AdventureConfig.txt @@ -1,7 +1,7 @@ Id OpenLevel RecommendForce RecommendHeroIds MinNum BaseRewardGroup RandomRewardGroup RecommendRewardGroup -int int int mut,int#int,1 int mut,int#int,1 mut,int#int,1 mut,int#int,1 -1 101001 1000 3#1#2 5 101 1001#1002 2001#2002#2003 -2 102001 2000 3#1#2 5 102 1001#1002 2001#2002#2003 -3 102001 3000 3#1#2 5 103 1001#1002 2001#2002#2003 -4 102001 4000 3#1#2 5 104 1001#1002 2001#2002#2003 -5 102001 5000 3#1#2 5 105 1001#1002 2001#2002#2003 +int int int mut,int#int,1 int mut,int#int,1 mut,int#int,1 mut,int#int,2 +1 101001 1000 2#1#2 5 101 111 2001#2002#2003|2001#2002#2003 +2 102001 2000 2#1#2 5 102 112 2001#2002#2003|2001#2002#2003 +3 102001 3000 2#1#2 5 103 113 2001#2002#2003|2001#2002#2003 +4 102001 4000 2#1#2 5 104 114 2001#2002#2003|2001#2002#2003 +5 102001 5000 2#1#2 5 105 115 2001#2002#2003|2001#2002#2003 diff --git a/conf/server/EventPointConfig.txt b/conf/server/EventPointConfig.txt index 23dce0285..235bbad86 100644 --- a/conf/server/EventPointConfig.txt +++ b/conf/server/EventPointConfig.txt @@ -32,8 +32,6 @@ int mut,int#int,1 100030 100032 100031 100033 100032 100034 -100033 100035 -100034 100036 101001 10101 101002 10102 101003 10110 @@ -249,6 +247,10 @@ int mut,int#int,1 101213 101302 101214 101303 101215 101304 +101216 101305 +101217 101306 +101218 101307 +101219 101308 102001 10101 102002 10102 102003 10104 @@ -411,6 +413,7 @@ int mut,int#int,1 102160 102242#102243 102161 102244#102245 102162 102246 +102163 102247 103001 10301 103002 10303 103003 10305 @@ -535,6 +538,7 @@ int mut,int#int,1 103122 103179#103180 103123 103181#103182 103124 103183 +103125 103184 104001 10401 104002 10403 104003 10407 @@ -677,6 +681,22 @@ int mut,int#int,1 104139 104169#104170 104140 104171#104172 104141 104173 +104142 104174 +104143 104175 +104144 104176 +104145 104177 +104146 104178 +104147 104179 +104148 104180 +104149 104181 +104150 104182 +104151 104183 +104152 104184 +104153 104185 +104154 104186 +104155 104187 +104156 104188 +104157 104189 105001 10501 105002 10502 105003 10503 @@ -787,6 +807,27 @@ int mut,int#int,1 105108 105166#105167 105109 105168#105169 105110 105170 +105111 105171 +105112 105172 +105113 105173 +105114 105174 +105115 105175 +105116 105176 +105117 105177 +105118 105178 +105119 105179 +105120 105180 +105121 105181 +105122 105182 +105123 105183 +105124 105184 +105125 105185 +105126 105186 +105127 105187 +105128 105188 +105129 105189 +105130 105190 +105131 105191 106001 10601 106002 10602 106003 10604 @@ -871,6 +912,13 @@ int mut,int#int,1 106082 10603 106083 106119 106084 106120 +106085 106121 +106086 106122 +106087 106123 +106088 106124 +106089 106125 +106090 106126 +106091 106127 107001 null 107002 null 107003 null diff --git a/conf/server/MissionEventsConfig.txt b/conf/server/MissionEventsConfig.txt index 5ddd19a9c..1f2617333 100644 --- a/conf/server/MissionEventsConfig.txt +++ b/conf/server/MissionEventsConfig.txt @@ -5,8 +5,8 @@ int int int int 3 1 6 2002 4 1 3 2003 5 1 4 2004 -6 1 3 2005 -7 1 2 2006 +6 1 4 2005 +7 1 3 2006 8 1 2 2007 9 1 1 2008 10 1 2 2009 diff --git a/conf/server/OptionConfig.txt b/conf/server/OptionConfig.txt index fc61ee4a8..cf50afe5d 100644 --- a/conf/server/OptionConfig.txt +++ b/conf/server/OptionConfig.txt @@ -29,18 +29,16 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 100027 0 0 null null 1 100026 100028 0 0 null null 1 100027 100029 0 0 null null 1 100028 -100030 0 27 2#101 null 1 100029 +100030 0 27 2 null 1 100029 100031 0 19 1#100#20#29 null 4 null -100032 0 0 null null 1 null +100032 0 26 2 null 4 null 100033 0 0 null null 1 null -100034 0 26 2 null 4 null -100035 0 0 null null 1 null -100036 0 26 101 null 4 null +100034 0 26 101 null 4 null 101001 1 2 1503#1 1001#1101#1201#1301 4 null 101002 0 0 null null 4 null -101003 0 19 2#0 null 4 null +101003 0 0 null null 5 102111 101004 0 0 null null 4 null -101005 0 0 null null 5 101007 +101005 0 27 101 null 5 101007 101006 0 0 null null 4 null 101007 0 0 null null 5 101008 101008 0 1 10101 null 1 101009 @@ -172,7 +170,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 0 0 0 null null 0 null 0 0 0 null null 0 null 101136 0 0 null null 1 101099 -101137 0 27 3 null 1 101100 +101137 0 0 null null 1 101100 101138 0 9 2 null 4 null 101139 0 0 null null 0 null 101140 0 0 null null 0 null @@ -339,7 +337,11 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 101301 0 0 null null 1 101213 101302 0 0 null null 4 null 101303 0 0 null null 1 null -101304 0 26 3 null 4 null +101304 0 0 null null 1 null +101305 0 0 null null 1 null +101306 0 0 null null 1 null +101307 0 0 null null 1 null +101308 0 26 3 null 4 null 102001 1 2 1503#1 1002#1102#1202#1302 4 null 102002 0 0 null null 4 null 102003 1 2 1503#1 1002#1102#1202#1302 4 null @@ -359,9 +361,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102017 0 0 null 10102 4 null 102018 0 0 null 10102 4 null 102019 0 0 null 10102 4 null -102020 0 5 0 null 4 null +102020 0 19 3#0 null 5 null 102021 0 0 null null 4 null -102022 0 19 3#103#19#2 null 4 null +102022 0 5 103#19#2 null 4 null 102023 0 0 null null 4 null 102024 6 14 3|1503#1 null 1 102016 102025 0 0 null null 4 null @@ -494,7 +496,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102152 0 0 null null 1 102102 102153 0 0 null null 1 102103 102154 0 0 null null 1 102104 -102155 0 0 null null 1 102105 +102155 0 27 4 null 1 102105 102156 0 9 3 null 4 null 102157 0 0 null null 4 null 102158 0 0 null null 4 null @@ -506,8 +508,8 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102164 0 0 null null 1 102113 102165 0 0 null null 1 102114 102166 0 0 null null 1 102115 -102167 0 0 null null 1 102116 -102168 0 0 null null 4 null +102167 0 27 3 null 1 102116 +102168 0 19 2#0 null 4 null 102169 0 0 null null 5 102118 102170 0 0 null null 1 102119 102171 0 0 null null 1 102120 @@ -586,6 +588,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102244 0 1 10102 null 1 102162 102245 0 0 null null 4 null 102246 0 0 null null 4 null +102247 0 26 4 null 4 null 103001 1 2 1503#1 1003#1103#1203#1303 4 null 103002 0 0 null null 4 null 103003 1 2 1503#1 1003#1103#1203#1303 4 null @@ -600,9 +603,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 103012 0 0 null null 4 null 103013 1 2 1503#1 1003#1103#1203#1303 4 null 103014 0 0 null null 4 null -103015 0 5 0 null 4 null +103015 0 19 4#0 null 4 null 103016 0 0 null null 4 null -103017 0 19 4#104#2#3 null 4 null +103017 0 0 null null 4 null 103018 0 0 null null 4 null 103019 0 1 10301 null 1 103014 103020 0 0 null null 4 null @@ -633,7 +636,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 103045 0 0 null null 1 103041 103046 0 0 null null 0 null 103047 0 0 null null 0 null -103048 0 11 4|103#13#15#103012 null 4 null +103048 0 27 5 null 4 null 103049 0 0 null null 1 103043 103050 0 0 null null 4 null 103051 0 1 10301 null 1 103044 @@ -769,6 +772,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 103181 0 1 10305 null 1 103124 103182 0 0 null null 4 null 103183 0 0 null null 4 null +103184 0 26 5 null 4 null 104001 1 2 1503#1 1004#1104#1204#1304 4 null 104002 0 0 null null 4 null 104003 1 2 1503#1 1004#1104#1204#1304 4 null @@ -785,9 +789,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 104014 0 0 null null 4 null 104015 1 2 1503#1 1004#1104#1204#1304 4 null 104016 0 0 null null 4 null -104017 0 5 0 null 4 null +104017 0 19 5#0 null 4 null 104018 0 0 null null 4 null -104019 0 19 5#105#14#4 null 4 null +104019 0 0 null null 4 null 104020 0 0 null null 4 null 104021 0 0 null null 1 104018 104022 0 0 null null 4 null @@ -916,7 +920,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 104145 0 0 null null 0 null 104146 0 0 null null 0 null 104147 0 0 null null 1 104110 -104148 0 11 5|104#40#3#104014 null 1 104119 +104148 0 27 6 null 1 104119 104149 0 15 104026 null 4 null 104150 0 0 null null 0 null 104151 0 0 null null 0 null @@ -942,6 +946,22 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 104171 0 1 10505 null 1 104141 104172 0 0 null null 4 null 104173 0 0 null null 4 null +104174 0 0 null null 5 null +104175 0 0 null null 5 null +104176 0 0 null null 5 null +104177 0 0 null null 5 null +104178 0 26 6 null 4 null +104179 0 0 null null 0 null +104180 0 0 null null 0 null +104181 0 0 null null 0 null +104182 0 0 null null 0 null +104183 0 0 null null 0 null +104184 0 0 null null 0 null +104185 0 0 null null 0 null +104186 0 0 null null 0 null +104187 0 0 null null 0 null +104188 0 0 null null 0 null +104189 0 0 null null 0 null 105001 1 2 1503#1 1005#1105#1205#1305 4 null 105002 0 0 null null 4 null 105003 1 2 1503#1 1005#1105#1205#1305 4 null @@ -958,9 +978,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 105014 0 0 null null 4 null 105015 1 2 1503#1 1005#1105#1205#1305 4 null 105016 0 0 null null 4 null -105017 0 5 0 null 4 null +105017 0 19 6#0 null 4 null 105018 0 0 null null 4 null -105019 0 19 6#106#6#17 null 4 null +105019 0 0 null null 4 null 105020 0 0 null null 4 null 105021 3 0 null 10102 4 null 105022 0 0 null null 4 null @@ -1059,7 +1079,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 105115 0 0 null null 1 105074 105116 0 0 null null 5 105075 105117 0 0 null null 5 105076 -105118 0 11 6|105#3#20#105014 null 1 105077 +105118 0 27 7 null 1 105077 105119 0 15 105032 null 4 null 105120 0 0 null null 4 null 105121 0 0 null null 4 null @@ -1112,6 +1132,27 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 105168 0 0 null 10102 1 105110 105169 0 0 null null 4 null 105170 0 0 null null 4 null +105171 0 0 null null 1 null +105172 0 0 null null 1 null +105173 0 26 7 null 4 null +105174 0 0 null null 1 105115 +105175 0 0 null null 5 105116 +105176 0 0 null null 5 105117 +105177 0 0 null null 5 105118 +105178 0 0 null null 5 105119 +105179 0 0 null null 5 105120 +105180 0 0 null null 5 105121 +105181 0 0 null null 5 105122 +105182 0 0 null null 5 105123 +105183 0 0 null null 4 null +105184 0 0 null null 1 105125 +105185 0 0 null null 1 105126 +105186 0 0 null null 1 105127 +105187 0 0 null null 1 105128 +105188 0 0 null null 5 105129 +105189 0 0 null null 5 105130 +105190 0 0 null null 1 105131 +105191 0 0 null null 4 null 106001 1 2 1503#1 10102 4 null 106002 0 0 null null 4 null 106003 1 2 1503#1 10102 4 null @@ -1128,9 +1169,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 106014 0 0 null null 4 null 106015 1 2 1503#1 10102 4 null 106016 0 0 null null 4 null -106017 0 5 0 null 4 null +106017 0 19 7#0 null 4 null 106018 0 0 null null 4 null -106019 0 19 8#107#26#29 null 4 null +106019 0 0 null null 4 null 106020 0 0 null null 4 null 106021 0 1 10101 null 4 null 106022 0 0 null null 4 null @@ -1232,6 +1273,13 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 106118 0 0 null null 0 null 106119 0 0 null null 4 null 106120 0 0 null null 4 null +106121 0 0 null null 1 106086 +106122 0 0 null null 1 106087 +106123 0 0 null null 4 null +106124 0 0 null null 1 106089 +106125 0 0 null null 1 106090 +106126 0 0 null null 1 106091 +106127 0 0 null null 4 null 107001 1 2 1503#1 10102 4 null 107002 0 0 null null 4 null 107003 1 2 1503#1 10102 4 null diff --git a/conf/server/RewardItemConfig.txt b/conf/server/RewardItemConfig.txt index 74f3524a8..121497d80 100644 --- a/conf/server/RewardItemConfig.txt +++ b/conf/server/RewardItemConfig.txt @@ -1,6 +1,6 @@ Id ItemId Chance GrowChance RandomMin RandomMax int int int float int int -100 3001 0 1.0 0 0 +100 3001 1 1.0 0 0 101 3001 100 1.0 1 1 102 3002 100 1.0 1 1 103 3003 100 1.0 1 1 diff --git a/conf/server/SkillLogicConfig.txt b/conf/server/SkillLogicConfig.txt index bc19695aa..1174f2893 100644 --- a/conf/server/SkillLogicConfig.txt +++ b/conf/server/SkillLogicConfig.txt @@ -662,93 +662,93 @@ int mut,float#float,2 mut,int#int,2 mut,float#float,2 float 500108 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 1.0 500109 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 1.0 500110 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 1.0 -500201 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500202 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500203 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500204 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500205 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500206 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500207 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500208 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500209 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500210 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2.0 -500301 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500302 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500303 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500304 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500305 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500306 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500307 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500308 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500309 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500310 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3.0 -500401 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500402 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500403 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500404 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500405 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500406 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500407 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500408 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500409 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500410 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4.0 -500501 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500502 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500503 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500504 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500505 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500506 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500507 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500508 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500509 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500510 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5.0 -500601 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500602 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500603 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500604 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500605 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500606 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500607 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500608 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500609 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500610 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6.0 -500701 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500702 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500703 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500704 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500705 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500706 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500707 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500708 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500709 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500710 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7.0 -500801 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500802 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500803 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500804 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500805 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500806 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500807 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500808 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500809 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500810 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8.0 -500901 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500902 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500903 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500904 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500905 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500906 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500907 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500908 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500909 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -500910 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9.0 -501001 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501002 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501003 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501004 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501005 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501006 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501007 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501008 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501009 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 -501010 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10.0 +500201 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500202 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500203 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500204 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500205 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500206 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500207 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500208 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500209 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500210 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 2 +500301 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500302 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500303 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500304 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500305 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500306 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500307 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500308 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500309 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500310 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 3 +500401 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500402 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500403 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500404 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500405 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500406 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500407 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500408 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500409 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500410 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 4 +500501 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500502 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500503 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500504 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500505 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500506 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500507 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500508 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500509 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500510 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 5 +500601 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500602 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500603 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500604 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500605 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500606 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500607 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500608 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500609 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500610 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 6 +500701 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500702 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500703 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500704 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500705 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500706 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500707 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500708 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500709 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500710 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 7 +500801 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500802 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500803 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500804 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500805 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500806 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500807 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500808 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500809 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500810 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 8 +500901 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500902 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500903 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500904 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500905 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500906 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500907 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500908 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500909 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +500910 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 9 +501001 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501002 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501003 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501004 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501005 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501006 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501007 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501008 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501009 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 +501010 20012#0.7|10014#0.7 26#27|25 600|100#4|2#0.1#4 10 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SAdventureConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SAdventureConfig.java index a719292da..be44fec71 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SAdventureConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SAdventureConfig.java @@ -26,26 +26,14 @@ public class SAdventureConfig implements BaseConfig { private int[] randomRewardGroup; - private int[] recommendRewardGroup; - - private int pooId; - - private Set recommendHeroSets; + private int[][] recommendRewardGroup; @Override public void init() throws Exception { - Map config = STableManager.getConfig(SAdventureConfig.class); - for(SAdventureConfig sAdventureConfig : config.values()){ - int[] recommendHeroIds = sAdventureConfig.getRecommendHeroIds(); - Set recommendHeroSetTmp = new HashSet<>(recommendHeroIds.length); - for(int i=0;i getRecommendHeroSets() { - return recommendHeroSets; - } - - public void setRecommendHeroSets(Set recommendHeroSets) { - this.recommendHeroSets = recommendHeroSets; - } - public int getId() { return id; } @@ -93,11 +73,8 @@ public class SAdventureConfig implements BaseConfig { return randomRewardGroup; } - public int[] getRecommendRewardGroup() { + public int[][] getRecommendRewardGroup() { return recommendRewardGroup; } - public int getPooId() { - return pooId; - } } \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SVipLevelConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SVipLevelConfig.java index a7b39164c..26aea1af9 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SVipLevelConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SVipLevelConfig.java @@ -33,8 +33,11 @@ public class SVipLevelConfig implements BaseConfig { for(int[] temp : privileges){ privilegeMap.put(temp[0],temp[1]); } + sVipLevelConfig.setPrivilegeMap(privilegeMap); + } } + sVipLevelConfigMap =config; } public static Map getsVipLevelConfigMap() { @@ -64,4 +67,8 @@ public class SVipLevelConfig implements BaseConfig { public Map getPrivilegeMap() { return privilegeMap; } + + public void setPrivilegeMap(Map privilegeMap) { + this.privilegeMap = privilegeMap; + } } \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java index 2c90a6ce0..8e869213f 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java @@ -154,8 +154,7 @@ public class CombatLogic { return; } - int pooId = sAdventureConfig.getPooId(); - SAdventureSetting sAdventureSetting = SAdventureSetting.getsAdventureSetting(pooId); + SAdventureSetting sAdventureSetting = SAdventureSetting.getsAdventureSetting(position); if(hourDuration > sAdventureSetting.getPerMapMaxHour()){ MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.ADVENTURE_STATION_RESPONSE_VALUE,"超出时长"); return; @@ -173,7 +172,7 @@ public class CombatLogic { int allowTime =0; if(!adventureManager.getAllowTimeMap().containsKey(position)){ int vipLevel = user.getPlayerInfoManager().getVipLevel(); - allowTime = SVipLevelConfig.getsVipLevelConfigMap().get(vipLevel).getPrivilegeMap().get(vipLevel) -hourDuration; + allowTime = SVipLevelConfig.getsVipLevelConfigMap().get(vipLevel).getPrivilegeMap().get(1) -hourDuration; }else{ Integer remainAllowTime = adventureManager.getAllowTimeMap().get(position); allowTime = remainAllowTime - hourDuration; @@ -196,7 +195,7 @@ public class CombatLogic { HeroManager heroManager = user.getHeroManager(); int myRecommendHeroSize=0; int totalForce=0; - Set recommendHeroSets = sAdventureConfig.getRecommendHeroSets(); + Set recommendHeroSets =adventureSeasonInfoCache.getRecommendFinalHeroMap().get(position); Set cacheHeroTid = new HashSet<>(recommendHeroSets.size()); for(String heroId : heroIds){ Hero hero = heroManager.getHero(heroId); @@ -235,8 +234,8 @@ public class CombatLogic { SAdventureConfig sAdventureConfig = SAdventureConfig.getsAdventureConfigByPosition(position); int recommendForce = sAdventureConfig.getRecommendForce(); - int pooId = sAdventureConfig.getPooId(); - SAdventureSetting sAdventureSetting = SAdventureSetting.getsAdventureSetting(pooId); + + SAdventureSetting sAdventureSetting = SAdventureSetting.getsAdventureSetting(position); float[][] baseRewardRatio = sAdventureSetting.getBaseRewardRatio(); @@ -251,13 +250,20 @@ public class CombatLogic { float baseRewardRatioTmp = calRatio(myForceRatio, baseRewardRatio) * hourRewardRatioTmp; float randomRewardRatioTmp = calRatio(myForceRatio, randomRewardRatio) * hourRewardRatioTmp; int[] baseRewardGroup = sAdventureConfig.getBaseRewardGroup(); - int[] recommendRewardGroup = sAdventureConfig.getRecommendRewardGroup(); + int[][] recommendRewardGroup = sAdventureConfig.getRecommendRewardGroup(); int[] randomRewardGroup = sAdventureConfig.getRandomRewardGroup(); Map dropInfoMap = new HashMap<>(); dropInfoMap.put(baseRewardGroup,baseRewardRatioTmp); dropInfoMap.put(randomRewardGroup,randomRewardRatioTmp); if(myRecommendHeroSize>0){ - dropInfoMap.put(new int[]{recommendRewardGroup[myRecommendHeroSize-1]},myRecommendHeroSize*1.0f); + int[] recommendRewardGroupDetail = recommendRewardGroup[myRecommendHeroSize - 1]; + for(int i=0;i heroAllAttribute = calHeroFinalAttribute(user, hero); + heroAllAttribute.remove(0); double result = 0; for(Map.Entry item : heroAllAttribute.entrySet()){ Integer propertyId = item.getKey(); From 2b06b9ace00f3ec8be42c4bf03992196a7d99835 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Fri, 22 Mar 2019 17:43:20 +0800 Subject: [PATCH 06/16] =?UTF-8?q?fix=20=E9=A9=BB=E6=89=8E=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ljsd/jieling/logic/fight/CombatLogic.java | 2 +- .../src/main/java/com/ljsd/jieling/util/CBean2Proto.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java index 8e869213f..3870f7604 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CombatLogic.java @@ -207,7 +207,7 @@ public class CombatLogic { totalForce += HeroLogic.getInstance().calHeoForce(user,hero); } - adventureManager.station(new AdventureStateInfo(position,heroIds,(int)(System.currentTimeMillis()),hourDuration,totalForce,myRecommendHeroSize),allowTime); + adventureManager.station(new AdventureStateInfo(position,heroIds,(int)(System.currentTimeMillis()/1000),hourDuration,totalForce,myRecommendHeroSize),allowTime); //发送成功 MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_STATION_RESPONSE_VALUE,null,true); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java b/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java index a2d06133a..ef9640d47 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/CBean2Proto.java @@ -84,7 +84,8 @@ public class CBean2Proto { if(adventureStateInfo!=null){ int startTime = adventureStateInfo.getStartTime(); int now = (int)(System.currentTimeMillis()/1000); - builder.setPositionId(adventureStateInfo.getPosition()) + builder.addAllHeroIdList(adventureStateInfo.getHeroIds()) + .setHourDuration(adventureStateInfo.getHourDuration()) .setRemainTime((now - startTime )); } return builder.build(); From 7a779b3ee3347ea192eb09ef7f3422eb33e4f556 Mon Sep 17 00:00:00 2001 From: mashiyu Date: Fri, 22 Mar 2019 18:36:24 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E6=88=98=E6=96=97=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luafight/BattleMain.lua | 16 ++--- luafight/Modules/Battle/Logic/Base/Effect.lua | 22 +------ luafight/Modules/Battle/Logic/Base/Skill.lua | 66 ++++++++++--------- luafight/Modules/Battle/Logic/BattleLogic.lua | 21 ++++-- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 12 ++++ .../ljsd/jieling/handler/map/MapLogic.java | 24 +++++-- 6 files changed, 91 insertions(+), 70 deletions(-) diff --git a/luafight/BattleMain.lua b/luafight/BattleMain.lua index 5264cac1d..21882ca44 100644 --- a/luafight/BattleMain.lua +++ b/luafight/BattleMain.lua @@ -125,7 +125,7 @@ function BattleMain.Execute(seed, fightData, optionData) print(PrintTable(fightData)) --该开关用于输出战斗过程中的日志,用于验证前后端是否出现战斗不同步 - BattleLogic.IsOpenBattleRecord = false + BattleLogic.IsOpenBattleRecord = true if xpcall(function () Random.SetSeed(seed) @@ -155,17 +155,17 @@ function BattleMain.Execute(seed, fightData, optionData) end -- print ----------------------------------------- - for i=1, #resultList do - print("hp:"..resultList[i]) - end - print("最终运行帧数:"..BattleLogic.CurFrame()) - print("result:"..BattleLogic.Result) + --for i=1, #resultList do + -- print("hp:"..resultList[i]) + --end + --print("最终运行帧数:"..BattleLogic.CurFrame()) + --print("result:"..BattleLogic.Result) return resultList end return { result = -1 } end ---BattleMain.Execute(1553167956, {enemyData={{{passivity={},skill={0,{20011,0.7,{1,1,1,},{3,0.3,1,3,},},},roleId=5,property={0,772,772,260,61,61,80,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,2,2,},type=2,professionId=0,quality=1,camp=1,},{passivity={},skill={0,{20011,0.7,{1,0.8,1,},{13,1,0.1,2,5,},},},roleId=3,property={0,772,772,260,61,61,240,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},type=2,professionId=0,quality=1,camp=1,},{passivity={},skill={0,{20011,0.7,{1,0.8,1,},{13,1,0.1,2,5,},},},roleId=3,property={0,772,772,260,61,61,7,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},type=2,professionId=0,quality=1,camp=1,},teamSkill={},},},playerData={{passivity={},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,10,0.2,4,1,},},},camp=0,roleId=10022,type=1,professionId=3,quality=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={3,{20000,0.7,{2,1.06,2,},{3,0.6,1,4,},},},skill={0,{40001,0.7,{11,0.93,2,2,0.2,},},},camp=0,roleId=10008,type=1,professionId=5,quality=0,property={1,2206,2208,221,193,232,130,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={2.5,{20000,0.7,{14,1.55,2,1,10023,0.2,},},},skill={0,{40001,0.7,{1,1.35,2,},},{30011,0.7,{3,0,0,5,},},},camp=0,roleId=10023,type=1,professionId=4,quality=0,property={1,1439,1441,284,131,157,168,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={2.3,{20312,0.7,{19,1.35,1,0.5,5,},},},skill={0,{40001,0.7,{1,1,1,},},{30011,0.7,{4,9,0.1,5,1,},{4,10,0.1,5,1,},},},camp=0,roleId=10013,type=1,professionId=1,quality=0,property={1,1678,1680,246,194,162,163,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},{passivity={},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,10,0.2,4,1,},},},camp=0,roleId=10022,type=1,professionId=3,quality=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},},teamSkill={{3,{20012,0.7,{26,600,},{27,100,4,},},{10014,0.7,{25,2,0.1,4,},},},},},}) -BattleMain.Execute(1553167956, {playerData={{professionId=4,passivity={},type=1,skill={0,{40001,0.7,{1,1.35,2,},},{30011,0.7,{3,0,0,5,},},},superSkill={2.5,{20000,0.7,{14,1.55,2,1,10023,0.2,},},},roleId=10023,camp=0,property={1,1439,1441,284,131,157,168,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=3,passivity={},type=1,skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,9,0.2,4,1,},},},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},roleId=10022,camp=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=2,passivity={},type=1,skill={0,{40001,0.7,{1,1.05,2,},{4,4,5,5,3,},},},superSkill={2.3,{20000,0.7,{2,1.89,2,},},{20012,0.7,{3,1,5,5,},},},roleId=10021,camp=0,property={1,1920,1922,209,170,204,178,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=5,passivity={},type=1,skill={0,{40001,0.7,{11,0.93,2,2,0.2,},},},superSkill={3,{20000,0.7,{2,1.06,2,},{3,0.6,1,4,},},},roleId=10008,camp=0,property={1,2206,2208,221,193,232,130,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=1,passivity={},type=1,skill={0,{40001,0.7,{1,1,1,},},{30011,0.7,{4,9,0.1,5,1,},{4,9,0.1,5,1,},},},superSkill={2.3,{20312,0.7,{19,1.35,1,0.5,5,},},},roleId=10013,camp=0,property={1,1678,1680,246,194,162,163,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={{3,{20012,0.7,{26,600,},{27,100,4,},},{10014,0.7,{25,2,0.1,4,},},},},},enemyData={{{professionId=0,passivity={},type=2,skill={0,{20011,0.7,{1,1,1,},{3,0.3,1,3,},},},superSkill={},roleId=14,camp=1,property={0,772,772,260,61,61,80,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,2,2,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=1,camp=1,property={0,483,483,260,61,61,240,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=3,camp=1,property={0,483,483,260,61,61,7,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={},},},}) +--BattleMain.Execute(1553167956, {playerData={{professionId=3,passivity={},type=1,skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,10,0.2,4,1,},},},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},roleId=10022,camp=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=5,passivity={},type=1,skill={0,{40001,0.7,{11,0.93,2,2,0.2,},},},superSkill={3,{20000,0.7,{2,1.06,2,},{3,0.6,1,4,},},},roleId=10008,camp=0,property={1,2206,2208,221,193,232,130,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=4,passivity={},type=1,skill={0,{40001,0.7,{1,1.35,2,},},{30011,0.7,{3,0,0,5,},},},superSkill={2.5,{20000,0.7,{14,1.55,2,1,10023,0.2,},},},roleId=10023,camp=0,property={1,1439,1441,284,131,157,168,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=1,passivity={},type=1,skill={0,{40001,0.7,{1,1,1,},},{30011,0.7,{4,9,0.1,5,1,},{4,10,0.1,5,1,},},},superSkill={2.3,{20312,0.7,{19,1.35,1,0.5,5,},},},roleId=10013,camp=0,property={1,1678,1680,246,194,162,163,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=3,passivity={},type=1,skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,10,0.2,4,1,},},},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},roleId=10022,camp=0,property={17,2732,2734,401,272,326,308,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={},},enemyData={{{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=1,camp=1,property={0,483,483,260,61,61,240,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=2,camp=1,property={0,483,483,260,61,61,80,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=3,camp=1,property={0,483,483,260,61,61,7,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={},},},}) +--BattleMain.Execute(1553167956, {playerData={{professionId=4,passivity={},type=1,skill={0,{40001,0.7,{1,1.35,2,},},{30011,0.7,{3,0,0,5,},},},superSkill={2.5,{20000,0.7,{14,1.55,2,1,10023,0.2,},},},roleId=10023,camp=0,property={1,1439,1441,284,131,157,168,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=3,passivity={},type=1,skill={0,{40001,0.7,{1,2.3,2,},},{30011,0.7,{4,9,0.2,4,1,},{4,9,0.2,4,1,},},},superSkill={1.6,{20211,0.7,{1,3.3,2,},{15,1.98,2,1.98,},},},roleId=10022,camp=0,property={1,1676,1678,248,167,200,173,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=2,passivity={},type=1,skill={0,{40001,0.7,{1,1.05,2,},{4,4,5,5,3,},},},superSkill={2.3,{20000,0.7,{2,1.89,2,},},{20012,0.7,{3,1,5,5,},},},roleId=10021,camp=0,property={1,1920,1922,209,170,204,178,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=5,passivity={},type=1,skill={0,{40001,0.7,{11,0.93,2,2,0.2,},},},superSkill={3,{20000,0.7,{2,1.06,2,},{3,0.6,1,4,},},},roleId=10008,camp=0,property={1,2206,2208,221,193,232,130,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=1,passivity={},type=1,skill={0,{40001,0.7,{1,1,1,},},{30011,0.7,{4,9,0.1,5,1,},{4,9,0.1,5,1,},},},superSkill={2.3,{20312,0.7,{19,1.35,1,0.5,5,},},},roleId=10013,camp=0,property={1,1678,1680,246,194,162,163,0,0,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={{3,{20012,0.7,{26,600,},{27,100,4,},},{10014,0.7,{25,2,0.1,4,},},},},},enemyData={{{professionId=0,passivity={},type=2,skill={0,{20011,0.7,{1,1,1,},{3,0.3,1,3,},},},superSkill={},roleId=14,camp=1,property={0,772,772,260,61,61,80,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,2,2,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=1,camp=1,property={0,483,483,260,61,61,240,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},{professionId=0,passivity={},type=2,skill={0,{20013,0.7,{1,0.45,1,},},},superSkill={},roleId=3,camp=1,property={0,483,483,260,61,61,7,0,0,0.3,0.3,0.2,1.5,1,0,0,0,0,0,0,0,0,0,0,0,0,},quality=1,},teamSkill={},},},}) return BattleMain \ No newline at end of file diff --git a/luafight/Modules/Battle/Logic/Base/Effect.lua b/luafight/Modules/Battle/Logic/Base/Effect.lua index 867159bfb..8fef33fb6 100644 --- a/luafight/Modules/Battle/Logic/Base/Effect.lua +++ b/luafight/Modules/Battle/Logic/Base/Effect.lua @@ -245,12 +245,13 @@ local effectList = { local f1 = args[1] local dt = args[2] local f2 = args[3] + caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval) if caster.camp == 0 and target.camp == 1 then BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval) end BattleLogic.WaitForTrigger(interval, function () - local dmg = BattleUtil.CalDamage(caster, target, dt, f1) + local dmg, crit = BattleUtil.CalDamage(caster, target, dt, f1) if target.isDead then local arr = BattleLogic.Query(function (r) return r.camp ~= caster.camp and r.uid ~= target.uid end) for i=1, #arr do @@ -314,25 +315,6 @@ local effectList = { end end) end, - --造成[a]%的[b]伤害,若暴击,则减少下次发动技能CD[c]秒。 - --a[float],b[伤害类型],c[float] - [18] = function(caster, target, args, interval) - local f1 = args[1] - local dt = args[2] - local f2 = args[3] - caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval) - if caster.camp == 0 and target.camp == 1 then - BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval) - end - BattleLogic.WaitForTrigger(interval, function () - local d, crit = BattleUtil.CalDamage(caster, target, dt, f1) - if crit then - if target.skill then - target.skill.sp = target.skill.sp + floor(f2 * BattleLogic.GameFrameRate) - end - end - end) - end, --造成[a]%的[b]伤害,有[c]%的概率追加伤害,最多可追加[d]次。(0无限追加) --a[float],b[伤害类型],c[float],d[int] [19] = function(caster, target, args, interval) diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index d6d92c17a..505c4a224 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -6,15 +6,14 @@ local min = math.min --local RoleDataName = RoleDataName --local BattleEventName = BattleEventName -local chooseList = {} local function chooseTarget(role, chooseId, exceptList) local chooseType = floor(chooseId / 10000) % 10 local chooseWeight = floor(chooseId / 100) % 10 local sort = floor(chooseId / 10) % 10 - local exceptNum = #exceptList + local exceptNum = exceptList.size local num = chooseId % 10 - local arr = BattleLogic.Query() + local arr if chooseType == 1 then arr = BattleLogic.Query(function (r) for i=1, exceptList.size do @@ -26,8 +25,7 @@ local function chooseTarget(role, chooseId, exceptList) end) elseif chooseType == 2 then if role.lockTarget and num == 1 then - arr[1] = role.lockTarget - return arr + return {role.lockTarget} end arr = BattleLogic.Query(function (r) for i=1, exceptList.size do @@ -38,70 +36,72 @@ local function chooseTarget(role, chooseId, exceptList) return r.camp ~= role.camp end) elseif chooseType == 3 then - arr[1] = role - return arr + return {role} elseif chooseType == 4 then return {BattleLogic.GetAggro(role.camp)} + else + arr = BattleLogic.Query() end + BattleUtil.RandomList(arr) if chooseWeight == 0 then BattleUtil.RandomList(arr) elseif chooseWeight == 1 then - table.sort(arr, function(a, b) + BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.Hp) local r2 = b:GetRoleData(RoleDataName.Hp) return sort == 1 and r1 < r2 or r1 > r2 end) elseif chooseWeight == 2 then - table.sort(arr, function(a, b) + BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.Hp) / a:GetRoleData(RoleDataName.MaxHp) local r2 = b:GetRoleData(RoleDataName.Hp) / b:GetRoleData(RoleDataName.MaxHp) return sort == 1 and r1 < r2 or r1 > r2 end) elseif chooseWeight == 3 then - table.sort(arr, function(a, b) + BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.Attack) local r2 = b:GetRoleData(RoleDataName.Attack) return sort == 1 and r1 < r2 or r1 > r2 end) elseif chooseWeight == 4 then - table.sort(arr, function(a, b) + BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.PhysicalDefence) local r2 = b:GetRoleData(RoleDataName.PhysicalDefence) return sort == 1 and r1 < r2 or r1 > r2 end) elseif chooseWeight == 5 then - table.sort(arr, function(a, b) + BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.PhysicalDefence) local r2 = b:GetRoleData(RoleDataName.PhysicalDefence) return sort == 1 and r1 < r2 or r1 > r2 end) elseif chooseWeight == 6 then - table.sort(arr, function(a, b) + BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.MagicDefence) local r2 = b:GetRoleData(RoleDataName.MagicDefence) return sort == 1 and r1 < r2 or r1 > r2 end) elseif chooseWeight == 7 then - table.sort(arr, function(a, b) + BattleUtil.Sort(arr, function(a, b) local r1 = a:GetRoleData(RoleDataName.MagicDefence) local r2 = b:GetRoleData(RoleDataName.MagicDefence) return sort == 1 and r1 < r2 or r1 > r2 end) end - for i=1, #chooseList do - chooseList[i] = nil + if exceptNum > 0 then + local chooseList = {} + for i=1, exceptNum do + chooseList[i] = exceptList.buffer[i] + end + for i=1+exceptNum, num == 0 and #arr or min(#arr, num) do + chooseList[i] = arr[i-exceptNum] + end + return chooseList + else + return arr end - --local chooseList = {} - for i=1, exceptNum do - chooseList[i] = exceptList[i] - end - for i=1+exceptNum, num == 0 and #arr or min(#arr, num) do - chooseList[i] = arr[i] - end - arr = chooseList - return arr end local effectPool = BattleObjectPool.New(function () return {0, {}} -- type, {args, ...} @@ -196,6 +196,12 @@ function Skill:ResetCD() BattleLogic.SetAggro(self.owner, 0) end +local function takeEffect(type, caster, target, args, interval) + effect[type](caster, target, args, interval) + if BattleLogic.IsOpenBattleRecord then + BattleLogic.RecordEffect(caster, target, type, args, interval) + end +end function Skill:Cast() for i=1, self.effectList.size do local effectGroup = self.effectList.buffer[i] @@ -217,7 +223,7 @@ function Skill:Cast() for j=1, #arr do for k=1, #effectGroup[3] do local v = effectGroup[3][k] - effect[v[1]](self.owner, arr[j], v[2], duration) + takeEffect(v[1], self.owner, arr[j], v[2], duration) end end elseif chooseId == 20000 then --敌方aoe @@ -225,14 +231,14 @@ function Skill:Cast() for j=1, #arr do for k=1, #effectGroup[3] do local v = effectGroup[3][k] - effect[v[1]](self.owner, arr[j], v[2], duration) + takeEffect(v[1], self.owner, arr[j], v[2], duration) end end elseif nn == 1 or nn == 3 then for j=1, #arr do for k=1, #effectGroup[3] do local v = effectGroup[3][k] - effect[v[1]](self.owner, arr[j], v[2], duration) + takeEffect(v[1], self.owner, arr[j], v[2], duration) end end else @@ -252,7 +258,7 @@ function Skill:Cast() r = arr[i] for k=1, #effectGroup[3] do local v = effectGroup[3][k] - effect[v[1]](self.owner, r, v[2], cd) + takeEffect(v[1], self.owner, r, v[2], cd) end return end @@ -265,7 +271,7 @@ function Skill:Cast() self.choosedList:Add(r) for k=1, #effectGroup[3] do local v = effectGroup[3][k] - effect[v[1]](self.owner, r, v[2], cd) + takeEffect(v[1], self.owner, r, v[2], cd) end end) end diff --git a/luafight/Modules/Battle/Logic/BattleLogic.lua b/luafight/Modules/Battle/Logic/BattleLogic.lua index f88ec7ed4..04926e6be 100644 --- a/luafight/Modules/Battle/Logic/BattleLogic.lua +++ b/luafight/Modules/Battle/Logic/BattleLogic.lua @@ -281,12 +281,12 @@ function BattleLogic.CurFrame() return curFrame end -local list = {} +--local list = {} function BattleLogic.Query(func, inCludeDeadRole) - for i=1, #list do - list[i] = nil - end - --local list = {} + --for i=1, #list do + -- list[i] = nil + --end + local list = {} local index = 1 if func then for i=1, objList.size do @@ -458,6 +458,17 @@ function BattleLogic.RecordRoleProperty(uid, camp, name, value, delta) table.insert(record, string.format("frame:%d, uid:%d, camp:%d, name:%s, value:%d, delta:%d", curFrame, uid, camp, name, value, delta)) end +--Record专用 +function BattleLogic.RecordEffect(caster, target, type, args, interval) + local cUid = tostring(caster.uid) or "cTeam" + local tUid = tostring(target.uid) or "tTeam" + local str = "" + for i=1, #args do + str = str..tostring(args[i]) .. (i == #args and "" or "#") + end + table.insert(record, string.format("frame:%d, caster:%s, target:%s, effectType:%d, args:%s, interval:%d", curFrame, cUid, tUid, type, str, interval)) +end + --Record专用 function BattleLogic.GenerateRecordFile() local time = string.format("%d-%d-%d-%d-%d-%d", diff --git a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua index 13829c74d..53252c1ee 100644 --- a/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/luafight/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -175,6 +175,18 @@ function BattleUtil.RandomList(arr) end end +function BattleUtil.Sort(arr, comp) + if #arr <= 1 then return arr end + for i=1, #arr do + for j = #arr, i+1, -1 do + if comp(arr[j-1], arr[j]) then + arr[j-1], arr[j] = arr[j], arr[j-1] + end + end + end + return arr +end + function BattleUtil.GetPropertyName(type) if type == 1 then return RoleDataName.Strength diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index ea564c56f..bb34ae74a 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -723,10 +723,25 @@ public class MapLogic { LuaValue getOptionData = FightDataUtil.getOptionData(frames); int[] checkResult = CheckFight.getInstance().checkFight(seed, getFightData, getOptionData); + + List remainHp = new ArrayList<>(5); + for (int i = 1; i < checkResult.length; i++) { + remainHp.add(checkResult[i]); + } + //校验结果码 1:胜利 int resultCode = checkResult[0]; - if (resultCode !=1){ - MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "战斗失败"); + if (resultCode == -1){ + MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "战斗异常!"); + return; + }else if(resultCode == 0){ + CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder(); + FightInfoProto.FightEndResponse fightEndResponse = FightInfoProto.FightEndResponse + .newBuilder() + .setDrop(dropBuilder) + .addAllRemainHpList(remainHp) + .build(); + MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse, true); return; } @@ -737,11 +752,6 @@ public class MapLogic { hero.setCurHp(checkResult[teamPosHeroInfo.getPosition()]); } - List remainHp = new ArrayList<>(5); - for (int i = 1; i < checkResult.length; i++) { - remainHp.add(checkResult[i]); - } - CommonProto.Drop.Builder drop = ItemUtil.drop(user, sMonsterGroup.getRewardgroup(), 1, 1); FightInfoProto.FightEndResponse fightEndResponse = FightInfoProto.FightEndResponse .newBuilder() From ce3a58641aa14feccd5a43a7002cc050c6aee32f Mon Sep 17 00:00:00 2001 From: mashiyu Date: Fri, 22 Mar 2019 18:57:17 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ljsd/jieling/handler/map/MapLogic.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index bb34ae74a..d859e22af 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -738,6 +738,7 @@ public class MapLogic { CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder(); FightInfoProto.FightEndResponse fightEndResponse = FightInfoProto.FightEndResponse .newBuilder() + .setResult(resultCode) .setDrop(dropBuilder) .addAllRemainHpList(remainHp) .build(); @@ -756,6 +757,7 @@ public class MapLogic { FightInfoProto.FightEndResponse fightEndResponse = FightInfoProto.FightEndResponse .newBuilder() .setDrop(drop) + .setResult(resultCode) .addAllRemainHpList(remainHp) .build(); MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse, true); From bb3fd97b0d33e6fdc2d80cabf3e946c0eac638fa Mon Sep 17 00:00:00 2001 From: mashiyu Date: Fri, 22 Mar 2019 19:06:00 +0800 Subject: [PATCH 09/16] log --- .../src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java index 32c1548f5..fc0f20683 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java @@ -84,7 +84,7 @@ public class CheckFight { if (status==1){ for (int i = 1; i <= result.length(); i++) { resultCache[i] = result.rawget(i).toint(); - LOGGER.info(i+" --> 单位剩余血量 : "+ resultCache[i]); +// LOGGER.info(i+" --> 单位剩余血量 : "+ resultCache[i]); } } return resultCache; From c1a542867a1a54b11a409283fa683855b854fb6c Mon Sep 17 00:00:00 2001 From: mashiyu Date: Sat, 23 Mar 2019 13:18:16 +0800 Subject: [PATCH 10/16] bug --- luafight/Modules/Battle/Logic/Base/Skill.lua | 13 +++++-------- luafight/Modules/Battle/Logic/BattleLogic.lua | 14 +++++++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index 505c4a224..409e3c2d6 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -91,17 +91,14 @@ local function chooseTarget(role, chooseId, exceptList) end if exceptNum > 0 then - local chooseList = {} for i=1, exceptNum do - chooseList[i] = exceptList.buffer[i] + for j=#arr, i+1, -1 do + arr[j] = arr[j-1] + end + arr[i] = exceptList.buffer[i] end - for i=1+exceptNum, num == 0 and #arr or min(#arr, num) do - chooseList[i] = arr[i-exceptNum] - end - return chooseList - else - return arr end + return arr end local effectPool = BattleObjectPool.New(function () return {0, {}} -- type, {args, ...} diff --git a/luafight/Modules/Battle/Logic/BattleLogic.lua b/luafight/Modules/Battle/Logic/BattleLogic.lua index 04926e6be..26e403341 100644 --- a/luafight/Modules/Battle/Logic/BattleLogic.lua +++ b/luafight/Modules/Battle/Logic/BattleLogic.lua @@ -253,6 +253,9 @@ function BattleLogic.WaitForTrigger(delayTime, action) item[1] = curFrame + floor(delayTime * BattleLogic.GameFrameRate + 0.5) item[2] = action tbActionList:Add(item) + if BattleLogic.IsOpenBattleRecord then + BattleLogic.RecordDelayTrigger(delayTime, curFrame + floor(delayTime * BattleLogic.GameFrameRate + 0.5)) + end end function BattleLogic.AddOption(opType, opArg) @@ -281,6 +284,7 @@ function BattleLogic.CurFrame() return curFrame end + --local list = {} function BattleLogic.Query(func, inCludeDeadRole) --for i=1, #list do @@ -292,6 +296,7 @@ function BattleLogic.Query(func, inCludeDeadRole) for i=1, objList.size do local v = objList.vList[i] if func(v) and (inCludeDeadRole or not v.isDead) then + --if memoize(func, v) and (inCludeDeadRole or not v.isDead) then list[index] = v index = index + 1 end @@ -360,9 +365,7 @@ function BattleLogic.Update() index = 1 while index <= tbActionList.size do if tbActionList.buffer[index][1] <= curFrame then - if tbActionList.buffer[index][2] then - tbActionList.buffer[index][2]() - end + tbActionList.buffer[index][2]() actionPool:Put(tbActionList.buffer[index]) tbActionList:Remove(index) else @@ -469,6 +472,11 @@ function BattleLogic.RecordEffect(caster, target, type, args, interval) table.insert(record, string.format("frame:%d, caster:%s, target:%s, effectType:%d, args:%s, interval:%d", curFrame, cUid, tUid, type, str, interval)) end +--Record专用 +function BattleLogic.RecordDelayTrigger(delayFrame, triggerFrame) + table.insert(record, string.format("frame:%d, delayFrame:%d, triggerFrame:%d", curFrame, delayFrame, triggerFrame)) +end + --Record专用 function BattleLogic.GenerateRecordFile() local time = string.format("%d-%d-%d-%d-%d-%d", From 347ec0a577325edd2558ed967af352a1ce5e1c08 Mon Sep 17 00:00:00 2001 From: mashiyu Date: Sat, 23 Mar 2019 17:06:14 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E6=95=B0=E6=8D=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luafight/Modules/Battle/Logic/Base/Skill.lua | 28 +++---------- luafight/Modules/Battle/Logic/BattleLogic.lua | 39 +++++-------------- luafight/Modules/Battle/Logic/RoleLogic.lua | 2 - .../jieling/config/SSkillLogicConfig.java | 16 +++++--- 4 files changed, 25 insertions(+), 60 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index 409e3c2d6..4958bad8c 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -2,6 +2,7 @@ local effect = require("Modules/Battle/Logic/Base/Effect") local floor = math.floor local max = math.max local min = math.min +local gameFrameRate = BattleLogic.GameFrameRate --local BattleConst = BattleConst --local RoleDataName = RoleDataName --local BattleEventName = BattleEventName @@ -91,8 +92,9 @@ local function chooseTarget(role, chooseId, exceptList) end if exceptNum > 0 then - for i=1, exceptNum do - for j=#arr, i+1, -1 do + local count = #arr + for i=1, min(exceptNum, count) do + for j=count, i+1, -1 do arr[j] = arr[j-1] end arr[i] = exceptList.buffer[i] @@ -100,12 +102,6 @@ local function chooseTarget(role, chooseId, exceptList) end return arr end -local effectPool = BattleObjectPool.New(function () - return {0, {}} -- type, {args, ...} -end) -local effectGroupPool = BattleObjectPool.New(function () - return { 0, 0, {}} -- chooseId, duration, {effect1, effect2, ...} -end) Skill = {} @@ -131,11 +127,11 @@ function Skill:Init(role, effectData) local v for i=2, #effectData do v = effectData[i] - local effectGroup = effectGroupPool:Get() -- chooseId, duration, {effect1, effect2, ...} + local effectGroup = { 0, 0, {}} -- chooseId, duration, {effect1, effect2, ...} effectGroup[1] = v[1] --chooseId effectGroup[2] = v[2] --duration for j=3, #v do --effectList - local effect = effectPool:Get() -- type, {args, ...} + local effect = {0, {}} -- type, {args, ...} effect[1] = v[j][1] for k=2, #v[j] do effect[2][k-1] = v[j][k] @@ -146,18 +142,6 @@ function Skill:Init(role, effectData) end end -function Skill:Dispose() - local effectGroup - for i=1, self.effectList.size do - effectGroup = self.effectList.buffer[i] - for k=1, #effectGroup[3] do - effectPool:Put(effectGroup[3][k]) - effectGroup[3][k] = nil - end - effectGroupPool:Put(effectGroup) - end -end - function Skill:ResetCD() if not self.isTeamSkill then if self.owner.superSkill == self then diff --git a/luafight/Modules/Battle/Logic/BattleLogic.lua b/luafight/Modules/Battle/Logic/BattleLogic.lua index 26e403341..74e7b78ee 100644 --- a/luafight/Modules/Battle/Logic/BattleLogic.lua +++ b/luafight/Modules/Battle/Logic/BattleLogic.lua @@ -14,8 +14,6 @@ local enemyMP local playerAggro local enemyAggro -local playerAggroChangable -local enemyAggroChangable local playerSkillUsable local enemySkillUsable @@ -84,9 +82,6 @@ function BattleLogic.Init(data, optionData) playerTeamSkillIndex = 1 enemyTeamSkillIndex = 1 - playerAggroChangable = true - enemyAggroChangable = true - playerSkillUsable = true enemySkillUsable = true @@ -185,24 +180,12 @@ end function BattleLogic.SetAggro(role, duration) if role.camp == 1 then - if playerAggroChangable then - playerAggro = role - if enemySkillUsable then - BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, role, max(duration/2, 0.3)) - end - playerAggroChangable = false - BattleLogic.WaitForTrigger(duration-BattleLogic.GameDeltaTime, function () --减去一帧避免卡点 - playerAggroChangable = true - end) + playerAggro = role + if enemySkillUsable then + BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, role, max(duration/2, 0.3)) end else - if enemyAggroChangable then - enemyAggro = role - enemyAggroChangable = false - BattleLogic.WaitForTrigger(duration-BattleLogic.GameDeltaTime, function () --减去一帧避免卡点 - enemyAggroChangable = true - end) - end + enemyAggro = role end end @@ -249,12 +232,14 @@ function BattleLogic.GetSkillUsable(camp) end function BattleLogic.WaitForTrigger(delayTime, action) + delayTime = floor(delayTime * 100000 + 0.5) / 100000 --进行精度处理,避免前后端计算不一致 + local delayFrame = floor(delayTime * BattleLogic.GameFrameRate + 0.5) local item = actionPool:Get() - item[1] = curFrame + floor(delayTime * BattleLogic.GameFrameRate + 0.5) + item[1] = curFrame + delayFrame item[2] = action tbActionList:Add(item) if BattleLogic.IsOpenBattleRecord then - BattleLogic.RecordDelayTrigger(delayTime, curFrame + floor(delayTime * BattleLogic.GameFrameRate + 0.5)) + BattleLogic.RecordDelayTrigger(delayTime, curFrame + delayFrame) end end @@ -284,19 +269,13 @@ function BattleLogic.CurFrame() return curFrame end - ---local list = {} function BattleLogic.Query(func, inCludeDeadRole) - --for i=1, #list do - -- list[i] = nil - --end local list = {} local index = 1 if func then for i=1, objList.size do local v = objList.vList[i] if func(v) and (inCludeDeadRole or not v.isDead) then - --if memoize(func, v) and (inCludeDeadRole or not v.isDead) then list[index] = v index = index + 1 end @@ -474,7 +453,7 @@ end --Record专用 function BattleLogic.RecordDelayTrigger(delayFrame, triggerFrame) - table.insert(record, string.format("frame:%d, delayFrame:%d, triggerFrame:%d", curFrame, delayFrame, triggerFrame)) + table.insert(record, string.format("frame:%d, delayTime:%f, triggerFrame:%d", curFrame, delayFrame, triggerFrame)) end --Record专用 diff --git a/luafight/Modules/Battle/Logic/RoleLogic.lua b/luafight/Modules/Battle/Logic/RoleLogic.lua index ef549287f..eeb5074a3 100644 --- a/luafight/Modules/Battle/Logic/RoleLogic.lua +++ b/luafight/Modules/Battle/Logic/RoleLogic.lua @@ -72,12 +72,10 @@ end function RoleLogic:Dispose() if self.skill then - self.skill:Dispose() skillPool:Put(self.skill) self.skill = nil end if self.superSkill then - self.superSkill:Dispose() skillPool:Put(self.superSkill) self.superSkill = nil end diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java index d0875544d..2d99a9fac 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java @@ -57,7 +57,7 @@ public class SSkillLogicConfig implements BaseConfig { return effect; } - public int getEffectValueIndex (int[][] effectArr,int value){ + public int getEffectValueIndex (int[][] effectArr,int value, int index){ StringBuilder effectStr = new StringBuilder(); for (int[] effects :effectArr){ for (int eff :effects){ @@ -73,14 +73,18 @@ public class SSkillLogicConfig implements BaseConfig { for (int i =0 ; i < ints.length; i++){ map.put(i,ints[i]); } - int index = 0; + int backIndex = 0; + int flag = 0; for (Map.Entry entry : map.entrySet()){ if (entry.getValue() == value){ - index = entry.getKey(); - break; + backIndex = entry.getKey(); + if (flag == index){ + break; + } + flag++; } } - return index; + return backIndex; } public float[][] getEffectValue() { @@ -120,7 +124,7 @@ public class SSkillLogicConfig implements BaseConfig { }else { effectInfo.append("|").append(effects[i]); } - int index = getEffectValueIndex(effect, effects[i]); + int index = getEffectValueIndex(effect, effects[i], i ); float[] effectValue = effectValues[index]; for (float effectVal : effectValue) { effectInfo.append("#").append(effectVal); From 8d9b8e1ff84152d88d2a27fd86b15f27bc8ae3bd Mon Sep 17 00:00:00 2001 From: jiahuiwen <1024696487@qq.com> Date: Sat, 23 Mar 2019 17:14:18 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ljsd/jieling/handler/map/EventType.java | 2 + .../ljsd/jieling/handler/map/MapLogic.java | 51 +++++++++---------- .../handler/map/behavior/BehaviorUtil.java | 24 +++++++++ .../map/behavior/DestroyPointBehavior.java | 3 -- .../map/behavior/MonitorMissionBehavior.java | 12 +---- .../map/behavior/TwentyFiveBehavior.java | 25 +++++++++ 6 files changed, 75 insertions(+), 42 deletions(-) create mode 100644 serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/TwentyFiveBehavior.java diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java index d0dbfd705..08c864601 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java @@ -53,6 +53,7 @@ public class EventType { * 行为参数:任务id#地图id#坐标(不输入地图id和坐标而输入0代表回主城) * 20 战斗并销毁指定地图点 * + * 25 完成任务往下推一步,销毁当前地图点,服务器跳转地图点到指定状态,客户端不读取新事件, 任务id#地图点id#新事件id * 26 接受任务,可直接做的任务 * 27 开启新任务,此任务需要激活 */ @@ -75,6 +76,7 @@ public class EventType { public static final int monitorMissionAndMove = 19; public static final int destroyPointAnd = 20; + public static final int twentyFive = 25; public static final int openAppointMission = 26; public static final int openNotDoMission = 27; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index ea564c56f..d37a1facd 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -107,18 +107,18 @@ public class MapLogic { if (mapId > mapManager.getCurMapId()) { return; } - SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapId); - if (energy < scMapConfig.getEnergyConfused()) { - LOGGER.info("enterMap() uid=>{} energy=>{} need=>{} energy not enough ", uid, energy, scMapConfig.getEnergyConfused()); - MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), ""); - return; - } - int leftEnergy = energy - scMapConfig.getEnergyConfused(); - user.getPlayerInfoManager().setEnergy(leftEnergy); - if (mapId != mapManager.getCurMapId()) { - initMap(mapManager, user); - user.setMapManager(mapManager); - } +// SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapId); +// if (energy < scMapConfig.getEnergyConfused()) { +// LOGGER.info("enterMap() uid=>{} energy=>{} need=>{} energy not enough ", uid, energy, scMapConfig.getEnergyConfused()); +// MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), ""); +// return; +// } +// int leftEnergy = energy - scMapConfig.getEnergyConfused(); +// user.getPlayerInfoManager().setEnergy(leftEnergy); +// if (mapId != mapManager.getCurMapId()) { +// initMap(mapManager, user); +// user.setMapManager(mapManager); +// } } List cells = new ArrayList<>(mapManager.getMapInfo().size()); for (Map.Entry entry : mapManager.getMapInfo().entrySet()) { @@ -230,6 +230,7 @@ public class MapLogic { public void updateMap(ISession session, int curXY, int triggerXY, List cells, MessageTypeProto.MessageType messageType) throws Exception { + LOGGER.info("updateMap() curXY=>{},triggerXY=>{}", curXY, triggerXY); if (triggerXY != curXY) { boolean isConnect = CellUtil.checkIsNextCell(curXY, triggerXY); if (!isConnect) { @@ -270,14 +271,11 @@ public class MapLogic { } mapManager.setTotalStep(leftStep); } - Cell cell = mapManager.getMapInfo().get(curXY); + Cell cell = mapManager.getMapInfo().get(triggerXY); if (cell == null) { - cell = mapManager.getMapInfo().get(triggerXY); - if (cell == null) { - LOGGER.info("xy is wrong =>{} triggerXY=>{}", curXY, triggerXY); - MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), ""); - return; - } + LOGGER.info("xy is wrong =>{} triggerXY=>{}", curXY, triggerXY); + MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), ""); + return; } mapManager.setTriggerXY(triggerXY); mapManager.addWalkCells(new HashSet<>(cells)); @@ -305,14 +303,11 @@ public class MapLogic { MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), ""); return; } - Cell cell = mapManager.getMapInfo().get(mapManager.getCurXY()); + Cell cell = mapManager.getMapInfo().get(mapManager.getTriggerXY()); if (cell == null) { - cell = mapManager.getMapInfo().get(mapManager.getTriggerXY()); - if (cell == null) { - LOGGER.info("cell == null xy is wrong =>{} triggerXY=>{}", mapManager.getCurXY(), mapManager.getTriggerXY()); - MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), ""); - return; - } + LOGGER.info("cell == null xy is wrong =>{} triggerXY=>{}", mapManager.getCurXY(), mapManager.getTriggerXY()); + MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), ""); + return; } int bigEventId = cell.getEventId(); if (eventId != bigEventId) { @@ -464,8 +459,8 @@ public class MapLogic { if (dropBuilder != null) { eventUpdateResponse.setDrop(dropBuilder); } -// LOGGER.info("updateEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}, mission=>{}, nextEventId=>{}, eventBehaviorCommon=>{}", mapManager.getCurXY(), cell == null ? 0 : cell.getPointId(), -// cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMissionList(), nextEventId, eventBehaviorCommon); + LOGGER.info("updateEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}, mission=>{}, nextEventId=>{}, eventBehaviorCommon=>{}", mapManager.getCurXY(), cell == null ? 0 : cell.getPointId(), + cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMissionList(), nextEventId, eventBehaviorCommon); MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java index 450bd4bad..24af85f34 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java @@ -167,4 +167,28 @@ public class BehaviorUtil { } return true; } + + /** + * 销毁当前点 + * @param user + */ + public static void destoryCurPoint(User user) { + Map mapInfo = user.getMapManager().getMapInfo(); + mapInfo.remove(user.getMapManager().getCurXY()); + } + + /** + * 改变其他点eventId + * @param user + * @throws Exception + */ + public static void changeOtherPoint(User user, int pointId, int eventId) throws Exception { + Map mapInfo = user.getMapManager().getMapInfo(); + for (Cell cell : mapInfo.values()) { + if (cell.getPointId() == pointId) { + cell.setEventId(eventId); + } + } + } + } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/DestroyPointBehavior.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/DestroyPointBehavior.java index a3749a282..c31709bb1 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/DestroyPointBehavior.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/DestroyPointBehavior.java @@ -1,13 +1,10 @@ package com.ljsd.jieling.handler.map.behavior; -import com.ljsd.jieling.handler.map.Cell; import com.ljsd.jieling.handler.map.EventType; import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.protocols.MapInfoProto; import org.springframework.stereotype.Component; -import java.util.Map; - @Component public class DestroyPointBehavior extends BaseBehavior { @Override diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/MonitorMissionBehavior.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/MonitorMissionBehavior.java index eccdc7a65..1a1b4aa03 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/MonitorMissionBehavior.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/MonitorMissionBehavior.java @@ -21,16 +21,6 @@ public class MonitorMissionBehavior extends BaseBehavior { @Override public boolean process(User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception { - Map doingMissions = user.getMissionManager().getDoingMissions(); - Mission mission = doingMissions.get(behaviorTypeValues[0][0]); - if (mission == null || !mission.isOpen()) { - return false; - } - CheckMissionReturn checkMissionReturn = MissionLogic.getInstance().checkMission(mission, user); - for (Mission cmission : checkMissionReturn.missions){ - CommonProto.Mission missionProto = MapLogic.getInstance().getMission(cmission); - eventUpdateResponse.addMission(missionProto); - } - return true; + return BehaviorUtil.updateMission(user, behaviorTypeValues[0][0], eventUpdateResponse); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/TwentyFiveBehavior.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/TwentyFiveBehavior.java new file mode 100644 index 000000000..8570ad6b7 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/TwentyFiveBehavior.java @@ -0,0 +1,25 @@ +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.protocols.MapInfoProto; +import org.springframework.stereotype.Component; + +@Component +public class TwentyFiveBehavior extends BaseBehavior { + @Override + public int getBehaviorType() { + return EventType.twentyFive; + } + + @Override + public boolean process(User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception { + boolean flag = BehaviorUtil.updateMission(user, behaviorTypeValues[0][0], eventUpdateResponse); + if (!flag) { + return flag; + } + BehaviorUtil.destoryCurPoint(user); + BehaviorUtil.changeOtherPoint(user, behaviorTypeValues[0][1], behaviorTypeValues[0][2]); + return true; + } +} From f7b6fb9afc868ac0fe11decb7486cc29c95e85b5 Mon Sep 17 00:00:00 2001 From: jiahuiwen <1024696487@qq.com> Date: Sat, 23 Mar 2019 17:14:58 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/server/EventPointConfig.txt | 52 ++++++++++++- conf/server/MissionEventsConfig.txt | 4 +- conf/server/OptionAddCondition.txt | 114 ++++++++++++++++++++++++++++ conf/server/OptionConfig.txt | 112 +++++++++++++++++++-------- 4 files changed, 246 insertions(+), 36 deletions(-) diff --git a/conf/server/EventPointConfig.txt b/conf/server/EventPointConfig.txt index 23dce0285..235bbad86 100644 --- a/conf/server/EventPointConfig.txt +++ b/conf/server/EventPointConfig.txt @@ -32,8 +32,6 @@ int mut,int#int,1 100030 100032 100031 100033 100032 100034 -100033 100035 -100034 100036 101001 10101 101002 10102 101003 10110 @@ -249,6 +247,10 @@ int mut,int#int,1 101213 101302 101214 101303 101215 101304 +101216 101305 +101217 101306 +101218 101307 +101219 101308 102001 10101 102002 10102 102003 10104 @@ -411,6 +413,7 @@ int mut,int#int,1 102160 102242#102243 102161 102244#102245 102162 102246 +102163 102247 103001 10301 103002 10303 103003 10305 @@ -535,6 +538,7 @@ int mut,int#int,1 103122 103179#103180 103123 103181#103182 103124 103183 +103125 103184 104001 10401 104002 10403 104003 10407 @@ -677,6 +681,22 @@ int mut,int#int,1 104139 104169#104170 104140 104171#104172 104141 104173 +104142 104174 +104143 104175 +104144 104176 +104145 104177 +104146 104178 +104147 104179 +104148 104180 +104149 104181 +104150 104182 +104151 104183 +104152 104184 +104153 104185 +104154 104186 +104155 104187 +104156 104188 +104157 104189 105001 10501 105002 10502 105003 10503 @@ -787,6 +807,27 @@ int mut,int#int,1 105108 105166#105167 105109 105168#105169 105110 105170 +105111 105171 +105112 105172 +105113 105173 +105114 105174 +105115 105175 +105116 105176 +105117 105177 +105118 105178 +105119 105179 +105120 105180 +105121 105181 +105122 105182 +105123 105183 +105124 105184 +105125 105185 +105126 105186 +105127 105187 +105128 105188 +105129 105189 +105130 105190 +105131 105191 106001 10601 106002 10602 106003 10604 @@ -871,6 +912,13 @@ int mut,int#int,1 106082 10603 106083 106119 106084 106120 +106085 106121 +106086 106122 +106087 106123 +106088 106124 +106089 106125 +106090 106126 +106091 106127 107001 null 107002 null 107003 null diff --git a/conf/server/MissionEventsConfig.txt b/conf/server/MissionEventsConfig.txt index 5ddd19a9c..1f2617333 100644 --- a/conf/server/MissionEventsConfig.txt +++ b/conf/server/MissionEventsConfig.txt @@ -5,8 +5,8 @@ int int int int 3 1 6 2002 4 1 3 2003 5 1 4 2004 -6 1 3 2005 -7 1 2 2006 +6 1 4 2005 +7 1 3 2006 8 1 2 2007 9 1 1 2008 10 1 2 2009 diff --git a/conf/server/OptionAddCondition.txt b/conf/server/OptionAddCondition.txt index c9bb53e52..cc88bce59 100644 --- a/conf/server/OptionAddCondition.txt +++ b/conf/server/OptionAddCondition.txt @@ -15,3 +15,117 @@ int int mut,int#int,2 13 4 3#1 14 4 6#1 15 4 9#1 +10101 6 0#2#5 +10102 6 1#2#5 +10103 0 null +10104 0 null +10105 0 null +10106 0 null +10107 0 null +10108 0 null +10109 0 null +10201 6 0#3#6 +10202 6 1#3#6 +10301 6 0#4#3 +10302 6 1#4#3 +10401 6 1#5#4 +10402 6 0#5#4 +10501 6 1#6#4 +10502 6 0#6#4 +10601 6 1#7#3 +10602 6 0#7#3 +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null +0 0 null diff --git a/conf/server/OptionConfig.txt b/conf/server/OptionConfig.txt index fc61ee4a8..f4c377785 100644 --- a/conf/server/OptionConfig.txt +++ b/conf/server/OptionConfig.txt @@ -29,18 +29,16 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 100027 0 0 null null 1 100026 100028 0 0 null null 1 100027 100029 0 0 null null 1 100028 -100030 0 27 2#101 null 1 100029 +100030 0 27 2 null 1 100029 100031 0 19 1#100#20#29 null 4 null -100032 0 0 null null 1 null +100032 0 26 2 null 4 null 100033 0 0 null null 1 null -100034 0 26 2 null 4 null -100035 0 0 null null 1 null -100036 0 26 101 null 4 null +100034 0 26 101 null 4 null 101001 1 2 1503#1 1001#1101#1201#1301 4 null 101002 0 0 null null 4 null -101003 0 19 2#0 null 4 null +101003 0 0 null null 5 101143 101004 0 0 null null 4 null -101005 0 0 null null 5 101007 +101005 0 27 101 null 5 101007 101006 0 0 null null 4 null 101007 0 0 null null 5 101008 101008 0 1 10101 null 1 101009 @@ -172,7 +170,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 0 0 0 null null 0 null 0 0 0 null null 0 null 101136 0 0 null null 1 101099 -101137 0 27 3 null 1 101100 +101137 0 0 null null 1 101100 101138 0 9 2 null 4 null 101139 0 0 null null 0 null 101140 0 0 null null 0 null @@ -232,14 +230,14 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 101194 0 0 null null 1 101142 101195 0 9 2 null 4 null 101196 0 0 null null 5 101144 -101197 0 0 null null 5 101146 -101198 0 0 null null 1 101147 -101199 0 0 null null 1 101148 -101200 0 0 null null 4 null +101197 0 0 null null 5 101145 +101198 0 0 null null 1 101146 +101199 0 27 3 null 1 101147 +101200 0 19 2#0 null 4 null 101201 0 0 null null 4 null 101202 10 0 null null 1 101067 101203 0 0 null null 4 null -101204 0 19 2#102#2#5 null 4 null +101204 0 0 null null 4 null 101205 0 0 null null 4 null 101206 14 0 null null 1 101155 101207 0 0 null null 4 null @@ -339,7 +337,11 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 101301 0 0 null null 1 101213 101302 0 0 null null 4 null 101303 0 0 null null 1 null -101304 0 26 3 null 4 null +101304 0 0 null null 1 null +101305 0 0 null null 1 null +101306 0 0 null null 1 null +101307 0 0 null null 1 null +101308 0 26 3 null 4 null 102001 1 2 1503#1 1002#1102#1202#1302 4 null 102002 0 0 null null 4 null 102003 1 2 1503#1 1002#1102#1202#1302 4 null @@ -359,9 +361,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102017 0 0 null 10102 4 null 102018 0 0 null 10102 4 null 102019 0 0 null 10102 4 null -102020 0 5 0 null 4 null +102020 0 0 null null 5 102123 102021 0 0 null null 4 null -102022 0 19 3#103#19#2 null 4 null +102022 0 5 103#19#2 null 4 null 102023 0 0 null null 4 null 102024 6 14 3|1503#1 null 1 102016 102025 0 0 null null 4 null @@ -506,8 +508,8 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102164 0 0 null null 1 102113 102165 0 0 null null 1 102114 102166 0 0 null null 1 102115 -102167 0 0 null null 1 102116 -102168 0 0 null null 4 null +102167 0 27 3 null 1 102116 +102168 0 19 2#0 null 4 null 102169 0 0 null null 5 102118 102170 0 0 null null 1 102119 102171 0 0 null null 1 102120 @@ -516,8 +518,8 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102174 0 15 102030 null 4 null 102175 0 0 null null 1 102124 102176 0 0 null null 1 102125 -102177 0 0 null null 1 102126 -102178 0 0 null null 4 null +102177 0 27 4 null 1 102126 +102178 0 19 3#0 null 4 null 102179 0 0 null null 1 102128 102180 0 0 null null 4 null 102181 0 0 null null 1 102129 @@ -586,6 +588,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 102244 0 1 10102 null 1 102162 102245 0 0 null null 4 null 102246 0 0 null null 4 null +102247 0 26 4 null 4 null 103001 1 2 1503#1 1003#1103#1203#1303 4 null 103002 0 0 null null 4 null 103003 1 2 1503#1 1003#1103#1203#1303 4 null @@ -600,16 +603,16 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 103012 0 0 null null 4 null 103013 1 2 1503#1 1003#1103#1203#1303 4 null 103014 0 0 null null 4 null -103015 0 5 0 null 4 null +103015 0 19 4#0 null 4 null 103016 0 0 null null 4 null -103017 0 19 4#104#2#3 null 4 null +103017 0 0 null null 4 null 103018 0 0 null null 4 null 103019 0 1 10301 null 1 103014 103020 0 0 null null 4 null 103021 0 0 null null 4 null 103022 0 0 null null 4 null 103023 0 0 null null 4 null -103024 0 0 null null 3 103020 +103024 0 0 null null 5 103020 103025 0 0 null null 4 null 103026 0 0 null null 1 103021 103027 0 0 null null 1 103022 @@ -633,7 +636,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 103045 0 0 null null 1 103041 103046 0 0 null null 0 null 103047 0 0 null null 0 null -103048 0 11 4|103#13#15#103012 null 4 null +103048 0 27 5 null 4 null 103049 0 0 null null 1 103043 103050 0 0 null null 4 null 103051 0 1 10301 null 1 103044 @@ -769,6 +772,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 103181 0 1 10305 null 1 103124 103182 0 0 null null 4 null 103183 0 0 null null 4 null +103184 0 26 5 null 4 null 104001 1 2 1503#1 1004#1104#1204#1304 4 null 104002 0 0 null null 4 null 104003 1 2 1503#1 1004#1104#1204#1304 4 null @@ -785,9 +789,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 104014 0 0 null null 4 null 104015 1 2 1503#1 1004#1104#1204#1304 4 null 104016 0 0 null null 4 null -104017 0 5 0 null 4 null +104017 0 19 5#0 null 4 null 104018 0 0 null null 4 null -104019 0 19 5#105#14#4 null 4 null +104019 0 0 null null 4 null 104020 0 0 null null 4 null 104021 0 0 null null 1 104018 104022 0 0 null null 4 null @@ -916,7 +920,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 104145 0 0 null null 0 null 104146 0 0 null null 0 null 104147 0 0 null null 1 104110 -104148 0 11 5|104#40#3#104014 null 1 104119 +104148 0 27 6 null 1 104119 104149 0 15 104026 null 4 null 104150 0 0 null null 0 null 104151 0 0 null null 0 null @@ -942,6 +946,22 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 104171 0 1 10505 null 1 104141 104172 0 0 null null 4 null 104173 0 0 null null 4 null +104174 0 0 null null 5 null +104175 0 0 null null 5 null +104176 0 0 null null 5 null +104177 0 0 null null 5 null +104178 0 26 6 null 4 null +104179 0 0 null null 0 null +104180 0 0 null null 0 null +104181 0 0 null null 0 null +104182 0 0 null null 0 null +104183 0 0 null null 0 null +104184 0 0 null null 0 null +104185 0 0 null null 0 null +104186 0 0 null null 0 null +104187 0 0 null null 0 null +104188 0 0 null null 0 null +104189 0 0 null null 0 null 105001 1 2 1503#1 1005#1105#1205#1305 4 null 105002 0 0 null null 4 null 105003 1 2 1503#1 1005#1105#1205#1305 4 null @@ -958,9 +978,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 105014 0 0 null null 4 null 105015 1 2 1503#1 1005#1105#1205#1305 4 null 105016 0 0 null null 4 null -105017 0 5 0 null 4 null +105017 0 19 6#0 null 4 null 105018 0 0 null null 4 null -105019 0 19 6#106#6#17 null 4 null +105019 0 0 null null 4 null 105020 0 0 null null 4 null 105021 3 0 null 10102 4 null 105022 0 0 null null 4 null @@ -1059,7 +1079,7 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 105115 0 0 null null 1 105074 105116 0 0 null null 5 105075 105117 0 0 null null 5 105076 -105118 0 11 6|105#3#20#105014 null 1 105077 +105118 0 27 7 null 1 105077 105119 0 15 105032 null 4 null 105120 0 0 null null 4 null 105121 0 0 null null 4 null @@ -1112,6 +1132,27 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 105168 0 0 null 10102 1 105110 105169 0 0 null null 4 null 105170 0 0 null null 4 null +105171 0 0 null null 1 null +105172 0 0 null null 1 null +105173 0 26 7 null 4 null +105174 0 0 null null 1 105115 +105175 0 0 null null 5 105116 +105176 0 0 null null 5 105117 +105177 0 0 null null 5 105118 +105178 0 0 null null 5 105119 +105179 0 0 null null 5 105120 +105180 0 0 null null 5 105121 +105181 0 0 null null 5 105122 +105182 0 0 null null 5 105123 +105183 0 0 null null 4 null +105184 0 0 null null 1 105125 +105185 0 0 null null 1 105126 +105186 0 0 null null 1 105127 +105187 0 0 null null 1 105128 +105188 0 0 null null 5 105129 +105189 0 0 null null 5 105130 +105190 0 0 null null 1 105131 +105191 0 0 null null 4 null 106001 1 2 1503#1 10102 4 null 106002 0 0 null null 4 null 106003 1 2 1503#1 10102 4 null @@ -1128,9 +1169,9 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 106014 0 0 null null 4 null 106015 1 2 1503#1 10102 4 null 106016 0 0 null null 4 null -106017 0 5 0 null 4 null +106017 0 19 7#0 null 4 null 106018 0 0 null null 4 null -106019 0 19 8#107#26#29 null 4 null +106019 0 0 null null 4 null 106020 0 0 null null 4 null 106021 0 1 10101 null 4 null 106022 0 0 null null 4 null @@ -1232,6 +1273,13 @@ int int int mut,int#int,2 mut,int#int,1 int mut,int#int,2 106118 0 0 null null 0 null 106119 0 0 null null 4 null 106120 0 0 null null 4 null +106121 0 0 null null 1 106086 +106122 0 0 null null 1 106087 +106123 0 0 null null 4 null +106124 0 0 null null 1 106089 +106125 0 0 null null 1 106090 +106126 0 0 null null 1 106091 +106127 0 0 null null 4 null 107001 1 2 1503#1 10102 4 null 107002 0 0 null null 4 null 107003 1 2 1503#1 10102 4 null From c7c43110e64916d0d32e3b227cd5b79ea74811de Mon Sep 17 00:00:00 2001 From: mashiyu Date: Sat, 23 Mar 2019 18:14:38 +0800 Subject: [PATCH 14/16] bug --- .../java/com/ljsd/jieling/config/SSkillLogicConfig.java | 9 +++++++-- .../java/com/ljsd/jieling/logic/fight/CheckFight.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java index 2d99a9fac..c16ba2659 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java @@ -4,6 +4,7 @@ import com.ljsd.jieling.logic.STableManager; import com.ljsd.jieling.logic.Table; import com.ljsd.jieling.util.StringUtil; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -69,7 +70,8 @@ public class SSkillLogicConfig implements BaseConfig { } } int[] ints = StringUtil.parseFiledInt(effectStr.toString()); - Map map = new ConcurrentHashMap<>(); + + Map map = new HashMap<>(); for (int i =0 ; i < ints.length; i++){ map.put(i,ints[i]); } @@ -81,8 +83,8 @@ public class SSkillLogicConfig implements BaseConfig { if (flag == index){ break; } - flag++; } + flag++; } return backIndex; } @@ -105,6 +107,9 @@ public class SSkillLogicConfig implements BaseConfig { for (int i = 0; i < targets.length ; i++){ SkillTargetVo skillTargetVo = new SkillTargetVo(); skillTargetVo.setTargetId((int) targets[i][0]); +// if (skillTargetVo.getTargetId()==30011){ +// System.out.println("SSSSSS"); +// } skillTargetVo.setContinuedTime(targets[i][1]); skillTargetVo.setEffectVale(getEffectVal(effect[i],effectValue,effect)); skillTargetVos.add(skillTargetVo); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java index fc0f20683..9678892e6 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java @@ -78,7 +78,7 @@ public class CheckFight { LuaValue func = transCoderObj.get(LuaValue.valueOf("Execute")); LuaValue result = func.call(LuaValue.valueOf(seed),fightData,optionData); int status = result.get("result").toint(); - int[] resultCache = new int[6]; + int[] resultCache = new int[]{}; resultCache[0]=status; LOGGER.info(" lua check test fight result : "+ status); if (status==1){ From 0805e3c16e6f69a2b4c8ffa321b0d16476dd0d4e Mon Sep 17 00:00:00 2001 From: mashiyu Date: Sat, 23 Mar 2019 18:17:38 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E7=A7=8D=E5=AD=90=E9=9A=8F=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java index 1439921b2..db3e1307e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/behavior/BehaviorUtil.java @@ -132,8 +132,8 @@ public class BehaviorUtil { fightData.addAllMonsterList(monsterGroupList); //设置战斗随机种子 -// int seed = (int)(System.currentTimeMillis()/1000); - int seed = 1553167956; + int seed = (int)(System.currentTimeMillis()/1000); +// int seed = 1553167956; fightData.setFightSeed(seed); fightStartRespons.setFightData(fightData); From cc9b412f634efc9072384fc7c28b8acd2a7cd8a3 Mon Sep 17 00:00:00 2001 From: mashiyu Date: Mon, 25 Mar 2019 10:58:38 +0800 Subject: [PATCH 16/16] bug --- .../Modules/Battle/Logic/Base/RoleData.lua | 3 ++- luafight/Modules/Battle/Logic/Base/Skill.lua | 23 +++++++++++++++++-- luafight/Modules/Battle/Logic/RoleLogic.lua | 2 ++ .../jieling/config/SSkillLogicConfig.java | 7 +++--- .../ljsd/jieling/logic/fight/CheckFight.java | 2 +- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Base/RoleData.lua b/luafight/Modules/Battle/Logic/Base/RoleData.lua index 978f9e4fd..3433d800d 100644 --- a/luafight/Modules/Battle/Logic/Base/RoleData.lua +++ b/luafight/Modules/Battle/Logic/Base/RoleData.lua @@ -1,6 +1,7 @@ RoleData = {} RoleData.__index = RoleData local max = math.max +local floor = math.floor function RoleData.New() local instance = {role=0, data={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}} setmetatable(instance, RoleData) @@ -10,7 +11,7 @@ end function RoleData:Init(role, data) self.role = role for i=1, #data do - self.data[i] = data[i] + self.data[i] = floor(data[i] * 100000 + 0.5) / 100000 --进行精度处理,避免前后端计算不一致 end end diff --git a/luafight/Modules/Battle/Logic/Base/Skill.lua b/luafight/Modules/Battle/Logic/Base/Skill.lua index 4958bad8c..1e0c373fd 100644 --- a/luafight/Modules/Battle/Logic/Base/Skill.lua +++ b/luafight/Modules/Battle/Logic/Base/Skill.lua @@ -102,6 +102,12 @@ local function chooseTarget(role, chooseId, exceptList) end return arr end +local effectPool = BattleObjectPool.New(function () + return {0, {}} -- type, {args, ...} +end) +local effectGroupPool = BattleObjectPool.New(function () + return { 0, 0, {}} -- chooseId, duration, {effect1, effect2, ...} +end) Skill = {} @@ -127,11 +133,11 @@ function Skill:Init(role, effectData) local v for i=2, #effectData do v = effectData[i] - local effectGroup = { 0, 0, {}} -- chooseId, duration, {effect1, effect2, ...} + local effectGroup = effectGroupPool:Get() -- chooseId, duration, {effect1, effect2, ...} effectGroup[1] = v[1] --chooseId effectGroup[2] = v[2] --duration for j=3, #v do --effectList - local effect = {0, {}} -- type, {args, ...} + local effect = effectPool:Get() -- type, {args, ...} effect[1] = v[j][1] for k=2, #v[j] do effect[2][k-1] = v[j][k] @@ -142,6 +148,19 @@ function Skill:Init(role, effectData) end end +function Skill:Dispose() + local effectGroup + while self.effectList.size > 0 do + effectGroup = self.effectList.buffer[self.effectList.size] + for k=1, #effectGroup[3] do + effectPool:Put(effectGroup[3][k]) + effectGroup[3][k] = nil + end + effectGroupPool:Put(effectGroup) + self.effectList:Remove(self.effectList.size) + end +end + function Skill:ResetCD() if not self.isTeamSkill then if self.owner.superSkill == self then diff --git a/luafight/Modules/Battle/Logic/RoleLogic.lua b/luafight/Modules/Battle/Logic/RoleLogic.lua index eeb5074a3..ef549287f 100644 --- a/luafight/Modules/Battle/Logic/RoleLogic.lua +++ b/luafight/Modules/Battle/Logic/RoleLogic.lua @@ -72,10 +72,12 @@ end function RoleLogic:Dispose() if self.skill then + self.skill:Dispose() skillPool:Put(self.skill) self.skill = nil end if self.superSkill then + self.superSkill:Dispose() skillPool:Put(self.superSkill) self.superSkill = nil end diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java index c16ba2659..a01de1fb9 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SSkillLogicConfig.java @@ -111,7 +111,7 @@ public class SSkillLogicConfig implements BaseConfig { // System.out.println("SSSSSS"); // } skillTargetVo.setContinuedTime(targets[i][1]); - skillTargetVo.setEffectVale(getEffectVal(effect[i],effectValue,effect)); + skillTargetVo.setEffectVale(getEffectVal(effect[i],effectValue, effect, i)); skillTargetVos.add(skillTargetVo); } SSkillLogicVo sSkillLogicVo = new SSkillLogicVo(); @@ -121,7 +121,7 @@ public class SSkillLogicConfig implements BaseConfig { return sSkillLogicVo; } - private float[][] getEffectVal(int[] effects, float[][] effectValues,int[][] effect) { + private float[][] getEffectVal(int[] effects, float[][] effectValues,int[][] effect,int arrIndex) { StringBuilder effectInfo = new StringBuilder(); for (int i = 0; i < effects.length; i++) { if (effectInfo.length() == 0){ @@ -129,7 +129,8 @@ public class SSkillLogicConfig implements BaseConfig { }else { effectInfo.append("|").append(effects[i]); } - int index = getEffectValueIndex(effect, effects[i], i ); +// int index = getEffectValueIndex(effect, effects[i], i ); + int index = i + arrIndex; float[] effectValue = effectValues[index]; for (float effectVal : effectValue) { effectInfo.append("#").append(effectVal); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java index 9678892e6..d204b4d29 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/fight/CheckFight.java @@ -78,7 +78,7 @@ public class CheckFight { LuaValue func = transCoderObj.get(LuaValue.valueOf("Execute")); LuaValue result = func.call(LuaValue.valueOf(seed),fightData,optionData); int status = result.get("result").toint(); - int[] resultCache = new int[]{}; + int[] resultCache = new int[result.length()+1]; resultCache[0]=status; LOGGER.info(" lua check test fight result : "+ status); if (status==1){