yunque9/lua_probject/extend_project/extend/majiang/tuidaohu/EXRoomConfig.lua

544 lines
9.7 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.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.QiangGang) 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.Qidui) then
local strL=2
str = str .."可胡七对"
if self.qidui_jiafan then
str = str .."翻倍"
strL=0
end
count=count+1
if count%2==0 then
str = str .."\n"
else
sp1=""
for i=1,strL do
sp1=sp1.." "
end
str = str .. sp1..sp
end
end
if self.Qanggangquanbao 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.Gangbaoquanbao 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.Minggangkeqiang 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.geng_zhuan 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.jiejiegao 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.jiejiegao_first 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
end
if self.wuguijiabei 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.no_wan 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
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=2
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=4
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.QiangGang) then
str = str .. "可抢杠胡"
str = str .. sp
--if (self.QiangGangNiao) then
--str = str .. "抢杠胡奖码"
--str = str .. sp
--end
end
if (self.Qidui) then
str = str .."可胡七对"
if self.qidui_jiafan then
str = str .."-翻倍"
end
str = str .. sp
end
if self.Qanggangquanbao then
str = str .."抢杠全包"
str = str .. sp
end
if self.Gangbaoquanbao then
str = str .."杠爆全包"
str = str .. sp
end
if self.Minggangkeqiang then
str = str .."明杠可抢"
str = str .. sp
end
if self.geng_zhuan then
str = str .."跟庄"
str = str .. sp
end
if self.jiejiegao then
str = str .."节节高"
str = str .. sp
end
if self.jiejiegao_first then
str = str .."首局不累加"
str = str .. sp
end
if self.wuguijiabei then
str = str .."无鬼加倍"
str = str .. sp
end
if self.no_wan 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_TuiDaoHu/gamerule")
return gamerulepanel
end
function M:GetGameSMSize()
return 467,500
end
function M:GetGameName()
return "推倒胡"
end
return M