|
@@ -26,39 +26,59 @@ cc.Class({
|
|
|
|
|
|
|
|
//发射攻击事件 // 普攻
|
|
//发射攻击事件 // 普攻
|
|
|
if (bLeft == 0) {
|
|
if (bLeft == 0) {
|
|
|
|
|
+
|
|
|
//右拳
|
|
//右拳
|
|
|
- this.armatureDisplay.node.scaleX = 1;
|
|
|
|
|
- this.armature.animation.play("attack", 1);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //this.armatureDisplay.node.scaleX = 1;
|
|
|
|
|
+
|
|
|
|
|
+ this.armature.animation.play("right_fit", 1);
|
|
|
this.node.emit("attack1");
|
|
this.node.emit("attack1");
|
|
|
|
|
+
|
|
|
} else if (bLeft == 1) {
|
|
} else if (bLeft == 1) {
|
|
|
//左拳
|
|
//左拳
|
|
|
- this.armatureDisplay.node.scaleX = -1;
|
|
|
|
|
- this.armature.animation.play("attack", 1);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //this.armatureDisplay.node.scaleX = -1;
|
|
|
|
|
+
|
|
|
|
|
+ this.armature.animation.play("left_fit", 1);
|
|
|
this.node.emit("attack2");
|
|
this.node.emit("attack2");
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
//暴击右
|
|
//暴击右
|
|
|
else if (bLeft == 2) {
|
|
else if (bLeft == 2) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
|
- this.armature.animation.play("critical_strike", 1);
|
|
|
|
|
|
|
+ this.armature.animation.play("double_hit", 1);
|
|
|
this.node.emit("attack_critical_strike1");
|
|
this.node.emit("attack_critical_strike1");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
//暴击左
|
|
//暴击左
|
|
|
else if (bLeft == 3) {
|
|
else if (bLeft == 3) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
|
- this.armature.animation.play("critical_strike", 1);
|
|
|
|
|
|
|
+ this.armature.animation.play("double_hit", 1);
|
|
|
this.node.emit("attack_critical_strike2");
|
|
this.node.emit("attack_critical_strike2");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
//连击
|
|
//连击
|
|
|
else if (bLeft == 4) {
|
|
else if (bLeft == 4) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
|
- this.armature.animation.play("double-hit", 1);
|
|
|
|
|
- this.node.emit("attack_double-hit1");
|
|
|
|
|
|
|
+ this.armature.animation.play("critical_strike", 1);
|
|
|
|
|
+ this.node.emit("attack_double_hit1");
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
//连击
|
|
//连击
|
|
|
else if (bLeft == 5) {
|
|
else if (bLeft == 5) {
|
|
|
|
|
+
|
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
|
- this.armature.animation.play("double-hit", 1);
|
|
|
|
|
- this.node.emit("attack_double-hit2");
|
|
|
|
|
|
|
+ this.armature.animation.play("critical_strike", 1);
|
|
|
|
|
+ this.node.emit("attack_double_hit2");
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
dodge(bLeft) { //躲闪
|
|
dodge(bLeft) { //躲闪
|
|
@@ -84,13 +104,13 @@ cc.Class({
|
|
|
if (bLeft == 0) {
|
|
if (bLeft == 0) {
|
|
|
//左挨打
|
|
//左挨打
|
|
|
|
|
|
|
|
- this.armatureDisplay.node.scaleX = -1;
|
|
|
|
|
- this.armature.animation.play("be_beaten", 1);
|
|
|
|
|
|
|
+ //this.armatureDisplay.node.scaleX = -1;
|
|
|
|
|
+ this.armature.animation.play("be_beaten_left", 1);
|
|
|
} else if (bLeft == 1) {
|
|
} else if (bLeft == 1) {
|
|
|
//右挨打
|
|
//右挨打
|
|
|
|
|
|
|
|
- this.armatureDisplay.node.scaleX = 1;
|
|
|
|
|
- this.armature.animation.play("be_beaten", 1);
|
|
|
|
|
|
|
+ //this.armatureDisplay.node.scaleX = 1;
|
|
|
|
|
+ this.armature.animation.play("be_beaten_right", 1);
|
|
|
}
|
|
}
|
|
|
this.node.emit("hurt_ord");
|
|
this.node.emit("hurt_ord");
|
|
|
}
|
|
}
|
|
@@ -100,13 +120,13 @@ cc.Class({
|
|
|
//左挨打
|
|
//左挨打
|
|
|
//被暴打
|
|
//被暴打
|
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
|
- this.armature.animation.play("be_critical_strike", 1);
|
|
|
|
|
|
|
+ this.armature.animation.play("be_double_hit", 1);
|
|
|
|
|
|
|
|
} else if (bLeft == 1) {
|
|
} else if (bLeft == 1) {
|
|
|
//被暴打
|
|
//被暴打
|
|
|
//右挨打
|
|
//右挨打
|
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
|
- this.armature.animation.play("be_critical_strike", 1);
|
|
|
|
|
|
|
+ this.armature.animation.play("be_double_hit", 1);
|
|
|
}
|
|
}
|
|
|
this.node.emit("hurt_critical");
|
|
this.node.emit("hurt_critical");
|
|
|
}
|
|
}
|
|
@@ -117,12 +137,12 @@ cc.Class({
|
|
|
//被连击打
|
|
//被连击打
|
|
|
//左挨打
|
|
//左挨打
|
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
this.armatureDisplay.node.scaleX = -1;
|
|
|
- this.armature.animation.play("be_double_hit", 1);
|
|
|
|
|
|
|
+ this.armature.animation.play("be_critical_strike", 1);
|
|
|
} else if (bLeft == 1) {
|
|
} else if (bLeft == 1) {
|
|
|
//被连击打
|
|
//被连击打
|
|
|
//右挨打
|
|
//右挨打
|
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
|
- this.armature.animation.play("be_double_hit", 1);
|
|
|
|
|
|
|
+ this.armature.animation.play("be_critical_strike", 1);
|
|
|
}
|
|
}
|
|
|
this.node.emit("hurt_double");
|
|
this.node.emit("hurt_double");
|
|
|
}
|
|
}
|
|
@@ -134,7 +154,7 @@ cc.Class({
|
|
|
animationEventHandler(event) {
|
|
animationEventHandler(event) {
|
|
|
if (event.type === dragonBones.EventObject.COMPLETE) {
|
|
if (event.type === dragonBones.EventObject.COMPLETE) {
|
|
|
//主角
|
|
//主角
|
|
|
- if (event.animationState.name === "attack") {
|
|
|
|
|
|
|
+ if (event.animationState.name === "right_fit" || event.animationState.name === "left_fit") {
|
|
|
console.log("attack 动作播放完毕!!!");
|
|
console.log("attack 动作播放完毕!!!");
|
|
|
//TODO:
|
|
//TODO:
|
|
|
//this.armatureDisplay.node.scaleX = 0.39;
|
|
//this.armatureDisplay.node.scaleX = 0.39;
|
|
@@ -145,7 +165,7 @@ cc.Class({
|
|
|
this.aicontroScp._Statepassivity = false;
|
|
this.aicontroScp._Statepassivity = false;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- if (event.animationState.name === "be_beaten") {
|
|
|
|
|
|
|
+ if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_beaten_right") {
|
|
|
console.log("critical_strike 动作播放完毕!!!");
|
|
console.log("critical_strike 动作播放完毕!!!");
|
|
|
//TODO:
|
|
//TODO:
|
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
this.armatureDisplay.node.scaleX = 1;
|
|
@@ -155,7 +175,7 @@ cc.Class({
|
|
|
this.aicontroScp._Statepassivity = false;
|
|
this.aicontroScp._Statepassivity = false;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- if (event.animationState.name === "critical_strike") {
|
|
|
|
|
|
|
+ if (event.animationState.name === "double_hit") {
|
|
|
console.log("critical_strike 动作播放完毕!!!");
|
|
console.log("critical_strike 动作播放完毕!!!");
|
|
|
//TODO:
|
|
//TODO:
|
|
|
//this.armatureDisplay.node.scaleX = 0.39;
|
|
//this.armatureDisplay.node.scaleX = 0.39;
|
|
@@ -165,7 +185,7 @@ cc.Class({
|
|
|
this.aicontroScp._Statepassivity = false;
|
|
this.aicontroScp._Statepassivity = false;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- if (event.animationState.name === "double-hit") {
|
|
|
|
|
|
|
+ if (event.animationState.name === "critical_strike") {
|
|
|
console.log("double-hit 动作播放完毕!!!");
|
|
console.log("double-hit 动作播放完毕!!!");
|
|
|
//TODO:
|
|
//TODO:
|
|
|
//this.armatureDisplay.node.scaleX = 0.39;
|
|
//this.armatureDisplay.node.scaleX = 0.39;
|
|
@@ -190,6 +210,17 @@ cc.Class({
|
|
|
|
|
|
|
|
this.armature.animation.play("idle", 0);
|
|
this.armature.animation.play("idle", 0);
|
|
|
|
|
|
|
|
|
|
+ this.aicontroScp._Defence = false;
|
|
|
|
|
+ this.aicontroScp._Statepassivity = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_critical_strike" ||
|
|
|
|
|
+ event.animationState.name === "be_double_hit" || event.animationState.name === "be_beaten_right") {
|
|
|
|
|
+ console.log("be_beaten 动作播放完毕!!!");
|
|
|
|
|
+ //TODO:
|
|
|
|
|
+ // this.armatureDisplay.node.scaleX = 0.39;
|
|
|
|
|
+
|
|
|
|
|
+ this.armature.animation.play("idle", 0);
|
|
|
|
|
+
|
|
|
this.aicontroScp._Defence = false;
|
|
this.aicontroScp._Defence = false;
|
|
|
this.aicontroScp._Statepassivity = false;
|
|
this.aicontroScp._Statepassivity = false;
|
|
|
}
|
|
}
|
|
@@ -199,6 +230,8 @@ cc.Class({
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
init() {
|
|
init() {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//角色脚本
|
|
//角色脚本
|
|
|
this.controScp = this.PlayerController.getComponent('PlayerController');
|
|
this.controScp = this.PlayerController.getComponent('PlayerController');
|
|
|
//Ai脚本
|
|
//Ai脚本
|