|
@@ -39,19 +39,36 @@ cc.Class({
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
start() {
|
|
start() {
|
|
|
- this.Charactor.on("attack", () => {
|
|
|
|
|
- //console.log("检测到攻击2");
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.Charactor.on("attack1", () => {
|
|
|
|
|
+ //console.log("检测到攻击2 右");
|
|
|
|
|
+ this.UiController.Ui_Shake(2);
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
});
|
|
});
|
|
|
- this.Charactor.on("attack_critical_strike", () => {
|
|
|
|
|
- //console.log("检测到暴击2");
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.Charactor.on("attack2", () => {
|
|
|
|
|
+ //console.log("检测到攻击2 左");
|
|
|
|
|
+ this.UiController.Ui_Shake(1);
|
|
|
|
|
+ cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
|
|
+ });
|
|
|
|
|
+ this.Charactor.on("attack_critical_strike1", () => {
|
|
|
|
|
+ //console.log("检测到暴击2右");
|
|
|
|
|
+ this.UiController.Ui_Shake(2);
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
});
|
|
});
|
|
|
- this.Charactor.on("attack_double-hit", () => {
|
|
|
|
|
- //console.log("检测到连击2");
|
|
|
|
|
|
|
+ this.Charactor.on("attack_critical_strike2", () => {
|
|
|
|
|
+ //console.log("检测到暴击2左");
|
|
|
|
|
+ this.UiController.Ui_Shake(1);
|
|
|
|
|
+ cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
|
|
+ });
|
|
|
|
|
+ this.Charactor.on("attack_double-hit1", () => {
|
|
|
|
|
+ //console.log("检测到连击2右");
|
|
|
|
|
+ this.UiController.Ui_Shake(2);
|
|
|
|
|
+ cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
|
|
+ cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ this.Charactor.on("attack_double-hit2", () => {
|
|
|
|
|
+ //console.log("检测到连击2左");
|
|
|
|
|
+ this.UiController.Ui_Shake(1);
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[3]);
|
|
|
|
|
|
|
@@ -72,21 +89,22 @@ cc.Class({
|
|
|
});
|
|
});
|
|
|
this.Charactor.on("hurt_ord", () => {
|
|
this.Charactor.on("hurt_ord", () => {
|
|
|
// console.log("检测到受普攻");
|
|
// console.log("检测到受普攻");
|
|
|
-
|
|
|
|
|
|
|
+ this.UiController.Shake(this.Charactor, 1);
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
|
this._hp = this.minusblood(this._hp);
|
|
this._hp = this.minusblood(this._hp);
|
|
|
this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
|
|
this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
|
|
|
});
|
|
});
|
|
|
this.Charactor.on("hurt_critical", () => {
|
|
this.Charactor.on("hurt_critical", () => {
|
|
|
//console.log("检测到受暴击");
|
|
//console.log("检测到受暴击");
|
|
|
-
|
|
|
|
|
|
|
+ this.UiController.Shake(this.Charactor, 1);
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
|
this._hp = this.minusblood_critical(this._hp);
|
|
this._hp = this.minusblood_critical(this._hp);
|
|
|
//console.log("暴击后的血量:", this._hp);
|
|
//console.log("暴击后的血量:", this._hp);
|
|
|
this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
|
|
this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
|
|
|
});
|
|
});
|
|
|
this.Charactor.on("hurt_double", () => {
|
|
this.Charactor.on("hurt_double", () => {
|
|
|
-
|
|
|
|
|
|
|
+ this.UiController.Shake(this.Charactor, 1);
|
|
|
|
|
+ this.UiController.Shake(this.Charactor, 1);
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
|
|
|
|
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
cc.audioEngine.playEffect(this.UiController.audioArr[4]);
|
|
@@ -110,6 +128,12 @@ cc.Class({
|
|
|
self.PanelResult.addChild(cc.instantiate(ResultArr));
|
|
self.PanelResult.addChild(cc.instantiate(ResultArr));
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ if (this._hp <= this._damage) {
|
|
|
|
|
+ this.UiController.Ui_Shake(4); //气血不足
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this._endurance <= this._block_minus_endurance) {
|
|
|
|
|
+ this.UiController.Ui_Shake(5); //能量不足不足
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
init() {
|
|
init() {
|
|
|
this.gamestate = cc.find("Canvas/Game/Interface_Game").getComponent('Interface_game');
|
|
this.gamestate = cc.find("Canvas/Game/Interface_Game").getComponent('Interface_game');
|