Ver Fonte

修复文档问题

FantasyUFG há 4 anos atrás
pai
commit
f056a4b7f2

Diff do ficheiro suprimidas por serem muito extensas
+ 236 - 333
assets/scene/Game.fire


+ 18 - 7
assets/script/Game/Ai/AiCharactor.js

@@ -155,7 +155,7 @@ cc.Class({
         if (event.type === dragonBones.EventObject.COMPLETE) {
             //主角
             if (event.animationState.name === "right_fit" || event.animationState.name === "left_fit") {
-                console.log("attack 动作播放完毕!!!");
+                //console.log("attack 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
                 this.armature.animation.play("idle", 0);
@@ -163,10 +163,13 @@ cc.Class({
                 this.aicontroScp._RightJayShow = false;
                 this.aicontroScp._LeftJayShow = false;
                 this.aicontroScp._Statepassivity = false;
+                if (this.controScp._Hurt) {
+                    this.UiController.Ui_Shake(3);
+                }
 
             }
             if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_beaten_right") {
-                console.log("critical_strike 动作播放完毕!!!");
+                // console.log("critical_strike 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
                 this.armature.animation.play("idle", 0);
@@ -176,25 +179,31 @@ cc.Class({
 
             }
             if (event.animationState.name === "double_hit") {
-                console.log("critical_strike 动作播放完毕!!!");
+                //  console.log("critical_strike 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
                 this.armature.animation.play("idle", 0);
 
                 this.aicontroScp._CriticalStrike = false;
                 this.aicontroScp._Statepassivity = false;
+                if (this.controScp._BeDoubleHit) {
+                    this.UiController.Ui_Shake(3);
+                }
 
             }
             if (event.animationState.name === "critical_strike") {
-                console.log("double-hit 动作播放完毕!!!");
+                //console.log("double-hit 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
                 this.armature.animation.play("idle", 0);
                 this.aicontroScp._DoubleHit = false;
                 this.aicontroScp._Statepassivity = false;
+                if (this.controScp._BeCriticalStrike) {
+                    this.UiController.Ui_Shake(3);
+                }
             }
             if (event.animationState.name === "dodge") {
-                console.log("dodge 动作播放完毕!!!");
+                // console.log("dodge 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
                 this.armature.animation.play("idle", 0);
@@ -204,7 +213,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
             }
             if (event.animationState.name === "block") {
-                console.log("block 动作播放完毕!!!");
+                // console.log("block 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
 
@@ -215,7 +224,7 @@ cc.Class({
             }
             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 动作播放完毕!!!");
+                //  console.log("be_beaten 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 1;
 
@@ -236,5 +245,7 @@ cc.Class({
         this.controScp = this.PlayerController.getComponent('PlayerController');
         //Ai脚本
         this.aicontroScp = this.AiPlayerController.getComponent('AiPlayerController');
+
+        this.UiController = cc.find("Canvas/UiController").getComponent('UiController');
     },
 });

+ 29 - 20
assets/script/Game/Ai/AiPlayerController.js

@@ -126,11 +126,11 @@ cc.Class({
                 if (randomnum_2 == 1) {
                     //暴击
                     this._CriticalStrike = true;
-
+                    this.UiController.Ui_Shake(1);
                     this.scheduleOnce(function() {
                         this.ctorScp.attack(2);
-                    }, 0.8);
-                    this.UiController.Ui_Shake(1);
+                    }, 2);
+
                     // this.AiControScp.ondefense_Ai(1, 1); //左右拳,击打类型
                     if (!this.PlayerControScp._RightDodge && !this.PlayerControScp._Defence) {
                         this.PlayerControScp._BeCriticalStrike = true;
@@ -141,11 +141,11 @@ cc.Class({
                 if (randomnum_2 == 2) {
                     //连击
                     this._DoubleHit = true;
-
+                    this.UiController.Ui_Shake(1);
                     this.scheduleOnce(function() {
                         this.ctorScp.attack(4);
-                    }, 0.8);
-                    this.UiController.Ui_Shake(1);
+                    }, 2);
+
                     //this.AiControScp.ondefense_Ai(1, 2); //左右拳,击打类型
                     if (!this.PlayerControScp._RightDodge && !this.PlayerControScp._Defence) {
                         this.PlayerControScp._BeDoubleHit = true;
@@ -154,11 +154,11 @@ cc.Class({
                 }
             } else { //普攻状态 普攻动作
                 this._RightJayShow = true;
-
+                this.UiController.Ui_Shake(1);
                 this.scheduleOnce(function() {
                     this.ctorScp.attack(0);
-                }, 0.8);
-                this.UiController.Ui_Shake(1);
+                }, 2);
+
                 //this.AiControScp.ondefense_Ai(1, 0); //左右拳,击打类型
                 if (!this.PlayerControScp._RightDodge && !this.PlayerControScp._Defence) {
                     this.PlayerControScp._Hurt = true;
@@ -175,32 +175,41 @@ cc.Class({
                 if (randomnum_2 == 1) {
                     //暴击
                     this._CriticalStrike = true;
-
+                    this.UiController.Ui_Shake(2);
                     this.scheduleOnce(function() {
                         this.ctorScp.attack(2);
-                    }, 0.8);
-                    this.UiController.Ui_Shake(2);
+                    }, 2);
+
                     //this.AiControScp.ondefense_Ai(1, 1); //左右拳,击打类型
-                    this.playerctorScp.hurt(1, 1); //右暴击
+                    if (!this.PlayerControScp._LeftDodg && !this.PlayerControScp._Defence) {
+                        this.PlayerControScp._BeCriticalStrike = true;
+                        this.playerctorScp.hurt(1, 1); //右暴击
+
+                    }
+
                 }
                 if (randomnum_2 == 2) {
                     //连击
                     this._DoubleHit = true;
-
+                    this.UiController.Ui_Shake(2);
                     this.scheduleOnce(function() {
                         this.ctorScp.attack(4);
-                    }, 0.8);
-                    this.UiController.Ui_Shake(2);
+                    }, 2);
+
                     //this.AiControScp.ondefense_Ai(1, 2); //左右拳,击打类型
-                    this.playerctorScp.hurt(1, 2); //右连击
+                    if (!this.PlayerControScp._LeftDodg && !this.PlayerControScp._Defence) {
+                        this.PlayerControScp._DoubleHit = true;
+                        this.playerctorScp.hurt(1, 2); //右连击
+                    }
+
                 }
             } else { //普攻状态 普攻动作
                 this._RightJayShow = true;
-
+                this.UiController.Ui_Shake(2);
                 this.scheduleOnce(function() {
                     this.ctorScp.attack(1);
-                }, 0.8);
-                this.UiController.Ui_Shake(2);
+                }, 2);
+
                 //this.AiControScp.ondefense_Ai(1, 0); //左右拳,击打类型
                 if (!this.PlayerControScp._LeftDodg && !this.PlayerControScp._Defence) {
                     this.PlayerControScp._Hurt = true;

+ 8 - 0
assets/script/Game/Ai/AiPlayerStates.js

@@ -119,6 +119,13 @@ cc.Class({
 
     update(dt) {
         if (this._hp <= 0 || this._hp <= this.playerStateScp._hp && this.gamestate._game_time == 0) {
+            this._GameState.gameresult = true;
+
+            this._GameState._currPass++;
+            if (this._GameState._currPass >= 3) {
+                this._GameState._currPass = 3;
+            }
+            // console.log("胜利", this._GameState.gameresult);
             cc.audioEngine.playEffect(this.UiController.audioArr[2]);
             this.game.removeAllChildren();
             var self = this;
@@ -138,6 +145,7 @@ cc.Class({
         //this.playerStateScp = this.PlayerState.getComponent('PlayerStates');
         this.playerStateScp = this.PlayerState.getComponent('PlayerStates');
         this.UiController = cc.find("Canvas/UiController").getComponent('UiController');
+        this._GameState = cc.find("GameStates").getComponent("GameStates");
 
     },
 });

+ 1 - 1
assets/script/Game/Base/BaseGameStates.js

@@ -11,7 +11,7 @@ cc.Class({
         this.player_gold = 10000;
         this.player_energy = 10001;
         this.player_sex = 0;
-        this.game_time = 720; //战斗时间
+        this.game_time = 60; //战斗时间
 
         this.currPass = 0;
     },

+ 2 - 2
assets/script/Game/Base/BasePlayerStates.js

@@ -5,8 +5,8 @@ cc.Class({
 
     },
     onLoad() {
-        this.hp = 110;
-        this.maxhp = 110; //血量
+        this.hp = 330;
+        this.maxhp = 330; //血量
         this.endurance = 100;
         this.maxendurance = 100; //蓝量
         this.damage = 11; //攻击力

+ 11 - 5
assets/script/Game/GameMode.js

@@ -1,3 +1,4 @@
+//const StatesManage = require("StatesManage");
 cc.Class({
     extends: require("BaseGameMode"),
 
@@ -7,15 +8,20 @@ cc.Class({
     onLoad() {
         this._gamestart = this.gamestart;
         this._initgame = this.initgame;
+        //this.scheduleOnce(() => {
+        //cc.resources.loadDir("prefab/Pass", (err, prefabs) => {
+        //     for (let i = 0; i < prefabs.length; i++) {
+        //         StatesManage.Game_Pass[i] = cc.instantiate(prefabs[i]);
+        //         //console.log("关卡数:", StatesManage.Game_Pass[i]);
+        //     }
+
+
+        // });
+        // }, 20);
     },
 
     start() {
-        cc.resources.loadDir("prefab/Interface", (completeCount, totalCount) => {
-
-        });
-        cc.resources.loadDir("prefab/Result", (completeCount, totalCount) => {
 
-        });
     },
 
     // update (dt) {},

+ 4 - 0
assets/script/Game/GameStates.js

@@ -13,6 +13,8 @@ cc.Class({
     onLoad() {
 
         this._super();
+
+
         this._restTime = this.restTime;
         this._currentTime = this.currentTime;
         this._player_name = this.player_name;
@@ -22,6 +24,8 @@ cc.Class({
 
         this._currPass = this.currPass; //当前关卡
 
+        this.gameresult = false;
+
 
         //#region 
         // this.InformationChanges("set", "name", "小明");

+ 8 - 8
assets/script/Game/Player/Charactor.js

@@ -130,7 +130,7 @@ cc.Class({
         if (event.type === dragonBones.EventObject.COMPLETE) {
             //主角
             if (event.animationState.name === "left_fit") {
-                console.log("attack 动作播放完毕!!!");
+                //  console.log("attack 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
                 this.armature.animation.play("idle", 0);
@@ -140,7 +140,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
             }
             if (event.animationState.name === "right_hit") {
-                console.log("attack 动作播放完毕!!!");
+                //     console.log("attack 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
                 this.armature.animation.play("idle", 0);
@@ -150,7 +150,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
             }
             if (event.animationState.name === "double_hit") {
-                console.log("critical_strike 动作播放完毕!!!");
+                //     console.log("critical_strike 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
                 this.armature.animation.play("idle", 0);
@@ -160,7 +160,7 @@ cc.Class({
 
             }
             if (event.animationState.name === "critical_strike") {
-                console.log("critical_strike 动作播放完毕!!!");
+                //     console.log("critical_strike 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
                 this.armature.animation.play("idle", 0);
@@ -169,7 +169,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
             }
             if (event.animationState.name === "be_beaten_left" || event.animationState.name === "be_beaten_right") {
-                console.log("double-hit 动作播放完毕!!!");
+                //    console.log("double-hit 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
                 this.armature.animation.play("idle", 0);
@@ -177,7 +177,7 @@ cc.Class({
                 this.aicontroScp._Statepassivity = false;
             }
             if (event.animationState.name === "dodge") {
-                console.log("dodge 动作播放完毕!!!");
+                //  console.log("dodge 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
                 this.armature.animation.play("idle", 0);
@@ -187,7 +187,7 @@ cc.Class({
 
             }
             if (event.animationState.name === "block") {
-                console.log("block 动作播放完毕!!!");
+                //   console.log("block 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
 
@@ -197,7 +197,7 @@ cc.Class({
             }
             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 动作播放完毕!!!");
+                //   console.log("be_beaten 动作播放完毕!!!");
                 //TODO:
                 this.armatureDisplay.node.scaleX = 0.39;
 

+ 1 - 1
assets/script/Game/Player/PlayerController.js

@@ -46,7 +46,7 @@ cc.Class({
     Gesture(name) {
         var randomnum_1 = parseInt(Math.round(Math.random() * 98 + 1)); //(0-100]
         var randomnum_2 = parseInt(Math.round(Math.random() + 1)); //[1-2]
-        console.log(randomnum_1, randomnum_2);
+        // console.log(randomnum_1, randomnum_2);
         if (name == 'right_top') {
             if (randomnum_1 >= 1 && randomnum_1 <= this._rate) {
                 //出现暴击或者连击

+ 5 - 3
assets/script/Game/Player/PlayerStates.js

@@ -68,20 +68,20 @@ cc.Class({
             this.progressBar_endur.getComponent(cc.Sprite).fillRange = this._endurance / this._maxendurance;
         });
         this.Charactor.on("hurt_ord", () => {
-            this.UiController.Ui_Shake(3);
+
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             this._hp = this.minusblood(this._hp);
             this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
         });
         this.Charactor.on("hurt_critical", () => {
-            this.UiController.Ui_Shake(3);
+
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             this._hp = this.minusblood_critical(this._hp);
             //console.log("暴击后的血量:", this._hp);
             this.progressBar_hp.getComponent(cc.Sprite).fillRange = this._hp / this._maxhp;
         });
         this.Charactor.on("hurt_double", () => {
-            this.UiController.Ui_Shake(3);
+
             cc.audioEngine.playEffect(this.UiController.audioArr[4]);
             this._hp = this.minusblood(this._hp);
 
@@ -102,6 +102,7 @@ cc.Class({
         this.init();
     },
     init() {
+        this._GameState = cc.find("GameStates").getComponent("GameStates");
         this.gamestate = cc.find("Canvas/Game/Interface_Game").getComponent('Interface_game');
         //角色脚本
         this.controScp = this.playerController.getComponent('PlayerController');
@@ -117,6 +118,7 @@ cc.Class({
 
         if (this._hp <= 0 || this._hp <= this.aiplayerStateScp._hp && this.gamestate._game_time == 0) {
             cc.audioEngine.playEffect(this.UiController.audioArr[2]);
+            // console.log("失败", this._GameState.gameresult);
             this.game.removeAllChildren();
             var self = this;
             cc.loader.loadRes("prefab/Result/interface_Loser", cc.Prefab, (err, ResultArr) => {

+ 2 - 2
assets/script/Game/Touch.js

@@ -34,7 +34,7 @@ cc.Class({
         let dirvecX = this.touchEndPoint.x - this.touchStartPoint.x;
         let dirvecY = this.touchEndPoint.y - this.touchStartPoint.y;
 
-        if (dirvecY >= 0) {
+        if (dirvecY > 0) {
             if (dirvecX > 0) {
                 //向右 上  出左拳
                 //console.log("右上滑!");
@@ -48,7 +48,7 @@ cc.Class({
 
             }
 
-        } else if (dirvecY <= 0) {
+        } else if (dirvecY < 0) {
 
             if (dirvecX > 0) {
                 //console.log("右下滑!");

+ 1 - 0
assets/script/Loading/Loading.js

@@ -32,6 +32,7 @@ cc.Class({
         //     this.UiController.change_interface(this.UiController.interfacaArr, 0);
         // });
 
+
         cc.resources.loadDir("texture", (completeCount, totalCount) => {
             this.progressBar.fillRange = completeCount / totalCount;
         }, () => {

+ 1 - 1
settings/project.json

@@ -1,3 +1,3 @@
 {
-  "last-module-event-record-time": 1615348349908
+  "last-module-event-record-time": 1615955534494
 }

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff