删除 YouleNexus 内嵌 .git,统一由根仓库唯一管理。提交: - projects/ 旧 H5 模板 Game_Surface_3 与各子游戏源码 - cocoscreator_projects/YouleNexus 工程 + cocos-creator-mcp 扩展源码 - CLAUDE.md、.mcp.json 等配置 library/temp/node_modules/dist 等缓存由 .gitignore 排除。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3163 lines
112 KiB
JavaScript
3163 lines
112 KiB
JavaScript
|
||
var Game_Modify = Game_Modify||{};//子游戏可能会修改的模块
|
||
Game_Modify.game_config={};
|
||
var winnerCount = 0;
|
||
Game_Modify.roomDes = "";
|
||
Game_Modify.Type_1 = [ //扣卡
|
||
{id:0,des:"房主扣卡",roomcard:0,type:1},
|
||
{id:1,des:"每人扣卡",roomcard:0,type:2},
|
||
{id:2,des:"大赢家扣卡",roomcard:0,type:3}
|
||
];
|
||
Game_Modify.Type_2 = [ //局数
|
||
{id:0,des:"6局",roomcount:[6,6],roomcard:[4,1],type:1},
|
||
{id:1,des:"12局",roomcount:[12,12],roomcard:[8,2],type:2},
|
||
{id:2,des:"无限局",type:3}
|
||
];
|
||
Game_Modify.Type_3 = [ //玩法
|
||
{id:0,des:"十带八2倍",roomcard:0,type:1},
|
||
{id:1,des:"十带几几倍",roomcard:0,type:2},
|
||
{id:2,des:"对冲十带几几倍",roomcard:0,type:3}
|
||
];
|
||
Game_Modify.Type_4 = [ //上庄
|
||
//{id:1,des:"无牛下庄",roomcard:1,type:1},
|
||
{id:0,des:"每局抢庄",roomcard:0,type:1},
|
||
{id:1,des:"轮庄", roomcard:0,type:2},
|
||
{id:2,des:"房主坐庄",roomcard:0,type:3},
|
||
{id:3,des:"看牌抢庄",roomcard:0,type:4},
|
||
{id:4,des:"下注抢庄",roomcard:0,type:5}
|
||
];
|
||
Game_Modify.Type_5 = [ //牌数
|
||
{id:0,des:"一副牌",roomcard:0,type:1},
|
||
{id:1,des:"两副牌",roomcard:0,type:2}
|
||
];
|
||
Game_Modify.Type_6 = [ //快速
|
||
{id:0,des: "快速版",roomcard:0,type:1},
|
||
{id:1,des: NN_config.beanDes +"场",roomcard:0,type:1},
|
||
{id:2,des: NN_config.beanDes +"数限",roomcard:0,type:1,max:0,max:1000,num:0},
|
||
{id:3,des: "离场" + NN_config.beanDes,roomcard:0,type:1,max:0,max:1000,num:0},
|
||
{id:4,des: "10人局",type:1}
|
||
];
|
||
|
||
Game_Modify.CreateRoomData = {//发送创建房间数据roomtype
|
||
typeCount : 7,
|
||
//Roomcard:0,
|
||
Type_1:0,
|
||
Type_2:0,
|
||
//增加房间类型时在下面添加
|
||
Type_3:0,
|
||
Type_4:0,
|
||
Type_5:0,
|
||
Type_6:[0,0,0,0], //3:房主服务费勾选
|
||
|
||
//强制下注状态
|
||
forceBet:0,
|
||
};
|
||
|
||
Game_Modify.utlmousedown = function(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6){
|
||
|
||
}
|
||
|
||
Game_Modify.utlmousedown_nomove = function(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5){
|
||
switch(spid){
|
||
//case ConstVal.Task.f_spid:
|
||
//GameData.slideTask = false;
|
||
//break;
|
||
}
|
||
}
|
||
|
||
Game_Modify.mouseup=function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2){
|
||
if(spid_down==spid_up){
|
||
if(spid_down == 52){
|
||
var pos = get_self(50,19,0,0,0);
|
||
if(pos > Game_Config.Combat.up_y){
|
||
var t = pos - Game_Config.Combat.up_y;
|
||
play_ani(1,50,19,pos,Game_Config.Combat.up_y,0,t,0,0,0,1,0,0,0);
|
||
for(var i=0;i<C_PageOneBtn.length;i++){
|
||
var p = get_self(C_PageOneBtn[i],19,0,0,0);
|
||
var d = pos - Game_Config.Combat.up_y;
|
||
|
||
play_ani(1,C_PageOneBtn[i],19,p,p-d,0,t,0,0,0,1,0,0,0);
|
||
}
|
||
}else{
|
||
if(CombatInfo.length<=5){
|
||
if(pos < Game_Config.Combat.up_y){
|
||
var t = Game_Config.Combat.up_y - pos;
|
||
play_ani(1,50,19,pos,Game_Config.Combat.up_y,0,t,0,0,0,1,0,0,0);
|
||
for(var i=0;i<C_PageOneBtn.length;i++){
|
||
var p = get_self(C_PageOneBtn[i],19,0,0,0);
|
||
var d = pos - Game_Config.Combat.up_y;
|
||
|
||
play_ani(1,C_PageOneBtn[i],19,p,p-d,0,t,0,0,0,1,0,0,0);
|
||
}
|
||
}
|
||
}else{
|
||
var dis = Game_Config.Combat.up_y+5*(Game_Config.Combat.height+2)-CombatInfo.length*(Game_Config.Combat.height+2);
|
||
if(pos < dis){
|
||
var t = dis - pos;
|
||
play_ani(1,50,19,pos,dis,0,t,0,0,0,1,0,0,0);
|
||
for(var i=0;i<C_PageOneBtn.length;i++){
|
||
var p = get_self(C_PageOneBtn[i],19,0,0,0);
|
||
var d = pos - dis;
|
||
|
||
play_ani(1,C_PageOneBtn[i],19,p,p-d,0,t,0,0,0,1,0,0,0);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}else if(spid_down == 56){
|
||
var pos = get_self(57,19,0,0,0);
|
||
if(pos > Game_Config.Combat.up_y){
|
||
var t = pos - Game_Config.Combat.up_y;
|
||
play_ani(1,57,19,pos,Game_Config.Combat.up_y,0,t,0,0,0,1,0,0,0);
|
||
for(var i=0;i<C_PageTwoBtn.length;i++){
|
||
var p = get_self(C_PageTwoBtn[i],19,0,0,0);
|
||
var d = pos - Game_Config.Combat.up_y;
|
||
|
||
play_ani(1,C_PageTwoBtn[i],19,p,p-d,0,t,0,0,0,1,0,0,0);
|
||
}
|
||
}else{
|
||
if(CombatInfo[CombatPageTwoIndex].round.length<=5){
|
||
if(pos < Game_Config.Combat.up_y){
|
||
var t = Game_Config.Combat.up_y - pos;
|
||
play_ani(1,57,19,pos,Game_Config.Combat.up_y,0,t,0,0,0,1,0,0,0);
|
||
for(var i=0;i<C_PageTwoBtn.length;i++){
|
||
var p = get_self(C_PageTwoBtn[i],19,0,0,0);
|
||
var d = pos - Game_Config.Combat.up_y;
|
||
|
||
play_ani(1,C_PageTwoBtn[i],19,p,p-d,0,t,0,0,0,1,0,0,0);
|
||
}
|
||
}
|
||
}else{
|
||
var dis = Game_Config.Combat.up_y+5*(Game_Config.Combat.height+2)-CombatInfo[CombatPageTwoIndex].round.length*(Game_Config.Combat.height+2);
|
||
if(pos < dis){
|
||
var t = dis - pos;
|
||
play_ani(1,57,19,pos,dis,0,t,0,0,0,1,0,0,0);
|
||
for(var i=0;i<C_PageTwoBtn.length;i++){
|
||
var p = get_self(C_PageTwoBtn[i],19,0,0,0);
|
||
var d = pos - dis;
|
||
|
||
play_ani(1,C_PageTwoBtn[i],19,p,p-d,0,t,0,0,0,1,0,0,0);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
switch(spid_up){
|
||
case 25://创建房间
|
||
var data={};
|
||
data.agentid = GameData.AgentId;
|
||
data.playerid = C_Player.playerid;
|
||
data.gameid = GameData.GameId;
|
||
if(Game_Modify.CreateRoomData.Type_6[2] > 0 && ( NN_config.model_bean[1] < 0 || NN_config.bean_mult[0] < 0)){
|
||
return;
|
||
}
|
||
if(NN_config.force_bet.length > 3){
|
||
NN_config.force_bet = NN_config.force_bet.slice(0,3);
|
||
}
|
||
//data.roomtype = [局数,上庄,牌数,玩法(倍数),扣卡,快版,星星,强制下注];
|
||
data.roomtype = [Game_Modify.Type_2[Game_Modify.CreateRoomData.Type_2].type,
|
||
Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_5[Game_Modify.CreateRoomData.Type_5].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
Game_Modify.Type_1[Game_Modify.CreateRoomData.Type_1].type,
|
||
[Game_Modify.CreateRoomData.Type_6[0],
|
||
Game_Modify.CreateRoomData.Type_6[1],
|
||
[Game_Modify.CreateRoomData.Type_6[2], NN_config.model_bean[1],NN_config.bean_mult[0], NN_config.bean_leaveMin[0]],
|
||
[NN_config.teaCost[0], NN_config.teaCost[1]],
|
||
[NN_config.creatRoomMode[1], NN_config.bean_leaveMin[0]],
|
||
Game_Modify.CreateRoomData.Type_6[4]
|
||
],
|
||
NN_config.force_bet];
|
||
//console.log("创建房间发包:" + NN_config.force_bet);
|
||
//if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] > 0){
|
||
//data.infinite = NN_config.creatRoomMode[1] - 1;
|
||
//}else {
|
||
data.infinite = GameData.infMode;
|
||
//}
|
||
//发送创建包
|
||
Net.Send_create_room(data);
|
||
break;
|
||
case 150://游戏内帮助按钮
|
||
GameUI.OpenHelp();
|
||
break;
|
||
case 1118://短号战绩
|
||
/*
|
||
Game_Modify.gameView._pageOpt = -1;
|
||
if(CombatCount == null){
|
||
Game_Modify.Send_get_player_grade1(0); //我的战绩
|
||
} else {
|
||
Game_Modify.Send_get_player_grade1(1); //开房战绩
|
||
}
|
||
*/
|
||
break;
|
||
case 1166: //本地战绩
|
||
Game_Modify.gameView.locRecordsClick[1] ++;
|
||
if(Game_Modify.gameView.locRecordsClick[1] == Game_Modify.gameView.locRecordsClick[2]){
|
||
try{
|
||
var locRecords = JSON.parse(Utl.readGradeInfo());
|
||
if(locRecords.length > 0){
|
||
gameCombat.get_player_grade1({ data: {gradeinfo : locRecords}});
|
||
}
|
||
Game_Modify.gameView.locRecordsClick[0] = 1;
|
||
Game_Modify.gameView.locRecordsClick[1] = 0;
|
||
}catch(e){
|
||
//alert(e);
|
||
//TODO handle the exception
|
||
}
|
||
}
|
||
|
||
break;
|
||
case Game_Modify.gameView.combat._fspid:
|
||
var up_id = ifast_check_add(spid_up,upx,upy);
|
||
for(var i = 0; i < Game_Modify.gameView.combat._payCodeTags.length; i++){
|
||
if(Game_Modify.gameView.combat._payCodeTags[i][0] == up_id){
|
||
var temp = CombatInfo[CombatPageTwoIndex].gameinfo1.playerlist[Game_Modify.gameView.combat._payCodeTags[i][1]];
|
||
//复制玩家吱口令
|
||
if(temp && temp[4]){
|
||
//复制到粘贴板
|
||
Utl.gameCopytext(temp[4]);
|
||
//提示复制成功
|
||
Utl.openTips("吱口令复制成功",1200);
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
|
||
if(spid_up>=20 && spid_up<=21 || spid_up == 1231){ //扣卡
|
||
if(spid_up == 1231){
|
||
Game_Modify.CreateRoomData.Type_1 = 2;
|
||
} else {
|
||
Game_Modify.CreateRoomData.Type_1 = spid_up-20;
|
||
}
|
||
//不同局数消耗房卡数不同
|
||
Game_Modify.gameView.roomCardUpdate();
|
||
}else if(spid_up>=22&&spid_up<=23){ //局数
|
||
Game_Modify.CreateRoomData.Type_2 = spid_up-22;
|
||
//判断值是否正确
|
||
//var _maxCost = Game_Modify.gameFunc.getMaxTeaCost();
|
||
//if(_maxCost != -1 && NN_config.teaCost[1] > _maxCost){ //判断是否超出
|
||
//NN_config.teaCost[1] = _maxCost;
|
||
//}
|
||
}else if(spid_up == 1229){ //无限局
|
||
Game_Modify.CreateRoomData.Type_2 = 2;
|
||
//判断值是否正确
|
||
//var _maxCost = Game_Modify.gameFunc.getMaxTeaCost();
|
||
//if(_maxCost != -1 && NN_config.teaCost[1] > _maxCost){ //判断是否超出
|
||
//NN_config.teaCost[1] = _maxCost;
|
||
//}
|
||
}else if(spid_up>=139&&spid_up<=140){ //玩法
|
||
Game_Modify.CreateRoomData.Type_3 = spid_up-139;
|
||
Game_Modify.gameFunc.AnalForceBet(Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
NN_config.data.model_bet, NN_config.data.force_bet);
|
||
}else if(spid_up == 1215){ //玩法
|
||
Game_Modify.CreateRoomData.Type_3 = 2;
|
||
Game_Modify.gameFunc.AnalForceBet(Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
NN_config.data.model_bet, NN_config.data.force_bet);
|
||
}else if(spid_up>=1204&&spid_up<=1205){ //上庄
|
||
Game_Modify.CreateRoomData.Type_4 = spid_up-1204;
|
||
Game_Modify.gameFunc.AnalForceBet(Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
NN_config.data.model_bet, NN_config.data.force_bet);
|
||
}else if(spid_up == 1213){ //上庄
|
||
Game_Modify.CreateRoomData.Type_4 = 2;
|
||
Game_Modify.gameFunc.AnalForceBet(Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
NN_config.data.model_bet, NN_config.data.force_bet);
|
||
}else if(spid_up == 1225){ //看牌抢庄
|
||
Game_Modify.CreateRoomData.Type_4 = 3;
|
||
Game_Modify.gameFunc.AnalForceBet(Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
NN_config.data.model_bet, NN_config.data.force_bet);
|
||
}else if(spid_up == 1227){ //下注抢庄
|
||
Game_Modify.CreateRoomData.Type_4 = 4;
|
||
Game_Modify.gameFunc.AnalForceBet(Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
NN_config.data.model_bet, NN_config.data.force_bet);
|
||
}else if(spid_up>=1209&&spid_up<=1210){ //牌数
|
||
Game_Modify.CreateRoomData.Type_5 = spid_up-1209;
|
||
}else if(spid_up == 1318){ //10人局
|
||
if(Game_Modify.CreateRoomData.Type_6[4] == 1){
|
||
Game_Modify.CreateRoomData.Type_6[4] = 0;
|
||
//更新房卡相关参数
|
||
Game_Modify.gameFunc.roomCardUpdate(5);
|
||
} else {
|
||
Game_Modify.CreateRoomData.Type_6[4] = 1;
|
||
Game_Modify.CreateRoomData.Type_6[0] = 1;
|
||
//更新房卡相关参数
|
||
Game_Modify.gameFunc.roomCardUpdate(10);
|
||
}
|
||
//更新房卡及扣卡显示
|
||
Game_Modify.gameView.roomCardUpdate();
|
||
}else if(spid_up == 1218 || spid_up == 1219 || spid_up == 1222 || spid_up == 1224 || spid_up == 1310 || spid_up == 1312 || spid_up == 1313){ //快慢,星星场,星星数(多选)
|
||
var isView = false;
|
||
if(NN_config.creatRoomMode[1] != 2 || spid_up == 1218){
|
||
if(spid_up == 1222){
|
||
if(Game_Modify.CreateRoomData.Type_6[2] == 1){
|
||
//取消星星场选中
|
||
Game_Modify.CreateRoomData.Type_6[1] = 0;
|
||
//取消星星数选中
|
||
Game_Modify.CreateRoomData.Type_6[2] = 0;
|
||
//取消离场选中
|
||
Game_Modify.CreateRoomData.Type_6[3] = 0;
|
||
}else {
|
||
isView = true;
|
||
//取消星星场选中
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
Game_Modify.CreateRoomData.Type_6[1] = 0;
|
||
Game_Modify.CreateRoomData.Type_6[3] = 0;
|
||
}
|
||
}
|
||
}else if(spid_up == 1310){
|
||
if(Game_Modify.CreateRoomData.Type_6[3] == 1){
|
||
//取消星星场选中
|
||
Game_Modify.CreateRoomData.Type_6[1] = 0;
|
||
//取消离场选中
|
||
Game_Modify.CreateRoomData.Type_6[3] = 0;
|
||
}else {
|
||
isView = true;
|
||
//星星场选中
|
||
Game_Modify.CreateRoomData.Type_6[1] = 1;
|
||
Game_Modify.CreateRoomData.Type_6[2] = 1;
|
||
Game_Modify.CreateRoomData.Type_6[3] = 1;
|
||
}
|
||
}else if(spid_up == 1218 || spid_up == 1219 || spid_up == 1222){
|
||
if(Game_Modify.CreateRoomData.Type_6[spid_up-1218] == 1){
|
||
Game_Modify.CreateRoomData.Type_6[spid_up-1218] = 0;
|
||
if(spid_up == 1218){
|
||
Game_Modify.CreateRoomData.Type_6[4] = 0;
|
||
}
|
||
if(spid_up == 1219){
|
||
Game_Modify.CreateRoomData.Type_6[3] = 0;
|
||
}
|
||
}else {
|
||
Game_Modify.CreateRoomData.Type_6[spid_up-1218] = 1;
|
||
if(spid_up == 1219){
|
||
if(Game_Modify.CreateRoomData.Type_6[2] != 1){
|
||
isView = true;
|
||
Game_Modify.CreateRoomData.Type_6[2] = 1;
|
||
}
|
||
Game_Modify.CreateRoomData.Type_6[3] = 1;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
//显示出无限局
|
||
if(NN_config.isOwnerInfinite == 1){
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
//set_self(1229,37,1,0,0);
|
||
//set_self(1230,37,1,0,0);
|
||
}else {
|
||
if(Game_Modify.CreateRoomData.Type_2 == 2){
|
||
Game_Modify.CreateRoomData.Type_2 = 0;
|
||
}
|
||
set_self(1229,37,0,0,0);
|
||
set_self(1230,37,0,0,0);
|
||
}
|
||
}
|
||
if(isView && NN_config.model_bean[3] > 0 || spid_up == 1224 || spid_up == 1312 || spid_up == 1313){ //星星场选中时显示数量选择界面
|
||
Game_Modify.gameView.creatRoom_beanSelect(1);
|
||
}
|
||
}else if(spid_up == 1257){ //
|
||
Game_Modify.gameView.creatRoom_beanSelect();
|
||
} else if(spid_up == 1268){ // 高级选项
|
||
var _roomType = [Game_Modify.Type_2[Game_Modify.CreateRoomData.Type_2].type,
|
||
Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_5[Game_Modify.CreateRoomData.Type_5].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
Game_Modify.Type_1[Game_Modify.CreateRoomData.Type_1].type,
|
||
[Game_Modify.CreateRoomData.Type_6[0],
|
||
Game_Modify.CreateRoomData.Type_6[1],
|
||
[Game_Modify.CreateRoomData.Type_6[2],NN_config.model_bean[1],NN_config.bean_mult[0]],
|
||
[NN_config.teaCost[0], NN_config.teaCost[1]],
|
||
[NN_config.creatRoomMode[1], NN_config.bean_leaveMin[0]],
|
||
Game_Modify.CreateRoomData.Type_6[4]],
|
||
NN_config.force_bet];
|
||
//局数
|
||
var _asetcount = 0, personType = 0;
|
||
if(_roomType[5][5] == 1){
|
||
personType = 1;
|
||
}
|
||
if(NN_config.room_card[personType] && NN_config.room_card[personType].length > 0){
|
||
if(NN_config.room_card[personType][_roomType[4] - 1].length > 0){ //房主扣卡
|
||
_asetcount = NN_config.room_card[personType][_roomType[4] - 1][_roomType[0] - 1][0];
|
||
}
|
||
}
|
||
//星星场服务费
|
||
var teaCost = 0;
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1 && NN_config.teaCost[0] == 1 && NN_config.teaCost[1] >= 0){
|
||
teaCost = NN_config.teaCost[1];
|
||
}
|
||
//房间描述
|
||
//var _des = Game_Modify.setRoomDes(null,_asetcount,_roomType);
|
||
var _des = Game_Modify.getFullRoomInfo(_roomType);
|
||
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
Utl.openSnrOption(0, _roomType, _des, teaCost);//(第一个参数->星星场传0、非星星场传1,第二个参数->roomtype,第三个参数->房间信息描述,最多5行,一行最多40个字符
|
||
} else {
|
||
Utl.openSnrOption(1, _roomType, _des, teaCost);
|
||
}
|
||
} else if(spid_up == 1269){ //强制下注
|
||
if(NN_config.forceBetType != 1 && Game_Modify.CreateRoomData.forceBet == 1 && Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type != 4 && Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type != 5){
|
||
Game_Modify.CreateRoomData.forceBet = -1;
|
||
NN_config.force_bet[0] = -1;
|
||
//强制下注按钮刷新显示
|
||
Game_Modify.gameView.btn_forceBet();
|
||
}else {
|
||
Game_Modify.CreateRoomData.forceBet = 1;
|
||
Game_Modify.gameView.forceBetSelect(1);
|
||
}
|
||
} else if(spid_up == 1272 || spid_up == 1298){ //强制下注确定按钮及关闭
|
||
if(spid_up == 1272 && NN_config.force_bet[2] > 0){//确定按钮-分数大于0为强制下注
|
||
NN_config.force_bet[0] = 1;
|
||
Game_Modify.CreateRoomData.forceBet = 1;
|
||
}
|
||
if(NN_config.force_bet[0] != 1){
|
||
Game_Modify.CreateRoomData.forceBet = -1;
|
||
}
|
||
//关闭弹窗
|
||
Game_Modify.gameView.forceBetSelect(false);
|
||
//刷新强制下注按钮显示
|
||
Game_Modify.gameView.btn_forceBet();
|
||
}else if(spid_up >= 1273 && spid_up <= 1282){
|
||
var _bet = spid_up - 1272;
|
||
var temp = false;
|
||
if(_bet <= NN_config.model_bet){
|
||
if(NN_config.betRange.length > 0){
|
||
for(var i=0;i< NN_config.betRange.length; i++){
|
||
if(NN_config.betRange[i] == spid_up - 1272){
|
||
temp = true;
|
||
}
|
||
}
|
||
}else {
|
||
temp = true;
|
||
}
|
||
}
|
||
if(temp){
|
||
NN_config.force_bet[2] = spid_up - 1272;
|
||
Game_Modify.CreateRoomData.forceBet = 1;
|
||
//设置下注分数显示
|
||
//set_self(1294,7,NN_config.force_bet[2],0,0);
|
||
//set_self(1294,20,String(NN_config.force_bet[2]).length * 30,0,0);
|
||
//强制下注按钮刷新显示
|
||
Game_Modify.gameView.btn_forceBet();
|
||
//刷新界面
|
||
Game_Modify.gameView.forceBetSelect(1);
|
||
}
|
||
}else if(spid_up == 1300){ //房主开房服务费勾选
|
||
if(NN_config.teaCost[0] == 1){//取消
|
||
NN_config.teaCost[0] = 0;
|
||
} else { //勾选
|
||
NN_config.teaCost[0] = 1;
|
||
}
|
||
} else if(spid_up == 1302){ //房主服务费数字输入
|
||
var callback = function(num){
|
||
if(num >= 0){
|
||
//判断值是否正确
|
||
//var _maxCost = Game_Modify.gameFunc.getMaxTeaCost();
|
||
//if(_maxCost != -1 && num > _maxCost){ //判断是否超出
|
||
//num = _maxCost;
|
||
//}
|
||
var range = null;
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 0);
|
||
}else {
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 1);
|
||
}
|
||
|
||
if(range[0] > num){
|
||
num = range[0];
|
||
}else if(num > range[1]){ //判断是否超出
|
||
num = range[1];
|
||
}
|
||
//
|
||
NN_config.teaCost[1] = num;
|
||
set_self(1303,7, num,0,0);
|
||
set_self(1303,20, String(num).length * 26,0,0);
|
||
//数字背景框位置调整
|
||
if(String(num).length > 6){
|
||
set_self(1302,20,170 + (String(num).length - 6) * 26 ,0,0);
|
||
} else {
|
||
set_self(1302,20,170,0,0);
|
||
}
|
||
//最大值位置调整
|
||
set_self(1304,18,get_self(1302,18) + get_self(1302,20) + 15,0,0);
|
||
}
|
||
GameUI.closeInputPanel(); //关闭数字输入
|
||
}
|
||
if(NN_config.teaCost[2] == 1){
|
||
Utl.openInputPanel("房间费("+ NN_config.beanDes +")", callback);
|
||
}
|
||
} else if(spid_up == 1305){ //房卡房
|
||
NN_config.creatRoomMode[1] = 1;
|
||
Game_Modify.OpenCreateRoom();
|
||
} else if(spid_up == 1307){ //真人竞技
|
||
NN_config.creatRoomMode[1] = 2;
|
||
Game_Modify.OpenCreateRoom();
|
||
} else if(spid_up == 1315){ //房主服务费数字输入
|
||
var callback = function(num){
|
||
//判断值是否正确
|
||
if(num >= 0){
|
||
var perVal = Number(Number(num / NN_config.model_bean[1]).toFixed(10));
|
||
if(perVal < NN_config.bean_leaveMin[2][0]){
|
||
NN_config.bean_leaveMin[0] = NN_config.bean_leaveMin[2][0];
|
||
} else if(perVal > NN_config.bean_leaveMin[2][1]){
|
||
NN_config.bean_leaveMin[0] = NN_config.bean_leaveMin[2][1];
|
||
}else {
|
||
NN_config.bean_leaveMin[0] = perVal;
|
||
}
|
||
//更新显示
|
||
Game_Modify.gameView.creatRoom_leaveBean(1);
|
||
}
|
||
GameUI.closeInputPanel(); //关闭数字输入
|
||
}
|
||
if(NN_config.bean_leaveMin[1] == 1){
|
||
Utl.openInputPanel("离场" + NN_config.beanDes + "数限制:", callback);
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
Game_Modify.utlmousemove = function(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1){
|
||
switch(spid){
|
||
case 52://战绩页一
|
||
set_self(50,19,offmovey,1,0);
|
||
for(var i=0;i<C_PageOneBtn.length;i++){
|
||
set_self(C_PageOneBtn[i],19,offmovey,1,0);
|
||
}
|
||
break;
|
||
case 56://战绩页二
|
||
set_self(57,19,offmovey,1,0);
|
||
for(var i=0;i<C_PageTwoBtn.length;i++){
|
||
set_self(C_PageTwoBtn[i],19,offmovey,1,0);
|
||
}
|
||
break;
|
||
case 1253: //星星数选择滑动
|
||
var bar_x = get_self(1252,18), bar_w = get_self(1252,20), btn_x = get_self(1253,18) + 35;
|
||
if(((btn_x > bar_x) && (btn_x < (bar_x + bar_w))) || (btn_x <= bar_x && offmovex > 0) || (btn_x >= (bar_x + bar_w) && offmovex < 0)){
|
||
if(btn_x + offmovex <= bar_x){
|
||
//超出左边界
|
||
btn_x = bar_x;
|
||
set_self(spid,18,bar_x - 35,0,0);
|
||
}else if(btn_x + offmovex >= bar_x + bar_w){
|
||
//超出右边界
|
||
btn_x = bar_x + bar_w;
|
||
set_self(spid,18,bar_x + bar_w - 35,0,0);
|
||
}else { //正常移动
|
||
set_self(spid,18,offmovex,1,0);
|
||
}
|
||
//显示滑动位置对应数量
|
||
var beanMin = NN_config.bean_mult[0] * NN_config.model_bean[2], beanMax = NN_config.bean_mult[0] * NN_config.model_bean[3],
|
||
_val = Math.ceil(Math.abs((btn_x - bar_x) / bar_w) * (beanMax - beanMin) + beanMin),
|
||
_jg = beanMax * NN_config.model_bean[4],
|
||
_temp = _val % _jg;
|
||
if(_temp < _jg / 2){
|
||
_val = _val - _temp;
|
||
}else {
|
||
_val = _val + (_jg - _temp);
|
||
}
|
||
if(_val >= beanMin && _val <= beanMax){
|
||
NN_config.model_bean[1] = _val;
|
||
Game_Modify.Type_6[2].num = _val;
|
||
set_self(1256,7,_val,0,0);
|
||
set_self(1256,20,String(_val).length * 30,0,0);
|
||
//设置创建房间星星场显示
|
||
//set_self(1221,7,Game_Modify.Type_6[1].des + "(" + NN_config.bean_mult[0] + "倍)",0,0);
|
||
//set_self(1223,7,Game_Modify.Type_6[2].des + ":" + NN_config.model_bean[1],0,0);
|
||
Game_Modify.gameView.createRoom_beanUpdata();
|
||
//显示抢庄、下注星星数限
|
||
//if(NN_config.cfg_bean[0]){
|
||
//set_self(1266,7,"抢庄所需 + NN_config.model_bean[1] + 数:" + NN_config.cfg_bean[0] * NN_config.bean_mult[0],0,0);
|
||
//}
|
||
//if(NN_config.cfg_bean[1]){
|
||
//set_self(1267,7,"下注所需 + NN_config.model_bean[1] + 数:" + NN_config.cfg_bean[1] * NN_config.bean_mult[0],0,0);
|
||
//}
|
||
}
|
||
//更新离场星星显示
|
||
if(NN_config.bean_leaveMin[1] == 1){ //范围取值
|
||
Game_Modify.gameView.creatRoom_leaveBean(1, 1);
|
||
}
|
||
}
|
||
break;
|
||
case 1263: //星星倍数滑动
|
||
var bar_x = get_self(1260,18), bar_w = get_self(1260,20), btn_x = get_self(1263,18) + 35;
|
||
if(((btn_x > bar_x) && (btn_x < (bar_x + bar_w))) || (btn_x <= bar_x && offmovex > 0) || (btn_x >= (bar_x + bar_w) && offmovex < 0)){
|
||
if(btn_x + offmovex <= bar_x){
|
||
//超出左边界
|
||
btn_x = bar_x;
|
||
set_self(spid,18,bar_x - 35,0,0);
|
||
}else if(btn_x + offmovex >= bar_x + bar_w){
|
||
//超出右边界
|
||
btn_x = bar_x + bar_w;
|
||
set_self(spid,18,bar_x + bar_w - 35,0,0);
|
||
}else { //正常移动
|
||
set_self(spid,18,offmovex,1,0);
|
||
}
|
||
//显示滑动位置对应数量
|
||
var _val = Math.ceil(Math.abs((btn_x - bar_x) / bar_w) * (NN_config.bean_mult[2] - NN_config.bean_mult[1]) + NN_config.bean_mult[1]),
|
||
_jg = NN_config.bean_mult[2] * NN_config.bean_mult[3],
|
||
_temp = _val % _jg;
|
||
if(_temp < _jg / 2){
|
||
_val = _val - _temp;
|
||
if(_val < NN_config.bean_mult[1]){
|
||
_val = NN_config.bean_mult[1];
|
||
}
|
||
}else {
|
||
_val = _val + (_jg - _temp);
|
||
}
|
||
if(_val >= 0 && _val <= NN_config.bean_mult[2]){
|
||
NN_config.bean_mult[0] = _val;
|
||
set_self(1264,7,_val,0,0);
|
||
set_self(1264,20,String(_val).length * 30,0,0);
|
||
|
||
//设置星星数对应比例显示
|
||
//星星数当前值
|
||
var beanMin = NN_config.bean_mult[0] * NN_config.model_bean[2], beanMax = NN_config.bean_mult[0] * NN_config.model_bean[3];
|
||
NN_config.model_bean[1] = beanMin;
|
||
set_self(1256,7,NN_config.model_bean[1],0,0);
|
||
set_self(1256,20,String(NN_config.model_bean[1]).length * 30,0,0);
|
||
//星星数最小值
|
||
set_self(1254,7,beanMin,0,0);
|
||
set_self(1254,18,197 - String(beanMin).length * 30,0,0);
|
||
set_self(1254,20,String(beanMin).length * 30,0,0);
|
||
//星星数最大值
|
||
set_self(1255,7,beanMax,0,0);
|
||
set_self(1255,20,String(beanMax).length * 30,0,0);
|
||
//星星数按钮位置
|
||
set_self(1253,18,((NN_config.model_bean[1] - beanMin) / (beanMax - beanMin) ) * get_self(1252,20) + get_self(1252,18) - 35,0,0);
|
||
//设置创建房间星星场显示
|
||
//set_self(1221,7,Game_Modify.Type_6[1].des + "(" + NN_config.bean_mult[0] + "倍)",0,0);
|
||
//set_self(1223,7,Game_Modify.Type_6[2].des + ":" + NN_config.model_bean[1],0,0);
|
||
Game_Modify.gameView.createRoom_beanUpdata();
|
||
//显示抢庄、下注星星数限
|
||
if(NN_config.cfg_bean[0]){
|
||
set_self(1266,7,"抢庄所需"+ NN_config.beanDes +"数:" + NN_config.cfg_bean[0] * NN_config.bean_mult[0],0,0);
|
||
}
|
||
if(NN_config.cfg_bean[1]){
|
||
set_self(1267,7,"下注所需"+ NN_config.beanDes +"数:" + NN_config.cfg_bean[1] * NN_config.bean_mult[0],0,0);
|
||
}
|
||
|
||
//茶水费调整
|
||
if(NN_config.teaCost[2] == 1){
|
||
//判断值是否正确
|
||
var range = null;
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 0);
|
||
}else {
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 1);
|
||
}
|
||
//if(range[0] > NN_config.teaCost[1]){ //判断是否超出
|
||
//NN_config.teaCost[1] = range[0];
|
||
//}else if(NN_config.teaCost[1] > range[1]){
|
||
//NN_config.teaCost[1] = range[1];
|
||
//}
|
||
NN_config.teaCost[1] = range[0];
|
||
set_self(1304,7,"("+ range[0] + " ~ " + range[1] +")",0,0); //范围
|
||
set_self(1303,7, NN_config.teaCost[1],0,0);
|
||
set_self(1303,20, String(NN_config.teaCost[1]).length * 26,0,0);
|
||
}
|
||
/*
|
||
if(NN_config.teaCost[2] == 1){
|
||
var _maxCost = -1;
|
||
//判断值是否正确
|
||
var _maxCost = Game_Modify.gameFunc.getMaxTeaCost();
|
||
if(_maxCost != -1 && NN_config.teaCost[1] > _maxCost){ //判断是否超出
|
||
NN_config.teaCost[1] = _maxCost;
|
||
}
|
||
|
||
NN_config.teaCost[6] = _maxCost; //数字背景框
|
||
if(NN_config.teaCost[6] >= 0){
|
||
set_self(1304,7,"(最大值:"+ NN_config.teaCost[6] +")",0,0);
|
||
}
|
||
|
||
//set_self(1299,7,"房间费("+ NN_config.beanDes +"):" + NN_config.teaCost[1] + NN_config.teaCost[3] * NN_config.bean_mult[0],0,0);
|
||
set_self(1303,7, NN_config.teaCost[1],0,0);
|
||
set_self(1303,20, String(NN_config.teaCost[1]).length * 26,0,0);
|
||
}
|
||
*/
|
||
//更新离场星星显示
|
||
if(NN_config.bean_leaveMin[1] == 1){ //范围取值
|
||
Game_Modify.gameView.creatRoom_leaveBean(1, 1);
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
Game_Modify.utlgamemydrawbegin = function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||
if(spid>=50&&spid<=52){
|
||
set_clip(0,0,50,Game_Config.Combat.up_y,1200,5*(Game_Config.Combat.height+2));
|
||
}
|
||
if(spid==54||spid==56||spid==57){
|
||
set_clip(0,0,50,Game_Config.Combat.up_y,1200,5*(Game_Config.Combat.height+2));
|
||
}
|
||
}
|
||
|
||
Game_Modify.gamemydraw = function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||
switch(spid){
|
||
//勾选状态的钩钩是画上去的(如果需要改动勾选图片的尺寸、绘画时的参数自己调整)
|
||
//------------------- begin --------------
|
||
case 248://协议勾选
|
||
if(GameData.ProtocolIndex){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 20://创建房间时的勾选1
|
||
if(Game_Modify.CreateRoomData.Type_1 == 0){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 21://创建房间时的勾选1
|
||
if(Game_Modify.CreateRoomData.Type_1 == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1231://创建房间时的勾选1
|
||
if(Game_Modify.CreateRoomData.Type_1 == 2){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 22://创建房间时的勾选2
|
||
if(Game_Modify.CreateRoomData.Type_2 == 0){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 23://创建房间时的勾选2
|
||
if(Game_Modify.CreateRoomData.Type_2 == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1229://创建房间时的勾选2
|
||
if(Game_Modify.CreateRoomData.Type_2 == 2){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 139://创建房间时的勾选 3
|
||
if(Game_Modify.CreateRoomData.Type_3 == 0){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 140://创建房间时的勾选3
|
||
if(Game_Modify.CreateRoomData.Type_3 == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1215://创建房间时的勾选3
|
||
if(Game_Modify.CreateRoomData.Type_3 == 2){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1204://创建房间时的勾选4
|
||
if(Game_Modify.CreateRoomData.Type_4 == 0){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1205://创建房间时的勾选4
|
||
if(Game_Modify.CreateRoomData.Type_4 == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1213://创建房间时的勾选4
|
||
if(Game_Modify.CreateRoomData.Type_4 == 2){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1225://创建房间时的勾选4
|
||
if(Game_Modify.CreateRoomData.Type_4 == 3){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1227://创建房间时的勾选4
|
||
if(Game_Modify.CreateRoomData.Type_4 == 4){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1209://创建房间时的勾选5
|
||
if(Game_Modify.CreateRoomData.Type_5 == 0){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1210://创建房间时的勾选5
|
||
if(Game_Modify.CreateRoomData.Type_5 == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1218://创建房间时的勾选6
|
||
if(Game_Modify.CreateRoomData.Type_6[0] == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1219://创建房间时的勾选6
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1222://创建房间时的勾选6
|
||
if(Game_Modify.CreateRoomData.Type_6[2] == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1300://创建房间时的勾选6
|
||
if(NN_config.teaCost[0] == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1310://创建房间时的勾选6
|
||
if(Game_Modify.CreateRoomData.Type_6[3] == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
case 1318://创建房间时的勾选6
|
||
if(Game_Modify.CreateRoomData.Type_6[4] == 1){
|
||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
}
|
||
break;
|
||
//case 1269://强制下注
|
||
//if(Game_Modify.CreateRoomData.forceBet == 1){
|
||
//ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||
//}
|
||
//break;
|
||
default:
|
||
break;
|
||
}
|
||
};
|
||
|
||
Game_Modify.OpenCreateRoom=function(roomTypeConfig){
|
||
//根据参数显示房间类型
|
||
//房间类型[/*0-扣卡*/ [1-房主扣卡,2-每人扣卡],/*1-局数*/ [1-6局(房卡x1),2-12局(房卡x2)],/*2-玩法*/ [1-牛八2倍,2-牛几几倍],/*3-上庄*/ [1-每局抢庄,2-轮庄,3-房主坐庄],/*4-牌数*/ [1-一副牌,2-两副牌]]
|
||
//Utl.getGameConfig().room_type = [[1,[1,2]],[1,[1,2,3]],[1,[1,2,3]],[1,[1,2,3,4,5]],[1,[1,2]],[[0,0,0,0],[1,2,3,4],[1000,10000,0.01,1,50,0.02]]];
|
||
var roomType_default = []; //默认选项
|
||
if(!roomTypeConfig && Utl.getGameConfig() && Utl.getGameConfig().room_type){
|
||
roomTypeConfig = [[],[],[],[],[],[]];
|
||
var _arr = Utl.getGameConfig().room_type;//获取游戏配置
|
||
//_arr = [[1,[1,2]],[1,[1,2,3]],[1,[1,2,3]],[1,[1,2,3]],[1,[1,2]],[1,[1,2]]];//获取游戏配置
|
||
for(var i=0;i<_arr.length;i++){
|
||
if(_arr[i][0] !== null){
|
||
if(i == 5){
|
||
roomType_default[i] = _arr[i][0].slice();
|
||
}else {
|
||
roomType_default[i] = _arr[i][0] - 1;
|
||
}
|
||
}else{
|
||
if(i == 5){
|
||
roomType_default[i] = [0,0,0,0,0];
|
||
} else {
|
||
roomType_default[i] = 0;
|
||
}
|
||
}
|
||
//
|
||
if(i == 5 && _arr[i][2] != null && _arr[i][2].length > 0){
|
||
NN_config.model_bean[2] = _arr[i][2][0];
|
||
NN_config.model_bean[3] = _arr[i][2][1];
|
||
NN_config.model_bean[4] = _arr[i][2][2];
|
||
|
||
if(_arr[i][2][6]){
|
||
NN_config.model_bean[5] = _arr[i][2][2];
|
||
} else {
|
||
NN_config.model_bean[5] = 0;
|
||
}
|
||
if(_arr[i][2][7]){
|
||
NN_config.model_bean[6] = _arr[i][2][2];
|
||
}else {
|
||
NN_config.model_bean[6] = 0;
|
||
}
|
||
NN_config.bean_mult[1] = _arr[i][2][3];
|
||
NN_config.bean_mult[2] = _arr[i][2][4];
|
||
NN_config.bean_mult[3] = _arr[i][2][5];
|
||
|
||
Game_Modify.Type_6[2].min = NN_config.model_bean[2] * NN_config.bean_mult[1];
|
||
Game_Modify.Type_6[2].max = NN_config.model_bean[3] * NN_config.bean_mult[2];
|
||
}
|
||
//本地模式赋值
|
||
Game_Modify.CreateRoomData["Type_"+(i+1)] = roomType_default[i];
|
||
if(_arr[i][1] !== null){
|
||
roomTypeConfig[i] = _arr[i][1];
|
||
}
|
||
}
|
||
//roomTypeConfig = Utl.getGameConfig().room_type;
|
||
}
|
||
//审核版本隐藏星星房卡相关
|
||
if(Utl.getVersionState() == 1){
|
||
roomTypeConfig[0] = [];
|
||
roomTypeConfig[5] = [];
|
||
}
|
||
|
||
var roomty = Utl.getRoomtype();//获取到的为创建房间成功时收到的roomtype数组
|
||
//对应发送房间类型时数据赋值
|
||
if(roomty && Game_Modify.CreateRoomData.typeCount == roomty.length){ //[局数,上庄,牌数,倍数,扣卡];
|
||
//判断本地的房间类型是否有显示,无显示类型值改为已显示的类型
|
||
//var _roomty = [roomty[4]-1, roomty[0]-1, roomty[3]-1, roomty[1]-1, roomty[2]-1, [roomty[5][0], roomty[5][1], roomty[5][2][0], roomty[5][2][3]]],
|
||
//temp1 = false;
|
||
//for(var i=0;i<roomTypeConfig.length;i++){
|
||
//if(_roomty[i] != null){
|
||
//if(i != 5){ //单选
|
||
//for(var j=0; j<roomTypeConfig[i].length; j++){
|
||
//if(_roomty[i] == roomTypeConfig[i][j]-1){
|
||
//temp1 = true;
|
||
//break;
|
||
//}
|
||
//}
|
||
//if(!temp1){
|
||
//_roomty[i] == roomTypeConfig[i][0]-1;
|
||
//}
|
||
//}else { //多选
|
||
|
||
//}
|
||
//}else{
|
||
//_roomty[i] = roomType_default[i];
|
||
//}
|
||
//}
|
||
Game_Modify.CreateRoomData.Type_1 = roomty[4]-1;
|
||
Game_Modify.CreateRoomData.Type_2 = roomty[0]-1;
|
||
Game_Modify.CreateRoomData.Type_3 = roomty[3]-1;
|
||
Game_Modify.CreateRoomData.Type_4 = roomty[1]-1;
|
||
Game_Modify.CreateRoomData.Type_5 = roomty[2]-1;
|
||
Game_Modify.CreateRoomData.Type_6 = [roomty[5][0], roomty[5][1], roomty[5][2][0], roomty[5][2][3], roomty[5][5]];
|
||
if(typeof Game_Modify.CreateRoomData.Type_6[4] != "number"){
|
||
Game_Modify.CreateRoomData.Type_6[4] = 0;
|
||
}
|
||
//星星数
|
||
if(roomty[5][2][1] != null && roomty[5][2][2] != null){
|
||
//倍数判断
|
||
if(roomty[5][2][2] > NN_config.bean_mult[2] || roomty[5][2][2] < NN_config.bean_mult[1]){
|
||
NN_config.bean_mult[0] = NN_config.bean_mult[1];
|
||
}else {
|
||
NN_config.bean_mult[0] = roomty[5][2][2];
|
||
}
|
||
NN_config.model_bean[1] = NN_config.bean_mult[0] * NN_config.model_bean[2];
|
||
//星星数判断是否正确
|
||
//if((roomty[5][2][1] > NN_config.bean_mult[0] * NN_config.model_bean[3]) || (roomty[5][2][1] < NN_config.bean_mult[0] * NN_config.model_bean[2])){
|
||
//NN_config.model_bean[1] = NN_config.bean_mult[0] * NN_config.model_bean[2];
|
||
//}else{
|
||
//NN_config.model_bean[1] = roomty[5][2][1];
|
||
//}
|
||
}else {//星星值错误,默认最小值
|
||
NN_config.bean_mult[0] = NN_config.bean_mult[1];
|
||
NN_config.model_bean[1] = NN_config.bean_mult[1] * NN_config.model_bean[2];
|
||
}
|
||
//服务费
|
||
if(roomty[5][3] != null && roomty[5][3][1] != null){
|
||
if(NN_config.teaCost[2] > 0){
|
||
NN_config.teaCost[0] = roomty[5][3][0];
|
||
NN_config.teaCost[1] = roomty[5][3][1];
|
||
}
|
||
}
|
||
//强制下注
|
||
if(roomty[6] && roomty[6][0] != null && roomty[6][2] != null){
|
||
NN_config.force_bet = roomty[6];
|
||
}
|
||
}else {//默认
|
||
if(roomType_default.length > 0){
|
||
Game_Modify.CreateRoomData.Type_1 = roomType_default[0];
|
||
Game_Modify.CreateRoomData.Type_2 = roomType_default[1];
|
||
Game_Modify.CreateRoomData.Type_3 = roomType_default[2];
|
||
Game_Modify.CreateRoomData.Type_4 = roomType_default[3];
|
||
Game_Modify.CreateRoomData.Type_5 = roomType_default[4];
|
||
Game_Modify.CreateRoomData.Type_6 = roomType_default[5];
|
||
} else {
|
||
Game_Modify.CreateRoomData.Type_1 = 0;
|
||
Game_Modify.CreateRoomData.Type_2 = 0;
|
||
Game_Modify.CreateRoomData.Type_3 = 0;
|
||
Game_Modify.CreateRoomData.Type_4 = 0;
|
||
Game_Modify.CreateRoomData.Type_5 = 0;
|
||
Game_Modify.CreateRoomData.Type_6 = [0,0,0,0,0];
|
||
}
|
||
//倍数、星星数
|
||
NN_config.bean_mult[0] = NN_config.bean_mult[1];
|
||
NN_config.model_bean[1] = NN_config.model_bean[2] * NN_config.bean_mult[1];
|
||
NN_config.force_bet = [-1,-1,0];
|
||
}
|
||
Game_Modify.Type_6[2].num = NN_config.model_bean[1];
|
||
//星星场选中时星星数默认选中
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
Game_Modify.CreateRoomData.Type_6[2] = 1;
|
||
}
|
||
|
||
if(!roomTypeConfig){
|
||
//默认显示及参数
|
||
roomTypeConfig = [[1,2],[1,2],[1,2],[1,2,3],[1,2],[1,2,3]];
|
||
if(roomType_default.length == 0){
|
||
roomType_default = [0,0,0,0,0,[0,0,0,0,0]];
|
||
}
|
||
//星星数
|
||
Game_Modify.Type_6[2].max = NN_config.model_bean[3];
|
||
Game_Modify.Type_6[2].num = NN_config.model_bean[2];
|
||
Game_Modify.Type_1[0].roomcard = 4;
|
||
}
|
||
|
||
//判断值服务费是否正确
|
||
//var _maxCost = Game_Modify.gameFunc.getMaxTeaCost();
|
||
//if(_maxCost != -1 && NN_config.teaCost[1] > _maxCost){ //判断是否超出
|
||
//NN_config.teaCost[1] = _maxCost;
|
||
//}
|
||
var range = null;
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 0);
|
||
}else {
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 1);
|
||
}
|
||
if(range[0] > NN_config.teaCost[1]){ //判断是否超出
|
||
NN_config.teaCost[1] = range[0];
|
||
}else if(NN_config.teaCost[1] > range[1]){
|
||
NN_config.teaCost[1] = range[1];
|
||
}
|
||
|
||
//真人模式
|
||
if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2){
|
||
//去除扣卡、局数显示
|
||
roomTypeConfig[0] = [];
|
||
//roomTypeConfig[1] = [];
|
||
//星星场、入场限制、离场限制
|
||
var diff = [], comp = [2, 3, -1];
|
||
for (var i = 0; i < roomTypeConfig[5].length; i++){
|
||
for (var j = 0; j < comp.length; j++){
|
||
if(roomTypeConfig[5][i] == comp[j]){
|
||
break;
|
||
}
|
||
}
|
||
if(j >= comp.length){
|
||
diff.push(roomTypeConfig[5][i]);
|
||
}
|
||
}
|
||
|
||
//星星场显示放上
|
||
//roomTypeConfig[5] = comp.concat(diff);
|
||
//星星场显示放下
|
||
if(diff.length > 0 && diff.length < 3){
|
||
diff = diff.concat(([-1,-1,-1]).slice(0,3 - diff.length));
|
||
comp.concat(diff);
|
||
}
|
||
roomTypeConfig[5] = diff.concat(comp);
|
||
}
|
||
|
||
//判断本地勾选项是否和界面显示对应
|
||
if(roomTypeConfig){
|
||
//设置
|
||
var temp1 = -1;
|
||
for(var i=0;i<roomTypeConfig.length;i++){
|
||
if(roomTypeConfig[i].length > 0){
|
||
temp1 = -1;
|
||
if(i == 5){ //多选项 判断默认值是否都有
|
||
//判断创建勾选的房间类型界面是否有显示,无显示取默认值
|
||
for(var j = 0; j < 5; j++){
|
||
for(var k = 0; k < roomTypeConfig[i].length; k++){
|
||
if(j + 1 == roomTypeConfig[i][k]){
|
||
break;
|
||
}
|
||
if(k == roomTypeConfig[i].length - 1){
|
||
Game_Modify.CreateRoomData.Type_6[j] = roomType_default[i][j];
|
||
}
|
||
}
|
||
}
|
||
|
||
//配置
|
||
if(Game_Modify.CreateRoomData.Type_6.length < Game_Modify.Type_6.length){
|
||
for(var j = Game_Modify.CreateRoomData.Type_6.length; j<Game_Modify.Type_6.length;j++){
|
||
if(roomType_default[j] != null){
|
||
Game_Modify.CreateRoomData.Type_6[j] = roomType_default[i][j];
|
||
} else {
|
||
Game_Modify.CreateRoomData.Type_6.push(0);
|
||
}
|
||
}
|
||
}
|
||
temp1 = 1;
|
||
}else {
|
||
for(var j=0;j<roomTypeConfig[i].length;j++){
|
||
if(Game_Modify.CreateRoomData["Type_"+(i+1)] == roomTypeConfig[i][j]-1){
|
||
temp1 = 1;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
//
|
||
if(temp1 == -1){
|
||
Game_Modify.CreateRoomData["Type_"+(i+1)] = roomTypeConfig[i][0]-1;
|
||
}
|
||
}else{
|
||
if(i == 5){
|
||
if(roomType_default[i].length == 3){
|
||
Game_Modify.CreateRoomData.Type_6 = (roomType_default[i].slice(0,3)).concat(Game_Modify.CreateRoomData.Type_6.slice(3));
|
||
}
|
||
}else {
|
||
Game_Modify.CreateRoomData["Type_"+(i+1)] = 0;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//真人模式
|
||
if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2){
|
||
//默认星星场相关勾选
|
||
Game_Modify.CreateRoomData.Type_6[1] = 1;
|
||
Game_Modify.CreateRoomData.Type_6[2] = 1;
|
||
Game_Modify.CreateRoomData.Type_6[3] = 1;
|
||
//星星场默认收服务费
|
||
NN_config.teaCost[0] = 1;
|
||
}
|
||
|
||
//不同局数消耗房卡数不同
|
||
if(Game_Modify.CreateRoomData.Type_6[4] == 1){
|
||
Game_Modify.gameFunc.roomCardUpdate(10);
|
||
}else {
|
||
Game_Modify.gameFunc.roomCardUpdate(5);
|
||
}
|
||
//Game_Modify.gameView.roomCardUpdate();
|
||
|
||
//类型-扣卡
|
||
set_self(672,7,Game_Modify.Type_1[0].des,0,0);
|
||
set_self(673,7,Game_Modify.Type_1[1].des,0,0);
|
||
set_self(1232,7,Game_Modify.Type_1[2].des,0,0);
|
||
//类型-局数
|
||
if(Utl.getVersionState() == 1 || Game_Modify.Type_2[0].roomcard[Game_Modify.CreateRoomData.Type_1] <= 0 || (NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2)){
|
||
set_self(674,7,Game_Modify.Type_2[0].roomcount[Game_Modify.CreateRoomData.Type_1] + "局",0,0);
|
||
set_self(675,7,Game_Modify.Type_2[1].roomcount[Game_Modify.CreateRoomData.Type_1] + "局",0,0);
|
||
}else {
|
||
set_self(674,7,Game_Modify.Type_2[0].roomcount[Game_Modify.CreateRoomData.Type_1] + "局("+ NN_config.roomCardDes +"x" + Game_Modify.Type_2[0].roomcard[Game_Modify.CreateRoomData.Type_1] + ")",0,0);
|
||
set_self(675,7,Game_Modify.Type_2[1].roomcount[Game_Modify.CreateRoomData.Type_1] + "局("+ NN_config.roomCardDes +"x" + Game_Modify.Type_2[1].roomcard[Game_Modify.CreateRoomData.Type_1] + ")",0,0);
|
||
}
|
||
set_self(1230,7,Game_Modify.Type_2[2].des,0,0);
|
||
//类型-玩法
|
||
set_self(1201,7,Game_Modify.Type_3[0].des,0,0);
|
||
set_self(1202,7,Game_Modify.Type_3[1].des,0,0);
|
||
//类型-上庄
|
||
set_self(1206,7,Game_Modify.Type_4[0].des,0,0);
|
||
set_self(1207,7,Game_Modify.Type_4[1].des,0,0);
|
||
set_self(1214,7,Game_Modify.Type_4[2].des,0,0);
|
||
set_self(1226,7,Game_Modify.Type_4[3].des,0,0);
|
||
set_self(1228,7,Game_Modify.Type_4[4].des,0,0);
|
||
//类型-牌数
|
||
set_self(1211,7,Game_Modify.Type_5[0].des,0,0);
|
||
set_self(1212,7,Game_Modify.Type_5[1].des,0,0);
|
||
//快版 //星星场
|
||
set_self(1220,7,Game_Modify.Type_6[0].des,0,0);
|
||
set_self(1221,7,Game_Modify.Type_6[1].des,0,0);
|
||
set_self(1223,7,Game_Modify.Type_6[2].des,0,0);
|
||
//10人局
|
||
set_self(1319,7,Game_Modify.Type_6[4].des,0,0);
|
||
//背景框位置显示
|
||
var temp = 0, bmp_x = 0, bmp_y = 0;
|
||
for (var i=0;i<roomTypeConfig.length;i++){
|
||
if(roomTypeConfig[i].length > 0){
|
||
temp += (1 + Math.floor((roomTypeConfig[i].length - 1) / 3));
|
||
}
|
||
}
|
||
|
||
var _spacing_y = 68; //上下层的间隔
|
||
set_group(4,37,0,0,0);
|
||
//半透明遮罩
|
||
set_self(18,37,1,0,0);
|
||
//背景框
|
||
//set_self(19,19,287 - 33 * temp,0,0);
|
||
set_self(19,19,270 - 33 * temp,0,0);
|
||
set_self(19,21,190 + (_spacing_y - 1) * temp,0,0);
|
||
set_self(19,37,1,0,0);
|
||
bmp_x = get_self(19,18);
|
||
bmp_y = get_self(19,19);
|
||
//标题背景
|
||
set_self(62,19,bmp_y - 57,0,0);
|
||
set_self(62,37,0,0,0);
|
||
//标题
|
||
set_self(686,19,bmp_y + 11,0,0);
|
||
set_self(686,37,1,0,0);
|
||
//关闭按钮
|
||
set_self(60,19,bmp_y - 10,0,0);
|
||
set_self(60,37,1,0,0);
|
||
//确定创建按钮
|
||
set_self(25,19,bmp_y + get_self(19,21) - 101,0,0);
|
||
set_self(25,37,1,0,0);
|
||
//强制按钮、高级选项
|
||
set_self(1268,19,bmp_y + get_self(19,21) - 90,0,0);
|
||
//强制按钮下注及分数
|
||
set_self(1269,19,bmp_y + get_self(19,21) - 90,0,0);
|
||
set_self(1296,19,get_self(1269,19) + 13,0,0);
|
||
//var _loc = [[202,bmp_y + 94],[325,bmp_y + 89],[377,bmp_y + 97],[570,bmp_y + 89],[622,bmp_y + 97],[840,bmp_y + 89],[892,bmp_y + 97]],//[[x,y]]
|
||
//房间类型相关坐标(相对背景)
|
||
var _loc = [[260,bmp_y + 104],[380,bmp_y + 99],[438,bmp_y + 107],[646,bmp_y + 99],[703,bmp_y + 107],[908,bmp_y + 99],[966,bmp_y + 107]],//[[x,y]]
|
||
//房间类型相关精灵
|
||
_spids = [[24,[20,672],[21,673],[1231,1232]],
|
||
[677,[22,674],[23,675],[1229,1230]],
|
||
[678,[139,1201],[140,1202],[1215,1216]],
|
||
[1203,[1204,1206],[1205,1207],[1213,1214],[1225,1226],[1227,1228]],
|
||
[1208,[1209,1211],[1210,1212]],
|
||
[1217,[1218,1220],[1219,1221],[1222,1223],[1310,1311],[1318,1319]]];
|
||
_xCount = 0, //横向计数
|
||
_yCount = 0, //纵向计数
|
||
_val1 = 0; //层级计数
|
||
for (var i=0;i<roomTypeConfig.length;i++){
|
||
//分类型
|
||
if(roomTypeConfig[i].length > 0){
|
||
set_self(_spids[i][0],18,bmp_x + _loc[0][0],0,0);
|
||
set_self(_spids[i][0],19,_loc[0][1] + _yCount * _spacing_y,0,0);
|
||
set_self(_spids[i][0],37,1,0,0);
|
||
}
|
||
for (var j=0;j<roomTypeConfig[i].length;j++){
|
||
_val1 = Math.floor(j / 3); //
|
||
//
|
||
//_xCount = j * 2 + 1;
|
||
_xCount = (j % 3) * 2 + 1;
|
||
if(_spids[i][roomTypeConfig[i][j]] != null && roomTypeConfig[i][j] > 0){
|
||
//选项框
|
||
set_self(_spids[i][roomTypeConfig[i][j]][0],18,bmp_x + _loc[_xCount][0],0,0);
|
||
set_self(_spids[i][roomTypeConfig[i][j]][0],19,_loc[_xCount][1] + (_val1 + _yCount) * _spacing_y,0,0);
|
||
set_self(_spids[i][roomTypeConfig[i][j]][0],37,1,0,0);
|
||
//选项文字位置
|
||
set_self(_spids[i][roomTypeConfig[i][j]][1],18,bmp_x + _loc[_xCount + 1][0],0,0);
|
||
set_self(_spids[i][roomTypeConfig[i][j]][1],19,_loc[_xCount + 1][1] + (_val1 + _yCount) * _spacing_y,0,0);
|
||
set_self(_spids[i][roomTypeConfig[i][j]][1],41,0,0,0);
|
||
set_self(_spids[i][roomTypeConfig[i][j]][1],37,1,0,0);
|
||
//选项文字
|
||
if(i == 5){//多选项
|
||
if(roomTypeConfig[i][j] == 3){ //星星场数
|
||
set_self(1223,7,Game_Modify.Type_6[2].des + ":" + NN_config.model_bean[1],0,0);
|
||
if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2){
|
||
set_self(_spids[i][roomTypeConfig[i][j]][0],37,0,0,0);
|
||
}
|
||
//设置背景点击
|
||
//set_self(1224,18,get_self(_spids[i][roomTypeConfig[i][j]][1],18) - 2,0,0);
|
||
//set_self(1224,19,get_self(_spids[i][roomTypeConfig[i][j]][1],19) - 8,0,0);
|
||
//set_self(1224,20,getStrLength(get_self(_spids[i][roomTypeConfig[i][j]][1],7)) * 15,0,0);
|
||
set_self(1224,37,1,0,0); //背景框
|
||
}
|
||
if(roomTypeConfig[i][j] == 2){ //星星场
|
||
set_self(1221,7,Game_Modify.Type_6[1].des + "(" + NN_config.bean_mult[0] + "倍)",0,0);
|
||
//set_self(1312,18,get_self(_spids[i][roomTypeConfig[i][j]][1],18) - 2,0,0);
|
||
//set_self(1312,19,get_self(_spids[i][roomTypeConfig[i][j]][1],19) - 8,0,0);
|
||
//set_self(1312,20,getStrLength(get_self(_spids[i][roomTypeConfig[i][j]][1],7)) * 15,0,0);
|
||
if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2){
|
||
set_self(_spids[i][roomTypeConfig[i][j]][0],37,0,0,0);
|
||
}
|
||
set_self(1312,37,1,0,0); //背景框
|
||
}
|
||
if(roomTypeConfig[i][j] == 4){ //离场星星
|
||
set_self(1311,7,Game_Modify.Type_6[3].des + ":" + Math.round(NN_config.bean_leaveMin[0] * NN_config.model_bean[1]),0,0);
|
||
//set_self(1313,18,get_self(_spids[i][roomTypeConfig[i][j]][1],18) - 2,0,0);
|
||
//set_self(1313,19,get_self(_spids[i][roomTypeConfig[i][j]][1],19) - 8,0,0);
|
||
//set_self(1313,20,getStrLength(get_self(_spids[i][roomTypeConfig[i][j]][1],7)) * 15,0,0);
|
||
if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2){
|
||
set_self(_spids[i][roomTypeConfig[i][j]][0],37,0,0,0);
|
||
}
|
||
set_self(1313,37,1,0,0); //背景框
|
||
}
|
||
}else if(i != 1){
|
||
set_self(_spids[i][roomTypeConfig[i][j]][1],7,Game_Modify["Type_"+(i+1)][roomTypeConfig[i][j]-1].des,0,0);
|
||
}
|
||
}
|
||
}
|
||
//类型名称
|
||
if(roomTypeConfig[i].length > 0){
|
||
_yCount += (_val1 + 1);
|
||
}
|
||
}
|
||
//星星按钮背景框位置
|
||
Game_Modify.gameView.createRoom_beanUpdata();
|
||
|
||
//星星场无限场显示
|
||
for (var i=0;i<roomTypeConfig[1].length;i++){
|
||
if(roomTypeConfig[1][i] == 3){
|
||
NN_config.isOwnerInfinite = 1;
|
||
break;
|
||
}
|
||
}
|
||
if(NN_config.isOwnerInfinite == 1){
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
//set_self(1229,37,1,0,0);
|
||
//set_self(1230,37,1,0,0);
|
||
}else {
|
||
if(Game_Modify.CreateRoomData.Type_2 == 2){
|
||
Game_Modify.CreateRoomData.Type_2 = 0;
|
||
}
|
||
set_self(1229,37,0,0,0);
|
||
set_self(1230,37,0,0,0);
|
||
}
|
||
}else {
|
||
set_self(1229,37,0,0,0);
|
||
set_self(1230,37,0,0,0);
|
||
}
|
||
|
||
//房卡房。真人竞技按钮位置
|
||
Game_Modify.gameView.btn_creatRoomType(true);
|
||
|
||
//显示其他图片
|
||
set_self(18,37,1,0,0);
|
||
set_self(19,37,1,0,0);
|
||
set_self(62,37,1,0,0);
|
||
set_self(686,37,1,0,0);
|
||
set_self(25,37,1,0,0);
|
||
set_self(60,37,1,0,0);
|
||
//set_group(4,37,1,0,0);
|
||
//高级选项显示
|
||
if(Utl.getAdvanced() && Utl.getAdvanced() > 0 && Utl.getVersionState() != 1){
|
||
set_self(1268,37,1,0,0);
|
||
}
|
||
//显示强制下注选项
|
||
Game_Modify.gameFunc.AnalForceBet(Game_Modify.Type_4[Game_Modify.CreateRoomData.Type_4].type,
|
||
Game_Modify.Type_3[Game_Modify.CreateRoomData.Type_3].type,
|
||
NN_config.data.model_bet, NN_config.data.force_bet,
|
||
NN_config.force_bet);
|
||
set_self(1269,37,1,0,0);
|
||
set_self(1296,37,1,0,0);
|
||
|
||
//音效
|
||
Utl.playSound(Game_Config.ClickButton.src_2);
|
||
}
|
||
Game_Modify.CloseCreateRoom=function(){
|
||
set_group(4,37,0,0,0);
|
||
}
|
||
|
||
//设置游戏界面房间号显示内容(也是在房间内时分享附加的房间信息)
|
||
Game_Modify.setRoomDes = function(roomcode, asetcount, roomtype, isRoomDes){
|
||
//Game_Modify.roomDes = "房间号:"+roomcode+"("+asetcount+"局)";
|
||
var isInfinite = false; //是否为无限局
|
||
var _pairs = 0; //几副牌
|
||
var _roomDes = [];
|
||
if(roomtype[2] == 1){
|
||
_pairs = 1;
|
||
}else if(roomtype[2] == 2){
|
||
_pairs = 2;
|
||
}
|
||
_roomDes = ["",""];
|
||
if(roomcode != null && Utl.getIsInfinite() != 1 && !Utl.getIsMathInfo()){
|
||
_roomDes[0] = "房号:" + roomcode;
|
||
}
|
||
if(asetcount > 0 && Utl.getIsInfinite() != 1){//系统房间-无限局
|
||
_roomDes[1] = asetcount + "局 ";
|
||
}
|
||
//几副牌
|
||
_roomDes[1] += Game_Modify.Type_3[roomtype[3]-1].des ;
|
||
|
||
if(!isRoomDes && roomcode != null && roomtype[5][5] == 1){
|
||
_roomDes[1] += "\n";
|
||
}
|
||
//上庄类型
|
||
if(roomcode == null){
|
||
_roomDes[1] += (" " + _pairs + "副牌 " + Game_Modify.Type_4[roomtype[1]-1].des);
|
||
}else {
|
||
_roomDes[1] += (" " + _pairs + "副牌 " + Game_Modify.Type_4[roomtype[1]-1].des);
|
||
}
|
||
|
||
//分享描述内容
|
||
_roomDes[2] = _roomDes[1];
|
||
|
||
if(roomcode == null){
|
||
_roomDes[2] += "\n";
|
||
}
|
||
//扣卡张数
|
||
if(Utl.getIsInfinite() != 1 && Utl.getVersionState() != 1 && roomtype[4] > 0 && Game_Modify.Type_2[roomtype[0]-1].roomcard[roomtype[4]-1] > 0){
|
||
if(NN_config.creatRoomMode[0] != 1 || (NN_config.creatRoomMode[0] == 1 && roomtype[5][1] != 1)){ //真人竞技房不显示扣卡
|
||
if(roomcode != null){
|
||
_roomDes[2] += " ";
|
||
}
|
||
_roomDes[2] += (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[2] += "张";
|
||
}
|
||
if(roomcode != null){
|
||
_roomDes[2] += " ";
|
||
}
|
||
}
|
||
}
|
||
//星星场
|
||
if(roomtype[5][1] != null && roomtype[5][1] == 1){
|
||
if(roomcode == null){
|
||
_roomDes[2] += ""+ NN_config.beanDes + "场(" + roomtype[5][2][2] + "倍)";
|
||
}else {
|
||
_roomDes[2] += " "+ NN_config.beanDes + "场(" + roomtype[5][2][2] + "倍)";
|
||
}
|
||
}
|
||
|
||
//星星数
|
||
if(roomtype[5][2] != null && roomtype[5][2][0] == 1){
|
||
if(roomcode == null){
|
||
_roomDes[2] += " ";
|
||
}
|
||
_roomDes[2] += " "+ NN_config.beanDes +"数限:"+ roomtype[5][2][1];
|
||
}
|
||
|
||
//强制下注
|
||
if(roomtype[6] && roomtype[6][0] != null && roomtype[6][0] == 1 && roomtype[6][2] > 0){
|
||
if(NN_config.forceBetType != 1){ //强制下注
|
||
if(roomcode == null){
|
||
_roomDes[2] += " \n强制下注:" + roomtype[6][2];
|
||
} else {
|
||
_roomDes[2] += " 强制下注:" + roomtype[6][2];
|
||
}
|
||
}else { //最低下注
|
||
if(roomcode == null){
|
||
_roomDes[2] += " \n最低下注:" + roomtype[6][2];
|
||
} else {
|
||
_roomDes[2] += " 最低下注:" + roomtype[6][2];
|
||
}
|
||
}
|
||
}
|
||
//10人局
|
||
if(roomtype[5][5] == 1){
|
||
if(roomcode == null){
|
||
_roomDes[2] += " ";
|
||
}
|
||
_roomDes[2] += " " + Game_Modify.Type_6[4].des;
|
||
}
|
||
//快版
|
||
if(roomtype[5][0] != null && roomtype[5][0] == 1){
|
||
if(roomcode == null){
|
||
_roomDes[2] += " ";
|
||
}
|
||
_roomDes[2] += " 快版";
|
||
}
|
||
|
||
//服务费
|
||
/*
|
||
if(roomtype[5][3] != null && roomtype[5][3][0] == 1 && roomtype[5][3][1] > 0){
|
||
if(roomcode == null && _roomDes[2].indexOf("\n") < 0){
|
||
_roomDes[2] += " \n房间费:" + roomtype[5][3][1];
|
||
}else{
|
||
_roomDes[2] += " 房间费:" + roomtype[5][3][1];
|
||
}
|
||
}
|
||
*/
|
||
|
||
|
||
|
||
//苹果审核隐房卡显示
|
||
if(GameData.versionState != 1){
|
||
var _math = Utl.getMathInfo();
|
||
if(_math){
|
||
if(_math.roomcard != null){
|
||
_roomDes[0] = "房号:比赛场";
|
||
}
|
||
if(_math.roomcard > 0 && Utl.getVersionState() != 1){
|
||
_roomDes[1] += (" "+ Game_Modify.Type_1[1].des + _math.roomcard);
|
||
if(NN_config.roomCardDes.slice(1,2) == "卡"){
|
||
_roomDes[1] += "张";
|
||
}
|
||
}
|
||
}else if(get_paravalue(GameData.serverConfig, "xxroomdeduct") == 1 && Utl.getIsInfinite() != 1 && roomtype[4] > 0 && Game_Modify.Type_2[roomtype[0]-1].roomcard[roomtype[4]-1] > 0){
|
||
if(NN_config.creatRoomMode[0] != 1 || (NN_config.creatRoomMode[0] == 1 && roomtype[5][1] != 1)){ //真人竞技房不显示扣卡
|
||
if(roomtype[5][1] != 1 || roomtype[5][1] == 1 && get_paravalue(GameData.serverConfig, "xxroomdeduct") == 1){
|
||
_roomDes[1] += (" "+ 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[1] += "张";
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//游戏房间信息
|
||
if(Utl.getIsInfinite() == 1){
|
||
if(NN_config.ui.sysRoomDes != 1){
|
||
Game_Modify.roomDes = " " + _roomDes[0] + _roomDes[1];
|
||
//set_self(284,20,1060);
|
||
}else {
|
||
Game_Modify.roomDes = "";
|
||
//set_self(284,20,320);
|
||
}
|
||
}else {
|
||
Game_Modify.roomDes = _roomDes[0] + "(" + _roomDes[1] + ")";
|
||
//set_self(284,20,1060);
|
||
}
|
||
//分享内容设置
|
||
Game_Config.Share.gameTitle = _roomDes[0]; //游戏中的分享标题
|
||
//分享描述
|
||
Game_Config.Share.gameDescription = _roomDes[2];
|
||
|
||
//显示模式图标(比赛、星星)
|
||
if(roomtype[5][1] == 1 && roomcode != null && asetcount != null){
|
||
set_self(976,37,1,0,0);
|
||
//显示星星场倍数和下限
|
||
//if(){
|
||
if(Utl.getIsInfinite() != 1 || (Utl.getIsInfinite() == 1 && NN_config.ui.sysRoomDes != 1)){
|
||
set_self(980,7,"倍:" + roomtype[5][2][2] + " 限:"+ roomtype[5][2][1],0,0);
|
||
set_self(980,37,1,0,0);
|
||
}
|
||
}
|
||
//显示强制下注分数
|
||
if(roomtype[6] && roomtype[6][0] == 1 && roomtype[6][2] > 0){
|
||
NN_config.force_bet = [1,-1,roomtype[6][2]];
|
||
if(NN_config.forceBetType != 1){ //强制下注
|
||
set_self(987,7,"强制下注:" + roomtype[6][2],0,0);
|
||
if(roomtype[5][5] != 1 && Utl.getIsInfinite() != 1 && roomcode != null){
|
||
set_self(987,37,1,0,0);
|
||
}
|
||
}else{
|
||
//set_self(987,7,"最低下注:" + roomtype[6][2],0,0);
|
||
}
|
||
}else {
|
||
NN_config.force_bet = [-1,-1,0];
|
||
}
|
||
//设置10人局的人数
|
||
NN_UIP.deskInfo.roundNum(0, asetcount, 0);
|
||
|
||
NN_UIP.deskInfo.setRoomTypeDes(_roomDes[0] + " "+ _roomDes[1]);
|
||
if(isRoomDes){ //只返回房间描述
|
||
return _roomDes[1];
|
||
}
|
||
return _roomDes[2];
|
||
}
|
||
|
||
|
||
//-----------------新版战绩---------------------------
|
||
var gameCombat={};
|
||
gameCombat.combatData = {
|
||
page:0,//当前处于第几页战绩 0我的战绩1第二页战绩
|
||
pageOneIndex:0,//选中的第二页的第几栏
|
||
pageTwoIndex:0,//选中的第二页的第几栏
|
||
type:0,
|
||
gradeIdx1:0,
|
||
gradeIdx2:0,
|
||
};
|
||
gameCombat.combatPageOneConfig = {
|
||
fSpid:63,
|
||
bgSpid:64,
|
||
splitSpid:86,
|
||
btnSpid:51,
|
||
txt1Spid:65,
|
||
txt2Spid:66,
|
||
txt3Spid:67,
|
||
bgTag:1,
|
||
splitTag:500,
|
||
btnTag:1000,
|
||
txt1Tag:1500,
|
||
txt2Tag:3000,
|
||
txt3Tag:4500,
|
||
|
||
clip_x:64,
|
||
clip_y:114,
|
||
clip_h:515,
|
||
clip_w:1175,
|
||
|
||
txt1Width:10,
|
||
txt2Width:10,
|
||
txt3Width:10,
|
||
|
||
splitPosition:[338,74],
|
||
btnPosition:[1065,0],
|
||
txt1Position:[[35,15],[35,60],[35,105]],//x,y
|
||
txt2Position:[[130,15],[130,60],[130,105]],//x,y
|
||
txt3Position5:[[400,45],[540,45],[680,45],[820,45],[960,45]],//[居中点,y]
|
||
txt3Position10:[[400,10],[540,10],[680,10],[820,10],[960,10],
|
||
[400,80],[540,80],[680,80],[820,80],[960,80]],//[居中点,y]
|
||
nickNameLimit5:8,
|
||
nickNameLimit10:8,
|
||
nsSpace:30,//昵称积分间隔
|
||
|
||
bgSpace:167,//背景间隔
|
||
|
||
|
||
};
|
||
gameCombat.combatPageTwoConfig = {
|
||
fSpid:87,
|
||
bgSpid:88,
|
||
splitSpid:91,
|
||
btnSpid:54,
|
||
txt1Spid:89,
|
||
//txt2Spid:66,
|
||
txt3Spid:90,
|
||
bgTag:1,
|
||
splitTag:500,
|
||
btnTag:1000,
|
||
txt1Tag:1500,
|
||
txt2Tag:3000,
|
||
txt3Tag:4500,
|
||
|
||
clip_x:64,
|
||
clip_y:114,
|
||
clip_h:515,
|
||
clip_w:1175,
|
||
|
||
txt1Width:10,
|
||
txt2Width:10,
|
||
txt3Width:10,
|
||
|
||
splitPosition:[338,74],
|
||
btnPosition:[1065,0],
|
||
txt1Position:[[90,50],[35,60],[35,105]],//x,y
|
||
txt2Position:[[130,15],[130,60],[130,105]],//x,y
|
||
txt3Position5:[[400,45],[540,45],[680,45],[820,45],[960,45]],//[居中点,y]
|
||
txt3Position10:[[400,10],[540,10],[680,10],[820,10],[960,10],
|
||
[400,80],[540,80],[680,80],[820,80],[960,80]],//[居中点,y]
|
||
nickNameLimit5:2,
|
||
nickNameLimit10:2,
|
||
nsSpace:30,//昵称积分间隔
|
||
|
||
bgSpace:167,//背景间隔
|
||
|
||
|
||
};
|
||
gameCombat.combatPageOneData = {
|
||
slide:false,
|
||
bgTag:0,
|
||
btnTag:0,
|
||
txt1Tag:0,
|
||
txt2Tag:0,
|
||
txt3Tag:0,
|
||
splitTag:0,
|
||
};
|
||
gameCombat.combatPageTwoData = {
|
||
slide:false,
|
||
bgTag:0,
|
||
btnTag:0,
|
||
txt1Tag:0,
|
||
txt2Tag:0,
|
||
txt3Tag:0,
|
||
splitTag:0,
|
||
};
|
||
gameCombat.utlani_doend=function(id,sx,count,allend){
|
||
|
||
};
|
||
gameCombat.utlmousedown = function(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6){
|
||
switch(spid){
|
||
case gameCombat.combatPageOneConfig.fSpid:
|
||
gameCombat.combatPageOneData.slide = false;
|
||
break;
|
||
case gameCombat.combatPageTwoConfig.fSpid:
|
||
gameCombat.combatPageTwoData.slide = false;
|
||
break;
|
||
}
|
||
};
|
||
gameCombat.utlmouseup=function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2){
|
||
if(spid_down == gameCombat.combatPageOneConfig.fSpid){
|
||
var pos = get_self(spid_down,19,0,0,0);
|
||
var sh = get_self(spid_down,21,0,0,0);
|
||
if(sh <= gameCombat.combatPageOneConfig.clip_h){
|
||
play_ani(1,spid_down,19,pos,gameCombat.combatPageOneConfig.clip_y,0,ifast_abs(gameCombat.combatPageOneConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||
}else{
|
||
if(pos > gameCombat.combatPageOneConfig.clip_y){
|
||
play_ani(1,spid_down,19,pos,gameCombat.combatPageOneConfig.clip_y,0,ifast_abs(gameCombat.combatPageOneConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||
}else{
|
||
var ppos = gameCombat.combatPageOneConfig.clip_y + gameCombat.combatPageOneConfig.clip_h - sh;
|
||
if(pos < ppos){
|
||
play_ani(1,spid_down,19,pos,ppos,0,ifast_abs(ppos - pos),0,0,0,1,0,0,0);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if(spid_down == gameCombat.combatPageTwoConfig.fSpid){
|
||
var pos = get_self(spid_down,19,0,0,0);
|
||
var sh = get_self(spid_down,21,0,0,0);
|
||
if(sh <= gameCombat.combatPageTwoConfig.clip_h){
|
||
play_ani(1,spid_down,19,pos,gameCombat.combatPageTwoConfig.clip_y,0,ifast_abs(gameCombat.combatPageTwoConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||
}else{
|
||
if(pos > gameCombat.combatPageTwoConfig.clip_y){
|
||
play_ani(1,spid_down,19,pos,gameCombat.combatPageTwoConfig.clip_y,0,ifast_abs(gameCombat.combatPageTwoConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||
}else{
|
||
var ppos = gameCombat.combatPageTwoConfig.clip_y + gameCombat.combatPageTwoConfig.clip_h - sh;
|
||
if(pos < ppos){
|
||
play_ani(1,spid_down,19,pos,ppos,0,ifast_abs(ppos - pos),0,0,0,1,0,0,0);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
if(spid_down==spid_up){
|
||
switch(spid_up){
|
||
case 13://发送战绩请求
|
||
if(GameData.sysConfig.nnLocal == 2){
|
||
gameCombat.Send_get_player_grade1();
|
||
}else{
|
||
Logic.getNNLocal();
|
||
}
|
||
break;
|
||
case gameCombat.combatPageOneConfig.fSpid://战绩页一
|
||
if(!gameCombat.combatPageOneData.slide){
|
||
var up_id = ifast_check_add(spid_up,upx,upy);
|
||
|
||
if(up_id>=gameCombat.combatPageOneConfig.btnTag&&up_id<=gameCombat.combatPageOneConfig.txt1Tag){
|
||
//console.log(up_id - gameCombat.combatPageOneConfig.btnTag);
|
||
gameCombat.newGoCombatPageTwo(up_id - gameCombat.combatPageOneConfig.btnTag);
|
||
}
|
||
}
|
||
break;
|
||
case gameCombat.combatPageTwoConfig.fSpid://战绩页二
|
||
if(!gameCombat.combatPageTwoData.slide){
|
||
var up_id = ifast_check_add(spid_up,upx,upy);
|
||
//console.log(up_id);
|
||
if(up_id>=gameCombat.combatPageTwoConfig.btnTag&&up_id<=gameCombat.combatPageTwoConfig.txt1Tag){
|
||
//选中的是第几小局0开始
|
||
gameCombat.combatData.pageTwoIndex = up_id - gameCombat.combatPageTwoConfig.btnTag;
|
||
gameCombat.newGoCombatPageThree(gameCombat.combatData.pageOneIndex,gameCombat.combatData.pageTwoIndex);
|
||
}
|
||
}
|
||
break;
|
||
case 49:
|
||
case 61:
|
||
{
|
||
gameCombat.closeNewCombat();
|
||
}
|
||
break;
|
||
case 55://战绩返回
|
||
if(gameCombat.combatData.page == 0){
|
||
gameCombat.closeNewCombat();
|
||
}else if(gameCombat.combatData.page == 1){
|
||
gameCombat.newGoCombatPageOne();
|
||
}else{
|
||
gameCombat.newGoCombatPageTwo(gameCombat.combatData.pageOneIndex);
|
||
}
|
||
break;
|
||
case 84:
|
||
//gameCombat.Send_get_player_grade1(0);
|
||
if(GameData.sysConfig.nnLocal == 2){
|
||
gameCombat.Send_get_player_grade1(0);
|
||
}else{
|
||
Logic.getNNLocal();
|
||
}
|
||
break;
|
||
case 85:
|
||
gameCombat.Send_get_player_grade1(1);
|
||
break;
|
||
case 104://我的开房上一页
|
||
gameCombat.Send_get_player_grade1(1,1,gameCombat.combatData.gradeIdx1);
|
||
break;
|
||
case 105://下一页
|
||
gameCombat.Send_get_player_grade1(1,2,gameCombat.combatData.gradeIdx2);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
gameCombat.utlmousemove=function(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1){
|
||
switch(spid){
|
||
case gameCombat.combatPageOneConfig.fSpid:
|
||
if(ifast_abs(offmovey)>2){
|
||
set_self(spid,19,offmovey,1,0,0);
|
||
gameCombat.combatPageOneData.slide = true;
|
||
}
|
||
break;
|
||
case gameCombat.combatPageTwoConfig.fSpid:
|
||
if(ifast_abs(offmovey)>2){
|
||
set_self(spid,19,offmovey,1,0,0);
|
||
gameCombat.combatPageTwoData.slide = true;
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
gameCombat.utlgamemydraw=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||
|
||
}
|
||
gameCombat.utlgamemydrawbegin=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||
if(spid==gameCombat.combatPageOneConfig.fSpid){
|
||
set_clip(0,0,gameCombat.combatPageOneConfig.clip_x,gameCombat.combatPageOneConfig.clip_y,gameCombat.combatPageOneConfig.clip_w,gameCombat.combatPageOneConfig.clip_h);
|
||
}
|
||
if(spid==gameCombat.combatPageTwoConfig.fSpid){
|
||
set_clip(0,0,gameCombat.combatPageTwoConfig.clip_x,gameCombat.combatPageTwoConfig.clip_y,gameCombat.combatPageTwoConfig.clip_w,gameCombat.combatPageTwoConfig.clip_h);
|
||
}
|
||
}
|
||
|
||
//打开战绩
|
||
gameCombat.openNewCombat = function(){
|
||
|
||
//gameCombat.combatData.page = 0;
|
||
if(!gameCombat.combatData.type){
|
||
set_self(83,43,1,0,0);
|
||
}else{
|
||
set_self(83,43,2,0,0);
|
||
}
|
||
set_group(7,37,1,0,0);
|
||
|
||
|
||
//gameCombat.newCreateCombatPageOne();
|
||
gameCombat.newGoCombatPageOne();
|
||
}
|
||
//关闭战绩
|
||
gameCombat.closeNewCombat = function(){
|
||
set_group(7,37,0,0,0);
|
||
set_group(8,37,0,0,0);
|
||
set_group(9,37,0,0,0);
|
||
set_group(13,37,0,0,0);
|
||
set_group(14,37,0,0,0);
|
||
set_group(15,37,0,0,0);
|
||
set_group(16,37,0,0,0);
|
||
set_group(17,37,0,0,0);
|
||
gameCombat.removeCombatPageOne();
|
||
gameCombat.removeCombatPageTwo();
|
||
gameCombat.removeCombatPageThree();
|
||
}
|
||
//创建战绩页一
|
||
gameCombat.newCreateCombatPageOne = function(){
|
||
gameCombat.removeCombatPageOne();
|
||
set_group(8,37,1,0,0);
|
||
set_self(gameCombat.combatPageOneConfig.fSpid,18,gameCombat.combatPageOneConfig.clip_x,0,0);
|
||
set_self(gameCombat.combatPageOneConfig.fSpid,19,gameCombat.combatPageOneConfig.clip_y,0,0);
|
||
var h = gameCombat.combatPageOneConfig.bgSpace;
|
||
set_self(gameCombat.combatPageOneConfig.fSpid,21,h*CombatInfo.length,0,0);
|
||
set_self(gameCombat.combatPageOneConfig.fSpid,20,get_self(gameCombat.combatPageOneConfig.bgSpid,20,0,0,0),0,0);
|
||
var bgTag = gameCombat.combatPageOneConfig.bgTag;
|
||
var btnTag = gameCombat.combatPageOneConfig.btnTag;
|
||
var txt1Tag = gameCombat.combatPageOneConfig.txt1Tag;
|
||
var txt2Tag = gameCombat.combatPageOneConfig.txt2Tag;
|
||
var txt3Tag = gameCombat.combatPageOneConfig.txt3Tag;
|
||
var splitTag = gameCombat.combatPageOneConfig.splitTag;
|
||
for(var i=0;i<CombatInfo.length;i++){
|
||
//背景
|
||
var bg = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.bgSpid,
|
||
0,0+i*gameCombat.combatPageOneConfig.bgSpace,bgTag);
|
||
bgTag++;
|
||
//时间标签
|
||
var timeTag = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt1Spid,
|
||
gameCombat.combatPageOneConfig.txt1Position[0][0],
|
||
gameCombat.combatPageOneConfig.txt1Position[0][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
txt1Tag);
|
||
set_self(timeTag,7,"时间:",0,0);
|
||
txt1Tag++;
|
||
//房号标签
|
||
var roomCodeTag = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt1Spid,
|
||
gameCombat.combatPageOneConfig.txt1Position[1][0],
|
||
gameCombat.combatPageOneConfig.txt1Position[1][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
txt1Tag);
|
||
set_self(roomCodeTag,7,"房号:",0,0);
|
||
txt1Tag++;
|
||
//局数标签
|
||
var countTag = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt1Spid,
|
||
gameCombat.combatPageOneConfig.txt1Position[2][0],
|
||
gameCombat.combatPageOneConfig.txt1Position[2][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
txt1Tag);
|
||
set_self(countTag,7,"局数:",0,0);
|
||
txt1Tag++;
|
||
//时间
|
||
var time = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt2Spid,
|
||
gameCombat.combatPageOneConfig.txt2Position[0][0],
|
||
gameCombat.combatPageOneConfig.txt2Position[0][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
txt2Tag);
|
||
set_self(time,7,CombatInfo[i].overtime,0,0);
|
||
txt2Tag++;
|
||
|
||
//房号
|
||
var roomcode = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt2Spid,
|
||
gameCombat.combatPageOneConfig.txt2Position[1][0],
|
||
gameCombat.combatPageOneConfig.txt2Position[1][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
txt2Tag);
|
||
txt2Tag++;
|
||
set_self(roomcode,7,CombatInfo[i].roomcode,0,0);
|
||
//局数
|
||
var round = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt2Spid,
|
||
gameCombat.combatPageOneConfig.txt2Position[2][0],
|
||
gameCombat.combatPageOneConfig.txt2Position[2][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
txt2Tag);
|
||
txt2Tag++;
|
||
set_self(round,7,CombatInfo[i].gameinfo1.roundsum,0,0);
|
||
|
||
//玩家信息(昵称,积分)
|
||
var position = gameCombat.combatPageOneConfig.txt3Position5;
|
||
var _pCount = 0;
|
||
for(var m=0;m<CombatInfo[i].gameinfo1.playerlist.length;m++){
|
||
if(CombatInfo[i].gameinfo1.playerlist[m]){
|
||
_pCount++;
|
||
}
|
||
}
|
||
if(_pCount > 5){
|
||
//splitPosition
|
||
position = gameCombat.combatPageOneConfig.txt3Position10;
|
||
var splitLine = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.splitSpid,
|
||
gameCombat.combatPageOneConfig.splitPosition[0],
|
||
gameCombat.combatPageOneConfig.splitPosition[1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
splitTag);
|
||
splitTag++;
|
||
}
|
||
var nameLimit;
|
||
CombatInfo[i].gameinfo1.playerlist.length > 5 ? nameLimit = gameCombat.combatPageOneConfig.nickNameLimit10:nameLimit = gameCombat.combatPageOneConfig.nickNameLimit5;
|
||
var n=0;
|
||
for(var j=0;j<CombatInfo[i].gameinfo1.playerlist.length;j++){
|
||
if(CombatInfo[i].gameinfo1.playerlist[j]){
|
||
//set_rec(233+i*count+j*2,Func.subString(CombatInfo[i].gameinfo1.playerlist[j][0],gameCombat.combat.pageOnelimitStrLen,gameCombat.combat.pageOneDoc));
|
||
//set_rec(234+i*count+j*2,CombatInfo[i].gameinfo1.playerlist[j][1]);
|
||
//var nameTxt = "";
|
||
//if(CombatInfo[i].gameinfo1.playerlist[j]){
|
||
var nameTxt = Func.subString(CombatInfo[i].gameinfo1.playerlist[j][0],nameLimit,true);
|
||
//}
|
||
|
||
var nickname = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt3Spid,
|
||
position[n][0]- String(nameTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width/2,
|
||
position[n][1]+i*gameCombat.combatPageOneConfig.bgSpace,txt3Tag);
|
||
txt3Tag++;
|
||
set_self(nickname,7,nameTxt,0,0);
|
||
//var scoreTxt = "";
|
||
//if(CombatInfo[i].gameinfo1.playerlist[j]){
|
||
var scoreTxt = CombatInfo[i].gameinfo1.playerlist[j][1];
|
||
//}
|
||
//
|
||
var score = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt3Spid,
|
||
position[n][0]- String(scoreTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width/2,
|
||
position[n][1]+gameCombat.combatPageOneConfig.nsSpace+i*gameCombat.combatPageOneConfig.bgSpace,txt3Tag);
|
||
txt3Tag++;
|
||
set_self(score,7,scoreTxt,0,0);
|
||
n++;
|
||
}
|
||
}
|
||
var btn = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.btnSpid,
|
||
gameCombat.combatPageOneConfig.btnPosition[0],
|
||
gameCombat.combatPageOneConfig.btnPosition[1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||
btnTag);
|
||
btnTag++;
|
||
}
|
||
gameCombat.combatPageOneData.bgTag = bgTag;
|
||
gameCombat.combatPageOneData.btnTag = btnTag;
|
||
gameCombat.combatPageOneData.txt1Tag = txt1Tag;
|
||
gameCombat.combatPageOneData.txt2Tag = txt2Tag;
|
||
gameCombat.combatPageOneData.txt3Tag = txt3Tag;
|
||
gameCombat.combatPageOneData.splitTag = splitTag;
|
||
}
|
||
//删除战绩页一
|
||
gameCombat.removeCombatPageOne = function(){
|
||
for(var i=gameCombat.combatPageOneConfig.bgTag;i<gameCombat.combatPageOneData.bgTag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageOneData.bgTag = 0;
|
||
for(var i=gameCombat.combatPageOneConfig.btnTag;i<gameCombat.combatPageOneData.btnTag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageOneData.btnTag = 0;
|
||
for(var i=gameCombat.combatPageOneConfig.txt1Tag;i<gameCombat.combatPageOneData.txt1Tag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageOneData.txt1Tag = 0;
|
||
for(var i=gameCombat.combatPageOneConfig.txt2Tag;i<gameCombat.combatPageOneData.txt2Tag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageOneData.txt2Tag = 0;
|
||
for(var i=gameCombat.combatPageOneConfig.txt3Tag;i<gameCombat.combatPageOneData.txt3Tag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageOneData.txt3Tag = 0;
|
||
for(var i=gameCombat.combatPageOneConfig.splitTag;i<gameCombat.combatPageOneData.splitTag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageOneData.splitTag = 0;
|
||
set_group(8,37,0,0,0);
|
||
|
||
//隐藏本地战绩按钮
|
||
set_self(Game_Modify.gameView.combat._locRecordsSpid, 37, 0, 0,0);
|
||
}
|
||
//创建战绩页二
|
||
gameCombat.newCreateCombatPageTwo = function(){
|
||
|
||
set_group(9,37,1,0,0);
|
||
set_self(gameCombat.combatPageTwoConfig.fSpid,18,gameCombat.combatPageTwoConfig.clip_x,0,0);
|
||
set_self(gameCombat.combatPageTwoConfig.fSpid,19,gameCombat.combatPageTwoConfig.clip_y,0,0);
|
||
var h = gameCombat.combatPageTwoConfig.bgSpace;
|
||
set_self(gameCombat.combatPageTwoConfig.fSpid,21,h*CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round.length,0,0);
|
||
set_self(gameCombat.combatPageTwoConfig.fSpid,20,get_self(gameCombat.combatPageTwoConfig.bgSpid,20,0,0,0),0,0);
|
||
var bgTag = gameCombat.combatPageTwoConfig.bgTag;
|
||
var btnTag = gameCombat.combatPageTwoConfig.btnTag;
|
||
var txt1Tag = gameCombat.combatPageTwoConfig.txt1Tag;
|
||
var txt3Tag = gameCombat.combatPageTwoConfig.txt3Tag;
|
||
var splitTag = gameCombat.combatPageTwoConfig.splitTag;
|
||
|
||
|
||
|
||
|
||
for(var i=0;i<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round.length;i++){
|
||
//背景
|
||
var bg = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.bgSpid,
|
||
0,0+i*gameCombat.combatPageTwoConfig.bgSpace,bgTag);
|
||
bgTag++;
|
||
//第几局
|
||
var round = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.txt1Spid,
|
||
gameCombat.combatPageTwoConfig.txt1Position[0][0],
|
||
gameCombat.combatPageTwoConfig.txt1Position[0][1]+i*gameCombat.combatPageTwoConfig.bgSpace,
|
||
txt1Tag);
|
||
var rd = i+1;
|
||
var txt = "";
|
||
rd < 10 ? (txt = "第 "+rd+" 局" ): (txt = "第"+rd+"局");
|
||
set_self(round,7,txt,0,0);
|
||
txt1Tag++;
|
||
|
||
//玩家信息(昵称,积分)
|
||
var position = gameCombat.combatPageTwoConfig.txt3Position5;
|
||
var _pCount=0;
|
||
for(var m=0;m<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist.length;m++){
|
||
if(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist[m]){
|
||
_pCount++;
|
||
}
|
||
}
|
||
if(_pCount > 5){
|
||
//splitPosition
|
||
position = gameCombat.combatPageTwoConfig.txt3Position10;
|
||
var splitLine = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.splitSpid,
|
||
gameCombat.combatPageTwoConfig.splitPosition[0],
|
||
gameCombat.combatPageTwoConfig.splitPosition[1]+i*gameCombat.combatPageTwoConfig.bgSpace,
|
||
splitTag);
|
||
splitTag++;
|
||
}
|
||
var nameLimit;
|
||
CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist.length > 5 ? nameLimit = gameCombat.combatPageTwoConfig.nickNameLimit10:nameLimit = gameCombat.combatPageTwoConfig.nickNameLimit5;
|
||
var scoreList = [];
|
||
var n=0;
|
||
for(var j=0;j<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist.length;j++){
|
||
if(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist[j]){
|
||
//set_rec(233+i*count+j*2,Func.subString(CombatInfo[i].gameinfo1.playerlist[j][0],gameCombat.combat.pageOnelimitStrLen,gameCombat.combat.pageOneDoc));
|
||
//set_rec(234+i*count+j*2,CombatInfo[i].gameinfo1.playerlist[j][1]); - String(nameTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width
|
||
var nameTxt = Func.subString(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist[j][0],nameLimit,true);
|
||
var nickname = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.txt3Spid,
|
||
position[n][0],position[n][1]+i*gameCombat.combatPageTwoConfig.bgSpace,txt3Tag);
|
||
txt3Tag++;
|
||
set_self(nickname,7,nameTxt,0,0);
|
||
|
||
//var scoreTxt = CombatInfo[gameCombat.combatData.page].gameinfo1.playerlist[j][1];
|
||
// - String(scoreTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width
|
||
var score = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.txt3Spid,
|
||
position[n][0],position[n][1]+gameCombat.combatPageTwoConfig.nsSpace+i*gameCombat.combatPageTwoConfig.bgSpace,txt3Tag);
|
||
txt3Tag++;
|
||
set_self(score,7,0,0,0);
|
||
//scoreList.push(score);
|
||
//.length <= 5 ? _maxLen = CombatInfo[v].gameinfo1.round[i].length : _maxLen = 5;
|
||
for(var k=0;k<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round[i].length;k++){
|
||
//set_rec(232+i*count+CombatInfo[gameCombat.combatData.page].gameinfo1.round[i][j][0],CombatInfo[v].gameinfo1.round[i][j][1]);
|
||
if(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round[i][k][0] == j){
|
||
set_self(score,7,CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round[i][k][1]);
|
||
}
|
||
}
|
||
n++;
|
||
}
|
||
}
|
||
|
||
var btn = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.btnSpid,
|
||
gameCombat.combatPageTwoConfig.btnPosition[0],
|
||
gameCombat.combatPageTwoConfig.btnPosition[1]+i*gameCombat.combatPageTwoConfig.bgSpace,
|
||
btnTag);
|
||
btnTag++;
|
||
|
||
|
||
|
||
}
|
||
|
||
gameCombat.combatPageTwoData.bgTag = bgTag;
|
||
gameCombat.combatPageTwoData.btnTag = btnTag;
|
||
gameCombat.combatPageTwoData.txt1Tag = txt1Tag;
|
||
gameCombat.combatPageTwoData.txt3Tag = txt3Tag;
|
||
gameCombat.combatPageTwoData.splitTag = splitTag;
|
||
//显示
|
||
//set_self(82, 37, 1, 0, 0);
|
||
//set_self(683, 37, 1, 0, 0);
|
||
//set_self(684, 37, 1, 0, 0);
|
||
}
|
||
//删除战绩页一
|
||
gameCombat.removeCombatPageTwo = function(){
|
||
for(var i=gameCombat.combatPageTwoConfig.bgTag;i<gameCombat.combatPageTwoData.bgTag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageTwoData.bgTag = 0;
|
||
for(var i=gameCombat.combatPageTwoConfig.btnTag;i<gameCombat.combatPageTwoData.btnTag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageTwoData.btnTag = 0;
|
||
for(var i=gameCombat.combatPageTwoConfig.txt1Tag;i<gameCombat.combatPageTwoData.txt1Tag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageTwoData.txt1Tag = 0;
|
||
for(var i=gameCombat.combatPageTwoConfig.txt3Tag;i<gameCombat.combatPageTwoData.txt3Tag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageTwoData.txt3Tag = 0;
|
||
for(var i=gameCombat.combatPageTwoConfig.splitTag;i<gameCombat.combatPageTwoData.splitTag;i++){
|
||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||
}
|
||
gameCombat.combatPageTwoData.splitTag = 0;
|
||
set_group(9,37,0,0,0);
|
||
}
|
||
//创建战绩页三
|
||
gameCombat.newCreateCombatPageThree = function(point){
|
||
gameCombat.combatData.page = 2;
|
||
//获取数据
|
||
var gameinfo = CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1,
|
||
rounds = CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round[point], //局数据
|
||
roomType = CombatInfo[gameCombat.combatData.pageOneIndex].roomtype, //房间类型
|
||
surplusCard = CombatInfo[gameCombat.combatData.pageOneIndex].roomcard; //剩卡
|
||
//显示游戏详情页
|
||
Game_Modify.gameView.combat.view(true, gameinfo, rounds, roomType, surplusCard, point);
|
||
}
|
||
gameCombat.removeCombatPageThree = function(){
|
||
//隐藏游戏详情页
|
||
Game_Modify.gameView.combat.view();
|
||
}
|
||
//前往战绩页一
|
||
gameCombat.newGoCombatPageOne = function(){
|
||
gameCombat.removeCombatPageTwo();
|
||
gameCombat.removeCombatPageThree();
|
||
gameCombat.combatData.page = 0;
|
||
gameCombat.newCreateCombatPageOne();
|
||
if(gameCombat.combatData.type){
|
||
set_self(104,37,1,0,0);
|
||
set_self(105,37,1,0,0);
|
||
}else{
|
||
set_self(104,37,0,0,0);
|
||
set_self(105,37,0,0,0);
|
||
}
|
||
if(CombatCount){
|
||
set_self(684,7,CombatCount,0,0);
|
||
set_self(684,20,String(CombatCount).length*14,0,0);
|
||
}else{
|
||
set_self(683,37,0,0,0);
|
||
set_self(684,37,0,0,0);
|
||
}
|
||
set_self(685,7,"今日大赢家次数;"+winnerCount,0,0);
|
||
set_self(82,37,1,0,0);
|
||
if(!gameCombat.combatData.type){
|
||
set_self(82,43,1,0,0);
|
||
}else{
|
||
set_self(82,43,2,0,0);
|
||
}
|
||
}
|
||
//前往战绩页二
|
||
gameCombat.newGoCombatPageTwo = function(page){
|
||
gameCombat.combatData.page = 1;
|
||
gameCombat.removeCombatPageOne();
|
||
gameCombat.removeCombatPageThree();
|
||
gameCombat.combatData.pageOneIndex = page;
|
||
gameCombat.newCreateCombatPageTwo();
|
||
if(CombatCount){
|
||
set_self(684,7,CombatCount,0,0);
|
||
set_self(684,20,String(CombatCount).length*14,0,0);
|
||
}else{
|
||
set_self(683,37,0,0,0);
|
||
set_self(684,37,0,0,0);
|
||
}
|
||
set_self(82,37,1,0,0);
|
||
if(!gameCombat.combatData.type){
|
||
set_self(82,43,1,0,0);
|
||
}else{
|
||
set_self(82,43,2,0,0);
|
||
}
|
||
}
|
||
//前往战绩页三
|
||
gameCombat.newGoCombatPageThree = function(idx1,idx2){//idx1第几大局,idx2第几小局
|
||
gameCombat.removeCombatPageOne();
|
||
gameCombat.removeCombatPageTwo();
|
||
gameCombat.newCreateCombatPageThree(idx2);
|
||
//console.log("idx1:"+idx1+" idx2:"+idx2);
|
||
}
|
||
//发送战绩一
|
||
gameCombat.Send_get_player_grade1 = function(type,direction,gradeidx){
|
||
|
||
var data={};
|
||
data.agentid = GameData.AgentId;
|
||
data.playerid = C_Player.playerid;
|
||
data.gameid = GameData.GameId;
|
||
gameCombat.combatData.type = type;
|
||
if(typeof type != "undefined"){
|
||
data.type = type;
|
||
}
|
||
if(typeof direction != "undefined"){
|
||
data.direction = direction;
|
||
}
|
||
if(typeof gradeidx != "undefined"){
|
||
data.gradeidx = gradeidx;
|
||
}
|
||
Net.Send_get_player_grade1(data);
|
||
}
|
||
//接收获取战绩
|
||
gameCombat.get_player_grade1 = function(_msg){
|
||
Utl.playSound(Game_Config.ClickButton.src_2);
|
||
//gameCombat.combatData.type = _msg.data.type;
|
||
CombatInfo = _msg.data.gradeinfo;
|
||
CombatCount = _msg.data.asetcount;
|
||
winnerCount = _msg.data.winnerCount;
|
||
for(var i=0;i<CombatInfo.length;i++){
|
||
if(typeof CombatInfo[i].gameinfo1 == "string"){
|
||
CombatInfo[i].gameinfo1=JSON.parse(CombatInfo[i].gameinfo1);
|
||
}
|
||
if(i==0){
|
||
gameCombat.combatData.gradeIdx1 = CombatInfo[i].idx;
|
||
}
|
||
if(i==CombatInfo.length-1){
|
||
gameCombat.combatData.gradeIdx2 = CombatInfo[i].idx;
|
||
}
|
||
}
|
||
|
||
gameCombat.openNewCombat();
|
||
//显示本地战绩按钮
|
||
set_self(Game_Modify.gameView.combat._locRecordsSpid, 37, 1, 0,0);
|
||
}
|
||
//
|
||
gameCombat.Send_get_player_grade2 = function(_data){
|
||
Net.Send_get_player_grade2(_data);
|
||
|
||
}
|
||
//
|
||
gameCombat.get_player_grade2 = function(_msg){
|
||
|
||
}
|
||
|
||
//游戏自行添加的函数
|
||
Game_Modify.gameFunc = {};
|
||
//登入游戏后初始化
|
||
Game_Modify.gameFunc.initData = 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 +"数限";
|
||
|
||
//星星场图标变帧
|
||
if(Utl.getNameImgFrame_2() != null){
|
||
set_self(976,43,Utl.getNameImgFrame_2(),0,0); //游戏界面
|
||
//set_self(1115,43,Utl.getNameImgFrame_2(),0,0); //战绩
|
||
}
|
||
//房主每人扣卡描述更改
|
||
if(NN_config.roomCardDes.slice(1,2) != "卡"){
|
||
Game_Modify.Type_1[0].des = "房主扣" + NN_config.roomCardDes;
|
||
Game_Modify.Type_1[1].des = "每人扣" + NN_config.roomCardDes;
|
||
}
|
||
};
|
||
|
||
//更新房卡相关参数
|
||
Game_Modify.gameFunc.roomCardUpdate = function(personMax){
|
||
var o_roomCard;
|
||
if(personMax == 10 && NN_config.room_card[1]){
|
||
o_roomCard = NN_config.room_card[1];
|
||
}else {
|
||
o_roomCard = NN_config.room_card[0];
|
||
}
|
||
//局数及房卡消耗
|
||
if(o_roomCard && o_roomCard.length > 0){
|
||
for(var i=0;i<o_roomCard.length;i++){
|
||
if(o_roomCard[i].length == 2){
|
||
//局数
|
||
Game_Modify.Type_2[0].roomcount[i] = o_roomCard[i][0][0];
|
||
Game_Modify.Type_2[1].roomcount[i] = o_roomCard[i][1][0];
|
||
//房卡消耗数量
|
||
Game_Modify.Type_2[0].roomcard[i] = o_roomCard[i][0][1];
|
||
Game_Modify.Type_2[1].roomcard[i] = o_roomCard[i][1][1];
|
||
}
|
||
}
|
||
}
|
||
};
|
||
|
||
//解析游戏强制下注
|
||
Game_Modify.gameFunc.AnalForceBet = function(model, model_mult, model_bet, force_bet, loc_forceBet){
|
||
//console.log("\n\n参数:model = "+ model + " model_mult = " +model_mult+"\n model_bet = " + JSON.stringify(model_bet)+ "\n force_bet = "+ JSON.stringify(force_bet));
|
||
if(loc_forceBet && loc_forceBet[0] > 0 && loc_forceBet[2] > 0){
|
||
NN_config.force_bet = loc_forceBet.slice();
|
||
}else {
|
||
NN_config.force_bet = [1,-1,1];
|
||
}
|
||
//
|
||
NN_config.betRange = [];
|
||
//NN_config.force_bet = [-1,-1,0];
|
||
var _val = null;
|
||
//下注模式赋值
|
||
if(model_bet && model_bet != null && model_mult != null && model_mult > 0){
|
||
//判断对应上庄模式配置是否有值
|
||
if(model_bet[model - 1]){
|
||
_val = model_bet[model - 1];
|
||
}else if(model == 2 || model == 3){
|
||
if(model_bet[0]){
|
||
_val = model_bet[0];
|
||
}
|
||
}else if(model == 4 || model == 5){
|
||
if(model_bet[3]){
|
||
_val = model_bet[3];
|
||
}else if(model_bet[0]){
|
||
_val = model_bet[0];
|
||
}
|
||
}
|
||
if(_val){
|
||
if(_val[model_mult - 1]){
|
||
//下注模式赋值
|
||
if(_val[model_mult - 1][0] > 0){
|
||
NN_config.model_bet = _val[model_mult - 1][0];
|
||
}
|
||
//下注范围
|
||
if(_val[model_mult - 1][1] && _val[model_mult - 1][1].length > 0){
|
||
NN_config.betRange = _val[model_mult - 1][1];
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
//判断下注范围是否有值
|
||
if(NN_config.betRange.length == 0){
|
||
for(var i=0; i<NN_config.model_bet; i++){
|
||
NN_config.betRange.push(i+1);
|
||
}
|
||
}
|
||
|
||
//console.log("下注模式"+NN_config.model_bet);
|
||
//console.log("下注范围:"+JSON.stringify(NN_config.betRange));
|
||
|
||
//强制下注赋值
|
||
if(force_bet && force_bet.length >= 3){
|
||
if(force_bet[0] < 0){ //修改默认强制下注
|
||
force_bet[0] = 1;
|
||
}
|
||
if(force_bet[2] < 0){ //修改默认强制下注值为1
|
||
force_bet[2] = 1;
|
||
}
|
||
var arr_fb = null;
|
||
if(force_bet[3] && force_bet[3][model - 1]){
|
||
arr_fb = force_bet[3][model - 1];
|
||
}else if(model == 4 || model == 5){
|
||
if(force_bet[3] && force_bet[3][3]){
|
||
arr_fb = force_bet[3][3];
|
||
}else if(force_bet[3] && force_bet[3][0]){
|
||
arr_fb = force_bet[3][0];
|
||
}else if(!loc_forceBet){
|
||
NN_config.force_bet = [1,-1,1];//看牌抢庄默认强制下注
|
||
}
|
||
}else {
|
||
if(force_bet[3] && force_bet[3][0]){
|
||
arr_fb = force_bet[3][0];
|
||
}else if(force_bet[0] > 0 && force_bet[2] > 0){
|
||
NN_config.force_bet[0] = 1;
|
||
if(NN_config.force_bet[2] < NN_config.betRange[0] || NN_config.force_bet[2] > NN_config.betRange[NN_config.betRange.length - 1]){
|
||
NN_config.force_bet[2] = force_bet[2];
|
||
}
|
||
}
|
||
}
|
||
if(arr_fb){
|
||
if(model == 4 || model == 5){
|
||
if(!loc_forceBet){
|
||
NN_config.force_bet = [1,-1,1];
|
||
if(NN_config.betRange.length > 0){
|
||
NN_config.force_bet[2] = NN_config.betRange[0];
|
||
}
|
||
}
|
||
}else if(force_bet[0] > 0 && force_bet[2] > 0){
|
||
NN_config.force_bet = force_bet.slice(0,3);
|
||
}
|
||
for(var i=0; i<arr_fb.length; i++){
|
||
if(arr_fb[i][0] == NN_config.model_bet){
|
||
if(loc_forceBet){
|
||
//判断是否在下注范围内
|
||
if(NN_config.betRange.length > 0){
|
||
var _temp = false;
|
||
for(var j=0; j<NN_config.betRange.length; j++){
|
||
if(loc_forceBet[2] == NN_config.betRange[j]){
|
||
NN_config.force_bet = loc_forceBet.slice();
|
||
_temp = true;
|
||
break;
|
||
}
|
||
}
|
||
if(!_temp){
|
||
NN_config.force_bet[2] = arr_fb[i][1];
|
||
}
|
||
}else if(NN_config.force_bet[2] <= 0 || NN_config.force_bet[2] > NN_config.model_bet){
|
||
NN_config.force_bet[2] = arr_fb[i][1];
|
||
}
|
||
}else {
|
||
NN_config.force_bet = [1,-1,arr_fb[i][1]];
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
//判断下注值是否在下注范围内
|
||
if(NN_config.betRange.length > 0){
|
||
if(NN_config.force_bet[2] < NN_config.betRange[0]){
|
||
NN_config.force_bet[2] = NN_config.betRange[0];
|
||
}else if(NN_config.force_bet[2] > NN_config.betRange[NN_config.betRange.length-1]){
|
||
NN_config.force_bet[2] = NN_config.betRange[NN_config.betRange.length-1];
|
||
}else {
|
||
var _temp = false;
|
||
for(var j=0; j<NN_config.betRange.length; j++){
|
||
if(NN_config.force_bet[2] == NN_config.betRange[j]){
|
||
_temp = true;
|
||
break;
|
||
}
|
||
}
|
||
if(!_temp){
|
||
NN_config.force_bet[2] = NN_config.betRange[0];
|
||
}
|
||
}
|
||
}else if(NN_config.force_bet[2] > NN_config.model_bet){
|
||
NN_config.force_bet[2] = NN_config.model_bet;
|
||
}else if(NN_config.force_bet[2] < 0){
|
||
NN_config.force_bet = [1,-1,1];
|
||
}
|
||
}else {
|
||
//if(model == 4 || model == 5){
|
||
if(NN_config.force_bet[0] < 0 || NN_config.force_bet[2] <= 0){
|
||
NN_config.force_bet = [1,-1,1];
|
||
}
|
||
if(NN_config.betRange.length > 0){
|
||
NN_config.force_bet[2] = NN_config.betRange[0];
|
||
}
|
||
//}
|
||
}
|
||
//console.log("强制下注:"+JSON.stringify(NN_config.force_bet));
|
||
|
||
//强制下注按钮 标记下注状态及按钮显示
|
||
if(NN_config.force_bet[0] == 1 && NN_config.force_bet[2] > 0){
|
||
Game_Modify.CreateRoomData.forceBet = 1;
|
||
}else {
|
||
Game_Modify.CreateRoomData.forceBet = -1;
|
||
}
|
||
//刷新强制下注按钮显示
|
||
Game_Modify.gameView.btn_forceBet();
|
||
};
|
||
|
||
//解析游戏服务费最大值
|
||
Game_Modify.gameFunc.getMaxTeaCost = function(){
|
||
var _maxCost = -1;
|
||
if(NN_config.teaCost[2] == 1){ //可变动
|
||
if(NN_config.teaCost[4] == 1 && NN_config.teaCost[5] != null){ //最大值可变
|
||
if(typeof(NN_config.teaCost[5]) == "object"){ //number
|
||
_maxCost = NN_config.bean_mult[0] * NN_config.teaCost[5][Game_Modify.CreateRoomData.Type_2];
|
||
}else {
|
||
_maxCost = NN_config.bean_mult[0] * NN_config.teaCost[5];
|
||
}
|
||
}else if(NN_config.teaCost[4] == 2 && NN_config.teaCost[5] != null){//最大值固定
|
||
if(typeof(NN_config.teaCost[5]) == "object"){ //number
|
||
_maxCost = NN_config.teaCost[5][Game_Modify.CreateRoomData.Type_2];
|
||
}else {
|
||
_maxCost = NN_config.teaCost[5];
|
||
}
|
||
}
|
||
}else if(NN_config.teaCost[2] == 2){ //固定值
|
||
if(typeof(NN_config.teaCost[5]) == "object"){ //number
|
||
_maxCost = NN_config.teaCost[3][Game_Modify.CreateRoomData.Type_2];
|
||
}else if(NN_config.teaCost[3] >= 0){
|
||
_maxCost = NN_config.teaCost[3];
|
||
}
|
||
}
|
||
if(_maxCost != -1){
|
||
NN_config.teaCost[6] = _maxCost;
|
||
}
|
||
return _maxCost;
|
||
};
|
||
|
||
//解析游戏服务费最大值
|
||
Game_Modify.gameFunc.updateMainSceneBtn = function(){
|
||
if(Utl.getIsInfinite() == 1){
|
||
//set_self(233,18,684,0,0);
|
||
//set_self(233,19,381,0,0);
|
||
}else{
|
||
//set_self(233,18,906,0,0);
|
||
//set_self(233,19,509,0,0);
|
||
}
|
||
};
|
||
|
||
//创建房间时相关显示
|
||
Game_Modify.gameView = {};
|
||
//房卡房。真人竞技按钮位置
|
||
Game_Modify.gameView.btn_creatRoomType = function(isView){
|
||
if(isView){
|
||
//按钮位置
|
||
//set_self(1305,19,get_self(19,19) + (get_self(19,21)/2 - get_self(1305,21))/2 + 20,0,0);
|
||
//set_self(1307,19,get_self(19,19) + get_self(19,21)/2 + (get_self(19,21)/2 - get_self(1307,21))/2 - 20,0,0);
|
||
//set_self(1306,19,get_self(1305,19) + 14,0,0);
|
||
//set_self(1308,19,get_self(1307,19) + 14,0,0);
|
||
//set_self(1309,19,get_self(1307,19) - 19,0,0);
|
||
//房卡房
|
||
set_self(1305,18,get_self(19,18) + 19,0,0);
|
||
set_self(1305,19,get_self(19,19) + 87,0,0);
|
||
set_self(1306,19,get_self(1305,19) + 50,0,0);
|
||
set_self(1306,19,get_self(1305,19) + 34,0,0);
|
||
set_self(1306,41,0,0,0);
|
||
|
||
//set_self(1309,18,get_self(1307,18) - 19,0,0);
|
||
//set_self(1309,19,get_self(1307,19) - 19,0,0);
|
||
|
||
if(NN_config.creatRoomMode[0] == 1){
|
||
//真人竞技
|
||
set_self(1307,18,get_self(19,18) + 19,0,0);
|
||
set_self(1307,19,get_self(19,19) + 187,0,0);
|
||
set_self(1308,18,get_self(1307,18) + 50,0,0);
|
||
set_self(1308,19,get_self(1307,19) + 34,0,0);
|
||
set_self(1308,41,0,0,0);
|
||
//按钮帧数
|
||
if(NN_config.creatRoomMode[1] == 1){
|
||
set_self(1305,43,1,0,0);
|
||
set_self(1306,43,2,0,0);
|
||
set_self(1307,43,2,0,0);
|
||
set_self(1308,43,3,0,0);
|
||
}else if(NN_config.creatRoomMode[1] == 2){
|
||
set_self(1305,43,2,0,0);
|
||
set_self(1306,43,1,0,0);
|
||
set_self(1307,43,1,0,0);
|
||
set_self(1308,43,4,0,0);
|
||
}
|
||
//显示真人竞技
|
||
set_self(1307,37,1,0,0);
|
||
set_self(1308,37,1,0,0);
|
||
}else {
|
||
//房卡房
|
||
set_self(1305,43,1,0,0);
|
||
set_self(1306,43,2,0,0);
|
||
}
|
||
//显示
|
||
set_self(1305,37,1,0,0);
|
||
set_self(1306,37,1,0,0);
|
||
//set_self(1309,37,1,0,0);
|
||
}else{
|
||
set_self(1305,37,0,0,0);
|
||
set_self(1306,37,0,0,0);
|
||
set_self(1307,37,0,0,0);
|
||
set_self(1308,37,0,0,0);
|
||
set_self(1309,37,0,0,0);
|
||
}
|
||
};
|
||
|
||
Game_Modify.gameView.btn_forceBet = function(){
|
||
if(NN_config.forceBetType != 1){ //强制下注
|
||
if(NN_config.force_bet[0] == 1 && NN_config.force_bet[2] > 0){
|
||
//按钮显示
|
||
set_self(1269,43,1,0,0);
|
||
set_self(1296,1,537,0,0);
|
||
}else {//换灰度按钮
|
||
set_self(1269,43,2,0,0);
|
||
set_self(1296,1,536,0,0);
|
||
}
|
||
}else { //最低下注
|
||
set_self(1269,43,3,0,0);
|
||
set_self(1296,1,537,0,0);
|
||
}
|
||
|
||
if(NN_config.force_bet[2] >= 0){//分数显示
|
||
set_self(1296,7,NN_config.force_bet[2],0,0);
|
||
}else {
|
||
NN_config.force_bet[2] = 0;
|
||
set_self(1296,7,0,0,0);
|
||
}
|
||
if(NN_config.force_bet[2] >= 10){//分数显示位置
|
||
set_self(1296,18,get_self(1269,18) + 160,0,0);
|
||
}else {
|
||
set_self(1296,18,get_self(1269,18) + 170,0,0);
|
||
}
|
||
set_self(1296,20,String(NN_config.force_bet[2]).length * 25,0,0);
|
||
};
|
||
|
||
//强制下注选择界面
|
||
Game_Modify.gameView.forceBetSelect = function(isView){
|
||
if(isView){
|
||
for (var i=0; i<10; i++) {
|
||
if(i < NN_config.model_bet){
|
||
set_self(1273+i,41,1,0,0);
|
||
set_self(1273+i,43,1,0,0);
|
||
set_self(1283+i,1,555,0,0);
|
||
set_self(1273+i,35,255,0,0);
|
||
set_self(1283+i,35,255,0,0);
|
||
}else {
|
||
set_self(1273+i,41,0,0,0);
|
||
set_self(1273+i,43,2,0,0);
|
||
set_self(1283+i,1,583,0,0);
|
||
set_self(1273+i,35,122,0,0);
|
||
set_self(1283+i,35,122,0,0);
|
||
}
|
||
set_self(1283+i,7,i+1,0,0);
|
||
set_self(1283+i,41,0,0,0);
|
||
}
|
||
//设置界面
|
||
if(NN_config.betRange.length > 0){
|
||
var temp = NN_config.betRange.slice(0);
|
||
for (var i=0; i< NN_config.model_bet; i++) {
|
||
if(i+1 == temp[0]){
|
||
temp.shift();
|
||
}else {
|
||
//变帧灰图
|
||
set_self(1273+i,41,0,0,0);
|
||
set_self(1273+i,43,2,0,0);
|
||
set_self(1273+i,35,122,0,0);
|
||
set_self(1283+i,35,122,0,0);
|
||
//数字
|
||
set_self(1283+i,1,583,0,0);
|
||
set_self(1283+i,7,i+1,0,0);
|
||
}
|
||
}
|
||
if(NN_config.forceBetType == 1){ //最低下注
|
||
for (var i=0; i< NN_config.force_bet[2] - 1; i++) {
|
||
//变帧灰图
|
||
set_self(1273+i,43,2,0,0);
|
||
//数字
|
||
set_self(1283+i,1,583,0,0);
|
||
}
|
||
}
|
||
}
|
||
//设置下注分数显示
|
||
set_self(1294,7,NN_config.force_bet[2],0,0);
|
||
set_self(1294,20,String(NN_config.force_bet[2]).length * 30,0,0);
|
||
if(NN_config.forceBetType != 1){ //强制下注
|
||
set_self(1293,7,"强制下注分数:",0,0);
|
||
}else { //最低下注
|
||
set_self(1293,7,"最低下注分数:",0,0);
|
||
}
|
||
|
||
//显示界面
|
||
for(var i=1270;i<=1295;i++){
|
||
set_self(i,37,1,0,0);
|
||
}
|
||
set_self(1298,37,1,0,0);
|
||
set_self(1295,35,120,0,0);
|
||
}else {
|
||
//关闭弹窗
|
||
for(var i=1270;i<=1295;i++){
|
||
set_self(i,37,0,0,0);
|
||
}
|
||
set_self(1298,37,0,0,0);
|
||
}
|
||
};
|
||
|
||
//星星场选中时显示数量选择界面
|
||
Game_Modify.gameView.creatRoom_beanSelect = function(isView){
|
||
if(isView){
|
||
set_self(1265,7,NN_config.beanDes +"倍数:",0,0);
|
||
set_self(1258,7,"入场"+ NN_config.beanDes +"数限制:",0,0);
|
||
set_self(1299,7,"房间费("+ NN_config.beanDes +"):",0,0);
|
||
|
||
Game_Modify.CreateRoomData.Type_6[2] = 1;
|
||
Game_Modify.Type_6[2].max = NN_config.model_bean[2];
|
||
if(NN_config.bean_mult[0] < NN_config.bean_mult[1] || NN_config.bean_mult[0] > NN_config.bean_mult[2]){
|
||
NN_config.bean_mult[0] = NN_config.bean_mult[1];
|
||
}
|
||
//星星倍数最小值
|
||
set_self(1261,7,NN_config.bean_mult[1],0,0);
|
||
set_self(1261,18,197 - String(NN_config.bean_mult[1]).length * 30,0,0);
|
||
set_self(1261,20,String(NN_config.bean_mult[1]).length * 30,0,0);
|
||
//星星倍数最大值
|
||
set_self(1262,7,NN_config.bean_mult[2],0,0);
|
||
set_self(1262,20,String(NN_config.bean_mult[2]).length * 30,0,0);
|
||
//星星倍数当前值
|
||
set_self(1264,7,NN_config.bean_mult[0],0,0);
|
||
set_self(1264,20,String(NN_config.bean_mult[0]).length * 30,0,0);
|
||
if( NN_config.bean_mult[0] < NN_config.bean_mult[1] || NN_config.bean_mult[0] > NN_config.bean_mult[2]){
|
||
NN_config.bean_mult[0] = NN_config.bean_mult[1];
|
||
}
|
||
//按钮位置
|
||
set_self(1263,18,((NN_config.bean_mult[0] - NN_config.bean_mult[1]) / (NN_config.bean_mult[2] - NN_config.bean_mult[1])) * get_self(1252,20) + get_self(1252,18) - 35,0,0);
|
||
// 星星倍数相关位置调整
|
||
if((NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2) || (NN_config.teaCost != null && NN_config.teaCost[2] > 0)){
|
||
set_self(1260,19, get_self(1259,19) + 110,0,0);
|
||
} else {
|
||
set_self(1260,19, get_self(1259,19) + 180,0,0);
|
||
}
|
||
set_self(1265,19, get_self(1260,19) - 80,0,0);
|
||
set_self(1264,19, get_self(1260,19) - 80,0,0);
|
||
set_self(1261,19, get_self(1260,19) - 8,0,0);
|
||
set_self(1262,19, get_self(1260,19) - 8,0,0);
|
||
set_self(1263,19, get_self(1260,19) - 14,0,0);
|
||
|
||
var beanMin = NN_config.bean_mult[0] * NN_config.model_bean[2], beanMax = NN_config.bean_mult[0] * NN_config.model_bean[3];
|
||
//星星数最小值
|
||
set_self(1254,7,beanMin,0,0);
|
||
set_self(1254,18,197 - String(beanMin).length * 30,0,0);
|
||
set_self(1254,20,String(beanMin).length * 30,0,0);
|
||
//星星数最大值
|
||
set_self(1255,7,beanMax,0,0);
|
||
set_self(1255,20,String(beanMax).length * 30,0,0);
|
||
//星星数当前值
|
||
if(NN_config.model_bean[1] < beanMin || NN_config.model_bean[1] > beanMax){
|
||
NN_config.model_bean[1] = beanMin;
|
||
}
|
||
set_self(1256,7,NN_config.model_bean[1],0,0);
|
||
set_self(1256,20,String(NN_config.model_bean[1]).length * 30,0,0);
|
||
//按钮位置
|
||
set_self(1253,18,((NN_config.model_bean[1] - beanMin) / (beanMax - beanMin) ) * get_self(1252,20) + get_self(1252,18) - 35,0,0);
|
||
// 星星数相关位置调整
|
||
set_self(1252,19, get_self(1260,19) + 130,0,0);
|
||
set_self(1258,19, get_self(1252,19) - 75,0,0);
|
||
set_self(1256,19, get_self(1252,19) - 75,0,0);
|
||
set_self(1254,19, get_self(1252,19) - 8,0,0);
|
||
set_self(1255,19, get_self(1252,19) - 8,0,0);
|
||
set_self(1253,19, get_self(1252,19) - 14,0,0);
|
||
//显示星星数量选择界面
|
||
for(var i=1251;i<=1265;i++){
|
||
set_self(i,37,1,0,0);
|
||
}
|
||
|
||
//下方显示个数, 背景y轴位置
|
||
var viewCount = 0, bmp_y = get_self(1259, 19); //背景y轴位置;
|
||
//离场星星
|
||
//if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2){
|
||
//Game_Modify.gameView.creatRoom_leaveBean(1);
|
||
//viewCount ++;
|
||
//}
|
||
|
||
//服务费 [是否房主服务费(-1、0:无,1:可变动,2:固定服务费值), 服务费值, 服务费最大值模式(1:可变动,2:固定值),服务费最大值];
|
||
if(NN_config.teaCost != null && NN_config.teaCost[2] > 0){
|
||
//判断值服务费是否正确
|
||
//var _maxCost = Game_Modify.gameFunc.getMaxTeaCost();
|
||
//if(_maxCost != -1 && NN_config.teaCost[1] > _maxCost){ //判断是否超出
|
||
//NN_config.teaCost[1] = _maxCost;
|
||
//}
|
||
var range = null;
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 0);
|
||
}else {
|
||
range = Utl.getRebateRange(NN_config.bean_mult[0], 1);
|
||
}
|
||
if(range[0] > NN_config.teaCost[1]){ //判断是否超出
|
||
NN_config.teaCost[1] = range[0];
|
||
}else if(NN_config.teaCost[1] > range[1]){
|
||
NN_config.teaCost[1] = range[1];
|
||
}
|
||
|
||
if(NN_config.teaCost[1] >= 0){
|
||
set_self(1303,7, NN_config.teaCost[1],0,0);
|
||
}else {
|
||
NN_config.teaCost[1] = 0;
|
||
set_self(1303,7, NN_config.teaCost[1],0,0);
|
||
}
|
||
set_self(1303,20, String(get_self(1303,7)).length * 26,0,0);
|
||
|
||
//数字背景框位置调整
|
||
if(String(get_self(1303,7)).length > 6){
|
||
set_self(1302,20,170 + (String(get_self(1303,7)).length - 6) * 26 ,0,0);
|
||
} else {
|
||
set_self(1302,20,170,0,0);
|
||
}
|
||
if(NN_config.teaCost[2] == 1){ //数字背景框
|
||
set_self(1302,37,1,0,0);
|
||
//if(NN_config.teaCost[6] >= 0){
|
||
set_self(1304,7,"("+ range[0] + " ~ " + range[1] +")",0,0);
|
||
set_self(1304,18,get_self(1302,18) + get_self(1302,20) + 15,0,0);
|
||
set_self(1304,37,1,0,0);
|
||
//}
|
||
}
|
||
//Y轴位置设置
|
||
set_self(1300,19,get_self(1252,19) + 80 + 70 * viewCount,0,0);
|
||
set_self(1301,19,get_self(1300,19) - 16,0,0);
|
||
set_self(1299,19,get_self(1300,19) + 6,0,0);
|
||
set_self(1302,19,get_self(1300,19) + 3,0,0);
|
||
set_self(1303,19,get_self(1300,19) + 8,0,0);
|
||
set_self(1304,19,get_self(1300,19) + 6,0,0);
|
||
//显示
|
||
set_self(1299,37,1,0,0);
|
||
//set_self(1300,37,1,0,0);
|
||
//set_self(1301,37,1,0,0);
|
||
set_self(1303,37,1,0,0);
|
||
set_self(1303,41,0,0,0);
|
||
viewCount ++;
|
||
}
|
||
|
||
//设置创建房间星星场显示
|
||
set_self(1221,7,Game_Modify.Type_6[1].des + "(" + NN_config.bean_mult[0] + "倍)",0,0);
|
||
set_self(1223,7,Game_Modify.Type_6[2].des + ":" + NN_config.model_bean[1],0,0);
|
||
|
||
if(Game_Modify.CreateRoomData.Type_6[1] == 1){
|
||
//显示抢庄、下注星星数限
|
||
if(NN_config.cfg_bean[0]){
|
||
set_self(1266,7,"抢庄所需"+ NN_config.beanDes +"数:" + NN_config.cfg_bean[0] * NN_config.bean_mult[0],0,0);
|
||
set_self(1266,37,1,0,0);
|
||
}else {
|
||
set_self(1266,37,0,0,0);
|
||
}
|
||
if(NN_config.cfg_bean[1]){
|
||
set_self(1267,7,"下注所需"+ NN_config.beanDes +"数:" + NN_config.cfg_bean[1] * NN_config.bean_mult[0],0,0);
|
||
set_self(1267,37,1,0,0);
|
||
}else {
|
||
set_self(1267,37,0,0,0);
|
||
}
|
||
set_self(1266,19,get_self(1252,19) + 80 + 70 * viewCount,0,0);
|
||
set_self(1267,19,get_self(1266,19),0,0);
|
||
if(get_self(1266,37) == 1 || get_self(1267,37) == 1){
|
||
viewCount ++;
|
||
}
|
||
}
|
||
//确定按钮位置
|
||
if(viewCount == 0){
|
||
set_self(1257,19,get_self(1252,19) + 150,0,0);
|
||
}else if(viewCount == 1){
|
||
set_self(1257,19,get_self(1252,19) + 180,0,0);
|
||
}else if(viewCount == 2){
|
||
set_self(1257,19,get_self(1252,19) + 240,0,0);
|
||
}else if(viewCount == 3){
|
||
set_self(1257,19,get_self(1252,19) + 270,0,0);
|
||
//set_self(1257,19,get_self(1252,19) + 80 + (80 - (viewCount-1) * 6) * viewCount,0,0);
|
||
}
|
||
}else {
|
||
//关闭星星数量选择界面
|
||
for(var i=1251;i<=1267;i++){
|
||
set_self(i,37,0,0,0);
|
||
}
|
||
for(var i=1314;i<=1317;i++){
|
||
set_self(i,37,0,0,0);
|
||
}
|
||
set_self(1299,37,0,0,0);
|
||
set_self(1300,37,0,0,0);
|
||
set_self(1301,37,0,0,0);
|
||
set_self(1302,37,0,0,0);
|
||
set_self(1303,37,0,0,0);
|
||
set_self(1304,37,0,0,0);
|
||
}
|
||
};
|
||
|
||
//创建房间界面显示离场星星
|
||
Game_Modify.gameView.creatRoom_leaveBean = function(isView, isDefaultMin){
|
||
if(isView){
|
||
return ;
|
||
//离场星星
|
||
if(NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2){
|
||
//var bmp_y = get_self(1259, 19); //背景y轴位置
|
||
//var bmp_y = get_self(1252, 19); //背景y轴位置
|
||
//判断值离场星星是否正确
|
||
if(NN_config.bean_leaveMin[0] <= 0){
|
||
NN_config.bean_leaveMin[0] = 0.5;
|
||
}
|
||
//判断值是否正确
|
||
if(NN_config.bean_leaveMin[1] == 1){ //范围取值
|
||
if(NN_config.bean_leaveMin[0] < NN_config.bean_leaveMin[2][0]){
|
||
NN_config.bean_leaveMin[0] = NN_config.bean_leaveMin[2][0];
|
||
} else if(NN_config.bean_leaveMin[0] > NN_config.bean_leaveMin[2][1]){
|
||
if(isDefaultMin){
|
||
NN_config.bean_leaveMin[0] = NN_config.bean_leaveMin[2][0];
|
||
}else{
|
||
NN_config.bean_leaveMin[0] = NN_config.bean_leaveMin[2][1];
|
||
}
|
||
}
|
||
} else { //固定值
|
||
NN_config.bean_leaveMin[0] = NN_config.bean_leaveMin[2][0];
|
||
}
|
||
//设置星星数值
|
||
set_self(1316,7, Math.round(NN_config.bean_leaveMin[0] * NN_config.model_bean[1]),0,0);
|
||
set_self(1316,20, String(get_self(1316,7)).length * 26,0,0);
|
||
set_self(1311,7,"离场星星:" + Math.round(NN_config.bean_leaveMin[0] * NN_config.model_bean[1]),0,0);
|
||
set_self(1313,20,getStrLength(get_self(1311,7)) * 15,0,0);
|
||
//数字背景框位置调整
|
||
if(String(get_self(1316,7)).length > 6){
|
||
set_self(1315,20,170 + (String(get_self(1316,7)).length - 6) * 26 ,0,0);
|
||
} else {
|
||
set_self(1315,20,170,0,0);
|
||
}
|
||
if(NN_config.bean_leaveMin[1] == 1){ //括号内容
|
||
set_self(1315,37,1,0,0);
|
||
set_self(1317,7,"(最小值:" + Math.round(NN_config.bean_leaveMin[2][0] * NN_config.model_bean[1]) + " 最大值:"+ Math.round(NN_config.bean_leaveMin[2][1] * NN_config.model_bean[1]) +")",0,0);
|
||
set_self(1317,18,get_self(1315,18) + get_self(1315,20) + 15,0,0);
|
||
set_self(1317,37,1,0,0);
|
||
}
|
||
//Y轴位置设置
|
||
set_self(1314,19,get_self(1252, 19) + 80,0,0);
|
||
set_self(1315,19,get_self(1314,19) - 3,0,0);
|
||
set_self(1316,19,get_self(1314,19) + 2,0,0);
|
||
set_self(1317,19,get_self(1314,19),0,0);
|
||
//显示
|
||
set_self(1314,37,1,0,0);
|
||
//set_self(1315,37,1,0,0);
|
||
set_self(1316,41,0,0,0);
|
||
set_self(1316,37,1,0,0);
|
||
//set_self(1317,37,1,0,0);
|
||
}
|
||
}else {
|
||
set_self(1314,37,0,0,0);
|
||
set_self(1315,37,0,0,0);
|
||
set_self(1316,41,0,0,0);
|
||
set_self(1316,37,0,0,0);
|
||
set_self(1317,37,0,0,0);
|
||
}
|
||
};
|
||
|
||
//创建房间界面显示离场星星
|
||
Game_Modify.gameView.createRoom_beanUpdata = function(){
|
||
//星星场数
|
||
set_self(1223,7,Game_Modify.Type_6[2].des + ":" + NN_config.model_bean[1],0,0);
|
||
set_self(1224,18,get_self(1223,18) - 6,0,0);
|
||
set_self(1224,19,get_self(1223,19) - 8,0,0);
|
||
set_self(1224,20,getStrLength(get_self(1223,7)) * 15 + 4,0,0);
|
||
//星星场
|
||
set_self(1221,7,Game_Modify.Type_6[1].des + "(" + NN_config.bean_mult[0] + "倍)",0,0);
|
||
set_self(1312,18,get_self(1221,18) - 6,0,0);
|
||
set_self(1312,19,get_self(1221,19) - 8,0,0);
|
||
set_self(1312,20,getStrLength(get_self(1221,7)) * 15 + 4,0,0);
|
||
//离场星星
|
||
set_self(1311,7,Game_Modify.Type_6[3].des + ":" + Math.round(NN_config.bean_leaveMin[0] * NN_config.model_bean[1]),0,0);
|
||
set_self(1313,18,get_self(1311,18) - 6,0,0);
|
||
set_self(1313,19,get_self(1311,19) - 8,0,0);
|
||
set_self(1313,20,getStrLength(get_self(1311,7)) * 15 +4,0,0);
|
||
};
|
||
|
||
//更新局数及扣卡显示
|
||
Game_Modify.gameView.roomCardUpdate = function(){
|
||
//不同局数消耗房卡数不同
|
||
if(Utl.getVersionState() == 1 || Game_Modify.Type_2[0].roomcard[Game_Modify.CreateRoomData.Type_1] <= 0 || (NN_config.creatRoomMode[0] == 1 && NN_config.creatRoomMode[1] == 2)){
|
||
set_self(674,7,Game_Modify.Type_2[0].roomcount[Game_Modify.CreateRoomData.Type_1] + "局",0,0);
|
||
set_self(675,7,Game_Modify.Type_2[1].roomcount[Game_Modify.CreateRoomData.Type_1] + "局",0,0);
|
||
} else{
|
||
set_self(674,7,Game_Modify.Type_2[0].roomcount[Game_Modify.CreateRoomData.Type_1] + "局("+ NN_config.roomCardDes +"x" + Game_Modify.Type_2[0].roomcard[Game_Modify.CreateRoomData.Type_1] + ")",0,0);
|
||
set_self(675,7,Game_Modify.Type_2[1].roomcount[Game_Modify.CreateRoomData.Type_1] + "局("+ NN_config.roomCardDes +"x" + Game_Modify.Type_2[1].roomcard[Game_Modify.CreateRoomData.Type_1] + ")",0,0);
|
||
}
|
||
};
|
||
|
||
//创建房间时相关显示
|
||
Game_Modify.gameView._pageOpt = -1;
|
||
Game_Modify.gameView._nowRecordType = -1;
|
||
Game_Modify.gameView._gradeIdx = [];
|
||
//本地战绩点击触发次数
|
||
Game_Modify.gameView.locRecordsClick = [-1, 0, 5];
|
||
|
||
|
||
//战绩页三显示
|
||
Game_Modify.gameView.combat = {
|
||
//本地战绩按钮精灵
|
||
_locRecordsSpid: 1166,
|
||
//动态创建精灵列表(10人局)
|
||
_fspid: 48,
|
||
//5人局战绩
|
||
_addSpids_5: {
|
||
frame: [1151, 37, 149, [226, 395], 232],//头像框5
|
||
head: [1152, 63, 42, [100, 100]], //头像
|
||
payCode:[1164, 68, 84, [90, 60]], //吱口令
|
||
name: [1153, 113, 155], //昵称
|
||
id: [1154, 113, 194], //玩家id
|
||
score: [1155, 113, 337], //赢分
|
||
card: [1156, 26, 233, [59, 84], 29], //牌
|
||
|
||
frameList: [],
|
||
tagCount: 0
|
||
},
|
||
//10人局战绩
|
||
_addSpids_10: {
|
||
frame: [1158, 38, 96, [572, 103], 584, 105],//头像框5
|
||
head: [1152, 8, 6, [90, 90]], //头像
|
||
payCode:[1164, 8, 36, [90, 60]], //吱口令
|
||
name: [1153, 107, 18], //昵称
|
||
id: [1154, 107, 60], //玩家id
|
||
score: [1155, 483, 34], //赢分
|
||
card: [1156, 254, 9, [59, 84], 27], //牌
|
||
|
||
frameList: [],
|
||
tagCount: 0
|
||
},
|
||
//吱口令标记值
|
||
_payCodeTags: [],
|
||
|
||
//创建标记列表
|
||
_tagList: [],
|
||
//最大玩家人数
|
||
_personMax: 10,
|
||
//其他精灵
|
||
_spid: {
|
||
zhuang: 1157,
|
||
zhuangIcon: 1159,
|
||
zhuangName: 1160,
|
||
zhuangId: 1161,
|
||
roomtype: 1163,
|
||
surplusCard:1162,
|
||
numGames: 1165
|
||
},
|
||
|
||
//添加背景框
|
||
addPlayerFrame:function(o_addSpid){
|
||
var spid;
|
||
for(var i = 0; i < this._personMax; i ++){
|
||
//创建框
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.frame[0], o_addSpid.frame[1], o_addSpid.frame[2], o_addSpid.tagCount);
|
||
o_addSpid.frameList[i] = spid;
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
if(this._personMax == 10){
|
||
set_self(spid, 18, o_addSpid.frame[1] + i % 2 * o_addSpid.frame[4],0,0);
|
||
set_self(spid, 19, o_addSpid.frame[2] + Math.floor(i / 2) * o_addSpid.frame[5],0,0);
|
||
} else {
|
||
set_self(spid, 18, o_addSpid.frame[1] + o_addSpid.frame[4] * i,0,0);
|
||
}
|
||
set_self(spid, 43, 1,0,0);
|
||
}
|
||
},
|
||
//添加玩家信息显示
|
||
addPlayerFrameInfo: function(seat, o_addSpid, name, id, score, cards, payCode){
|
||
var spid, fPos;
|
||
//o_addSpid = this._addSpids_5;
|
||
/*
|
||
//创建框
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.frame[0], o_addSpid.frame[1], o_addSpid.frame[2], o_addSpid.tagCount);
|
||
o_addSpid.frameList[seat] = spid;
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
if(this._personMax == 10){
|
||
set_self(spid, 18, o_addSpid.frame[1] + seat % 2 * o_addSpid.frame[4],0,0);
|
||
set_self(spid, 19, o_addSpid.frame[2] + Math.floor(seat / 2) * o_addSpid.frame[5],0,0);
|
||
} else {
|
||
set_self(spid, 18, o_addSpid.frame[1] + o_addSpid.frame[4] * seat,0,0);
|
||
}
|
||
*/
|
||
set_self(o_addSpid.frameList[seat], 43, 2,0,0);
|
||
fPos = [get_self(o_addSpid.frameList[seat], 18), get_self(o_addSpid.frameList[seat], 19)];
|
||
//判断座位是否为空
|
||
if(o_addSpid == null){
|
||
return ;
|
||
}
|
||
//创建精灵-头像
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.head[0], o_addSpid.head[1], o_addSpid.head[2], o_addSpid.tagCount);
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
//图片替换
|
||
set_self(spid, 1, 116 + seat,0,0);
|
||
set_self(spid, 18, fPos[0] + o_addSpid.head[1],0,0);
|
||
set_self(spid, 19, fPos[1] + o_addSpid.head[2],0,0);
|
||
set_self(spid, 20, o_addSpid.head[3][0],0,0);
|
||
set_self(spid, 21, o_addSpid.head[3][1],0,0);
|
||
|
||
//创建牌
|
||
for(var i = 0; i < 5; i ++){
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.card[0], o_addSpid.card[1], o_addSpid.card[2], o_addSpid.tagCount);
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
set_self(spid, 43, cards[i] + 1, 0,0);
|
||
set_self(spid, 18, fPos[0] + o_addSpid.card[1] + o_addSpid.card[4] * i,0,0);
|
||
set_self(spid, 19, fPos[1] + o_addSpid.card[2],0,0);
|
||
set_self(spid, 20, o_addSpid.card[3][0],0,0);
|
||
set_self(spid, 21, o_addSpid.card[3][1],0,0);
|
||
}
|
||
|
||
//创建精灵-昵称
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.name[0], o_addSpid.name[1], o_addSpid.name[2], o_addSpid.tagCount);
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
if(this._personMax == 5){
|
||
set_self(spid, 7, name,0,0);
|
||
set_self(spid, 18, fPos[0] + o_addSpid.name[1] - 6 * getStrLength(name),0,0);
|
||
}else {
|
||
set_self(spid, 7, Func.subString(name, 10, true),0,0);
|
||
set_self(spid, 18, fPos[0] + o_addSpid.name[1],0,0);
|
||
}
|
||
set_self(spid, 19, fPos[1] + o_addSpid.name[2],0,0);
|
||
|
||
//创建精灵-id
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.id[0], o_addSpid.id[1], o_addSpid.id[2], o_addSpid.tagCount);
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
set_self(spid, 7,"ID:" + id ,0,0);
|
||
if(this._personMax == 5){
|
||
set_self(spid, 18, fPos[0] + o_addSpid.id[1] - 6 * getStrLength(get_self(spid, 7)),0,0);
|
||
}else {
|
||
set_self(spid, 18, fPos[0] + o_addSpid.id[1],0,0);
|
||
}
|
||
set_self(spid, 19, fPos[1] + o_addSpid.id[2],0,0);
|
||
|
||
//创建精灵-得分
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.score[0], o_addSpid.score[1], o_addSpid.score[2], o_addSpid.tagCount);
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
set_self(spid, 7, score, 0,0);
|
||
set_self(spid, 18, fPos[0] + o_addSpid.score[1] - 7.5 * String(score).length,0,0);
|
||
set_self(spid, 19, fPos[1] + o_addSpid.score[2],0,0);
|
||
|
||
if(payCode != null){
|
||
//吱口令
|
||
o_addSpid.tagCount ++;
|
||
spid = ifast_addtospritefromspritecopy(this._fspid, o_addSpid.payCode[0], o_addSpid.payCode[1], o_addSpid.payCode[2], o_addSpid.tagCount);
|
||
this._tagList.push([this._fspid, o_addSpid.tagCount]);
|
||
this._payCodeTags.push([o_addSpid.tagCount, seat]);
|
||
set_self(spid, 18, fPos[0] + o_addSpid.payCode[1],0,0);
|
||
set_self(spid, 19, fPos[1] + o_addSpid.payCode[2],0,0);
|
||
set_self(spid, 20, o_addSpid.payCode[3][0],0,0);
|
||
set_self(spid, 21, o_addSpid.payCode[3][1],0,0);
|
||
}
|
||
},
|
||
|
||
//显示战绩 gameInfo游戏战绩, rounds回合数据, roomtype:房间类型, surplusCard:余卡, 局数-1
|
||
view: function(isView, gameInfo, rounds, roomtype, surplusCard, point){
|
||
if(isView){
|
||
var pList = gameInfo.playerlist, //玩家信息
|
||
o_addSpid;
|
||
if(typeof roomtype == "string"){
|
||
roomtype = JSON.parse(roomtype);
|
||
}
|
||
//清除创建的精灵
|
||
this.clearAddSprite();
|
||
//判断最大玩家人数
|
||
if(roomtype[5] && roomtype[5][5] == 1){
|
||
this._personMax = 10;
|
||
o_addSpid = this._addSpids_10;
|
||
} else {
|
||
this._personMax = 5;
|
||
o_addSpid = this._addSpids_5;
|
||
}
|
||
o_addSpid.tagCount = 0;
|
||
o_addSpid.frameList = [];
|
||
//创建玩家信息栏
|
||
set_group(216,37,1,0,0); //显示
|
||
//添加背景框
|
||
this.addPlayerFrame(o_addSpid);
|
||
//背景框上添加玩家信息
|
||
var pRound;
|
||
for(var i = 0; i < pList.length; i++){
|
||
if(pList[i]){
|
||
//找到对应玩家的战绩
|
||
pRound = null;
|
||
for(var j=0;j<rounds.length;j++){
|
||
if(rounds[j] && rounds[j][0] == i){
|
||
pRound = rounds[j];
|
||
break;
|
||
}
|
||
}
|
||
if(pRound){
|
||
//先加载头像
|
||
up_imgurl(116 + i, pList[i][2], 1);
|
||
//创建该玩家相关精灵
|
||
this.addPlayerFrameInfo(i, o_addSpid, pList[i][0], pList[i][3], pRound[1], [pRound[2], pRound[3],pRound[4],pRound[5],pRound[6]], pList[i][4]);
|
||
}
|
||
//
|
||
}else {
|
||
//创建该玩家
|
||
//this.addPlayerFrame(i);
|
||
}
|
||
}
|
||
|
||
//房主
|
||
set_self(this._spid.zhuangName, 7, Func.subString(gameInfo.desk[0][1], 10, true), 0, 0);
|
||
set_self(this._spid.zhuangId, 7, "ID:" + gameInfo.desk[0][2], 0, 0);
|
||
|
||
//余卡
|
||
if(Utl.getVersionState() != 1 && surplusCard != null){//审核
|
||
set_self(this._spid.surplusCard, 7, "剩卡:" + surplusCard, 0, 0);
|
||
}
|
||
|
||
//庄
|
||
if(rounds[0] && rounds[0][8] != null){
|
||
if(this._personMax == 10){
|
||
set_self(this._spid.zhuang, 18, get_self(o_addSpid.frameList[rounds[0][8]],18) + 8, 0, 0);
|
||
set_self(this._spid.zhuang, 19, get_self(o_addSpid.frameList[rounds[0][8]],19) - 2, 0, 0);
|
||
}else {
|
||
set_self(this._spid.zhuang, 18, get_self(o_addSpid.frameList[rounds[0][8]],18) + 60, 0, 0);
|
||
set_self(this._spid.zhuang, 19, get_self(o_addSpid.frameList[rounds[0][8]],19) + 30, 0, 0);
|
||
}
|
||
}
|
||
//房间类型
|
||
set_self(this._spid.roomtype, 7, Game_Modify.setRoomDes(null, null, roomtype, true), 0, 0);
|
||
|
||
//隐藏其他显示
|
||
set_self(82, 37, 0, 0, 0);
|
||
set_self(683, 37, 0, 0, 0);
|
||
set_self(684, 37, 0, 0, 0);
|
||
//第几局
|
||
set_self(this._spid.numGames, 7, "第 " + (point + 1) + " 局", 0, 0);
|
||
}else {
|
||
//清除创建的精灵
|
||
this.clearAddSprite();
|
||
//隐藏父精灵
|
||
set_group(216,37,0,0,0);
|
||
}
|
||
},
|
||
//清除创建的精灵
|
||
clearAddSprite: function(){
|
||
for(var i=0; i < this._tagList.length; i++){
|
||
ifast_dllpritefromspritecopy(this._tagList[i][0], this._tagList[i][1]);
|
||
}
|
||
this._tagList = [];
|
||
this._payCodeTags = [];
|
||
}
|
||
};
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|