yunque9/lua_probject/extend_project/extend/poker/mushi/MuShi_RoomConfig.lua

444 lines
8.3 KiB
Lua

---
--- Created by 谌建军.
--- DateTime: 2017/12/19 10:54
---
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 = "MuShi_RoomConfig"
self.config=config
self.Leaf = config.leaf
self.Rule = config.rule
self.Times = config.times
self.WillBeOut = config.willBeOut
self.Heart10 = config.heartten
self.BombSpring = config.minboom
self.AA = config.aa
self.PlayerNum = config.maxPlayers
self.showlength = config.showlength
self.fourBeltThree=config.fourBeltThree
self.demolition=config.demolition
self.fangzuobi=config.fangzuobi
self.planelack=config.planelack
self.threelack=config.threelack
self.threeA=config.threeA
self.tuoguan_active_time=config.tuoguan_active_time
self.tuoguan=config.tuoguan
self.tuoguan_result_type=config.tuoguan_result_type
self.isNonnegative=config.isNonnegative
self.sandaidan = config.sandaidan
self.isHidden = config.isHidden
self.ba = config.ba
self.fs = config.fs
self.area = config.area
self.playType = config.playType
self.mushiMul = config.mushiMul
self.laizi = config.laizi
self.tiangong = config.tiangong
self.opt = config.opt
if config.piao ~= nil then
self.piao = config.piao
else
self.piao = 0
end
if config.daniao ~= nil then
self.daniao = config.daniao
else
self.daniao = 0
end
if self.isNonnegative == nil then
self.isNonnegative = 0
end
self.energyTab=config.energyTab
if self.energyTab==nil then
self.energyTab=0
end
return self
end
function M:GetDes(sp)
sp = sp or " "
local str = ""
-- str = str.. self.Times.."局"..sp
str = str .. RoomConfig.GetDes(self, sp).." "
local count=1
if self.playType == 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
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.mushiMul == 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.mushiMul ==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.mushiMul ==2 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.mushiMul ==3 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.opt == 1) then
-- str = str.."10局"
-- 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.opt == 2) then
-- str = str.."15局"
-- 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.."20局"
-- 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.playType == 0 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
else
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.mushiMul == 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.mushiMul ==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.mushiMul ==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
elseif self.mushiMul ==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
end
if self.laizi == 0 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.laizi ==1 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.tiangong == 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
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
str = str.."\n"
return str
end
function M:GetDes2(sp)
sp = sp or " "
local str = "房间规则:"
-- str = str.. self.Times.."局"..sp
str = str .. RoomConfig.GetDes(self, sp)
if self.playType == 0 then
str = str.. "潮汕"
else
str = str.. "汕头"
end
if self.mushiMul == 0 then
str = str.."抢庄"..sp
elseif self.mushiMul ==1 then
str = str.."木虱鱼"..sp
elseif self.mushiMul ==2 then
str = str.."房主坐庄"..sp
elseif self.mushiMul ==3 then
str = str.."轮庄"..sp
end
if (self.opt == 1) then
str = str.."10局"..sp
elseif (self.opt == 2) then
str = str.."15局"..sp
else
str = str.."20局"..sp
end
if self.playType == 0 then
str = str.. "潮汕玩法"..sp
else
str = str.. "汕头玩法"..sp
end
if self.mushiMul == 0 then
str = str.."抢庄"..sp
elseif self.mushiMul ==1 then
str = str.."木虱鱼"..sp
elseif self.mushiMul ==2 then
str = str.."房主坐庄"..sp
elseif self.mushiMul ==3 then
str = str.."轮庄"..sp
end
if self.laizi == 0 then
str = str.."2鬼(大小鬼)"..sp
elseif self.laizi ==1 then
str = str.."翻鬼"..sp
else
str = str.."无鬼"..sp
end
if self.tiangong == 0 then
str = str.."翻倍"..sp
else
str = str.."不翻倍"..sp
end
str = str.."\n"
return str
end
function M:GetGameJS()
local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_Poker_MuShi/gamerule")
return gamerulepanel
end
function M:GetGameSMSize()
return 467,500
end
function M:GetGameName()
return "木虱"
end
--function M:GetIsShowCardNumber()
-- return self.ShowNumber == 1
--end
return M