86 lines
2.4 KiB
JavaScript
86 lines
2.4 KiB
JavaScript
|
|
"use strict";
|
||
|
|
cc._RF.push(module, '5be07q+8SlJj48dKFOyJwZ2', 'summon.crystal.mod');
|
||
|
|
// Scripts/mod/summon/crystal/summon.crystal.mod.js
|
||
|
|
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
/******************************************************************
|
||
|
|
*
|
||
|
|
* STEP-UP 水晶召喚
|
||
|
|
*
|
||
|
|
******************************************************************/
|
||
|
|
|
||
|
|
var BridgeController = require("bridge.controller");
|
||
|
|
var CrystalModel = cc.Class({
|
||
|
|
"extends": BridgeController,
|
||
|
|
// 初始化配置数据
|
||
|
|
initConfig: function initConfig() {},
|
||
|
|
// 注册监听事件
|
||
|
|
registerEvents: function registerEvents() {},
|
||
|
|
// 注册协议接受事件
|
||
|
|
registerProtocals: function registerProtocals() {
|
||
|
|
this.RegisterProtocal(23213, this.handle23213.bind(this));
|
||
|
|
this.RegisterProtocal(23214, this.handle23214.bind(this));
|
||
|
|
this.RegisterProtocal(23215, this.handle23215.bind(this));
|
||
|
|
},
|
||
|
|
// 从服务器初始化数据
|
||
|
|
reqBaseFromServer: function reqBaseFromServer(_cb) {
|
||
|
|
// 配置加载
|
||
|
|
var cfgs = ["recruit_high_data"];
|
||
|
|
this.loadConfigs(cfgs, function (_ret, _data) {
|
||
|
|
nx.dt.fnInvoke(_cb, true);
|
||
|
|
});
|
||
|
|
},
|
||
|
|
// 水晶召喚
|
||
|
|
reqSummon: function reqSummon(_groupId, _cb) {
|
||
|
|
this.SendProtocal(23213, {
|
||
|
|
group_id: _groupId
|
||
|
|
}, _cb);
|
||
|
|
},
|
||
|
|
// 水晶召喚返回
|
||
|
|
handle23213: function handle23213(_data) {
|
||
|
|
if (!this.isGoodData(_data)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// 当前置换状态
|
||
|
|
reqSwapRecord: function reqSwapRecord(_cb) {
|
||
|
|
this.SendProtocal(23214, {}, _cb);
|
||
|
|
},
|
||
|
|
// 当前置换状态返回
|
||
|
|
handle23214: function handle23214(_data) {
|
||
|
|
if (!this.isGoodData(_data)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// 申请置换
|
||
|
|
reqSwap: function reqSwap(_partnerId, _cb) {
|
||
|
|
this.SendProtocal(23215, {
|
||
|
|
partner_id: _partnerId,
|
||
|
|
action: 1 // 0:取消保存;1:置换;2:确认置换
|
||
|
|
}, _cb);
|
||
|
|
},
|
||
|
|
// 取消置换
|
||
|
|
reqSwapCancel: function reqSwapCancel(_partnerId, _cb) {
|
||
|
|
this.SendProtocal(23215, {
|
||
|
|
partner_id: _partnerId,
|
||
|
|
action: 0 // 0:取消保存;1:置换;2:确认置换
|
||
|
|
}, _cb);
|
||
|
|
},
|
||
|
|
// 确认置换
|
||
|
|
reqSwapSave: function reqSwapSave(_partnerId, _cb) {
|
||
|
|
this.SendProtocal(23215, {
|
||
|
|
partner_id: _partnerId,
|
||
|
|
action: 2 // 0:取消保存;1:置换;2:确认置换
|
||
|
|
}, _cb);
|
||
|
|
},
|
||
|
|
// 申请置换返回
|
||
|
|
handle23215: function handle23215(_data) {
|
||
|
|
if (!this.isGoodData(_data)) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
module.exports = CrystalModel;
|
||
|
|
|
||
|
|
cc._RF.pop();
|