60 lines
1.7 KiB
JavaScript
60 lines
1.7 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, '32a2fhrgVBIrZ40LcggMXF8', 'cmp.adventure.trap');
|
|
// Scripts/mod/pve/adventure/cmp/cmp.adventure.trap.js
|
|
|
|
"use strict";
|
|
|
|
var BridgeWindow = require("bridge.window");
|
|
var ADVCT = require("adventure_controller");
|
|
var ADEVT = require("adventure_event");
|
|
cc.Class({
|
|
"extends": BridgeWindow,
|
|
properties: {
|
|
desc: {
|
|
"default": null,
|
|
type: cc.Node
|
|
},
|
|
detail: {
|
|
"default": null,
|
|
type: cc.Node
|
|
}
|
|
},
|
|
// LIFE-CYCLE CALLBACKS:
|
|
onLoad: function onLoad() {
|
|
this.ctrl = ADVCT.getInstance();
|
|
},
|
|
start: function start() {},
|
|
onOpenConfigs: function onOpenConfigs(params) {
|
|
var model_type = this.ctrl.getPlayModel();
|
|
var buff_id = params.evt_id;
|
|
var data = null;
|
|
var buff_data = null;
|
|
this.is_battle = params.is_battle;
|
|
if (model_type == 1) {
|
|
//無盡模式
|
|
data = game.configs.adventure_endless_data.data_evt_desc[buff_id];
|
|
buff_data = game.configs.adventure_endless_data.data_buff[buff_id];
|
|
} else {
|
|
data = game.configs.adventure_weekly_data.data_adventure_event[buff_id];
|
|
buff_data = data;
|
|
}
|
|
if (!data) return;
|
|
nx.gui.setString(this.desc, "", data.desc);
|
|
nx.gui.setString(this.detail, "", data.tip);
|
|
if (!buff_data) return;
|
|
gcore.GlobalEvent.fire(ADEVT.Update_Role_Good_Status, buff_data.effect);
|
|
},
|
|
onPreClosed: function onPreClosed() {
|
|
this.ctrl.setCurEvtType(null);
|
|
},
|
|
confirmTrap: function confirmTrap() {
|
|
var pos = this.ctrl.getTrapPos();
|
|
if (this.is_battle == 1) {
|
|
this.ctrl.send29520([pos], 3, [], this.ctrl.getPlayModel()); //直接戰鬥
|
|
}
|
|
|
|
this.close();
|
|
} // update (dt) {},
|
|
});
|
|
|
|
cc._RF.pop(); |