397 lines
7.4 KiB
Lua
397 lines
7.4 KiB
Lua
|
|
|
||
|
|
|
||
|
|
|
||
|
|
---
|
||
|
|
local M = {}
|
||
|
|
|
||
|
|
|
||
|
|
--- Create a new RoomConfig
|
||
|
|
function M.new(config)
|
||
|
|
setmetatable(M,{__index = RoomConfig})
|
||
|
|
local self = setmetatable({}, {__index = M})
|
||
|
|
RoomConfig.init(self,config)
|
||
|
|
self.class = "RoomConfig"
|
||
|
|
self.config=config
|
||
|
|
self.round = config["times"]
|
||
|
|
self.Qidui = config["qidui"]
|
||
|
|
self.QiangGang = config["qiangkong"]
|
||
|
|
self.QiangGangNiao = config["qiangkong_niao"]
|
||
|
|
self.Zhama = config["niao_opt"]
|
||
|
|
local isOpenLaizi8=false
|
||
|
|
--if config["laizi"]==3 then
|
||
|
|
-- isOpenLaizi8=true
|
||
|
|
--end
|
||
|
|
self.Laizi = isOpenLaizi8 --是否是8个赖子
|
||
|
|
self.LaiziType=config["laizi"]
|
||
|
|
self.NiaoType = config["niao"]
|
||
|
|
--self.Zhamatype= config["niao_opt"]
|
||
|
|
self.piao_niao = config["piao_niao"]
|
||
|
|
self.Jiangma = config["jiangma"]
|
||
|
|
self.isHidden = config.isHidden
|
||
|
|
|
||
|
|
self.Qanggangquanbao=config["qianggang_type"]
|
||
|
|
self.Gangbaoquanbao=config["gangbao_type"]
|
||
|
|
self.Minggangkeqiang=config["qiangkong_ming"]
|
||
|
|
self.geng_zhuan=config["geng_zhuan"]
|
||
|
|
self.jiejiegao=config["jiejiegao"]
|
||
|
|
self.jiejiegao_first=config["jiejiegao_first"]
|
||
|
|
self.wuguijiabei=config["wuguijiabei"]
|
||
|
|
self.no_wan=config["no_wan"]
|
||
|
|
self.ma_gen_di_fen=config["ma_gen_di_fen"]
|
||
|
|
self.ma_gen_gong=config["ma_gen_gong"]
|
||
|
|
self.qidui_jiafan=config["qidui_jiafan"]
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:GetDes(sp)
|
||
|
|
sp = sp or " "
|
||
|
|
local count=0
|
||
|
|
local str = self.round and self.round .. "局" .. " " or ""
|
||
|
|
str = str .. RoomConfig.GetDes(self, sp).."\n"
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if self.config["chipai"] then
|
||
|
|
str = str .."可吃牌"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["must_hu"] then
|
||
|
|
str = str .."自动胡"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["jiejiegao"] then
|
||
|
|
str = str .."连庄"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=4
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
if (self.LaiziType==3) then
|
||
|
|
str = str .. "翻双鬼"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
elseif self.LaiziType==1 then
|
||
|
|
str = str .. "大小王做鬼"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=1
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
elseif self.LaiziType==2 then
|
||
|
|
str = str .. "大小王加翻鬼"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=0
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
else
|
||
|
|
str = str .. "无鬼"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=4
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.NiaoType==0 then
|
||
|
|
str = str .. "无马"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=4
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
elseif self.NiaoType==1 then
|
||
|
|
if self.Zhama==1 then
|
||
|
|
str = str .. "买二马"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
elseif self.Zhama==2 then
|
||
|
|
str = str .. "买四马"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
elseif self.Zhama==3 then
|
||
|
|
str = str .. "买六马"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
elseif self.Zhama==4 then
|
||
|
|
str = str .. "买八马"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
elseif self.NiaoType==2 then
|
||
|
|
local strMB="爆炸马加分"
|
||
|
|
if self.Zhama==1 then
|
||
|
|
strMB="爆炸马加倍"
|
||
|
|
end
|
||
|
|
str = str .. strMB
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=1
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.ma_gen_di_fen then
|
||
|
|
str = str .."马跟底分"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=2
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.ma_gen_gong then
|
||
|
|
str = str .."马跟杠"
|
||
|
|
count=count+1
|
||
|
|
if count%2==0 then
|
||
|
|
str = str .."\n"
|
||
|
|
else
|
||
|
|
sp1=""
|
||
|
|
local strL=3
|
||
|
|
for i=1,strL do
|
||
|
|
sp1=sp1.." "
|
||
|
|
end
|
||
|
|
str = str .. sp1..sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
str = str.sub(str, 1, string.len(str) - string.len(sp))
|
||
|
|
return str
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
function M:GetDes2(sp)
|
||
|
|
sp = sp or " "
|
||
|
|
local str = RoomConfig.GetDes(self, sp)
|
||
|
|
local str = self.round and self.round .. "局" .. sp or ""
|
||
|
|
str = str .. RoomConfig.GetDes(self, sp)
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
if self.config["chipai"] then
|
||
|
|
str = str .."可吃牌"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["must_hu"] then
|
||
|
|
str = str .."自动胡"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["jiejiegao"] then
|
||
|
|
str = str .."连庄"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
if (self.LaiziType==3) then
|
||
|
|
str = str .. "翻双鬼"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.LaiziType==1 then
|
||
|
|
str = str .. "大小王做鬼"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.LaiziType==2 then
|
||
|
|
str = str .. "大小王加翻鬼"
|
||
|
|
str = str .. sp
|
||
|
|
else
|
||
|
|
str = str .. "无鬼"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.NiaoType==0 then
|
||
|
|
str = str .. "无马"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.NiaoType==1 then
|
||
|
|
if self.Zhama==1 then
|
||
|
|
str = str .. "买2马"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.Zhama==2 then
|
||
|
|
str = str .. "买4马"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.Zhama==3 then
|
||
|
|
str = str .. "买6马"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.Zhama==4 then
|
||
|
|
str = str .. "买8马"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
elseif self.NiaoType==2 then
|
||
|
|
local strMB="爆炸马加分"
|
||
|
|
if self.Zhama==1 then
|
||
|
|
strMB="爆炸马加倍"
|
||
|
|
end
|
||
|
|
str = str .. strMB
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.ma_gen_di_fen then
|
||
|
|
str = str .."马跟底分"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.ma_gen_gong then
|
||
|
|
str = str .."马跟杠"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
--if (self.piao_niao) then
|
||
|
|
-- str = str .. "飘鸟" .. sp
|
||
|
|
--end
|
||
|
|
|
||
|
|
--[[if (self.NiaoType) then
|
||
|
|
if self.NiaoType == 1 then
|
||
|
|
str = str .. string.format("扎%d码", self.Zhama * 2)
|
||
|
|
elseif self.NiaoType == 2 then
|
||
|
|
str = str .. "一码全中"
|
||
|
|
elseif self.NiaoType == 3 then
|
||
|
|
str = str .. "窝窝鸟" .. sp .. (self.Zhama == 1 and "1鸟2分" or "1鸟1分")
|
||
|
|
end
|
||
|
|
str = str .. sp
|
||
|
|
|
||
|
|
-- if self.NiaoType ~= 2 and self.Jiangma > 0 then
|
||
|
|
-- str = str .. "没有红中奖" .. self.Jiangma .. "码" .. sp
|
||
|
|
-- end
|
||
|
|
if self.Jiangma > 0 then
|
||
|
|
str = str .. "没有红中奖" .. self.Jiangma .. "码" .. sp
|
||
|
|
end
|
||
|
|
end--]]
|
||
|
|
|
||
|
|
str = str.sub(str, 1, string.len(str) - string.len(sp))
|
||
|
|
return str
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
function M:GetGameJS()
|
||
|
|
local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_MJ_QiZhiBa/gamerule")
|
||
|
|
return gamerulepanel
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
function M:GetGameSMSize()
|
||
|
|
return 467,500
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
function M:GetGameName()
|
||
|
|
return "七支八"
|
||
|
|
end
|
||
|
|
|
||
|
|
return M
|