zhanwencai 1 anno fa
parent
commit
4e364c76eb
1 ha cambiato i file con 18 aggiunte e 5 eliminazioni
  1. 18 5
      script/module/drawCard/DrawCardLogic.lua

+ 18 - 5
script/module/drawCard/DrawCardLogic.lua

@@ -164,14 +164,22 @@ function getDrawCurCnt(human, id)
     if not info then return 0 end
 
     info.drawLV = info.drawLV or 0
-    local drawCurCnt = info.cntHero3 or 0
+    info.cntHero3 = info.cntHero3 or 0
 
-    if drawCurCnt == 0 then return drawCurCnt end
+    Log.write(Log.LOGID_TEST, "getDrawCurCnt start")
+    Log.write(Log.LOGID_TEST, "drawLV" .. info.drawLV .. "cntHero3" .. info.cntHero3)
 
-    local drawNextLvCnt = DrawLevelExcel[info.drawLV]
-    if not drawNextLvCnt then return 0 end
+    if info.cntHero3 == 0 then return 0 end
 
-    return drawCurCnt - drawNextLvCnt.need
+    local drawCurCnt = 0
+    local drawNextLvCnt = DrawLevelExcel[info.drawLV]
+    if not drawNextLvCnt then
+        drawCurCnt =  (info.cntHero3 - 0)
+    else
+        drawCurCnt = (info.cntHero3 - drawNextLvCnt.need)
+    end
+    Log.write(Log.LOGID_TEST, "drawCurCnt" .. drawCurCnt)
+    return drawCurCnt
 end
 
 function addDrawLv(human, id, cnt)
@@ -182,6 +190,9 @@ function addDrawLv(human, id, cnt)
     info.drawLV = info.drawLV or 0
     info.cntHero3 = (info.cntHero3 or 0) + cnt
 
+    Log.write(Log.LOGID_TEST, "addDrawLv start")
+    Log.write(Log.LOGID_TEST, "drawLV" .. info.drawLV .. "cntHero3" .. info.cntHero3)
+
     if info.drawLV >= 15 then return end
 
     for lv, val in ipairs(DrawLevelExcel) do
@@ -189,6 +200,8 @@ function addDrawLv(human, id, cnt)
             info.drawLV = lv
         end
     end
+
+    Log.write(Log.LOGID_TEST, "addDrawLv end")
 end
 
 function getDrawNextLvCnt(human, id)