目录结构调整
This commit is contained in:
@@ -0,0 +1,162 @@
|
||||
var Game_Config = Game_Config||{};//相关配置
|
||||
Game_Config.Debugger={ //调试配置
|
||||
isDebugger : false, // debugger模式下会将所有收发的包输出到控制台(正式发布改为false)
|
||||
AutoLogin : true, //debugger模式下是否需要记住登录状态自动登录(正式发布改为true)
|
||||
isSubmitError : true, //是否需要服务器收集错误信息调试时可根据需要(正式发布改为true)
|
||||
visitorLogin : true, //隐藏式游客登录
|
||||
visiblePay:true, //审核通过后是否显示支付按钮
|
||||
serverType:0, //->正式服务器 0->测试服务器 1->本地服务器
|
||||
gameserver:"https://tsgames.daoqi88.cn/config/update_jsonv2.txt"
|
||||
};
|
||||
|
||||
Game_Config.Max = {
|
||||
SumOfRoomtype:5,//创建时房间类型roomtype数组长度
|
||||
ShowChat:2000,//聊天停留时间
|
||||
PlayerCnt:10,//房间最大人数
|
||||
group:500,//游戏最大群组号
|
||||
showtime:10,//加载等待最少时间
|
||||
reconnecttime:30000,//唤醒游戏间隔(超过间隔断线重连)
|
||||
Mainnickname:20,//主界面玩家昵称显示长度(字符长度)
|
||||
Infonickname:16//个人信息显示长度(字符长度)
|
||||
};
|
||||
Game_Config.Combat = {
|
||||
height:80,//战绩页单行高度高度
|
||||
up_y:190,//战绩页裁剪y坐标
|
||||
bannerheight:60,//战绩横幅高度
|
||||
bannery:80,//战绩横幅Y左边(相对48精灵)
|
||||
btnbg:50
|
||||
};
|
||||
Game_Config.Info = {
|
||||
Mainnickname:8,//游戏主界面玩家信息显示最大长度(字符)
|
||||
textwidth_1:10,//聊天显示文字的宽度(未改动聊天显示文字大小无需改动无需修改)
|
||||
textwidth_2:12.5,//聊天显示文字的宽度(未改动聊天显示文字大小无需改动无需修改)
|
||||
otherPositionDefault:false,//其他主界面玩家信息(昵称、积分)是否采用默认对齐方式对齐居中点为头像中点
|
||||
myPositionDefault:false,//其他主界面玩家信息(昵称、积分)是否采用默认对齐方式对齐居中点为头像中点
|
||||
myPosition:194,//自己信息对齐点(根据游戏界面自行修改) 5人
|
||||
position:[1195,1195,85,85], //5人
|
||||
TextContent:["快点下注啊!","大家都别抢,让我坐把庄!","下这么多注,输死你去!","输死了,一盘大牌都没摸过!","今天手气真好。","给我一个五花吧!","小手一抖,大牌到手!"],
|
||||
TextContentMp3:["","","","","","",""]//常用语对应音效
|
||||
};
|
||||
Game_Config.Share={//分享参数
|
||||
appdownload:"",//下载链接(无需配置,从服务器获取)
|
||||
title:"【友乐牛牛】",//(分享标题)
|
||||
description:"朋友圈的棋牌游戏,经典玩法,乐趣无穷!",//分享描述
|
||||
gameTitle:"",//游戏中的分享标题模板工程会自动将游戏名字分享出去、不必写在这个变量里(子游戏需要设置)
|
||||
gameDescription:"朋友圈的棋牌游戏,经典玩法,乐趣无穷!"//游戏中分享描述(子游戏需要设置)
|
||||
};
|
||||
Game_Config.Chat={//游戏内聊天配置信息
|
||||
LimitLength:40,//聊天最大长度(字节长度)
|
||||
textwidth:12.5,//聊天显示文字的宽度(未改动聊天显示文字大小无需改动无需修改)
|
||||
ChatDis:[30,15],//聊天气泡与内容的间隔0位置左右间隔(最好不要低于30)1位置上下间隔
|
||||
isLeft:[1,0,0,1,1],//聊天气泡是否为以左边为基准线
|
||||
ChatLoc:[[35,517],[1100,315],[1100,105],[175,105],[175,315]]//聊天气泡的基准点位置(注意是基准点位置!)
|
||||
|
||||
};
|
||||
Game_Config.Voice={//游戏内聊天配置信息
|
||||
VoiceTime:600,//播放语音动画的时间一般情况无需无需修改
|
||||
VoiceDis:[30,12],//语音气泡与内容的间隔0位置左右间隔(最好不要低于30)1位置上下间隔
|
||||
isLeft:[1,0,0,1,1],//气泡是否为以左边为基准线
|
||||
VoiceLoc:[[35,517],[1100,315],[1100,105],[175,105],[175,315]]//气泡的基准点位置(注意是基准点位置!)
|
||||
};
|
||||
|
||||
Game_Config.Setting={
|
||||
Ads1:"本游戏仅为娱乐休\n闲使用,房卡所有\n 游戏通用\n\n游戏问题请联系微\n 信公众号:\n",
|
||||
//Ads2:"\n 或客服号:\n",
|
||||
board:"",//从后台获取设置无效
|
||||
info:[" 客服信息","QQ:","",""],//客服QQ提醒
|
||||
//info:[" 客服信息","QQ:","手机:","微信:"],//客服QQ提醒
|
||||
board_blength:24,//通知页面一行最大字节数(无需设置)
|
||||
charge:"关注友乐微信公众号充值",//充值提示
|
||||
};
|
||||
|
||||
Game_Config.Protocol={
|
||||
x:270,//协议图片初始x坐标
|
||||
y:70,//协议图片初始y坐标
|
||||
h:560,//协议图片显示高度
|
||||
w:729//协议图片显示宽度
|
||||
};
|
||||
Game_Config.Help={//帮助
|
||||
x:276,//帮助图片初始x坐标
|
||||
y:160,//帮助图片初始y坐标
|
||||
w:729,//帮助图片显示高度
|
||||
h:482//帮助图片显示宽度
|
||||
};
|
||||
Game_Config.Notice={//滚动公告
|
||||
x1:0,//无需设置
|
||||
x2:0,//无需设置
|
||||
y:0,//无需设置
|
||||
h:0,//无需设置
|
||||
//以上参数用来截取滚动公告的显示,截取位置是与滚动公告底大小位置一致
|
||||
speed:0.1,//滚动公告的滚动速度
|
||||
width:15//滚动公告的内容字体的字节长度(汉字是两个字节)
|
||||
};
|
||||
Game_Config.Feedback = {//反馈配置
|
||||
maxLen:250 //反馈内容最大长度
|
||||
};
|
||||
Game_Config.shakeList ={//摇一摇事件的回调ID、需要添加时在此处添加回调事件写在Utl_Input.js中的Utl.shakeEvent()中
|
||||
nil:0,
|
||||
startwar:1
|
||||
};
|
||||
Game_Config.soundList ={//声音资源名
|
||||
MenuSceneMusic:"00050.mp3",//大厅界面背景音
|
||||
MainSceneMusic:"00101.mp3"//游戏主界面背景音
|
||||
};
|
||||
Game_Config.ClickButton = {//需要设置点击音效的按钮(只有有弹窗的按钮设置此音效有效、按钮已经设置好、子游戏不允许修改)
|
||||
src_1:"",//点击时播放的声音资源文件( 不需要播放则不填,下同)
|
||||
src_2:"00051.mp3"//弹窗时播放的音效
|
||||
};
|
||||
Game_Config.loginButton = {//登录按钮信息
|
||||
x1:440,//非审核版本微信登录按钮x //415
|
||||
x2:113,//审核版本微信登录按钮x
|
||||
x3:488,//审核版本游客登录按钮x
|
||||
};
|
||||
|
||||
Game_Config.sysConfig = {
|
||||
mainMenuButton:false,//是否进入主菜单界面隐藏四个按钮
|
||||
mainScenePlayerInfo:false,//是否隐藏主界面玩家信息
|
||||
mainSceneButton:false,//是否隐藏主界面按钮
|
||||
shareRoom:false,//接收到星星场是否屏蔽平台框架显示
|
||||
changeSeat:false,//是否屏蔽平台自动刷新换座后界面
|
||||
hideNotice:false,//隐藏公告栏
|
||||
vipInfinite:false,//vip房是否默认开启无限局
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,629 @@
|
||||
//注:ConsttVal中的ChatLoc与isLeft的数组长度一定要与ConstVal.Max.PlayerCnt保持一致否则会导致报错或者聊天气泡位置不对
|
||||
|
||||
Game_Modify.StartWar=function(_msg){//开战
|
||||
if(_msg.data && NN_RevData.firstStartWar){
|
||||
NN_RevData.firstStartWar(_msg.data);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify._ReceiveData=function(_msg){//接收数据包
|
||||
if(NN_Net.DoPack){
|
||||
NN_Net.DoPack(_msg);
|
||||
}
|
||||
};
|
||||
|
||||
//无限局创建新桌时返回游戏数据
|
||||
Game_Modify.onCreateRoom = function(data){
|
||||
NN_RevData.firstStartWar(data);
|
||||
};
|
||||
|
||||
Game_Modify.createRoom=function(_roomtype, _infinite){//创建房间
|
||||
if(_infinite != null){
|
||||
NN_config.isInfinite = _infinite;
|
||||
}else {
|
||||
NN_config.isInfinite = 0;
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.myJoinRoom=function(_msg){//自己进入房间
|
||||
|
||||
};
|
||||
|
||||
Game_Modify.Reconnect=function(_deskinfo){//重连
|
||||
NN_Desk = new NN_deskInfo();
|
||||
NN_Desk.initData_net(_deskinfo);
|
||||
if(NN_Desk.model_fast >= 1 || NN_Desk.model == 4 || NN_Desk.model == 5){
|
||||
if(NN_Desk.personMax == 10){
|
||||
NN_UIP.update.game();
|
||||
}else {
|
||||
NN_UIF.update.game();
|
||||
}
|
||||
}else{
|
||||
NN_UI.game(true, true);
|
||||
}
|
||||
//判断准备、换房、退出按钮显示
|
||||
//if(Utl.getPlayerReadyState(NN_Desk.myseat)){
|
||||
//Utl.closeMainSceneButton();
|
||||
//this.pList[seat].isJoin = 1;
|
||||
//}
|
||||
//测试定时刷新游戏界面
|
||||
//setInterval(function(){
|
||||
//Game_Modify.updateScene();
|
||||
//},2000);
|
||||
};
|
||||
|
||||
Game_Modify.stopAllSounds=function(){//关闭所有声音 (游戏声音)
|
||||
if(NN_playSound){
|
||||
NN_playSound();
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.Free=function(_msg){//投票解散结果为同意时,点击结果界面确认的按钮时触发
|
||||
if(NN_RevData.disbandGame){
|
||||
NN_RevData.disbandGame(_msg);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.DeskInfo=function(_msg){//开战状态下自己加入是牌桌数据
|
||||
NN_Desk = new NN_deskInfo();
|
||||
NN_Desk.initData_net(_msg);
|
||||
if(NN_Desk.model_fast >= 1 || NN_Desk.model == 4 || NN_Desk.model == 5){
|
||||
if(NN_Desk.personMax == 10){
|
||||
NN_UIP.update.game();
|
||||
}else {
|
||||
NN_UIF.update.game();
|
||||
}
|
||||
}else{
|
||||
NN_UI.game(true, true);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.breakRoom=function(){//游戏已开局情况下自己退出房间触发
|
||||
//if(NN_UI.exit_clearDesk){
|
||||
//NN_UI.exit_clearDesk();
|
||||
//}
|
||||
//先清除牛牛游戏界面
|
||||
//NN_Exit_clearUI();
|
||||
//清除牛牛游戏桌数据
|
||||
//NN_Exit_clearData();
|
||||
};
|
||||
|
||||
Game_Modify.playerJoinRoom=function(seat){//其他玩家加入房间
|
||||
if(NN_Desk.isAddPlayer){
|
||||
NN_Desk.isAddPlayer(seat);
|
||||
}
|
||||
//无限局显示玩家星星数
|
||||
if(Utl.getIsInfinite() == 1){
|
||||
NN_UIF.update.setGrade(seat, Utl.getBeanBySeat(seat), 1);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.playerLeaveRoom=function(seat){//其他玩家离开房间
|
||||
if(NN_UI.isAddPlayer){
|
||||
NN_UI.playerState_leave(seat,false);
|
||||
NN_Desk.delPlayer(seat);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.updateScene = function(){//更新游戏界面
|
||||
//根据本地数据重新显示界面
|
||||
setTimeout(function(){
|
||||
if(typeof(NN_Desk.state) != "undefined" && NN_Desk.pList){//
|
||||
var temp_NN_Desk = JSON.stringify(NN_Desk);
|
||||
if(NN_Desk.stageTime_loc > 0){
|
||||
NN_Desk.stageTime = (new Date()).getTime() - NN_Desk.stageTime_loc;
|
||||
}
|
||||
NN_RevDataRecord.over = -1;
|
||||
try{
|
||||
if(NN_Desk.model_fast >= 1 || NN_Desk.model == 4 || NN_Desk.model == 5){
|
||||
if(NN_Desk.personMax == 10){
|
||||
NN_UIP.update.game();
|
||||
}else {
|
||||
NN_UIF.update.game();
|
||||
}
|
||||
}else{
|
||||
NN_UI.game(true);
|
||||
}
|
||||
//普通房间准备按钮刷新显示
|
||||
if(Utl.getIsInfinite() != 1){
|
||||
GameUI.showReady();
|
||||
}
|
||||
}catch(e){
|
||||
//alert("重画错误:"+e.message+" \n桌数据:"+JSON.stringify(NN_Desk));
|
||||
NN_Net.submit_error("切回重画界面",e.stack+"出错时:"+JSON.stringify(NN_Desk)+" 未错时:"+temp_NN_Desk);
|
||||
}
|
||||
}
|
||||
},200);
|
||||
};
|
||||
|
||||
Game_Modify.closeGameScene=function(){//关闭游戏界面
|
||||
//if(NN_UI.exit_clearDesk){
|
||||
//NN_UI.exit_clearDesk();
|
||||
//}
|
||||
//先清除牛牛游戏界面
|
||||
NN_Exit_clearUI();
|
||||
//清除牛牛游戏桌数据
|
||||
NN_Exit_clearData();
|
||||
};
|
||||
|
||||
Game_Modify.playerOffline = function(seat){//玩家离线
|
||||
if(NN_UI.playerState_leave){
|
||||
NN_UI.playerState_leave(seat,false);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.playerOnline = function(seat){//玩家上线
|
||||
if(NN_UI.playerState_leave){
|
||||
NN_UI.playerState_leave(seat,true);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.playerphonestate = function(seat,type){//玩家电话状态type->挂断1->接打电话、有电话进来的状态
|
||||
if(NN_UI.playerState_leave){
|
||||
NN_UI.playerState_leave(seat,false);
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.shakeEvent = function(){
|
||||
switch(GameData.shakeID){
|
||||
case Game_Config.shakeList.startwar://摇一摇开战(如果有主动开战)
|
||||
var data={};
|
||||
data.agentid=GameData.AgentId;
|
||||
data.gameid=GameData.GameId;
|
||||
data.playerid=C_Player.playerid;
|
||||
data.roomcode=Desk.roomcode;
|
||||
Net.Send_self_makewar(data);
|
||||
Func.stopshake();
|
||||
GameData.shakeID=Game_Config.shakeList.nil;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.calResult = function(inputArr){
|
||||
//console.log("计算结果:"+inputArr);
|
||||
if(NN_Desk && NN_Desk.personMax == 10){
|
||||
NN_UIP.gameOver.multResult(true, inputArr);
|
||||
}else {
|
||||
NN_UI.gameOver_multResult(inputArr);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Game_Modify.onEnterMainScene = function(roomtype){//进入游戏主场景
|
||||
//玩家头像位置调整
|
||||
if(roomtype[5] && roomtype[5][5] == 1){ //10人局
|
||||
//框架相关显示
|
||||
if(roomtype[5][1] == 1){
|
||||
NN_Sprite.mainScence.init(10, 1);
|
||||
}else{
|
||||
NN_Sprite.mainScence.init(10);
|
||||
}
|
||||
}else{ //5人
|
||||
//框架相关显示
|
||||
NN_Sprite.mainScence.init(5);
|
||||
}
|
||||
|
||||
//NN_UIP.deskInfo.update();
|
||||
//游戏开始相关按钮调整
|
||||
//Game_Modify.gameFunc.updateMainSceneBtn();
|
||||
//无限局显示玩家星星数
|
||||
if(Utl.getIsInfinite() == 1){
|
||||
for(var i=0; i<5; i++){
|
||||
NN_UIF.update.setGrade(i, Utl.getBeanBySeat(i));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.onExitMainScene = function(){//退出游戏主场景
|
||||
//隐藏模式图标(比赛、星星)
|
||||
set_self(976,37,0,0,0);
|
||||
//先清除牛牛游戏界面
|
||||
NN_Exit_clearUI();
|
||||
//清除牛牛游戏桌数据
|
||||
NN_Exit_clearData();
|
||||
};
|
||||
|
||||
Game_Modify.onGameConfig = function(_gameConfig){//获取到游戏配置时调用(只在game_config有数据时才调用)
|
||||
//alert("配置文件:"+JSON.stringify(_gameConfig));
|
||||
NN_config.data = _gameConfig;
|
||||
//局数及房卡消耗 格式:[[[6,4],[12,8]],[[6,1],[12,2]]];
|
||||
if(_gameConfig.room_card && _gameConfig.room_card.length > 0){
|
||||
NN_config.room_card = _gameConfig.room_card;
|
||||
Game_Modify.gameFunc.roomCardUpdate();
|
||||
}
|
||||
/*
|
||||
if(_gameConfig.room_card && _gameConfig.room_card.length > 0){
|
||||
NN_config.room_card = _gameConfig.room_card;
|
||||
for(var i=0;i<_gameConfig.room_card[0].length;i++){
|
||||
if(_gameConfig.room_card[i].length == 2){
|
||||
//局数
|
||||
Game_Modify.Type_2[0].roomcount[i] = _gameConfig.room_card[i][0][0];
|
||||
Game_Modify.Type_2[1].roomcount[i] = _gameConfig.room_card[i][1][0];
|
||||
//房卡消耗数量
|
||||
Game_Modify.Type_2[0].roomcard[i] = _gameConfig.room_card[i][0][1];
|
||||
Game_Modify.Type_2[1].roomcard[i] = _gameConfig.room_card[i][1][1];
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
// _gameConfig.card_mult = [[9,2],[1,1,1,1,1,1,1,1,1,2,3,4,4,6]];
|
||||
//牛八2倍类型牌型倍数
|
||||
if(_gameConfig.card_mult){
|
||||
NN_config.card_mult = _gameConfig.card_mult;
|
||||
//显示
|
||||
var cap = ["一","二","三","四","五","六","七","八","九","双十"];
|
||||
if(NN_config.card_mult[0][0] < 11){
|
||||
Game_Modify.Type_3[0].des = "十带" + cap[NN_config.card_mult[0][0] - 1] + NN_config.card_mult[0][1] + "倍";
|
||||
} else {
|
||||
Game_Modify.Type_3[0].des = cap[NN_config.card_mult[0][0] - 1] + NN_config.card_mult[0][1] + "倍";
|
||||
}
|
||||
}
|
||||
//是否强制下注配置
|
||||
//if(_gameConfig.force_bet && _gameConfig.force_bet.length >= 3){
|
||||
//NN_config.force_bet = _gameConfig.force_bet;
|
||||
//}
|
||||
//NN_config.force_bet = [1,-1,2];
|
||||
//if(_gameConfig.model_bean){
|
||||
//NN_config.model_bean = gameConfig.model_bean;
|
||||
//}
|
||||
//
|
||||
//_gameConfig.cfg_bean[2] = [1,[111,222],1,[333,444]];
|
||||
//服务费
|
||||
if(_gameConfig.cfg_bean){
|
||||
if(_gameConfig.cfg_bean[0] != null){
|
||||
NN_config.cfg_bean[0] = _gameConfig.cfg_bean[0];
|
||||
}
|
||||
if(_gameConfig.cfg_bean[1] != null){
|
||||
NN_config.cfg_bean[1] = _gameConfig.cfg_bean[1];
|
||||
}
|
||||
if(_gameConfig.cfg_bean[2] != null && _gameConfig.cfg_bean[2].length == 4){
|
||||
NN_config.teaCost = NN_config.teaCost.slice(0,2).concat(_gameConfig.cfg_bean[2]);
|
||||
if(NN_config.teaCost[2] == 2 && NN_config.teaCost[3] >= 0){ //固定值时赋值
|
||||
NN_config.teaCost[1] = NN_config.teaCost[3];
|
||||
}
|
||||
}
|
||||
//离场相关
|
||||
if(_gameConfig.cfg_bean[3] != null){
|
||||
NN_config.bean_leaveMin[1] = _gameConfig.cfg_bean[3][0];
|
||||
NN_config.bean_leaveMin[2] = _gameConfig.cfg_bean[3][1];
|
||||
}
|
||||
}
|
||||
//游戏相关设置
|
||||
if(_gameConfig.cfg_game){
|
||||
//无限局
|
||||
if(_gameConfig.cfg_game[0] != null){
|
||||
NN_config.isOwnerInfinite = _gameConfig.cfg_bean[0];
|
||||
}
|
||||
}
|
||||
if(_gameConfig.ui){
|
||||
if(_gameConfig.ui[0] != null){
|
||||
NN_config.ui.sysRoomDes = _gameConfig.ui[0];
|
||||
}
|
||||
if(_gameConfig.ui[1] != null){
|
||||
NN_config.creatRoomMode[0] = _gameConfig.ui[1];
|
||||
}
|
||||
}
|
||||
//桌相关设置
|
||||
if(_gameConfig.desk){
|
||||
if(_gameConfig.desk[0] != null){ //强制下注,最低下注
|
||||
NN_config.forceBetType = _gameConfig.desk[0];
|
||||
}
|
||||
}
|
||||
//进入游戏后游戏初始化些数据
|
||||
Game_Modify.gameFunc.initData();
|
||||
|
||||
//测试数据模拟
|
||||
//NN_config.isOwnerInfinite = 1; //无限局
|
||||
};
|
||||
|
||||
Game_Modify.onEnterVideo = function(){//进入牌局回放触发
|
||||
|
||||
};
|
||||
|
||||
Game_Modify.onSurrender = function(_msg){//收到投降回包
|
||||
NN_RevData.surrender(_msg.data);
|
||||
};
|
||||
|
||||
Game_Modify.onReady = function(seat){//玩家准备触发
|
||||
if(NN_Desk && NN_Desk.model_fast != null && NN_Desk.model != null){
|
||||
if(NN_Desk.personMax == 10){
|
||||
NN_UIP.net.ready(seat);
|
||||
}else {
|
||||
NN_UIF.net.ready(seat);
|
||||
}
|
||||
//if(NN_Desk.model_fast < 1 && NN_Desk.model != 4 && NN_Desk.model != 5){
|
||||
//NN_UI.playerReady(seat);
|
||||
//}else { //快版
|
||||
//NN_UIF.net.ready(seat);
|
||||
//}
|
||||
}
|
||||
};
|
||||
|
||||
Game_Modify.getRoomInfo = function(roomtype, isInfinite ,tea, isAll){//通过roomtype获取房间描述每行最多18个字符超过需要自己换行
|
||||
if(!roomtype || (roomtype && roomtype.length == 0)){ return; }
|
||||
var _roomDes = "";
|
||||
var personType = 0;
|
||||
if(roomtype[5][5] == 1){
|
||||
personType = 1;
|
||||
}
|
||||
//局数
|
||||
if(isInfinite == 1){
|
||||
//_roomDes += " 无限局";
|
||||
_roomDes += " ";
|
||||
} else if(NN_config.room_card[personType] && NN_config.room_card[personType].length == 2){
|
||||
if(NN_config.room_card[personType][roomtype[4] - 1].length > 0 && NN_config.room_card[personType][roomtype[4] - 1][roomtype[0] - 1][0] > 0){ //房主扣卡
|
||||
if(NN_config.room_card[personType][roomtype[4] - 1][roomtype[0] - 1][0] >= 10){
|
||||
_roomDes += " " + NN_config.room_card[personType][roomtype[4] - 1][roomtype[0] - 1][0] + "局";
|
||||
}else {
|
||||
_roomDes += " " + NN_config.room_card[personType][roomtype[4] - 1][roomtype[0] - 1][0] + "局";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//扣卡张数
|
||||
if(Utl.getVersionState() != 1){
|
||||
if(isInfinite != 1 && roomtype[4] > 0){
|
||||
if(NN_config.creatRoomMode[0] != 1 || (NN_config.creatRoomMode[0] == 1 && roomtype[5][1] != 1)){ //真人竞技房不显示扣卡
|
||||
_roomDes += " " + (Game_Modify.Type_1[roomtype[4]-1].des + Game_Modify.Type_2[roomtype[0]-1].roomcard[roomtype[4]-1]);
|
||||
if(NN_config.roomCardDes.slice(1,2) == "卡"){
|
||||
_roomDes += "张";
|
||||
}
|
||||
}
|
||||
|
||||
if(_roomDes != ""){
|
||||
_roomDes += "\n";
|
||||
}
|
||||
}else {
|
||||
if(_roomDes != ""){
|
||||
_roomDes += "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
//上庄
|
||||
_roomDes += " " + Game_Modify.Type_4[roomtype[1]-1].des;
|
||||
//几副牌
|
||||
var _pairs = 0;
|
||||
if(roomtype[2] == 1){
|
||||
_pairs = 1;
|
||||
}else if(roomtype[2] == 2){
|
||||
_pairs = 2;
|
||||
}
|
||||
if(isAll){
|
||||
_roomDes += " " + _pairs + "副牌 ";
|
||||
}
|
||||
|
||||
//倍数
|
||||
_roomDes += " " + Game_Modify.Type_3[roomtype[3]-1].des;
|
||||
//快版
|
||||
if(isInfinite != 1 && roomtype[5][0] != null && roomtype[5][0] == 1){
|
||||
_roomDes += "\n 快版";
|
||||
//if(roomtype[3] == 3){
|
||||
//_roomDes += " 快版";
|
||||
//}else {
|
||||
//_roomDes += " 快版";
|
||||
//}
|
||||
}
|
||||
//强制下注
|
||||
if(isAll){
|
||||
if(isInfinite != 1 && roomtype[6] && roomtype[6][0] != null && roomtype[6][0] == 1 && roomtype[6][2] > 0){
|
||||
_roomDes += " 强制下注:" + roomtype[6][2];
|
||||
//10人局
|
||||
if(roomtype[5][5] == 1){
|
||||
_roomDes += " " + Game_Modify.Type_6[4].des;
|
||||
}
|
||||
}else {
|
||||
//10人局
|
||||
if(roomtype[5][5] == 1){
|
||||
_roomDes += " \n " + Game_Modify.Type_6[4].des;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//服务费
|
||||
//if(isInfinite != 1 && !isAll && roomtype[5][3] != null && roomtype[5][3][0] == 1 && roomtype[5][3][1] > 0){
|
||||
//if(tea != null){
|
||||
//_roomDes += " \n 房间费:" + tea;
|
||||
//}else {
|
||||
//_roomDes += " \n 房间费:" + roomtype[5][3][1];
|
||||
//}
|
||||
//}
|
||||
|
||||
//星星数
|
||||
if(isAll && roomtype[5][2] != null){
|
||||
if(roomtype[5][1] == 1){
|
||||
_roomDes += " \n " + NN_config.beanDes + "场(" + roomtype[5][2][2] + "倍)";
|
||||
_roomDes += " " + NN_config.beanDes + "数限:" + roomtype[5][2][1] + "\n";
|
||||
}else if(roomtype[5][2][0] == 1){
|
||||
_roomDes += " \n "+ NN_config.beanDes +"数限:"+ roomtype[5][2][1]+"\n";
|
||||
}
|
||||
}
|
||||
if(!isAll){
|
||||
_roomDes = _roomDes.replace(/[\r\n]/g, ""); //去除换行
|
||||
_roomDes = _roomDes.replace(/\s+/g, ' '); //多个空格替换一个空格
|
||||
if(_roomDes.substring(0,1) == " "){
|
||||
_roomDes = _roomDes.slice(1); //去除换行
|
||||
}
|
||||
}
|
||||
return _roomDes;
|
||||
};
|
||||
|
||||
Game_Modify.getStarLimit = function(roomtype){//通过roomtype获取房间星星场下限数量
|
||||
//星星数限制
|
||||
if(roomtype && roomtype[5][2] != null && roomtype[5][2][0] == 1){
|
||||
return roomtype[5][2][1];
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
Game_Modify.getMult = function(roomtype, isInfinite){//通过roomtype获取房间星星场倍数
|
||||
//星星场倍数
|
||||
if(roomtype && roomtype[5][2] != null && roomtype[5][2][0] == 1){
|
||||
if(roomtype[5][2][2] > 0){
|
||||
return roomtype[5][2][2];
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
};
|
||||
|
||||
Game_Modify.getFullRoomInfo = function(roomtype){//通过roomtype获取房间全部信息描述 返回的字符串最多两行,一行最多38字符
|
||||
return Game_Modify.getRoomInfo(roomtype, 2 , null, 1);
|
||||
};
|
||||
|
||||
Game_Modify.onOpenHelp = function(spid){//打开帮助页面触发spid为帮助内容图片精灵
|
||||
|
||||
};
|
||||
|
||||
Game_Modify.onMainMenuScene = function(){//显示大厅界面触发
|
||||
//NN_config.beanDes = Utl.getstarName(); //星星文字显示
|
||||
//NN_config.roomCardDes = Utl.getRoomCardName(); //房卡显示
|
||||
//Game_Modify.Type_6[1].des = NN_config.beanDes +"场";
|
||||
//Game_Modify.Type_6[2].des = NN_config.beanDes +"数";
|
||||
};
|
||||
|
||||
Game_Modify.onCheckInput = function(_result){ //数字输入
|
||||
|
||||
};
|
||||
|
||||
|
||||
//获取离场限制
|
||||
Game_Modify.getLeaveLimit = function(roomtype){
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
//成功获取定位信息触发
|
||||
Game_Config.onLocationInfo = function(_locationInfo){
|
||||
|
||||
};
|
||||
|
||||
//成功获取定位信息触发
|
||||
Game_Modify.onLocationInfo = function(_locationInfo){
|
||||
|
||||
};
|
||||
|
||||
//进入游戏界面创建牌桌之前调用
|
||||
Game_Modify.onCreateDesk = function(roomtype){
|
||||
NN_Sprite.init_OnCreateDesk(roomtype);
|
||||
//console.log("onCreateDesk:"+roomtype);
|
||||
};
|
||||
|
||||
Game_Modify.getVideoByRoomType = function(roomtype){
|
||||
return 0;
|
||||
};
|
||||
|
||||
//返回值为字符数组数组每项为房间一项描述信息
|
||||
Game_Modify.getRoomTopDescAry = function(roomtype){
|
||||
var _roomDes = [];
|
||||
|
||||
//局数
|
||||
var personType = 0;
|
||||
if(roomtype[5][5] == 1){
|
||||
personType = 1;
|
||||
}
|
||||
if(Utl.getIsInfinite() != 1 && NN_config.room_card[personType] && NN_config.room_card[personType].length >= 2){
|
||||
if(NN_config.room_card[personType][roomtype[4] - 1].length > 0 && NN_config.room_card[personType][roomtype[4] - 1][roomtype[0] - 1][0] > 0){ //房主扣卡
|
||||
_roomDes.push(NN_config.room_card[personType][roomtype[4] - 1][roomtype[0] - 1][0] + "局");
|
||||
}
|
||||
}
|
||||
|
||||
//扣卡张数
|
||||
if(Utl.getVersionState() != 1 && roomtype[4] > 0){
|
||||
if(NN_config.creatRoomMode[0] != 1 || (NN_config.creatRoomMode[0] == 1 && roomtype[5][1] != 1)){ //真人竞技房不显示扣卡
|
||||
_roomDes.push(Game_Modify.Type_1[roomtype[4]-1].des + Game_Modify.Type_2[roomtype[0]-1].roomcard[roomtype[4]-1]);
|
||||
if(NN_config.roomCardDes.slice(1,2) == "卡"){
|
||||
_roomDes[_roomDes.length -1] += "张";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//上庄
|
||||
_roomDes.push(Game_Modify.Type_4[roomtype[1]-1].des);
|
||||
|
||||
//几副牌
|
||||
_roomDes.push(roomtype[2] + "副牌");
|
||||
|
||||
//倍数
|
||||
_roomDes.push(Game_Modify.Type_3[roomtype[3]-1].des);
|
||||
|
||||
//强制下注
|
||||
if(Utl.getIsInfinite() != 1 && roomtype[6] && roomtype[6][0] != null && roomtype[6][0] == 1 && roomtype[6][2] > 0){
|
||||
_roomDes.push("强制下注:" + roomtype[6][2]);
|
||||
//10人局
|
||||
if(roomtype[5][5] == 1){
|
||||
_roomDes.push(Game_Modify.Type_6[4].des);
|
||||
}
|
||||
}else {
|
||||
//10人局
|
||||
if(roomtype[5][5] == 1){
|
||||
_roomDes.push(Game_Modify.Type_6[4].des);
|
||||
}
|
||||
}
|
||||
|
||||
//快版
|
||||
if(Utl.getIsInfinite() != 1 && roomtype[5][0] != null && roomtype[5][0] == 1){
|
||||
_roomDes.push("快版");
|
||||
}
|
||||
//服务费
|
||||
//if(isInfinite != 1 && !isAll && roomtype[5][3] != null && roomtype[5][3][0] == 1 && roomtype[5][3][1] > 0){
|
||||
//if(tea != null){
|
||||
//_roomDes += " \n 房间费:" + tea;
|
||||
//}else {
|
||||
//_roomDes += " \n 房间费:" + roomtype[5][3][1];
|
||||
//}
|
||||
//}
|
||||
|
||||
//星星数
|
||||
//if(isAll && roomtype[5][2] != null){
|
||||
//if(roomtype[5][1] == 1){
|
||||
//_roomDes += " \n\n " + NN_config.beanDes + "场(" + roomtype[5][2][2] + "倍)";
|
||||
//_roomDes += " \n " + NN_config.beanDes + "数限:" + roomtype[5][2][1] + "\n";
|
||||
//}else if(roomtype[5][2][0] == 1){
|
||||
//_roomDes += " \n\n "+ NN_config.beanDes +"数限:"+ roomtype[5][2][1]+"\n";
|
||||
//}
|
||||
//}
|
||||
//if(!isAll){
|
||||
//_roomDes = _roomDes.replace(/[\r\n]/g, ""); //去除换行
|
||||
//_roomDes = _roomDes.replace(/\s+/g, ' '); //多个空格替换一个空格
|
||||
//if(_roomDes.substring(0,1) == " "){
|
||||
//_roomDes = _roomDes.slice(1); //去除换行
|
||||
//}
|
||||
//}
|
||||
return _roomDes;
|
||||
};
|
||||
|
||||
//星星场房间列表
|
||||
Game_Modify.getShareRoom = function(_msg){
|
||||
|
||||
}
|
||||
//玩家自己退出房间
|
||||
Game_Modify.myExitRoom = function(seat){
|
||||
|
||||
}
|
||||
|
||||
//接收到换座包触发
|
||||
Game_Modify.changeSeat = function(seat1,seat2){
|
||||
|
||||
}
|
||||
|
||||
//判断房间是否为金币场(是金币场返回1否则返回0)
|
||||
Game_Modify.getRoomMode = function(roomtype){
|
||||
if(roomtype[5] != null ){
|
||||
if(roomtype[5][1] != null){
|
||||
if(roomtype[5][1] == 1){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user