client/lua_probject/extend_project/extend/majiang/hongzhong/EXRoomConfig.lua

180 lines
3.8 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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 = ""
local str = "红中麻将" .. sp
local round = self.round
if not round then
if self.config["opt"]== 1 then
round = 1
else
round = 8
end
end
str = str .. (round== 1 and '' or round) .. "局结算,可接炮" .. sp or ""
str = str .. RoomConfig.GetDes(self, sp)
if self.config["queyimen"] 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.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.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))
str = str .. '首局随机庄闲' .. ""
return str
end
function M:GetGameName()
local round = self.round
if not round then
if self.config["opt"]== 1 then
round = 1
else
round = 8
end
end
return round == 1 and '红把结' or "红中麻将"
end
function M:GetGameJS()
local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_MJ_HongZhong/gamerule")
return gamerulepanel
end
return M