woso_javan 2 сар өмнө
parent
commit
fdae7b7c30

+ 1 - 0
assets/core_tgx/base/ad/AdvertMgr.ts

@@ -17,6 +17,7 @@ export class AdvertMgr {
 
     adInstance: any = null;
     gtag: any = null;
+    openAd: boolean = true;
 
     initilize(): void {
         this.adInstance = (window as any)['adInstance'];

+ 12 - 9
assets/module_storm_sunder/Script/Component/TornadoAIComponent.ts

@@ -59,9 +59,9 @@ export class TornadoAIComponent extends TornadoComponent {
         this.currentLv = 1;
         this.playerInfo.level = this.currentLv;
 
-        this.moveDuration = Math.floor(Math.random() * (move_time[1] - move_time[0] + 1));
-        this.escapeDuration = Math.floor(Math.random() * (escape_time[1] - escape_time[0] + 1));
-        this.chaseDuration = Math.floor(Math.random() * (pursuit_time[1] - pursuit_time[0] + 1));
+        this.moveDuration = Math.floor(Math.random() * (move_time[1] - move_time[0] + 1)) + move_time[0];
+        this.escapeDuration = Math.floor(Math.random() * (escape_time[1] - escape_time[0] + 1)) + escape_time[0];
+        this.chaseDuration = Math.floor(Math.random() * (pursuit_time[1] - pursuit_time[0] + 1)) + pursuit_time[0];
         this.chaseAIProbability = pursuit_1;
         this.chasePlayerProbability = pursuit_2;
 
@@ -74,8 +74,8 @@ export class TornadoAIComponent extends TornadoComponent {
         this.attack = this.attributeBonusMgr.getStormSunderAttack(this.currentLv, true);
         this.speed = this.attributeBonusMgr.getStormSunderSpeed(this.currentLv, true);
         this.speed = Math.round((this.speed / 2) * 100) / 100;
-        this.speed = this.speed * 0.8;//测试
-        console.log(`AI速度:${this.speed}`);
+        // this.speed = this.speed * 0.5;//测试
+        console.log(`移动时长:${this.moveDuration} 逃离时长:${this.escapeDuration} 追击时长:${this.chaseDuration} 追击AI概率:${this.chaseAIProbability} 追击玩家概率:${this.chasePlayerProbability} 移动概率:${this.moveProbability}`);
     }
 
     /** 选择 AI 行为 */
@@ -84,7 +84,7 @@ export class TornadoAIComponent extends TornadoComponent {
 
         const move = Math.random() * 100 < this.moveProbability;
 
-        // console.log(`AI 行为判断:移动概率:${this.moveProbability} 是否移动:${move}`);
+        console.log(`AI 行为判断:移动概率:${this.moveProbability} 是否移动:${move}`);
         if (move) {
             this.randomMove();
         } else {
@@ -177,7 +177,7 @@ export class TornadoAIComponent extends TornadoComponent {
 
             if (targetLv > this.currentLv) {
                 // 目标等级比自己高 → 逃跑
-                this.escapeFrom(targetTornado.node);
+                // this.escapeFrom(targetTornado.node);
             } else if (targetLv < this.currentLv) {
                 // 目标等级比自己低 → 先判断是否追击
                 if (Math.random() * 100 < this.chaseAIProbability) {
@@ -219,7 +219,7 @@ export class TornadoAIComponent extends TornadoComponent {
         this.targetNode = target;
 
         PathfindingManager.getInstance().followTarget(this, target, this.speed, () => {
-            // console.log(`AI 追击目标到达`);
+            console.log(`AI 追击目标到达`);
             this.cancelAction();
             this.decideAction();
         });
@@ -227,13 +227,14 @@ export class TornadoAIComponent extends TornadoComponent {
         // 追击时间结束后恢复行为
         this.scheduleOnce(() => {
             this.cancelAction();
+            this.decideAction();
         }, this.chaseDuration);
     }
 
     /** 逃离目标 */
     private escapeFrom(target: Node) {
         this.isEscaping = true;
-        // console.log(`AI 逃离行为->>>>>>>>>>>>>>`);
+        console.log(`AI 逃离行为 时长:${this.escapeDuration}`);
 
         // 计算最大可逃离距离 = 速度 * 持续时间
         const maxDistance = this.speed * this.escapeDuration;
@@ -247,6 +248,7 @@ export class TornadoAIComponent extends TornadoComponent {
 
         this.scheduleOnce(() => {
             this.cancelAction();
+            this.decideAction();
         }, this.escapeDuration);
     }
 
@@ -257,6 +259,7 @@ export class TornadoAIComponent extends TornadoComponent {
         this.isEscaping = false;
         this.targetNode = null;
         Tween.stopAllByTarget(this.node);
+        console.log(`AI 行为取消`);
     }
 
     protected onDestroy(): void {

+ 1 - 1
assets/module_storm_sunder/Script/Component/TornadoComponent.ts

@@ -94,7 +94,7 @@ export class TornadoComponent extends Component {
         this.nickName = userModel.nickName;
         this.height = userModel.game_tornado_base_height;
         this.speed = Math.round((this.speed / 2) * 100) / 100;
-        this.speed = this.speed * 1.5;//测试
+        // this.speed = this.speed * 2;//测试
 
         console.log(`玩家的速度:${this.speed}`);
         this.playerInfo = {

+ 1 - 1
assets/module_storm_sunder/Script/Manager/Effect2DUIMgr.ts

@@ -41,7 +41,7 @@ export class Effect2DUIMgr {
 
                 const height = existing.getComponent(UITransform).height * 15;
 
-                console.log('height:', height);
+                // console.log('height:', height);
                 this.setPlayerInfoPosition(existing, target, bloodUI, height);
             }
             return; // 正在加载或已存在

+ 1 - 1
assets/module_storm_sunder/Script/Manager/GameMgr.ts

@@ -79,7 +79,7 @@ export class GameMgr {
                 const revive = tgxUIMgr.inst.isShowing(UI_BattleRevive);
                 if (!revive) {
                     tgxUIMgr.inst.showUI(UI_BattleRevive);
-                    console.log("GameMgr.ts updateGameStatusUI() GameStatus.Revive");
+                    // console.log("GameMgr.ts updateGameStatusUI() GameStatus.Revive");
                 }
                 break;
             case GameStatus.End:

+ 3 - 3
assets/module_storm_sunder/Script/Manager/PlayerMgr.ts

@@ -38,9 +38,9 @@ export class PlayerMgr {
         return new Promise(async (resolve, reject) => {
             const mapConfig = MapMgr.Instance.getMapConfig(1);
             this.createAIPlayerCount = mapConfig.count;
-            this.createAIPlayerCount = 10;//测试
+            // this.createAIPlayerCount = 1;//测试
             const aiPoints = StormSunderGlobalInstance.instance.aiPoints;
-            for (let i = 0; i < this.createAIPlayerCount - 1; i++) {
+            for (let i = 0; i < this.createAIPlayerCount; i++) {
                 const infoPrefab = await resLoader.loadAsync(resLoader.gameBundleName, res[0], Prefab);
                 let infoNode = instantiate(infoPrefab);
                 infoPrefab.name = 'AIPlayer' + i;
@@ -139,7 +139,7 @@ export class PlayerMgr {
             this.pickAiMap.set(accumulatedWeight, config);
         }
 
-        console.log(this.pickAiMap);
+        // console.log(this.pickAiMap);
     }
 
     /**

+ 2 - 2
assets/module_storm_sunder/Script/Manager/TimerMgr.ts

@@ -36,7 +36,7 @@ export class TimerMgr {
             this.countDownTime--;
             if (this.countDownTime <= 0) {
                 this.stopCountdown();
-                console.log("Countdown finished!");
+                // console.log("Countdown finished!");
             }
             this.upateLbTime();
         }, 1000); // 每秒减少一次
@@ -78,6 +78,6 @@ export class TimerMgr {
 
         const mapConfig = MapMgr.Instance.getMapConfig(1);
         this.countDownTime = mapConfig.time;
-        this.countDownTime = 10; //测试
+        // this.countDownTime = 10; //测试
     }
 }

+ 2 - 4
assets/scripts/GlobalMgr.ts

@@ -13,7 +13,7 @@ export class GlobalMgr {
 
     //初始化__woso 挂载到window对象上
     public initilize() {
-        window.__woso = {
+        window['__woso'] = {
             SoundMr: {
                 pauseAll: () => {
                     GlobalMgr.instance.pauseAllSounds();
@@ -53,13 +53,11 @@ export class GlobalMgr {
 
     //开启广告
     openAd() {
-        console.log("开启广告");
         AdvertMgr.instance.openAd = true;
     }
 
     //关闭广告
     closeAd() {
-        console.log("关闭广告");
         AdvertMgr.instance.openAd = false;
     }
 
@@ -70,7 +68,7 @@ export class GlobalMgr {
 
     timeTest() {
         setTimeout(() => {
-            window.__woso.SoundMr.pauseAll();
+            window['__woso'].SoundMr.pauseAll();
         }, 2000);
     }