Parcourir la source

修改100抽逻辑

gitxsm il y a 3 semaines
Parent
commit
d53fdc764d
1 fichiers modifiés avec 22 ajouts et 5 suppressions
  1. 22 5
      script/module/drawCard/DrawCardLogic.lua

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

@@ -758,21 +758,36 @@ local function draw(human, id, op, actConfig, skip,isAct)
     local fenjielist = {}
     local heroIDs = nil
 
-    local randomMin = math.random(1, heroCnt)
+    -- local randomMin = math.random(1, heroCnt)
+    local randomMinSet = {}
+    if id == DRAWCARD_ID2 then
+        if op == DRAWCARD_OP_2 then
+            -- 十连:1个保底位置
+            randomMinSet[math.random(1, 10)] = true
+        elseif op == DRAWCARD_OP_3 then
+            -- 百连:分成10组,每组10抽里随机1个保底位置,共10次
+            for group = 0, 9 do
+                local pos = math.random(1, 10) + group * 10
+                randomMinSet[pos] = true
+            end
+        end
+    end
 
     local tag = 0
 
     for i = 1, heroCnt do
         config = DrawCardExcel[id]
         -- if id == DRAWCARD_ID2 and op == DRAWCARD_OP_2 and i == randomMin and getDraw2Cnt(human, id) > 3 then
-        if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
+        -- if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
+        if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and randomMinSet[i] then
             config = DrawCardExcel[DRAWCARD_ID5]
         elseif id == DRAWCARD_ID2 and op == DRAWCARD_OP_1 then
             config = DrawCardExcel[DRAWCARD_ID6]
         end
 
         
-        if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
+        -- if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and i == randomMin then
+        if id == DRAWCARD_ID8 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and randomMinSet[i] then
             config = DrawCardExcel[DRAWCARD_ID10]
         end
 
@@ -782,7 +797,8 @@ local function draw(human, id, op, actConfig, skip,isAct)
         end
 
         -- 高级召唤前5次10连每轮必出SSR
-        if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and i ~= randomMin and tag == 0 then
+        -- if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and i ~= randomMin and tag == 0 then
+        if id == DRAWCARD_ID2 and (op == DRAWCARD_OP_2 or op == DRAWCARD_OP_3) and getDraw2Cnt(human, id) < DRAWCARD_ID2_CNT and not randomMinSet[i] and tag == 0 then
             config = DrawCardExcel[DRAWCARD_ID7]
             tag = 1
         end
@@ -796,7 +812,8 @@ local function draw(human, id, op, actConfig, skip,isAct)
             config = DrawCardExcel[DRAWCARD_ID9]
         end
 
-        local heroID = randHeroID(human, id, op, config, actConfig, i == randomMin, isAct)
+        -- local heroID = randHeroID(human, id, op, config, actConfig, i == randomMin, isAct)
+        local heroID = randHeroID(human, id, op, config, actConfig, randomMinSet[i], isAct)
         local heroConfig = HeroExcel[heroID]
         local star = heroConfig.star
 		local name = heroConfig.name