var gameabc_face = gameabc_face || {}; { gameabc_face.tag = 12; //定义你的游戏全局内存 gameabc_face.tag1 = 123;//定义你的游戏全局内存 gameabc_face.tag2 = 123;//定义你的游戏全局内存 gameabc_face.tag3 = 123;//定义你的游戏全局内存 gameabc_face.dfwgao = 1; } gameabc_face.gamestart = function (gameid) { jQuery.getScript("http://pv.sohu.com/cityjson?ie=utf-8", function () { var data = returnCitySN; gameabc_face.ip = data.cip; C_Player.ip = gameabc_face.ip; }); //游戏初始化代码 // var arr0=[1,2,3,11,11,11,12,12,16,16,16,23,33]; // var arrs=[[1,2,3,11,11,11,12,12,16,16,16,23,33]]; // alert(JING_zhen_hu(arr0,23,arrs)); Logic.AppStart(); set_self(800, 57, 1000, 0, 0); set_self(801, 57, 100, 0, 0); set_self(802, 57, 150, 0, 0); set_self(803, 57, 300, 0, 0); set_self(804, 57, 35, 0, 0); set_self(805, 57, 600, 0, 0); set_self(3124, 41, 0, 0, 0); set_self(694,19,216,0,0); set_self(43,19,220,0,0); set_self(695,19,326,0,0); set_self(44,19,331,0,0); set_self(356,18,-300,0,0); set_self(357,18,-300,0,0); set_self(387,19,435,0,0); set_self(388,19,437,0,0); set_self(515,19,346,0,0); set_self(183,19,440,0,0); set_self(569,19,510,0,0); //设置声音,语音等位置 logmessage("麻将", 2); if(get_self(184, 37)){ set_self(184, 18, -500); set_self(184, 19, -500); } app.runmouse("gamestart", gameid); Game_Modify.sb_Init(); }; gameabc_face.ani_doend = function (id, sx, count, allend) { //logmessage(id+"/"+sx+"/"+count+"/"+allend); //play_ani(0,2,18,50,200,0,1000,0,0,0,0,6000,1);//主动关闭 GameUI.utlani_doend(id, sx, count, allend); gameCombat.utlani_doend(id, sx, count, allend); d.put_card_doend(id, sx, allend); d.act_pai_doend(id, sx, allend); d.show_light_horse_doend(id, sx, allend); app.runmouse("ani_doend", id, sx, count, allend); }; gameabc_face.box_doend = function (id, sx, timelen) { //play_box 结束事件 //showmessage("box_doend:"+id+"/"+sx+"/"+timelen); //logmessage("box_doend:"+id+"/"+sx+"/"+timelen); app.runmouse("box_doend", id, sx, timelen); }; gameabc_face.onloadurl = function (recid, rectype, url, error, count, len) { //修改为gameabc_face.onloadurl 则自己处理图片加载进度 //资源加载完成函数 //recid:资源id //rectype:1 图片 2声音 //url :网络地址 //error:是否加载错误 //len:资源大小 //count:加载的个数百分比 //logmessage("onload:"+recid+"/"+rectype+"/"+count+"/"+error); GameUI.onloadurl(recid, rectype, url, error, count, len); app.runmouse("onloadurl1", recid, rectype, url, error, count, len); /* if (rectype==0) { open_load("","1.mp3",""); gameabc_face.randombase=0;//使用系统浏览器缓存 } if (count==100) { game_close_zsmsg(""); } else { game_open_zsmsg(count+"%"+" 加载中..."); }; */ }; gameabc_face.chongzhi = function (userid, zt, data) { //游戏接口代码 app.runmouse("chongzhi", userid, zt, data); }; gameabc_face.onresize = function (pmw/*屏幕宽*/, pmh/*屏幕宽*/, sjweww/*设计宽*/, sjnewh/*设计宽*/, nweww/*显示宽*/, newh/*显示高*/) { //屏幕变化 // 在此调整 列表控件的宽高和区域 不是整体缩放 //logmessage("onresize:"+pmw+"/"+pmh+"/"+sjweww+"/"+sjnewh+"/"+nweww+"/"+newh); app.runmouse("onresize", pmw/*屏幕宽*/, pmh/*屏幕宽*/, sjweww/*设计宽*/, sjnewh/*设计宽*/, nweww/*显示宽*/, newh/*显示高*/); }; gameabc_face.gamebegindraw = function (gameid, spid, times, timelong) { //更新开始代码 GameUI.utlgamebegindraw(gameid, spid, times, timelong); app.runmouse("gamebegindraw", gameid, spid, times, timelong); }; gameabc_face.gameenddraw = function (gameid, spid, times, timelong) { //更新完成代码 GameUI.gameenddraw(gameid, spid, times, timelong); app.runmouse("gameenddraw", gameid, spid, times, timelong); }; gameabc_face.mousedown = function (gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6) { //点击代码 GameUI.utlmousedown(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6); Game_Modify.utlmousedown(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6); gameCombat.utlmousedown(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6); app.runmouse("mousedown", gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6); console.log("mousedown="+d.last_id+","+spid); if(spid < 936 || spid > 954 || spid >= 936 && spid <= 954 && get_self(spid, 21, 0, 0, 0) < 120) {d.last_id=0;} if(RoomFunc.Overtime_chupai()&&d.last_id==0 && d.replay==0 && Desk.stage>0 && d.final_hu[0]==-1&&d.gang_option==0) { if (d.status == 2 && d.click_ban == 1 && spid >= 936 && spid <= 954 && get_self(spid, 21, 0, 0, 0) > 120 && d.gang_option == 0 && d.get_hua() == 0&&d.gang_option==0) {// d.user_ctrl[2] == C_Player.seat && d.click_chu(spid); } } if(get_self(2233,43) == 1) { if(spid < 936 || spid > 954 || spid >= 936 && spid <= 954 && get_self(spid, 21, 0, 0, 0) < 120) {d.last_id=0;} if(RoomFunc.Overtime_chupai()&&d.last_id==0 && d.replay==0 && Desk.stage>0 && d.final_hu[0]==-1&&d.gang_option==0) { if (d.status == 2 && d.click_ban == 1 && spid >= 936 && spid <= 954 && get_self(spid, 21, 0, 0, 0) > 120 && d.gang_option == 0 && d.get_hua() == 0&&d.gang_option==0) {// d.user_ctrl[2] == C_Player.seat && d.click_chu(spid); } } } if (spid == 149 && d.replay != 1) { for (var i = 0; i < 19; i++) { if (get_self(936 + i, 21, 0, 0, 0) > 120) { set_self(936 + i, 19, 585, 0, 0); } }d.click_id=0;d.zhenshu=0; } app.runmouse("mousedown", gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6); }; gameabc_face.mousedown_nomove = function (gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5) { //点击代没移动代码 GameUI.utlmousedown_nomove(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5); Game_Modify.utlmousedown_nomove(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5); app.runmouse("mousedown_nomove", gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5); }; gameabc_face.mouseup = function (gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2) { //点击弹起代码 //可以通过spid_down和spid_up 的比较 来判断是 点击还是 移动 if (spid_down==spid_up&&spid_up==245){ if (get_self(361,37)==1&&get_self(361,7)=="解散房间不扣房卡,是否解散?") { d.free_room(); } } if(spid_down == 25 && get_self(2061,43) == 1 && Utl.getIsInfinite() == 0 && (!C_Player.addr || C_Player.addr && !C_Player.addr.address)) { if(Utl.getH5Version()) { Utl.openTips("网页版暂不支持创建定位房", 3500); }else{ Func.startlocation(2); GameUI.OpenTips("请开启定位后重新创建此房间", 0); } return; } if (RoomFunc.Overtime_chupai()&&spid_down==spid_up&& spid_down >= 936 && spid_down <= 954 && get_self(spid_down, 21, 0, 0, 0) > 120&&d.gang_option==0) { d.click_chu(spid_down); } if((RoomFunc.Overtime_chupai() || get_self(spid_down, 19, 0, 0, 0)<565) && (spid_down!=spid_up || d.last_id>0)&&!get_self(1143,37)&&d.gang_option==0) {d.click_chu_down(spid_down,spid_up);console.log("gameabc_face.mouseup="+d.last_id+","+spid_down+","+spid_up); return; } if (d.replay == 1) { if (spid_down >= 256 && spid_down <= 259) { return; } if (spid_down >= 376 && spid_down <= 379) { return; } } if (spid_up == 183) { if(d.a.share) {d.a.share();} } if (spid_up == 181 && Utl.getIsInfinite() == 1) { spid_down = 233; spid_up = 233; } // if(spid_up==80 || GameData.hallConfig.worldRoomList) // {GameData.hallConfig.worldRoomList=false;} GameUI.utlmouseup(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2); Game_Modify.mouseup(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2); gameCombat.utlmouseup(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2); d.a.move_up(spid_down); if(spid_up!=spid_down){return;} d.click(spid_up, upx, upy, downx, downy, spid_down); app.runmouse("mouseup", gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2); }; gameabc_face.mousemove = function (gameid, spid, downx, downy, movex, movey, timelong, offmovex, offmovey, no1) { //点击后移动代码 //set_self(spid,18,offmovex,1,0); //set_self(spid,19,offmovey,1,0); GameUI.utlmousemove(gameid, spid, downx, downy, movex, movey, timelong, offmovex, offmovey, no1); Game_Modify.utlmousemove(gameid, spid, downx, downy, movex, movey, timelong, offmovex, offmovey, no1); gameCombat.utlmousemove(gameid, spid, downx, downy, movex, movey, timelong, offmovex, offmovey, no1); d.set_click_chu(spid,movex,movey); d.a.move(spid, offmovey); d.move_hu(spid, offmovex, offmovey); d.move_chu(spid, offmovey, offmovex); app.runmouse("mousemove", gameid, spid, downx, downy, movex, movey, timelong, offmovex, offmovey, no1); }; gameabc_face.gamemydraw = function (gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7) { //每个精灵更新绘画代码 GameUI.utlgamemydraw(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); Game_Modify.gamemydraw(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); gameCombat.utlgamemydraw(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); d.gamemydraw(spid); app.runmouse("gamemydraw", gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); }; gameabc_face.gamemydrawbegin = function (gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7) { //每个精灵更新前绘画代码 GameUI.utlgamemydrawbegin(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); Game_Modify.utlgamemydrawbegin(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); gameCombat.utlgamemydrawbegin(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); for (var i = 0; i < 4; i++) { if (get_self(spid, 44, 0, 0, 0) == 233 + i) { set_clip(0, 0, 180, get_self(1706 + 5 * i, 19, 0, 0, 0), 1062, 36); } } if (get_self(spid, 44, 0, 0, 0) == 223) { set_clip(0, 0, 0, get_self(1453, 19, 0, 0, 0), 1280, get_self(1453, 21, 0, 0, 0)); } if (get_self(spid, 44, 0, 0, 0) == 215) { set_clip(0, 0, 0, get_self(1570, 19, 0, 0, 0) + 36, 1280, 520); } if (get_self(spid, 44, 0, 0, 0) == 217) { set_clip(0, 0, 0, get_self(1665, 19, 0, 0, 0) + 36, 1280, get_self(1341, 19) - get_self(1665, 19) - get_self(1665, 21)); } app.runmouse("gamemydrawbegin", gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7); }; gameabc_face.ontimer = function (gameid, spid, /* 本次间隔多少次了 */ times, /* 本次间隔多久 */ timelong, /* 开启后运行多少次了 */ alltimes) { /*请在下面输入您的代码 */ //set_self(1,18,5,1,0); GameUI.utlontimer(gameid, spid, /* 本次间隔多少次了 */ times, /* 本次间隔多久 */ timelong, /* 开启后运行多少次了 */ alltimes); d.sieve_flash(spid); d.show_13card_flash(spid); d.show_chi_peng_act(spid); d.show_horse_flash(spid); d.show_time_flash(spid); if (spid == 291 && get_self(149, 37) && Game_Modify.roomDes && Game_Modify.roomDes.length > 0 && !get_self(1157,37) ) { GameUI.openRoomInfo(); set_self(291, 57, 0, 0, 0); if (Utl.getIsInfinite() == 1) { GameUI.openRoomInfo(); set_self(110, 7, "系统房"); set_self(512, 37, 0, 0, 0); var h = get_self(109, 21); set_self(109, 21, h); } } app.runmouse("ontimer", gameid, spid, /* 本次间隔多少次了 */ times, /* 本次间隔多久 */ timelong, /* 开启后运行多少次了 */ alltimes); }; gameabc_face.tcpconnected = function (tcpid) { /* ifast_tcp_open(1,"127.0.0.1:5414");//连接ws tcp */ //logmessage("tcpopen:"+tcpid); //Logic.tcpconnected(tcpid); app.runmouse("tcpconnected", tcpid); }; gameabc_face.tcpmessage = function (tcpid, data) { //logmessage("tcpread:"+data); //Net._ReceiveData(data); //Net_nn.TcpMessage(tcpid,data); app.runmouse("tcpmessage", tcpid, data); }; gameabc_face.tcpdisconnected = function (tcpid) { //logmessage("tcpclose:"+tcpid); //Logic.DisConnect(); app.runmouse("tcpdisconnected", tcpid); }; gameabc_face.tcperror = function (tcpid, data) { //logmessage("tcperror:"+tcpid); app.runmouse("tcperror", tcpid, data); }; gameabc_face.httpmessage = function (myid, url, data) { /* ifast_http(1,"web/test.txt",1);//获取文件 同域 */ //logmessage("httpread:"+myid+"/"+url+":"+data); app.runmouse("httpread", myid, url, data); };