jxlast/lua_probject/extend_project/extend/poker/twodoudizhu/TwoDouDiZhu_RoomConfig.lua

199 lines
3.9 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 = "TwoDouDiZhu_RoomConfig"
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.fourBeltThree = config.fourBeltThree
self.threeBeltTwo = config.threeBeltTwo
self.baseMul =config.baseMul
self.rangXian = config.rangXian
self.threezhang = config.threezhang
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.rangXian == 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
end
if self.fourBeltThree == 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
end
if self.threeBeltTwo == 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
end
if self.baseMul == 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.Rule == 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
end
if self.threezhang == 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
end
return str
end
function M:GetGameJS()
local gamerulepanel= UIPackage.CreateObjectFromURL("ui://Extend_Poker_TwoDouDiZhu/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