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; } var d = d || {}; d.a = d.a || {}; 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(2926,41,0,0,0); 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); logmessage("跑得快", 2); app.runmouse("gamestart", gameid); set_self(3124, 41, 0, 0, 0); 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 >= 817 && spid <= 876 && d.replay==0){ //d.djzt = 0; d.btn2 = spid; d.btn2_y=get_self(d.btn2,19); d.btn2_aleady_move==0; } if (spid == 149 && !d.change_card_state) { for (var i = 0; i < 60; i++) { if (get_self(817 + i, 19, 0, 0, 0) < 500) { set_self(817 + i, 19, 500, 0, 0); } } d.click_id = 0; d.zhenshu = 0; d.pai=[]; set_self(2897,43,6); set_self(2897,41,0); if(d.getEnumCard&&d.getEnumCard.value&&d.getEnumCard.value.length!=0){ d.getEnumCard.getIndex.resetIndex(); } } }; 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 的比较 来判断是 点击还是 移动 d.xp = spid_up; if(d.btn2_aleady_move==0 && spid_up==spid_down && spid_up >= 817 && spid_up <= 876 && d.replay==0){ // var l = Math.abs(d.xp - d.btn2); // for(var i=0;i0){ // if(get_self(d.btn2+i,19)==480){ // set_self(d.btn2+i,19,500); // d.pai.splice(d.pai.indexOf(get_self(d.btn2+i,43)),1); // }else{ // set_self(d.btn2+i,19,480); // d.pai.push(get_self(d.btn2+i,43)); // } // }else{ if(get_self(d.xp,19)==480){ set_self(d.xp,19,500); d.pai.splice(d.pai.indexOf(get_self(d.xp,43)),1); }else{ set_self(d.xp,19,480); d.pai.push(get_self(d.xp,43)); } //} //} } if (get_self(2897,37)==1 && spid_down >= 817 && spid_down <= 876 && d.replay==0) { d.show_btn(); }; if (spid_up == 149 && !d.change_card_state && d.replay==0) { if(d.pai.length>0){ var chu = (d.last_put[0]==-1 || d.last_put[0]==C_Player.seat) && Battle.check(d.pai); var beat = (d.user_ctrl[1]>-1 && Battle.beat(d.pai,d.last_put[1]) && d.recon!=1); if(chu||beat){ set_self(2897,43,3); set_self(2897,41,1); } } } d.btn2_aleady_move=0; //d.show_btn(); 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; } 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) { //点击后移动代码 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_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_clearing_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); } if (d.recon == 2) { GameUI.closeRoomInfo(); } } 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); };