159 lines
3.2 KiB
Lua
159 lines
3.2 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.config=config
|
||
|
|
self.class = "RoomConfig"
|
||
|
|
self.round = config["times"]
|
||
|
|
self.Qidui = config["qidui"]
|
||
|
|
self.QiangGang = config["qiangkong"]
|
||
|
|
self.QiangGangNiao = config["qiangkong_niao"]
|
||
|
|
self.Zhama = config["niao_opt"]
|
||
|
|
self.Laizi = config["laizi8"]
|
||
|
|
self.NiaoType = config["niao"]
|
||
|
|
self.piao_niao = config["piao_niao"]
|
||
|
|
self.Jiangma = config["jiangma"]
|
||
|
|
self.isHidden = config.isHidden
|
||
|
|
|
||
|
|
return self
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:GetDes(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.QiangGang) then
|
||
|
|
str = str .. "可抢杠胡"
|
||
|
|
str = str .. sp
|
||
|
|
if (self.QiangGangNiao) then
|
||
|
|
str = str .. "抢杠胡奖码"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
if (self.Qidui) then
|
||
|
|
str = str .."可胡七对"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
if (self.Laizi) then
|
||
|
|
str = str .. "八个红中"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["laizi4_hu"] then
|
||
|
|
str = str .."四红中起手胡"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["qiangkong_niao"] then
|
||
|
|
str = str .."抢杠胡奖码"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["hz_hu"] then
|
||
|
|
str = str .."无红中可捉炮"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["wuguijiabei"] then
|
||
|
|
str = str .."无红中自摸翻倍"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["wuguizhuopaojiabei"] 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
|
||
|
|
end
|
||
|
|
|
||
|
|
str = str..(self.config["niao_opt_score"] == 1 and "1鸟2分" or "1鸟1分")
|
||
|
|
str = str .. sp
|
||
|
|
|
||
|
|
|
||
|
|
if self.Jiangma > 0 then
|
||
|
|
str = str .. "没有红中奖" .. self.Jiangma .. "码" .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["piao_niao"]==1 then
|
||
|
|
str = str .."自由飘"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.config["piao_niao"]==2 then
|
||
|
|
str = str .."固定飘"
|
||
|
|
str = str .. sp
|
||
|
|
if self.config["piao1"] then
|
||
|
|
str = str .."飘1"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["piao2"] then
|
||
|
|
str = str .."飘2"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
|
||
|
|
if self.config["piao3"] then
|
||
|
|
str = str .."飘3"
|
||
|
|
str = str .. sp
|
||
|
|
end
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
if self.config["fengding_score"]==0 then
|
||
|
|
str = str .."无封顶"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.config["fengding_score"]==1 then
|
||
|
|
str = str .."35分封顶"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.config["fengding_score"]==1 then
|
||
|
|
str = str .."40分封顶"
|
||
|
|
str = str .. sp
|
||
|
|
elseif self.config["fengding_score"]==1 then
|
||
|
|
str = str .."45分封顶"
|
||
|
|
str = str .. sp
|
||
|
|
|
||
|
|
end
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
str = str.sub(str, 1, string.len(str) - string.len(sp))
|
||
|
|
return str
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:GetGameName()
|
||
|
|
return "红中麻将"
|
||
|
|
end
|
||
|
|
|
||
|
|
function M:GetGameJS()
|
||
|
|
local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_MJ_HongZhong/gamerule")
|
||
|
|
return gamerulepanel
|
||
|
|
end
|
||
|
|
|
||
|
|
return M
|