241 lines
9.0 KiB
JavaScript
241 lines
9.0 KiB
JavaScript
// 一些常量
|
|
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强赛
|
|
match_64 : 64, // 64強賽
|
|
match_8 : 8, // 8強賽
|
|
}
|
|
|
|
ArenaConst.champion_my_status = {
|
|
unopened : 0, // 未开启
|
|
unjoin : 1, // 没资格
|
|
in_match : 2, // 可pk
|
|
}
|
|
|
|
// 冠軍賽類型
|
|
ArenaConst.champion_type = {
|
|
normal : 1, // 本服冠軍賽
|
|
cross : 2, // 跨服冠軍賽
|
|
}
|
|
|
|
// 購買物品界面類型
|
|
ArenaConst.view_type = {
|
|
arena : 1, // 競技場和跨服競技場
|
|
summon : 2, // 召喚
|
|
elfin : 3, // 精靈
|
|
},
|
|
|
|
ArenaConst.CrosschampionConstDefine = [
|
|
{"pos":1,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":2,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":3,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":4,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":5,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":6,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":7,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":8,"rid":0,"srv_id":"","name":"64","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":9,"rid":0,"srv_id":"","name":"32","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":10,"rid":0,"srv_id":"","name":"32","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":11,"rid":0,"srv_id":"","name":"32","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":12,"rid":0,"srv_id":"","name":"32","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":13,"rid":0,"srv_id":"","name":"16","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":14,"rid":0,"srv_id":"","name":"16","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":15,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
],
|
|
|
|
ArenaConst.CrosschampionEConstDefine = [
|
|
{"pos":1,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":2,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":3,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":4,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":5,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":6,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":7,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":8,"rid":0,"srv_id":"","name":"8","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":9,"rid":0,"srv_id":"","name":"4","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":10,"rid":0,"srv_id":"","name":"4","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":11,"rid":0,"srv_id":"","name":"4","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":12,"rid":0,"srv_id":"","name":"4","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":13,"rid":0,"srv_id":"","name":"2","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":14,"rid":0,"srv_id":"","name":"2","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
{"pos":15,"rid":0,"srv_id":"","name":"1","face":0,"ret":0,"replay_id":0,"face_update_time":0,"face_file":""},
|
|
],
|
|
|
|
// 根据阶段回合显示相应的说明 周循環冠軍賽
|
|
ArenaConst.dealDesc = function( _stage, _round ){
|
|
|
|
let stage = _stage;
|
|
let round = _round;
|
|
let desc = "";
|
|
switch( stage ){
|
|
case ArenaConst.champion_step.score : {
|
|
desc = nx.text.format( "TrialsDesc", round );
|
|
}; break;
|
|
case ArenaConst.champion_step.match_64 : {
|
|
if ( round <= 1 ) {
|
|
desc = nx.text.format( "Match64Desc", 32 );
|
|
} else if (round == 2) {
|
|
desc = nx.text.format( "Match64Desc", 16 );
|
|
} else {
|
|
desc = nx.text.format( "Match64Desc", 8 );
|
|
}
|
|
}; break;
|
|
case ArenaConst.champion_step.match_8 : {
|
|
if (round == 1) {
|
|
desc = nx.text.format( "Match64Desc", 4 );
|
|
} else if (round == 2) {
|
|
desc = nx.text.getKey( "MHalfFianl" );
|
|
} else if (round == 3) {
|
|
desc = nx.text.getKey( "FinalRace" );
|
|
} else {
|
|
desc = nx.text.format( "Match64Desc", 8 );
|
|
}
|
|
}; break;
|
|
}
|
|
|
|
return desc;
|
|
|
|
}
|
|
|
|
// 冠军赛阶段描述
|
|
ArenaConst.getMatchStepDesc = function(step) {
|
|
if (step == ArenaConst.champion_step.unopened ) {
|
|
return Utils.TI18N("Not started");
|
|
} else if (step == ArenaConst.champion_step.score) {
|
|
return Utils.TI18N("Trials");
|
|
} else if (step == ArenaConst.champion_step.match_64) {
|
|
return Utils.TI18N("Top 64");
|
|
} else if (step == ArenaConst.champion_step.match_32) {
|
|
return Utils.TI18N("Top 32");
|
|
} else if (step == ArenaConst.champion_step.match_8) {
|
|
return Utils.TI18N("Top 8");
|
|
} else if (step == ArenaConst.champion_step.match_4) {
|
|
return Utils.TI18N("Top 4");
|
|
}
|
|
return Utils.TI18N("Not started");
|
|
}
|
|
|
|
// 冠军赛阶段描述 16强 8强 这样的
|
|
ArenaConst.getMatchStepDesc2 = function(step, round) {
|
|
if (step == ArenaConst.champion_step.match_64) {
|
|
if (round <= 1) {
|
|
return Utils.TI18N("Top 32");
|
|
} else if (round == 2) {
|
|
return Utils.TI18N("Top 16");
|
|
} else {
|
|
return Utils.TI18N("Top 8");
|
|
}
|
|
} else if (step == ArenaConst.champion_step.match_32) {
|
|
if (round <= 1) {
|
|
return Utils.TI18N("Top 16");
|
|
} else if (round == 2) {
|
|
return Utils.TI18N("Top 8");
|
|
} else {
|
|
return Utils.TI18N("Top 4");
|
|
}
|
|
} else if (step == ArenaConst.champion_step.match_8) {
|
|
if (round == 1) {
|
|
return Utils.TI18N("Top 4");
|
|
} else if (round == 2) {
|
|
return Utils.TI18N("Semi-final");
|
|
} else if (round == 3) {
|
|
return Utils.TI18N("Final");
|
|
} else {
|
|
return Utils.TI18N("ended");
|
|
}
|
|
} else if (step == ArenaConst.champion_step.match_4) {
|
|
if (round == 1) {
|
|
return Utils.TI18N("Semi-final");
|
|
} else if (round == 2) {
|
|
return Utils.TI18N("Final");
|
|
} else {
|
|
return Utils.TI18N("ended");
|
|
}
|
|
} else if (step == ArenaConst.champion_step.score) {
|
|
if (round == 0) {
|
|
return Utils.TI18N("The next");
|
|
} else {
|
|
return cc.js.formatStr(Utils.TI18N("%s round.%s"), ArenaConst.getMatchStepDesc(step), round);
|
|
}
|
|
} else if (step == ArenaConst.champion_step.unopened) {
|
|
return Utils.TI18N("The next");
|
|
} else {
|
|
return Utils.TI18N("Not started");
|
|
}
|
|
}
|
|
|
|
// 所在组的转换
|
|
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 if (group == 5) {
|
|
return Utils.TI18N("E");
|
|
} else if (group == 6) {
|
|
return Utils.TI18N("F");
|
|
} else if (group == 7) {
|
|
return Utils.TI18N("G");
|
|
} else if (group == 8) {
|
|
return Utils.TI18N("H");
|
|
} else {
|
|
return "";
|
|
}
|
|
}
|
|
|
|
module.exports = ArenaConst; |