zhanwencai пре 1 година
родитељ
комит
252e48fc43
2 измењених фајлова са 17 додато и 10 уклоњено
  1. BIN
      script/file3.tar.gz
  2. 17 10
      script/module/role/NewLogic.lua

BIN
script/file3.tar.gz


+ 17 - 10
script/module/role/NewLogic.lua

@@ -88,16 +88,23 @@ function NewProto(human, type, param)
             local fatherHeroBagIndex = tonumber(tb[1]) or 0
             local motherHeroBagIndex = tonumber(tb[2]) or 0
 
-            local fatherHeroGrid     = human.db.heroBag[fatherHeroBagIndex]
+            Log.write(Log.LOGID_TEST, "查询融合前的 fatherHeroBagIndex: " .. fatherHeroBagIndex)
+            Log.write(Log.LOGID_TEST, "查询融合前的 motherHeroBagIndex: " .. motherHeroBagIndex)
+
+            local fatherHeroGrid = human.db.heroBag[fatherHeroBagIndex]
             if not fatherHeroGrid then
                 return
             end
 
+            Log.write(Log.LOGID_TEST, "查询融合前的 fatherHeroGrid: " .. Json.Encode(fatherHeroGrid))
+
             local motherHeroGrid = human.db.heroBag[motherHeroBagIndex]
             if not motherHeroGrid then
                 return
             end
 
+            Log.write(Log.LOGID_TEST, "查询融合前的 motherHeroGrid: " .. Json.Encode(motherHeroBagIndex))
+
             local mergeInfo  = {}
             local heroSimple = {}
             local xLv        = getxLv(fatherHeroGrid, motherHeroGrid)
@@ -215,7 +222,7 @@ function NewProto(human, type, param)
             if cf.grade >= 6 then
                 heroSimple.name = "?????"
             end
-            mergeInfo.mergeTime        = human.db.mergeInfo.hatchTime
+            mergeInfo.mergeTime        = getHatchTime(xLv)
             mergeInfo.xLv              = xLv
             mergeInfo.heroData         = heroSimple
             mergeInfo.isHatch          = 1
@@ -440,7 +447,7 @@ function NewProto(human, type, param)
             msgRet.ret                 = QUICK_HATCH_TYPE
             msgRet.tip                 = Json.Encode(mergeInfo)
 
-            Log.write(Log.LOGID_TEST, "加速孵化 ret: " .. Json.Encode(ret))
+            Log.write(Log.LOGID_TEST, "加速孵化 ret: " .. Json.Encode(msgRet))
 
             Msg.send(msgRet, human.fd)
             return
@@ -478,15 +485,15 @@ end
 
 -- 初始化融合信息
 function initMergeInfo(human)
-    human.db.mergeInfo = human.db.mergeInfo or {}
-    human.db.mergeInfo.mergeTime = human.db.mergeInfo.mergeTime or 0 --融合时间 时间戳
-    human.db.mergeInfo.hatchTime = human.db.mergeInfo.hatchTime or 0 --孵化时间 单位s
-    human.db.mergeInfo.heroInfo = human.db.mergeInfo.heroInfo or {}
-    human.db.mergeInfo.heroInfo.heroID = human.db.mergeInfo.heroInfo.heroID or 0
-    human.db.mergeInfo.heroInfo.xLv = human.db.mergeInfo.heroInfo.xLv or 0
+    human.db.mergeInfo                             = human.db.mergeInfo or {}
+    human.db.mergeInfo.startTime                   = human.db.mergeInfo.startTime or 0 --融合时间 时间戳
+    human.db.mergeInfo.endTime                     = human.db.mergeInfo.endTime or 0   --孵化时间 单位s
+    human.db.mergeInfo.heroInfo                    = human.db.mergeInfo.heroInfo or {}
+    human.db.mergeInfo.heroInfo.heroID             = human.db.mergeInfo.heroInfo.heroID or 0
+    human.db.mergeInfo.heroInfo.xLv                = human.db.mergeInfo.heroInfo.xLv or 0
     human.db.mergeInfo.heroInfo.fatherHeroBagIndex = human.db.mergeInfo.heroInfo.fatherHeroBagIndex or 0
     human.db.mergeInfo.heroInfo.motherHeroBagIndex = human.db.mergeInfo.heroInfo.motherHeroBagIndex or 0
-    human.db.mergeInfo.heroInfo.heroAttrs = human.db.mergeInfo.heroInfo.heroAttrs or RoleDefine.PANEL_ATTR_KEY
+    human.db.mergeInfo.heroInfo.heroAttrs          = human.db.mergeInfo.heroInfo.heroAttrs or RoleDefine.PANEL_ATTR_KEY
 end
 
 -- 获取孵化时间 单位s