difenduandada
2024-12-31 34abe6963b344c882358274957f4b992456fee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
 // 一些常量
var ArenaConst = {}
 
// 竞技场类型,分为循环赛和排名赛
ArenaConst.arena_type = {
    loop : 1,
    rank : 2
}
 
 
// 循环赛窗体的标签值
ArenaConst.loop_index = {
    challenge : 1,
    activity  : 2,
    rank      : 3,
    awards    : 4,
}
 
// 红点状态
ArenaConst.red_type = {
    loop_challenge : 1,
    loop_artivity  : 2,
    loop_reward    : 5,
    champion_guess : 3,         // 冠军赛竞猜阶段红点
    loop_log       : 4,         // 挑战记录
}
 
// 冠军赛主窗体的标签
ArenaConst.champion_index = {
    my_match_ready : 1,
    guess          : 2,
    match          : 3,
    rank           : 4,
    my_match       : 5,
}
 
// 冠军赛阶段状态
ArenaConst.champion_step_status = {
    unopened : 0,      // 未到时间 
    opened   : 1,      // 进行中
    over     : 2,      // 结束
}
 
ArenaConst.champion_round_status = {
    prepare : 1,       // 准备阶段
    guess   : 2,       // 竞猜阶段
    fight   : 3        // 对战阶段
}
 
// 冠军赛阶段
ArenaConst.champion_step = {
    unopened : 0, // 未开始
    score    : 1, // 选拔赛
    match_32 : 32, // 32强赛
    match_4  : 4, //4强赛
}
 
ArenaConst.champion_my_status = {
    unopened : 0,   // 未开启
    unjoin   : 1,     // 没资格
    in_match : 2,   // 可pk
}
 
 
// 冠军赛阶段描述
ArenaConst.getMatchStepDesc = function(step) {
    if (step == ArenaConst.champion_step.unopened ) {
        return Utils.TI18N("暂未开始");
     } else if (step == ArenaConst.champion_step.score) {
        return Utils.TI18N("选拔赛");
     } else if (step == ArenaConst.champion_step.match_32) {
        return Utils.TI18N("32强赛");
     } else if (step == ArenaConst.champion_step.match_4) {
        return Utils.TI18N("4强赛");
     } 
    return Utils.TI18N("暂未开始");  
}
 
// 冠军赛阶段描述 16强 8强 这样的
ArenaConst.getMatchStepDesc2 = function(step, round) {
    if (step == ArenaConst.champion_step.match_32) {
        if (round <= 1) {
            return Utils.TI18N("16强赛");
        } else if (round == 2) {
            return Utils.TI18N("8强赛");
        } else {
            return Utils.TI18N("4强赛");
        }
    } else if (step == ArenaConst.champion_step.match_4) {
        if (round == 1) {
            return Utils.TI18N("半决赛");
        } else if (round == 2) {
            return Utils.TI18N("决赛");
        } else {
            return Utils.TI18N("本轮冠军赛已结束");
        }
    } else if (step == ArenaConst.champion_step.score) {
        if (round == 0) {
            return Utils.TI18N("下次冠军赛");
        } else {
            return cc.js.formatStr(Utils.TI18N("%s第%s回合"), ArenaConst.getMatchStepDesc(step), round);
        }
    } else if (step == ArenaConst.champion_step.unopened) {
        return Utils.TI18N("下次冠军赛");
    } else {
        return Utils.TI18N("冠军赛暂未开始");
    }
}
 
// 所在组的转换
ArenaConst.getGroup = function(group) {
    if (group == 1) {
        return Utils.TI18N("A组");
    } else if (group == 2) {
        return Utils.TI18N("B组");
    } else if (group == 3) {
        return Utils.TI18N("C组");
    } else if (group == 4 ) {
        return Utils.TI18N("D组");
    } else {
        return "";
    }
}
 
module.exports = ArenaConst;