Files
fc/dev/project/library/imports/db/db76eb47-61cc-4188-bd19-439ad8470b45.js
T
2026-05-24 10:21:26 +08:00

148 lines
4.1 KiB
JavaScript

"use strict";
cc._RF.push(module, 'db76etHYcxBiL0ZQ5rYRwtF', 'act.mysteryexplore.mod');
// Scripts/mod/acts/nysteryexplore/act.mysteryexplore.mod.js
"use strict";
/*******************************************************************************
*
* 活动: 迷窟探险
*
*
******************************************************************************/
var ActBase = require("act.base");
var MysteryExploreMod = cc.Class({
"extends": ActBase,
// 初始化配置数据
initConfig: function initConfig() {
// 视图附着
nx.plugin.add(this, ["view"]);
this.vattach("Acts");
},
// 注册协议接受事件
registerProtocals: function registerProtocals() {
this.RegisterProtocal(31020, this.handle31020.bind(this)); //限定挑戰基本信息
this.RegisterProtocal(31021, this.handle31021.bind(this)); //開始挑戰
this.RegisterProtocal(31022, this.handle31022.bind(this)); //領獎
this.RegisterProtocal(31023, this.handle31023.bind(this)); //排行榜
this.RegisterProtocal(31024, this.handle31024.bind(this)); //掃蕩
this.RegisterProtocal(31025, this.handle31025.bind(this)); //购买挑战次数
},
// 从服务器初始化数据
reqBaseFromServer: function reqBaseFromServer(_cb) {
var cfgs = ["happy_challenge_data"];
this.loadConfigs(cfgs, function (_ret, _data) {
nx.dt.fnInvoke(_cb, true);
});
},
// 请求信息
reqLimitData: function reqLimitData(_camp_id, _cb) {
this.SendProtocal(31020, {
camp_id: _camp_id
}, _cb);
},
// 请求相關配置信息
handle31020: function handle31020(_data) {
if (!this.isGoodData(_data)) {
return;
}
this.setCurCamp(_data.camp_id);
this.setCurDps(_data.all_dps);
this.vset("MysteryExploreInfos", _data);
},
reqBat: function reqBat(_camp_id, _cb) {
this.SendProtocal(31021, {
camp_id: _camp_id
}, _cb);
},
// 请求相關配置信息
handle31021: function handle31021(_data) {
if (!this.isGoodData(_data)) {
return;
}
},
// 请求獎勵
reqAward: function reqAward(_camp_id, _cb) {
this.SendProtocal(31022, {
camp_id: _camp_id
}, _cb);
},
// 请求相關配置信息
handle31022: function handle31022(_data) {
if (!this.isGoodData(_data)) {
return;
}
},
// 请求排行榜
reqRank: function reqRank(_camp_id, _cb) {
this.SendProtocal(31023, {
camp_id: _camp_id
}, _cb);
},
// 请求相關配置信息
handle31023: function handle31023(_data) {
if (!this.isGoodData(_data)) {
return;
}
this.vset("MysteryExploreRank", _data);
},
reqBatClear: function reqBatClear(_camp_id, _cb) {
this.SendProtocal(31024, {
camp_id: _camp_id
}, _cb);
},
// 请求相關配置信息
handle31024: function handle31024(_data) {
if (!this.isGoodData(_data)) {
return;
}
if (_data.flag == 1) {
nx.tbox("startower_tip3");
}
},
reqBuyChalNum: function reqBuyChalNum(_camp_id, _cb) {
this.SendProtocal(31025, {
camp_id: _camp_id
}, _cb);
},
handle31025: function handle31025(_data) {
if (!this.isGoodData(_data)) {
return;
}
},
setCurCamp: function setCurCamp(camp_id) {
this.cur_camp_id = camp_id;
},
getCurCamp: function getCurCamp() {
return this.cur_camp_id;
},
setCurDps: function setCurDps(dps) {
this.total_dps = dps;
},
getCurDps: function getCurDps() {
return this.total_dps || 0;
} // ============================================================
// 活动红点提示
// ============================================================
// // 红点提示更新
// freshTips: function() {
// let can = false;
// let list = this.vget( "sign15" ) || [];
// for( let i = 0; i < list.length; ++i ) {
// // 0不可领取 1可领取 2已领取
// let task = list[i];
// if( task && task.status == 1 ) {
// can = true;
// break;
// }
// }
// this.openTip( "reward", can );
// },
});
// 模块导出
module.exports = MysteryExploreMod;
cc._RF.pop();