local xichongFunctions=ZPFramework.ZPFrameworkClassImprot("zp_base.luaScript.ZPFunctions") local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef") --获取小家是否可以看牌 function xichongFunctions.getLittleIsCanLookCard() --[[ local roomInfo = app.room.roomInfo; local jsonInfo = json.decode(roomInfo.strGameInfo) if jsonInfo then if getNumBand(jsonInfo.specialRule,0x0020) > 0 then return true end end--]] return false end --获取字牌资源名字 function xichongFunctions.getZPCardImgByValue(value,cardType,desktopType,backType) local textureName = "" if not backType then backType = ZPDef.BackType.Red end if not desktopType then desktopType = ZPDef.GameStyleType.XIANDAI end if cardType == ZPDef.CardType.CARD_TYPE_HAND then --手牌 if value > 0 then textureName = string.format(ZPDef.CardFile.CARD_FILE_HAND,desktopType,value) end elseif cardType == ZPDef.CardType.CARD_TYPE_TABLE then --组合牌 if value > 0 then textureName = string.format(ZPDef.CardFile.CARD_FILE_WEAVE_CARD,value) else textureName = string.format(ZPDef.CardFile.CARD_FILE_WEAVE_CARD,backType) end elseif cardType == ZPDef.CardType.CARD_TYPE_OUTCARD then --出牌 if value > 0 then textureName = string.format(ZPDef.CardFile.CARD_FILE_OUT_CARD,desktopType,value) else textureName = string.format(ZPDef.CardFile.CARD_FILE_OUT_CARD_BACK,desktopType,backType) end elseif cardType == ZPDef.CardType.CARD_TYPE_GROUPCARD then if value > 0 then textureName = string.format(ZPDef.CardFile.CARD_FILE_GROUP_CARD,desktopType,value) end end return textureName end --获取操作显示类型 function xichongFunctions.getZPOperationType(mType,isHaveGuo,isChongZhao) local mResult = {} --默认有过操作 if isHaveGuo then table.insert(mResult,ZPDef.OpType.OP_TYPE_CANCEL) end --判断是否有吃 local retChi = bit32.band(mType,ZPDef.OpCode.OP_CHI) if retChi > 0 then table.insert(mResult,ZPDef.OpType.OP_TYPE_CHI) end --判断是否有碰 local retPeng = bit32.band(mType,ZPDef.OpCode.OP_PENG) if retPeng > 0 then table.insert(mResult,ZPDef.OpType.OP_TYPE_PENG) end --判断是否有巴 local retBa2 = bit32.band(mType,ZPDef.OpCode.OP_BA_ZHUA) if retBa2 > 0 then table.insert(mResult,ZPDef.OpType.OP_TYPE_ANSIZHANG) end --判断是否有偷 local retTou2 = bit32.band(mType,ZPDef.OpCode.OP_TOU_ZHUA) if retTou2 > 0 then table.insert(mResult,ZPDef.OpType.OP_TYPE_ANSANZHANG) end --判断是否有偷垮 local retTou2 = bit32.band(mType,ZPDef.OpCode.OP_KUA) if retTou2 > 0 then table.insert(mResult,ZPDef.OpType.OP_TYPE_KUA) end --判断是否有违规 local retweigui = bit32.band(mType,ZPDef.OpCode.OP_WEIGUI) if retweigui > 0 then table.insert(mResult,ZPDef.OpType.OP_TYPE_WEIGUI) end --判断是否有胡 local retHu = bit32.band(mType,ZPDef.OpCode.OP_HU) if retHu > 0 then --isHaveGuo = false ---有胡必须胡,没有过 table.insert(mResult,ZPDef.OpType.OP_TYPE_HU) end local retHu1 = bit32.band(mType,ZPDef.OpCode.OP_TIAN_HU) if retHu1 > 0 then --isHaveGuo = false ---有胡必须胡,没有过 table.insert(mResult,ZPDef.OpType.OP_TYPE_HU) end print("getchangpaiPaiOperationType : "..table.tostring(mResult)) return mResult end return xichongFunctions