woso_javan 1 月之前
父節點
當前提交
fe41506ab7

+ 1 - 0
assets/module_basic/config/refresh_config.json

@@ -0,0 +1 @@
+{"1":{"level_float":[-2,0]},"2":{"level_float":[0,2]}}

+ 11 - 0
assets/module_basic/config/refresh_config.json.meta

@@ -0,0 +1,11 @@
+{
+  "ver": "2.0.1",
+  "importer": "json",
+  "imported": true,
+  "uuid": "158fad0f-71f7-4430-91db-e40a1c98c6be",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {}
+}

+ 23 - 0
assets/module_basic/table/Tablerefresh_config.ts

@@ -0,0 +1,23 @@
+
+import { JsonUtil } from "db://assets/core_tgx/base/utils/JsonUtil";
+
+export class Tablerefresh_config {
+    static TableName: string = "refresh_config";
+
+    private data: any;
+
+    init(id: number) {
+        const table = JsonUtil.get(Tablerefresh_config.TableName);
+        this.data = table[id];
+        this.id = id;
+    }
+
+    /** 编号【KEY】 */
+    id: number = 0;
+
+    /** 等级浮动 */
+    get level_float(): any {
+        return this.data.level_float;
+    }
+}
+    

+ 9 - 0
assets/module_basic/table/Tablerefresh_config.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "e7e8e552-18ce-4da5-8d39-b03e0e0f9926",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 30 - 29
assets/module_storm_sunder/Script/Component/TornadoAIComponent.ts

@@ -131,7 +131,8 @@ export class TornadoAIComponent extends TornadoComponent {
             this.setPositionByObstacle(event, () => {
                 this.decideAction();
             });
-        } else if (event.otherCollider.getGroup() === 1 << 3) {
+        }
+        else if (event.otherCollider.getGroup() === 1 << 3) {
             if (event.otherCollider.node.name == 'radiusTigger') return;
 
             const otherCollider = event.otherCollider;
@@ -163,34 +164,34 @@ export class TornadoAIComponent extends TornadoComponent {
         if (GameMgr.inst.getGameStatus() != GameStatus.Playing) return;
         super.onTriggerStay(event);
 
-        const otherCollider = event.otherCollider;
-        if (event.otherCollider.getGroup() === 1 << 3) {
-            const targetTornado = otherCollider.node.parent.getComponent(TornadoComponent);
-            if (!targetTornado) return;
-
-            if (event.selfCollider.node.name == 'RigibodyStorm') {
-                if (event.otherCollider.node.name == 'RigibodyStorm') {
-                    const distance = Vec3.distance(event.selfCollider.node.worldPosition, otherCollider.node.worldPosition);
-
-                    // 增加碰撞检测的容差范围
-                    const collisionThreshold = 3;  // 增加检测范围
-                    if (distance <= collisionThreshold) {
-                        // 添加额外的速度检查,确保不会因为速度太快而错过碰撞
-                        const relativeSpeed = Math.abs(this.speed - targetTornado.speed);
-                        const minSpeedThreshold = 5;  // 最小速度阈值
-
-                        if (relativeSpeed >= minSpeedThreshold || distance <= 1.5) {  // 如果速度差够大或距离非常近
-                            const isAI = targetTornado.ai;
-                            if (this.currentLv > targetTornado.currentLv && !isAI) {
-                                console.log(`AI 击杀玩家!!!`);
-                                GameMgr.inst.isWin = false;
-                                GameMgr.inst.setGameStatus(GameStatus.Revive);
-                            }
-                        }
-                    }
-                }
-            }
-        }
+        // const otherCollider = event.otherCollider;
+        // if (event.otherCollider.getGroup() === 1 << 3) {
+        //     const targetTornado = otherCollider.node.parent.getComponent(TornadoComponent);
+        //     if (!targetTornado) return;
+
+        //     if (event.selfCollider.node.name == 'RigibodyStorm') {
+        //         if (event.otherCollider.node.name == 'RigibodyStorm') {
+        //             const distance = Vec3.distance(event.selfCollider.node.worldPosition, otherCollider.node.worldPosition);
+
+        //             // 增加碰撞检测的容差范围
+        //             const collisionThreshold = 3;  // 增加检测范围
+        //             if (distance <= collisionThreshold) {
+        //                 // 添加额外的速度检查,确保不会因为速度太快而错过碰撞
+        //                 const relativeSpeed = Math.abs(this.speed - targetTornado.speed);
+        //                 const minSpeedThreshold = 5;  // 最小速度阈值
+
+        //                 if (relativeSpeed >= minSpeedThreshold || distance <= 1.5) {  // 如果速度差够大或距离非常近
+        //                     const isAI = targetTornado.ai;
+        //                     if (this.currentLv > targetTornado.currentLv && !isAI) {
+        //                         console.log(`AI 击杀玩家!!!`);
+        //                         GameMgr.inst.isWin = false;
+        //                         GameMgr.inst.setGameStatus(GameStatus.Revive);
+        //                     }
+        //                 }
+        //             }
+        //         }
+        //     }
+        // }
     }
 
     protected addExpByKill() {