目录结构调整
This commit is contained in:
434
codes/games/client/Projects/majiang_jx/js/config/Config.js
Normal file
434
codes/games/client/Projects/majiang_jx/js/config/Config.js
Normal file
@@ -0,0 +1,434 @@
|
||||
var RoomConfig = {
|
||||
roomcode: 100000,
|
||||
roomtype: [],
|
||||
room_name_type: {},
|
||||
turns: 0,
|
||||
people: 2,
|
||||
}
|
||||
|
||||
/*房间号,局数,游戏玩法,人数*/
|
||||
function RoomInit(roomtype) {
|
||||
RoomConfig.roomcode = Desk.roomcode || 100000;
|
||||
if (Desk.roomtype && Desk.roomtype.length > 0) {
|
||||
RoomConfig.roomtype = Desk.roomtype;
|
||||
} else if (roomtype && roomtype.length > 0) {
|
||||
RoomConfig.roomtype = roomtype;
|
||||
} else {
|
||||
RoomConfig.roomtype = [];
|
||||
}
|
||||
(function (roomtype) {
|
||||
RoomConfig.turns = roomtype[1] * 8 || 0;
|
||||
var peoples = [4, 4, 3, 2]
|
||||
RoomConfig.people = (peoples[roomtype[6]]) || 4;
|
||||
RoomConfig.room_name_type.jushu = roomtype[1];//局数
|
||||
RoomConfig.room_name_type.buy_horse = roomtype[2];//买马
|
||||
RoomConfig.room_name_type.limit = roomtype[3];//精分
|
||||
RoomConfig.room_name_type.horse = roomtype[5];//几匹马
|
||||
RoomConfig.room_name_type.top_limit = roomtype[6];//封顶 人数
|
||||
RoomConfig.room_name_type.host2 = roomtype[7];//庄家翻倍
|
||||
RoomConfig.room_name_type.base_score = roomtype[8];//底分
|
||||
RoomConfig.room_name_type.piao = roomtype[9];//底分
|
||||
RoomConfig.room_name_type.jia = roomtype[10];//底分
|
||||
RoomConfig.room_name_type.start_hu = roomtype[11];//底分
|
||||
RoomConfig.room_name_type.start_hu_arr = roomtype[12];//底分
|
||||
RoomConfig.room_name_type.star = roomtype[13];//底分
|
||||
RoomConfig.room_name_type.qiangganghu = roomtype[15];//底分
|
||||
})(RoomConfig.roomtype);
|
||||
}
|
||||
//房间接口
|
||||
var RoomFunc = {};
|
||||
//房间变量池
|
||||
var RoomPool={};
|
||||
|
||||
//可能会执行很多次
|
||||
//点击,永远可用
|
||||
RoomFunc.c_click = function (spid_up, upx, upy, downx, downy, spid_down) {
|
||||
if(spid_up == 2998){
|
||||
d.show_xiao_settle(1);
|
||||
d.show_timeready(1);
|
||||
}
|
||||
if (spid_up != 2999 && get_self(1247,37)) {//听牌显示
|
||||
set_group(237, 37, 0, 0, 0);
|
||||
}
|
||||
if (spid_up == 2233 ) {//托管
|
||||
RoomFunc.tuoguan();
|
||||
}
|
||||
if (d.replay==0 && (spid_up == 2231 || spid_up == 2232 || (spid_up >= 1013 && spid_up <= 1018) || (spid_up >= 791 && spid_up <= 799) || (spid_up >= 1131 && spid_up <= 1139))) {//取消托管
|
||||
d.OverTime=0;
|
||||
d.jishi_chu=0;
|
||||
set_group(221, 37, 0, 0, 0);
|
||||
set_self(2233,43,1,0,0);
|
||||
d.show_my13card();
|
||||
d.show_14card();
|
||||
}
|
||||
if (spid_up == 2999) {//听牌显示
|
||||
if (!get_self(1247,37)) {
|
||||
d.show_hu_card(d.Ting_ui);
|
||||
} else {
|
||||
set_group(237, 37, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
if (spid_up == 2509) {//小局2
|
||||
d.horse_time=0;
|
||||
d.compare_jing_time3=0;
|
||||
if (get_self(1598, 37) == 1) {
|
||||
d.a.show_history3_1();
|
||||
} else {
|
||||
d.show_xiao1_settle(1);
|
||||
}
|
||||
}
|
||||
if (spid_up == 2510) {//小局2
|
||||
set_group(260,37,0,0,0);
|
||||
}
|
||||
if (spid_up == 2656) {//精牌详情
|
||||
d.horse_time=0;
|
||||
d.compare_jing_time3=0;
|
||||
set_self(2656,37,0);
|
||||
d.show_xiao2_settle(1);
|
||||
set_group(214,41,0,0,0);
|
||||
set_self(2657,41,1);
|
||||
set_self(2787,41,1);
|
||||
//if (get_self(1598,37) == 1) {
|
||||
//d.a.show_history3_2();
|
||||
//}else {
|
||||
//d.show_xiao2_settle(1);
|
||||
//}
|
||||
}
|
||||
if ((spid_up == 2787 || spid_up == 2657) && Desk.roomtype[19] != 1) {//关闭精牌详情
|
||||
set_self(2656,37,1);
|
||||
set_group(214,37,0,0,0);
|
||||
}
|
||||
if (spid_up == 233) {//结算
|
||||
d.compare_jing_time3=0;
|
||||
}
|
||||
//console.log("roomfunc 点击,永远可用");
|
||||
}
|
||||
|
||||
//点击,游戏开始之后可用
|
||||
RoomFunc.g_click = function (spid_up, upx, upy, downx, downy, spid_down) {
|
||||
//console.log("roomfunc 点击,游戏开始之后可用");
|
||||
}
|
||||
|
||||
//开战,是否发牌
|
||||
RoomFunc.make_war = function (_msg) {
|
||||
console.log("roomfunc RoomConfig一进去就开战");
|
||||
return true;
|
||||
}
|
||||
|
||||
//重连重绘之前,游戏开始后收到包就执行
|
||||
RoomFunc.running_before = function (_msg) {
|
||||
console.log("roomfunc RoomConfig重连重绘之前,游戏开始后收到包就执行");
|
||||
}
|
||||
|
||||
//重连重绘
|
||||
RoomFunc.re_connect = function () {
|
||||
console.log("roomfunc RoomConfig重连重绘")
|
||||
}
|
||||
|
||||
//重连重绘之后,游戏开始后收到包就执行
|
||||
RoomFunc.running_after = function (_msg) {
|
||||
console.log("roomfunc RoomConfig重连重绘之后,游戏开始后收到包就执行")
|
||||
}
|
||||
|
||||
//点击牌的判断
|
||||
RoomFunc.clickpai_before = function (spid) {
|
||||
//console.log("roomfunc RoomConfig点击牌的判断");console.log(spid);
|
||||
if (Desk.roomtype[19] || d.replay!=0) {
|
||||
return false;
|
||||
}
|
||||
if(get_self(1965, 37) == 1 || d.baoting[0] == 1 || d.baoting[1] == 1 || d.baoting[2] == 1 || d.baoting[3] == 1 || (d.baoting[C_Player.seat] == 2 && spid < 949&&(!d.baoting[4]||(d.baoting[4]&&!d.baoting[4].length))))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(d.baoting[0] == 0 && d.baoting[1] == 0 && d.baoting[2] == 0 && d.baoting[3] == 0){
|
||||
return true;
|
||||
}
|
||||
if (d.baoting[4]&&d.baoting[4].length&&d.identity[4]==C_Player.seat&&d.baoting[C_Player.seat]==2) {
|
||||
var pos=d.baoting[4].indexOf(get_self(spid,43) );
|
||||
if (pos!=-1) {
|
||||
return true;
|
||||
}
|
||||
}else {
|
||||
if (d.final_hu[0] == -1) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//点击操作按钮,显示出操作图案之后
|
||||
RoomFunc.operate_before = function (spid, num) {
|
||||
if(num == 4){
|
||||
num = 1;
|
||||
}
|
||||
if (num == 8 || num == 7) {
|
||||
//return;
|
||||
num = 4;
|
||||
}
|
||||
if (num == 20) {
|
||||
// num = 8;
|
||||
return ;
|
||||
}
|
||||
if(num == 6 || num == 5){
|
||||
num = 3;
|
||||
}
|
||||
if(num == 11){
|
||||
num = 5;
|
||||
}
|
||||
if (!AM.is_play(spid)) {
|
||||
AM.remove(spid, false)
|
||||
//var dh_bz = [0, 0, 634, 633, 630, 633, 633, 631, 631, 632, 632, 9];//1吃,3杠,5胡,7碰,9听,
|
||||
//var a=1;
|
||||
AM.add(spid).bfunc(function () {
|
||||
set_self(spid, 1, 630, 0, 0);
|
||||
set_self(spid, 37, 1, 0, 0);
|
||||
set_self(spid, 33, 100, 0, 0);
|
||||
set_self(spid, 43, (num*2)-1, 0, 0);
|
||||
}).zoom(150, 2).zoom(50,3).wait(35,function(){
|
||||
set_self(spid,37,0,0,0);
|
||||
AM.cls_id(spid);
|
||||
}).start();
|
||||
}
|
||||
//var dh_bz2 = [0, 0, 634, 633, 630, 633, 633, 631, 631, 632, 632, 9];//1吃,3杠,5胡,7碰,9听,
|
||||
if (!AM.is_play(spid + 61)) {
|
||||
AM.add(spid + 61).wait(6, function () {
|
||||
set_self(spid + 61, 1, 630, 0, 0);
|
||||
set_self(spid + 61, 18, get_self(spid, 18), 0, 0);
|
||||
set_self(spid + 61, 19, get_self(spid, 19), 0, 0);
|
||||
set_self(spid + 61, 37, 1, 0, 0);
|
||||
set_self(spid + 61, 43, num*2, 0, 0);
|
||||
set_self(spid + 61, 35, 255, 0, 0);
|
||||
set_self(spid + 61, 33, 0, 0, 0);
|
||||
}).alpha(200, 3).zoom(200, 7).wait(2, function () {
|
||||
//set_self(spid+61,43,4,0,0);
|
||||
set_self(spid + 61, 37, 0, 0, 0);
|
||||
//set_self(spid, 37, 0, 0, 0);
|
||||
//AM.cls_id(spid);
|
||||
AM.cls_id(spid + 61);
|
||||
}).start();
|
||||
}
|
||||
if (!AM.is_play(spid + 663)) {
|
||||
AM.add(spid + 663).wait(10,function () {
|
||||
set_self(spid + 663, 37, 1, 0, 0);
|
||||
set_self(spid + 663, 1, 640, 0, 0);
|
||||
set_self(spid + 663, 18, get_self(spid,18)+50, 0, 0);
|
||||
set_self(spid + 663, 19, get_self(spid,19)+60, 0, 0);
|
||||
set_self(spid + 663, 33, 50, 0, 0);
|
||||
set_self(spid + 663, 35, 255, 0, 0);
|
||||
}).zoom(200, 15).alpha(0, 15).wait(1, function () {
|
||||
set_self(spid + 663,37,0,0,0);
|
||||
AM.cls_id(spid + 663);
|
||||
}).start();
|
||||
}
|
||||
|
||||
if((d.last_operate[0] == 2|| d.last_operate[0] == 4) && d.final_hu[0]==-1){
|
||||
//加杠动画 明杠动画
|
||||
if (!AM.is_play(2394)) {
|
||||
AM.add(2394).bfunc(function(){
|
||||
set_self(2394,37,1,0,0);
|
||||
set_self(2394,43,2,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,3,0,0);
|
||||
Utl.playSound("00302.mp3");
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,4,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,5,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,6,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,2,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,3,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,4,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,5,0,0);
|
||||
}).wait(3,function(){
|
||||
set_self(2394,43,6,0,0);
|
||||
}).wait(3,function(){
|
||||
|
||||
}).func(function() {
|
||||
set_self(2394,37,0,0,0);
|
||||
set_self(2394,43,2,0,0);
|
||||
AM.cls_id(2394);
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (d.last_operate[0] == 5 && d.final_hu[0] == -1) {
|
||||
//暗杠动画
|
||||
if (!AM.is_play(2674)) {
|
||||
AM.add(2674).bfunc(function () {
|
||||
set_self(2674, 37, 1, 0, 0);
|
||||
set_self(2674, 43, 1, 0, 0);
|
||||
Utl.playSound("00" + 303 + ".mp3");
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 2, 0, 0);
|
||||
Utl.playSound("00303.mp3");
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 3, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 4, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 5, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 6, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 1, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 2, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 3, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 4, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 5, 0, 0);
|
||||
}).wait(3, function () {
|
||||
set_self(2674, 43, 6, 0, 0);
|
||||
}).wait(3, function () {
|
||||
|
||||
}).func(function () {
|
||||
set_self(2674, 37, 0, 0, 0);
|
||||
set_self(2674, 43, 1, 0, 0);
|
||||
AM.cls_id(2674);
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
//点击操作按钮
|
||||
RoomFunc.operate_click = function (spid_up) {
|
||||
if(get_self(1965, 37) == 1)
|
||||
{return false;}
|
||||
else
|
||||
{return true;}
|
||||
}
|
||||
//战局开始,牌显示之前
|
||||
RoomFunc.showcard_before = function () {
|
||||
//一般执行14次
|
||||
//console.log("roomfunc RoomConfig战局开始,牌显示之前");
|
||||
if (Utl.getIsInfinite() == 1||Desk.roomtype[14]==3||Desk.roomtype[14]==4){
|
||||
for(var i=0;i<4;i++){
|
||||
if(d.sieves[2] == 0 && d.sieves[3] == -1 && d.sieves[4] == 0 && d.robot[i] ==1 && i == d.identity[4] && d.click_sieves == 0){
|
||||
for(var j=0;j<4;j++){
|
||||
if(d.robot[j]==-1 && !Desk.PlayerList[j].onstate){
|
||||
if (C_Player.seat == j) {
|
||||
d.click_sieves = 1;//庄家掷骰子选人选牌蹲专用
|
||||
d.click(1363);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(d.sieves[2] == 0 && d.sieves[3] == -1 && d.sieves[4] == 0 && d.click_sieves == 0 && d.status!=3)
|
||||
{
|
||||
d.click_sieves = 1;//庄家掷骰子选人选牌蹲专用
|
||||
if (d.replay == 0){
|
||||
//set_self(1363, 37, 1, 0, 0);
|
||||
d.click(1363);
|
||||
}
|
||||
}
|
||||
return d.showcard_before;
|
||||
}
|
||||
//战局开始,牌显示之后
|
||||
RoomFunc.showcard_after = function () {
|
||||
//执行一次
|
||||
console.log("roomfunc RoomConfig战局开始,牌显示之后");
|
||||
}
|
||||
|
||||
//自己有摸牌,且是自己的控制權
|
||||
RoomFunc.mopai_before = function (first_card, seat) {
|
||||
//最新的牌
|
||||
console.log("roomfunc RoomConfig自己有摸牌,且是自己的控制權", first_card, seat);
|
||||
}
|
||||
//自己沒摸牌,且是自己的控制權
|
||||
RoomFunc.nomopai_before = function (seat) {
|
||||
console.log("roomfunc RoomConfig自己沒摸牌", seat);
|
||||
}
|
||||
|
||||
//要不要顯示战绩,服务器判断要不要买马动画
|
||||
RoomFunc.zhanji_before = function () {
|
||||
console.log("roomfunc RoomConfig要不要顯示战绩");
|
||||
if(get_self(2377, 37) == 0 && Desk.roomtype[19]!=1)
|
||||
{set_self(2377, 37, 1);}
|
||||
if (!Desk.roomtype[19]) {
|
||||
d.compare_jing_time3=1;
|
||||
}else {
|
||||
d.show_xiao_settle(1);
|
||||
d.show_timeready();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//一小局的结束,显示了牌之后,还没有显示动画
|
||||
RoomFunc.turn_over = function () {
|
||||
for (var i = 936; i <= 954; i++) {
|
||||
set_self(i, 1, 503, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//游戲中战绩显示,在其他数据全部显示之后
|
||||
RoomFunc.game_show_settle = function (turn, identity, names, avatar, playerids, hand, turn_point, buyHorse, winHorse, Horse_vic_def, final_hu, hu_note, hu_note_gang, roomtype, many_hu, start_hu, piao, sea_hua, peng_chi_num, hu_note_gang_jing, putJing, jing, jing_reduce) {
|
||||
|
||||
}
|
||||
|
||||
//大厅战绩显示,在其他数据全部显示之后,与上面的
|
||||
RoomFunc.game_out_show_settle = function (js, js1) {
|
||||
|
||||
}
|
||||
//绘制接口
|
||||
RoomFunc.draw = function(spid){
|
||||
|
||||
}
|
||||
//超时自动出牌
|
||||
RoomFunc.Overtime_chupai = function(){
|
||||
var Overtime_chupai = Desk.roomtype[18];
|
||||
if (Overtime_chupai==2) {//快版
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//托管
|
||||
RoomFunc.tuoguan = function(mode){
|
||||
mode=mode || 0;
|
||||
if (get_self(2233,43)==1 && mode==0) {
|
||||
set_self(2233,43,2,0,0)
|
||||
d.show_tuoguan();
|
||||
}else if(mode==0 || mode==1){
|
||||
set_self(2233,43,1,0,0)
|
||||
d.OverTime=0;
|
||||
set_group(221, 37, 0, 0, 0);
|
||||
d.jishi_chu = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user