Kziwws 1 settimana fa
parent
commit
1bcb5131ca

+ 1 - 1
assets/data/csv/levels.csv

@@ -2,7 +2,7 @@ ID,关卡名称,名字多语言,关卡任务,任务多语言,地图,玩家点位
 敌人类型_属性",敌人射击精准度,,,,,,,,,
 number,string,string,string,string,string,number,number,string,string,string,string,number,,,,,,,,,
 id,name,name_lang,task,task_lang,map,point,coefficient,reward_1,reward_2,unlock,dispose,precision,,,,,,,,,
-1,任务1,Task1,击杀所有敌军,Kill all the enemy troops,map1,1,0,1001_150,1001_30,100016|1/10,10001_1|10002_2|10003_3|20002_1|20003_1,0.2,,10001_5|10002_1,,10001_1|10002_2|10003_3|20002_1|20003_1,,,,,20003_1
+1,任务1,Task1,击杀所有敌军,Kill all the enemy troops,map1,1,0,1001_150,1001_30,100016|1/10,20003_1,0.2,,10001_5|10002_1,,10001_1|10002_2|10003_3|20002_1|20003_1,,,,,20003_1
 2,任务2,Task2,击杀所有敌军,Kill all the enemy troops,map1,2,0,1001_200,1001_30,100016|2/10,10001_3|10002_3,0.2,,,,,,,,,
 3,任务3,Task3,击杀所有敌军,Kill all the enemy troops,map1,3,0,1001_250,1001_30,100016|3/10,10001_4|10002_2|10003_1,0.2,,,,,,,,,
 4,任务4,Task4,击杀所有敌军,Kill all the enemy troops,map1,4,0.1,1001_300,1001_30,100016|4/10,10001_5|10002_3|10003_1,0.2,,,,,,,,,

+ 59 - 0
assets/fbx/mat/base/green.mtl

@@ -0,0 +1,59 @@
+{
+  "__type__": "cc.Material",
+  "_name": "",
+  "_objFlags": 0,
+  "__editorExtras__": {},
+  "_native": "",
+  "_effectAsset": {
+    "__uuid__": "a3cd009f-0ab0-420d-9278-b9fdab939bbc",
+    "__expectedType__": "cc.EffectAsset"
+  },
+  "_techIdx": 0,
+  "_defines": [
+    {},
+    {},
+    {}
+  ],
+  "_states": [
+    {
+      "rasterizerState": {},
+      "depthStencilState": {},
+      "blendState": {
+        "targets": [
+          {}
+        ]
+      }
+    },
+    {
+      "rasterizerState": {},
+      "depthStencilState": {},
+      "blendState": {
+        "targets": [
+          {}
+        ]
+      }
+    },
+    {
+      "rasterizerState": {},
+      "depthStencilState": {},
+      "blendState": {
+        "targets": [
+          {}
+        ]
+      }
+    }
+  ],
+  "_props": [
+    {
+      "mainColor": {
+        "__type__": "cc.Color",
+        "r": 125,
+        "g": 72,
+        "b": 225,
+        "a": 255
+      }
+    },
+    {},
+    {}
+  ]
+}

+ 1 - 0
assets/fbx/mat/base/green.mtl.meta

@@ -0,0 +1 @@
+{"ver":"1.0.21","importer":"material","imported":true,"uuid":"4f05b421-9dbe-4812-9458-bff13b2b26b4","files":[".json"],"subMetas":{},"userData":{}}

+ 35 - 0
assets/fbx/mat/base/purple.mtl

@@ -0,0 +1,35 @@
+{
+  "__type__": "cc.Material",
+  "_name": "",
+  "_objFlags": 0,
+  "_native": "",
+  "_effectAsset": {
+    "__uuid__": "a3cd009f-0ab0-420d-9278-b9fdab939bbc"
+  },
+  "_techIdx": 0,
+  "_defines": [
+    {}
+  ],
+  "_states": [
+    {
+      "rasterizerState": {},
+      "depthStencilState": {},
+      "blendState": {
+        "targets": [
+          {}
+        ]
+      }
+    }
+  ],
+  "_props": [
+    {
+      "mainColor": {
+        "__type__": "cc.Color",
+        "r": 253,
+        "g": 0,
+        "b": 0,
+        "a": 255
+      }
+    }
+  ]
+}

+ 1 - 0
assets/fbx/mat/base/purple.mtl.meta

@@ -0,0 +1 @@
+{"ver":"1.0.21","importer":"material","imported":true,"uuid":"1df23d83-4bb5-4baf-b1b8-c8cf4898cd92","files":[".json"],"subMetas":{},"userData":{}}

File diff suppressed because it is too large
+ 167 - 858
assets/model/scenePrb.scene


BIN
assets/model/坦克动画/tank_gongji.fbx


+ 43 - 64
assets/model/坦克动画/tank_gongji.fbx.meta

@@ -7,22 +7,6 @@
     "__original-animation-0.cconb"
   ],
   "subMetas": {
-    "55094": {
-      "importer": "gltf-material",
-      "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@55094",
-      "displayName": "",
-      "id": "55094",
-      "name": "tietu.material",
-      "userData": {
-        "gltfIndex": 0
-      },
-      "ver": "1.0.14",
-      "imported": true,
-      "files": [
-        ".json"
-      ],
-      "subMetas": {}
-    },
     "90438": {
       "importer": "gltf-mesh",
       "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@90438",
@@ -31,7 +15,7 @@
       "name": "tanke.mesh",
       "userData": {
         "gltfIndex": 0,
-        "triangleCount": 200
+        "triangleCount": 488
       },
       "ver": "1.1.1",
       "imported": true,
@@ -59,24 +43,6 @@
       ],
       "subMetas": {}
     },
-    "07d75": {
-      "importer": "gltf-mesh",
-      "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@07d75",
-      "displayName": "",
-      "id": "07d75",
-      "name": "立方体.001.mesh",
-      "userData": {
-        "gltfIndex": 2,
-        "triangleCount": 216
-      },
-      "ver": "1.1.1",
-      "imported": true,
-      "files": [
-        ".bin",
-        ".json"
-      ],
-      "subMetas": {}
-    },
     "5b587": {
       "importer": "gltf-mesh",
       "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@5b587",
@@ -84,7 +50,7 @@
       "id": "5b587",
       "name": "立方体.005.mesh",
       "userData": {
-        "gltfIndex": 3,
+        "gltfIndex": 2,
         "triangleCount": 216
       },
       "ver": "1.1.1",
@@ -95,33 +61,15 @@
       ],
       "subMetas": {}
     },
-    "49b7c": {
+    "769bf": {
       "importer": "gltf-mesh",
-      "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@49b7c",
+      "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@769bf",
       "displayName": "",
-      "id": "49b7c",
-      "name": "柱体.mesh",
+      "id": "769bf",
+      "name": "立方体.008.mesh",
       "userData": {
-        "gltfIndex": 4,
-        "triangleCount": 144
-      },
-      "ver": "1.1.1",
-      "imported": true,
-      "files": [
-        ".bin",
-        ".json"
-      ],
-      "subMetas": {}
-    },
-    "9d07e": {
-      "importer": "gltf-mesh",
-      "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@9d07e",
-      "displayName": "",
-      "id": "9d07e",
-      "name": "柱体.003.mesh",
-      "userData": {
-        "gltfIndex": 5,
-        "triangleCount": 144
+        "gltfIndex": 3,
+        "triangleCount": 216
       },
       "ver": "1.1.1",
       "imported": true,
@@ -177,6 +125,38 @@
       ],
       "subMetas": {}
     },
+    "8ac71": {
+      "importer": "gltf-material",
+      "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@8ac71",
+      "displayName": "",
+      "id": "8ac71",
+      "name": "tietu-0.material",
+      "userData": {
+        "gltfIndex": 0
+      },
+      "ver": "1.0.14",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "6f707": {
+      "importer": "gltf-material",
+      "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@6f707",
+      "displayName": "",
+      "id": "6f707",
+      "name": "tietu-1.material",
+      "userData": {
+        "gltfIndex": 1
+      },
+      "ver": "1.0.14",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
     "c6cd8": {
       "importer": "gltf-scene",
       "uuid": "0fa1a531-f3fd-455e-b1ab-fdac61179591@c6cd8",
@@ -242,17 +222,16 @@
       "meshes": [
         "0fa1a531-f3fd-455e-b1ab-fdac61179591@90438",
         "0fa1a531-f3fd-455e-b1ab-fdac61179591@1650e",
-        "0fa1a531-f3fd-455e-b1ab-fdac61179591@07d75",
         "0fa1a531-f3fd-455e-b1ab-fdac61179591@5b587",
-        "0fa1a531-f3fd-455e-b1ab-fdac61179591@49b7c",
-        "0fa1a531-f3fd-455e-b1ab-fdac61179591@9d07e"
+        "0fa1a531-f3fd-455e-b1ab-fdac61179591@769bf"
       ],
       "skeletons": [],
       "textures": [
         "0fa1a531-f3fd-455e-b1ab-fdac61179591@7d6ab"
       ],
       "materials": [
-        "0fa1a531-f3fd-455e-b1ab-fdac61179591@55094"
+        "0fa1a531-f3fd-455e-b1ab-fdac61179591@8ac71",
+        "0fa1a531-f3fd-455e-b1ab-fdac61179591@6f707"
       ],
       "scenes": [
         "0fa1a531-f3fd-455e-b1ab-fdac61179591@c6cd8"

+ 1 - 1
assets/prefabs/enemy/enemy.prefab

@@ -142281,7 +142281,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 0,
+      "y": 0.051,
       "z": 0
     },
     "_lrot": {

File diff suppressed because it is too large
+ 287 - 281
assets/prefabs/map/map1.prefab


+ 33 - 16
assets/scripts/game/GMap.ts

@@ -10,6 +10,8 @@ const { ccclass, property } = _decorator;
 export class AmbushPoint {
     //埋伏点位置节点数组
     public standPosArr: Vec3[] = [];
+    //中间路径节点
+    public roadPosArr: Vec3[] = [];
     //掩体点位置节点
     public ambushPosArr: Vec3[] = [];
     //逃跑点位置节点
@@ -61,21 +63,34 @@ export class GMap extends BaseExp {
      * 解析埋伏点
      */
     private parseAmbushPoints() {
-        this.ambushPoints = this.ambush_points.children.map(ambushNode => {
-            const point = new AmbushPoint();
-            point.isVacancy = false;
-            //从节点结构获取坐标配置
-            point.standPosArr = ambushNode.children
-                .filter(e => e.name.startsWith('stand_'))
-                .map(node => node.worldPosition.clone()); 
-            point.ambushPosArr = ambushNode.children
-                .filter(e => e.name.startsWith('bunker_')) 
-                .map(node => node.worldPosition.clone()); 
-            point.escapePosArr = ambushNode.children
-                .filter(e => e.name.startsWith('escape_')) 
-                .map(node => node.worldPosition.clone()); 
-            return point;
-        });
+        this.ambushPoints = this.ambush_points.children
+            .filter(e=>e.active)
+            .map(ambushNode => {
+                const point = new AmbushPoint();
+                point.isVacancy = false;
+                //从节点结构获取坐标配置
+                point.standPosArr = ambushNode.children
+                    .filter(e => e.name.startsWith('stand_'))
+                    .map(node => node.worldPosition.clone()); 
+                point.roadPosArr = ambushNode.children
+                    .filter(e => e.name.startsWith('road_'))
+                    .sort((a, b) => {
+                        //提取数字部分(兼容 road_1 / road_01 / road_001 等所有情况)
+                        const getNumber = (name: string) => {
+                            const numPart = name.split('_').pop(); // 取最后一段
+                            return parseInt(numPart || '0', 10);   // 自动忽略前导零
+                        };
+                        return getNumber(a.name) - getNumber(b.name); // 按数值升序
+                    })
+                    .map(node => node.worldPosition.clone()); 
+                point.ambushPosArr = ambushNode.children
+                    .filter(e => e.name.startsWith('bunker_')) 
+                    .map(node => node.worldPosition.clone()); 
+                point.escapePosArr = ambushNode.children
+                    .filter(e => e.name.startsWith('escape_')) 
+                    .map(node => node.worldPosition.clone()); 
+                return point;
+            });
     }
 
     /**
@@ -96,6 +111,8 @@ export class GMap extends BaseExp {
         const ambush: AmbushPoint = this.getAmbushClas();
         ambush.isVacancy = true;
         eData.ambush = ambush;
+        //查找中间路径点
+        paths = paths.concat(ambush.roadPosArr);
         //随机一个站立点到最后坐标
         const endPos:Vec3 = Utils.randomArray(ambush.standPosArr)[0];
         endPos.x += Utils.getRandomFloat(1,0.2);
@@ -122,7 +139,7 @@ export class GMap extends BaseExp {
             //随机返回一个可用埋伏点
             return Utils.randomArray(availablePoints)[0];
         }
-        // 当所有点位都被占用时,随机返回任意一个
+        //当所有点位都被占用时,随机返回任意一个
         if(this.ambushPoints.length > 0) {
             return Utils.randomArray(this.ambushPoints)[0];
         }

+ 3 - 2
assets/scripts/items/base/BulletBase.ts

@@ -25,11 +25,12 @@ export class BulletBase extends Component {
     /**
      * 递归查找父节点直到找到名字为 "enemy" 的节点
      * @param startNode 起始查找的节点
+     * @param objOrCtor 要查找的对象或构造函数
      * @returns 找到的 Enemy 节点(未找到返回 null)
      */
-    public findEnemyNode(startNode: Node): Node | null {
+    public findEnemyNode(startNode: Node,objOrCtor: any): Node | null {
         let currentNode: Node | null = startNode;
-        const clsName: string = js.getClassName(Enemy);
+        const clsName: string = js.getClassName(objOrCtor);
         let nodeName: string = clsName.charAt(0).toLowerCase() + clsName.slice(1);
         while (currentNode) {//匹配节点名字为enemy
             if (currentNode.name == nodeName) {

+ 11 - 3
assets/scripts/items/player/Bullet1.ts

@@ -6,6 +6,7 @@ import { BulletBase } from '../base/BulletBase';
 import { Enemy, EPartType } from '../../game/Enemy';
 import { PoolManager } from '../../core/manager/PoolManager';
 import MsgHints from '../../utils/MsgHints';
+import { Sundries } from '../../game/Sundries';
 const { ccclass, property } = _decorator;
 
 //玩家所用子弹 98k m24 awm BarrettM82A1 重狙子弹
@@ -81,11 +82,12 @@ export class Bullet1 extends BulletBase {
         if (isHit && phy.raycastResults.length > 0) {
             let result:PhysicsRayResult = phy.raycastResults[0];   
             this.addImpact(result);
-            const enemyNode: Node = this.findEnemyNode(result.collider.node);
+            let attack: number = this.gunBase.data.attack;
+            const name: string = result.collider.node.name;
+            //查询是否打到的是敌人
+            const enemyNode: Node = this.findEnemyNode(result.collider.node,Enemy);
             if(enemyNode){
-                const name: string = result.collider.node.name;
                 let e: Enemy = enemyNode.getComponent(Enemy);
-                let attack: number = this.gunBase.data.attack;
                 //爆头击杀
                 let isHeadShot:boolean = false;
                 if(name == EPartType.head){
@@ -109,6 +111,12 @@ export class Bullet1 extends BulletBase {
                 }else{
                     e.subHP(attack,this.gunBase.data,isHeadShot);
                 }
+            }else{//查询是否打的是杂物
+                const sundrieNode: Node = this.findEnemyNode(result.collider.node,Sundries);
+                if(sundrieNode){
+                    let sundrie: Sundries = sundrieNode.getComponent(Sundries);
+                    sundrie.subHP(attack,this.gunBase.data);
+                }
             }
             //自动回收了子弹
             this.autoRecycle();

Some files were not shown because too many files changed in this diff