From ac1476379c26a5fab030f3a1c5fa438da569da88 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Fri, 14 Sep 2018 09:10:30 -0400 Subject: [PATCH] implement corresponding wild matching for sub lists (drop support for `nil` in sublists, such a thing doesn't make any sense anyway) --- minislots_engine/engine.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/minislots_engine/engine.lua b/minislots_engine/engine.lua index 9e26a88..a1df228 100644 --- a/minislots_engine/engine.lua +++ b/minislots_engine/engine.lua @@ -59,6 +59,13 @@ function minislots.spin_reels(def) -- if reel == 4 then n = 10 end -- if reel == 5 then n = 14 end +-- force a mixed-7's win, 5-reel, but with one wild card on the mixed-7's payline +-- local n = 3 +-- if reel == 2 then n = 10 end +-- if reel == 3 then n = 9 end +-- if reel == 4 then n = 10 end +-- if reel == 5 then n = 14 end + -- force the all-wilds win shown in the cabinet graphics, 3-reel -- local n = 10 -- if reel == 2 then n = 9 end @@ -122,14 +129,17 @@ function minislots.check_win(spin, def, maxlines) break end else - local matchlistwin = false + local sublistmatch = false for e in ipairs(m[reel+1]) do paylinecontent[payline][reel] = spin[row][reel][2] - if not m[reel+1][e] or spin[row][reel][2] == m[reel+1][e] then - matchlistwin = true + if spin[row][reel][2] == m[reel+1][e] + or (spin[row][reel][2] == "wild" + and not (def.wild_doesnt_match + and def.wild_doesnt_match[m[reel+1][e]])) then + sublistmatch = true end end - if not matchlistwin then matchwin = false break end + if not sublistmatch then matchwin = false break end end end