54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
"use strict";
|
|
cc._RF.push(module, 'cb914gHLVRCCpAQVQBIBTRb', 'cmp.partner.item.planesafk');
|
|
// Scripts/mod/pve/planesafk/cmp/cmp.partner.item.planesafk.js
|
|
|
|
"use strict";
|
|
|
|
var ItemBase = require("cmp.item.base");
|
|
var HeroController = require("hero_controller");
|
|
cc.Class({
|
|
"extends": ItemBase,
|
|
properties: {
|
|
hp: {
|
|
"default": null,
|
|
type: cc.ProgressBar
|
|
},
|
|
die: {
|
|
"default": null,
|
|
type: cc.Node
|
|
}
|
|
},
|
|
setEmpty: function setEmpty() {
|
|
this._super();
|
|
this.hp.node.active = false;
|
|
this.die.active = false;
|
|
},
|
|
// 重载:刷新
|
|
freshAll: function freshAll() {
|
|
this._super();
|
|
|
|
// 血量刷新
|
|
this.setHp();
|
|
this.setLevel(this.info.level);
|
|
},
|
|
setHp: function setHp() {
|
|
if (this.mdata.hp_per != null) {
|
|
this.hp.node.active = true;
|
|
this.hp.progress = this.mdata.hp_per / 100;
|
|
if (this.mdata.hp_per <= 0) {
|
|
//已死亡
|
|
this.die.active = true;
|
|
} else {
|
|
this.die.active = false;
|
|
}
|
|
} else {
|
|
this.hp.node.active = false;
|
|
}
|
|
},
|
|
// 单设:等级
|
|
setLevel: function setLevel(_lev) {
|
|
nx.gui.setString(this.nodCount, "", "Lv." + _lev);
|
|
}
|
|
});
|
|
|
|
cc._RF.pop(); |