Explorar el Código

修改子弹攻击力

zhoupeng hace 1 año
padre
commit
11e43f75bf

+ 48 - 396
airPlay/assets/Scene/game.fire

@@ -75,19 +75,19 @@
         "__id__": 5
       },
       {
-        "__id__": 46
+        "__id__": 34
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 48
+        "__id__": 36
       },
       {
-        "__id__": 49
+        "__id__": 37
       },
       {
-        "__id__": 50
+        "__id__": 38
       }
     ],
     "_prefab": null,
@@ -251,25 +251,25 @@
         "__id__": 8
       },
       {
-        "__id__": 34
+        "__id__": 22
       },
       {
-        "__id__": 36
+        "__id__": 24
       },
       {
-        "__id__": 38
+        "__id__": 26
       },
       {
-        "__id__": 40
+        "__id__": 28
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 44
+        "__id__": 32
       },
       {
-        "__id__": 45
+        "__id__": 33
       }
     ],
     "_prefab": null,
@@ -378,19 +378,19 @@
         "__id__": 9
       },
       {
-        "__id__": 15
+        "__id__": 12
       },
       {
-        "__id__": 21
+        "__id__": 15
       },
       {
-        "__id__": 27
+        "__id__": 18
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 33
+        "__id__": 21
       }
     ],
     "_prefab": null,
@@ -456,15 +456,6 @@
       },
       {
         "__id__": 11
-      },
-      {
-        "__id__": 12
-      },
-      {
-        "__id__": 13
-      },
-      {
-        "__id__": 14
       }
     ],
     "_prefab": null,
@@ -479,7 +470,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 500,
-      "height": 1136
+      "height": 1500
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -515,84 +506,6 @@
     "groupIndex": 1,
     "_id": "6dMqOg9ApKSZpa8XF6aH+o"
   },
-  {
-    "__type__": "cc.RigidBody",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 9
-    },
-    "_enabled": true,
-    "_type": 0,
-    "_allowSleep": true,
-    "_gravityScale": 1,
-    "_linearDamping": 0,
-    "_angularDamping": 0,
-    "_linearVelocity": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_angularVelocity": 0,
-    "_fixedRotation": false,
-    "enabledContactListener": false,
-    "bullet": false,
-    "awakeOnLoad": true,
-    "_id": "8dOpytbm1H7bIexpwxfSJt"
-  },
-  {
-    "__type__": "cc.Widget",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 9
-    },
-    "_enabled": true,
-    "alignMode": 1,
-    "_target": null,
-    "_alignFlags": 5,
-    "_left": 320,
-    "_right": -220,
-    "_top": 0,
-    "_bottom": 0,
-    "_verticalCenter": 0,
-    "_horizontalCenter": 0,
-    "_isAbsLeft": true,
-    "_isAbsRight": true,
-    "_isAbsTop": true,
-    "_isAbsBottom": true,
-    "_isAbsHorizontalCenter": true,
-    "_isAbsVerticalCenter": true,
-    "_originalWidth": 0,
-    "_originalHeight": 1136,
-    "_id": "72hAu/yQ5LlpEtk80v6zKU"
-  },
-  {
-    "__type__": "cc.PhysicsBoxCollider",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 9
-    },
-    "_enabled": true,
-    "tag": 0,
-    "_density": 1,
-    "_sensor": false,
-    "_friction": 0.2,
-    "_restitution": 0,
-    "body": null,
-    "_offset": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_size": {
-      "__type__": "cc.Size",
-      "width": 500,
-      "height": 1500
-    },
-    "_id": "92eM1J9VBGQoaQZ1sTxUg7"
-  },
   {
     "__type__": "3491dCwpnhFEqX9BL4D2ZCF",
     "_name": "",
@@ -612,13 +525,13 @@
       "__id__": 9
     },
     "_enabled": true,
-    "_draw_collide": false,
+    "_draw_collide": true,
     "_collide_shape": 1,
     "collide_group_id": 6,
     "_radius": 50,
     "_size": {
       "__type__": "cc.Size",
-      "width": 40,
+      "width": 500,
       "height": 1500
     },
     "_polygon_points": [
@@ -667,19 +580,10 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 16
-      },
-      {
-        "__id__": 17
-      },
-      {
-        "__id__": 18
-      },
-      {
-        "__id__": 19
+        "__id__": 13
       },
       {
-        "__id__": 20
+        "__id__": 14
       }
     ],
     "_prefab": null,
@@ -694,7 +598,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 500,
-      "height": 1136
+      "height": 1500
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -730,90 +634,12 @@
     "groupIndex": 1,
     "_id": "2aEw+ndExIVavH8EZaPeaa"
   },
-  {
-    "__type__": "cc.Widget",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 15
-    },
-    "_enabled": true,
-    "alignMode": 1,
-    "_target": null,
-    "_alignFlags": 5,
-    "_left": -40,
-    "_right": 0,
-    "_top": 0,
-    "_bottom": 0,
-    "_verticalCenter": 0,
-    "_horizontalCenter": 0,
-    "_isAbsLeft": true,
-    "_isAbsRight": true,
-    "_isAbsTop": true,
-    "_isAbsBottom": true,
-    "_isAbsHorizontalCenter": true,
-    "_isAbsVerticalCenter": true,
-    "_originalWidth": 0,
-    "_originalHeight": 1136,
-    "_id": "b4+wFerMJFFIafOqrYX7De"
-  },
-  {
-    "__type__": "cc.RigidBody",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 15
-    },
-    "_enabled": true,
-    "_type": 0,
-    "_allowSleep": true,
-    "_gravityScale": 1,
-    "_linearDamping": 0,
-    "_angularDamping": 0,
-    "_linearVelocity": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_angularVelocity": 0,
-    "_fixedRotation": false,
-    "enabledContactListener": false,
-    "bullet": false,
-    "awakeOnLoad": true,
-    "_id": "c9aWOYcepK35sEsANzvFBP"
-  },
-  {
-    "__type__": "cc.PhysicsBoxCollider",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 15
-    },
-    "_enabled": true,
-    "tag": 0,
-    "_density": 1,
-    "_sensor": false,
-    "_friction": 0.2,
-    "_restitution": 0,
-    "body": null,
-    "_offset": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_size": {
-      "__type__": "cc.Size",
-      "width": 500,
-      "height": 1500
-    },
-    "_id": "238KfcmJFE05PBolZSfWtT"
-  },
   {
     "__type__": "3491dCwpnhFEqX9BL4D2ZCF",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 15
+      "__id__": 12
     },
     "_enabled": true,
     "auto_update_point": true,
@@ -824,7 +650,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 15
+      "__id__": 12
     },
     "_enabled": true,
     "_draw_collide": false,
@@ -833,7 +659,7 @@
     "_radius": 50,
     "_size": {
       "__type__": "cc.Size",
-      "width": 40,
+      "width": 500,
       "height": 1500
     },
     "_polygon_points": [
@@ -882,19 +708,10 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 22
-      },
-      {
-        "__id__": 23
-      },
-      {
-        "__id__": 24
-      },
-      {
-        "__id__": 25
+        "__id__": 16
       },
       {
-        "__id__": 26
+        "__id__": 17
       }
     ],
     "_prefab": null,
@@ -945,90 +762,12 @@
     "groupIndex": 1,
     "_id": "53Zzw7QZtOLrGmUSZXu1Er"
   },
-  {
-    "__type__": "cc.Widget",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 21
-    },
-    "_enabled": true,
-    "alignMode": 1,
-    "_target": null,
-    "_alignFlags": 1,
-    "_left": 0,
-    "_right": 0,
-    "_top": -139.962,
-    "_bottom": 0,
-    "_verticalCenter": 0,
-    "_horizontalCenter": 0,
-    "_isAbsLeft": true,
-    "_isAbsRight": true,
-    "_isAbsTop": true,
-    "_isAbsBottom": true,
-    "_isAbsHorizontalCenter": true,
-    "_isAbsVerticalCenter": true,
-    "_originalWidth": 0,
-    "_originalHeight": 0,
-    "_id": "c5MT+y9sJCZok9qHe5k39/"
-  },
-  {
-    "__type__": "cc.RigidBody",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 21
-    },
-    "_enabled": true,
-    "_type": 0,
-    "_allowSleep": false,
-    "_gravityScale": 1,
-    "_linearDamping": 0,
-    "_angularDamping": 0,
-    "_linearVelocity": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_angularVelocity": 0,
-    "_fixedRotation": false,
-    "enabledContactListener": false,
-    "bullet": false,
-    "awakeOnLoad": true,
-    "_id": "d6hTacQgVNFZTkw8jfUxCo"
-  },
-  {
-    "__type__": "cc.PhysicsBoxCollider",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 21
-    },
-    "_enabled": true,
-    "tag": 0,
-    "_density": 1,
-    "_sensor": false,
-    "_friction": 0.2,
-    "_restitution": 0,
-    "body": null,
-    "_offset": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_size": {
-      "__type__": "cc.Size",
-      "width": 1500,
-      "height": 40
-    },
-    "_id": "78HZerWxJPII2Sx9hi6lgh"
-  },
   {
     "__type__": "3491dCwpnhFEqX9BL4D2ZCF",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 21
+      "__id__": 15
     },
     "_enabled": true,
     "auto_update_point": true,
@@ -1039,7 +778,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 21
+      "__id__": 15
     },
     "_enabled": true,
     "_draw_collide": false,
@@ -1097,19 +836,10 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 28
-      },
-      {
-        "__id__": 29
-      },
-      {
-        "__id__": 30
-      },
-      {
-        "__id__": 31
+        "__id__": 19
       },
       {
-        "__id__": 32
+        "__id__": 20
       }
     ],
     "_prefab": null,
@@ -1160,90 +890,12 @@
     "groupIndex": 1,
     "_id": "4cvyRAjzRLYLC/5GkzzOmX"
   },
-  {
-    "__type__": "cc.Widget",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 27
-    },
-    "_enabled": true,
-    "alignMode": 1,
-    "_target": null,
-    "_alignFlags": 4,
-    "_left": 0,
-    "_right": 0,
-    "_top": 0,
-    "_bottom": -128.40499999999997,
-    "_verticalCenter": 0,
-    "_horizontalCenter": 0,
-    "_isAbsLeft": true,
-    "_isAbsRight": true,
-    "_isAbsTop": true,
-    "_isAbsBottom": true,
-    "_isAbsHorizontalCenter": true,
-    "_isAbsVerticalCenter": true,
-    "_originalWidth": 0,
-    "_originalHeight": 0,
-    "_id": "dcBOTUO5NI34U6WX+61W1v"
-  },
-  {
-    "__type__": "cc.RigidBody",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 27
-    },
-    "_enabled": true,
-    "_type": 0,
-    "_allowSleep": false,
-    "_gravityScale": 1,
-    "_linearDamping": 0,
-    "_angularDamping": 0,
-    "_linearVelocity": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_angularVelocity": 0,
-    "_fixedRotation": true,
-    "enabledContactListener": false,
-    "bullet": false,
-    "awakeOnLoad": true,
-    "_id": "7ai/4D0wBIlZtTLD9sl+Qz"
-  },
-  {
-    "__type__": "cc.PhysicsBoxCollider",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 27
-    },
-    "_enabled": true,
-    "tag": 0,
-    "_density": 1,
-    "_sensor": false,
-    "_friction": 0.2,
-    "_restitution": 0,
-    "body": null,
-    "_offset": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_size": {
-      "__type__": "cc.Size",
-      "width": 640,
-      "height": 40
-    },
-    "_id": "89Cp4+lYVJnozfhx/bHFRQ"
-  },
   {
     "__type__": "3491dCwpnhFEqX9BL4D2ZCF",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 27
+      "__id__": 18
     },
     "_enabled": true,
     "auto_update_point": true,
@@ -1254,7 +906,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 27
+      "__id__": 18
     },
     "_enabled": true,
     "_draw_collide": false,
@@ -1335,7 +987,7 @@
       "__id__": 5
     },
     "_prefab": {
-      "__id__": 35
+      "__id__": 23
     },
     "_name": "@player",
     "_active": true,
@@ -1366,7 +1018,7 @@
   {
     "__type__": "cc.PrefabInfo",
     "root": {
-      "__id__": 34
+      "__id__": 22
     },
     "asset": {
       "__uuid__": "e7a4df83-43eb-4dd7-9347-a5402b7e33f8"
@@ -1385,7 +1037,7 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 37
+        "__id__": 25
       }
     ],
     "_prefab": null,
@@ -1441,7 +1093,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 36
+      "__id__": 24
     },
     "_enabled": true,
     "alignMode": 1,
@@ -1474,7 +1126,7 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 39
+        "__id__": 27
       }
     ],
     "_prefab": null,
@@ -1530,7 +1182,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 38
+      "__id__": 26
     },
     "_enabled": true,
     "_materials": [
@@ -1569,14 +1221,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 41
+        "__id__": 29
       },
       {
-        "__id__": 42
+        "__id__": 30
       }
     ],
     "_prefab": {
-      "__id__": 43
+      "__id__": 31
     },
     "_opacity": 255,
     "_color": {
@@ -1630,7 +1282,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 40
+      "__id__": 28
     },
     "_enabled": true,
     "alignMode": 1,
@@ -1657,7 +1309,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 40
+      "__id__": 28
     },
     "_enabled": true,
     "_id": "a4i1WA1tZEX6iQd7viSwQ9"
@@ -1665,7 +1317,7 @@
   {
     "__type__": "cc.PrefabInfo",
     "root": {
-      "__id__": 40
+      "__id__": 28
     },
     "asset": {
       "__uuid__": "e7d4dc80-56d7-4cab-a629-4fb72693f56c"
@@ -1709,10 +1361,10 @@
     },
     "_enabled": true,
     "$layer_node": {
-      "__id__": 36
+      "__id__": 24
     },
     "$levelTitle_lb": {
-      "__id__": 39
+      "__id__": 27
     },
     "_id": "42TH/rHIRGfrn++JgDZxG2"
   },
@@ -1727,7 +1379,7 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 47
+        "__id__": 35
       }
     ],
     "_prefab": null,
@@ -1783,7 +1435,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 46
+      "__id__": 34
     },
     "_enabled": true,
     "alignMode": 1,
@@ -1858,7 +1510,7 @@
     },
     "_enabled": true,
     "$ui_node": {
-      "__id__": 46
+      "__id__": 34
     },
     "_id": "0b2bGzYl1FW55TsAOrqsGh"
   }

+ 1 - 1
airPlay/assets/Scene/test.ts

@@ -37,7 +37,7 @@ export default class test extends cc.Component {
         Barrage.inst.createMonsterBullet({
             worldPos: this.node.convertToWorldSpaceAR(cc.v2(0,0)),
             dirction: cc.v2(0,1),
-            atk:1,
+            atk:80,
         }, bulletItem);
     }
     

+ 22 - 21
airPlay/assets/Script/game/monster/monsterModel.ts

@@ -5,12 +5,12 @@ import { Utils } from "../common/utils";
 import { ZooId } from "../zoo/zooId";
 import { BulletPlay } from "./bulletPlay";
 
-const {ccclass, property, executeInEditMode, playOnFocus} = cc._decorator;
+const { ccclass, property, executeInEditMode, playOnFocus } = cc._decorator;
 
 @ccclass
-export class MonsterModel extends cc.Component{
-    hp:number = 1000;
-    atk:number = 100;
+export class MonsterModel extends cc.Component {
+    hp: number = 1000;
+    atk: number = 100;
 
     zooId: number;
 
@@ -19,36 +19,37 @@ export class MonsterModel extends cc.Component{
         cc.log('[MonsterModel]', this.zooId);
     }
 
-    beAttacked(harmNum: number){
+    beAttacked(harmNum: number) {
         this.hp -= harmNum;
     }
 
-    isOver(){
+    isOver() {
         return this.hp <= 0;
     }
 
-    init(id: string, level: number){
-        cc.log('[MonsterModel] [init]', `[id:${id}]-[level:${level}]`);
-        let monsterData= ConfigMgr.inst.getCfgClassById<MonsterItem>(EConfigConst.monster, id, MonsterItem);
-        let atk = Utils.pos2vec2(monsterData.data.atk);
-        let hp = Utils.pos2vec2(monsterData.data.hp);
-        
-        this.hp = hp.x + level * hp.y;
-        this.atk = atk.x + level * hp.y;
+    init(id: string, level: number) {
+        let monsterData = ConfigMgr.inst.getCfgClassById<MonsterItem>(EConfigConst.monster, id, MonsterItem);
+        let atk = Utils.strToJson(monsterData.data.atk);
+        let hp = Utils.strToJson(monsterData.data.hp);
+
+        this.hp = hp[0] + (level - 1) * hp[1];
+        this.atk = atk[0] + (level - 1) * atk[1];
+
+        cc.log('[MonsterModel] [init]', `[id:${id}]-[level:${level}]`, `[hp:${this.hp}  atk:${this.atk}]`);
     }
 
-    setBullet(data: []){
-        if(!data) return;
+    setBullet(data: []) {
+        if (!data) return;
         cc.log('[MonsterModel] [setBullet]', data);
-        
-        let len = Math.floor(data.length/2);
+
+        let len = Math.floor(data.length / 2);
         for (let index = 0; index < len; index++) {
             let cpt = this.addComponent(BulletPlay);
             cpt.monsterZooid = this.zooId;
-            cpt.init(data[1+index*2], data[2+index*2]);
-            cpt.start();            
+            cpt.init(data[1 + index * 2], data[2 + index * 2]);
+            cpt.start();
         }
-        
+
         // let cpt = this.addComponent(BulletPlay);
         // cpt.monsterZooid = this.zooId;
         // cpt.init('1001', 0);

+ 0 - 147
airPlay/assets/Script/game/monster/nest.ts

@@ -1,147 +0,0 @@
-import { ResMgr } from "../res/resMgr";
-import { ConfigConst } from "../cfg/ConfigDef";
-import { ConfigMgr } from "../cfg/configMgr";
-import { Utils } from "../common/utils";
-import MoveDest from "../update/moveDest";
-
-interface INest {
-    num: number;
-    delay: number;
-    behavior: number;
-    pos: string;
-}
-
-export interface IBehavior {
-    next: number;
-    loop: number;
-    time: number;
-    path: number;
-}
-
-interface IPath {
-    type: number;
-    value: string;
-}
-
-
-enum NestState {
-    init,
-    moving,
-}
-
-
-export class Nest {
-    data: INest;
-    parent: cc.Node;
-    selfNode: cc.Node;
-    pathData: IPath;
-
-    step: number = 0;
-    behaviors: IBehavior[];
-    state: NestState = NestState.init;
-    nextTime: number;
-
-    constructor(data, parent: cc.Node) {
-        this.data = data;
-        this.parent = parent;
-
-        let node = new cc.Node('nest');
-        node.setPosition(Utils.pos2vec2(this.data.pos));
-        parent.addChild(node);
-        this.selfNode = node;
-
-        cc.director.getScheduler().enableForTarget(this);
-
-        let behaviorId: any = this.data.behavior;
-        let arr = [];
-        while (behaviorId != '' && behaviorId > 0) {
-            let bdata = ConfigMgr.inst.getCfgById(ConfigConst.behavior, behaviorId) as IBehavior;
-            arr.push(bdata);
-            behaviorId = bdata.next;
-        }
-
-        this.behaviors = arr;
-
-    }
-
-    async begin() {
-        this.step = 0;
-        await this.oneBehavior();
-        // cc.director.getScheduler().schedule(this.update, this, 1, cc.macro.REPEAT_FOREVER, 0, false);
-        cc.director.getScheduler().scheduleUpdate(this, 1, false);
-    }
-
-    update(dt) {
-        if(this.state != NestState.moving) return;
-        if(Date.now() <= this.nextTime) return;
-
-        let flag = true;
-        for (let index = 0; index < this.selfNode.children.length; index++) {
-            const element = this.selfNode.children[index];
-            let cMoveDest = element.getComponent(MoveDest);
-            if(!cMoveDest.isDone()){
-                flag = false;
-                break;
-            }
-        }
-
-        if(flag) {
-            this.nextBehavior();
-        }
-    }
-
-    end() {
-        cc.director.getScheduler().unscheduleUpdate(this);
-    }
-
-    private async oneBehavior() {
-        let bdata = this.behaviors[this.step];
-        
-        this.state = NestState.init;
-
-        if(this.step == 0){
-            let res = await ResMgr.inst.getPrefab('monster/monster');
-            for (let index = 0; index < this.data.num; index++) {
-                let node = new cc.Node('monsterPath');
-                this.selfNode.addChild(node);
-                ResMgr.inst.createNode(res, node);
-                node.addComponent(MoveDest);
-            }
-        }
-        if(bdata.path as unknown != '') {
-            let pathData = ConfigMgr.inst.getCfgById(ConfigConst.path, bdata.path) as IPath;
-            for (let index = 0; index < this.selfNode.childrenCount; index++) {
-                let node = this.selfNode.children[index];
-                let monsterNode = node.children[0];
-    
-                let monsterSize = monsterNode.getContentSize();
-        
-                let cMoveDest = node.getComponent(MoveDest);
-                let dest = Utils.pos2vec2(pathData.value);
-                cMoveDest.destination = dest;
-                cMoveDest.speed = dest.mag() / bdata.time;
-    
-                let angle = cc.v2(0, -1).signAngle(dest) / Math.PI * 180;
-                monsterNode.angle = Math.round(angle * 100) / 100;
-    
-                let normalDest = dest.normalize();
-                monsterNode.y = -index * monsterSize.height * normalDest.y;
-                monsterNode.x = -index * monsterSize.width * normalDest.x;
-            }
-        }
-
-
-        this.state = NestState.moving;
-        this.nextTime = Date.now() + bdata.time * 1000;
-    }
-
-    nextBehavior(){
-        this.step ++;
-        if(this.step >= this.behaviors.length) {
-            this.end();
-        }
-        else{
-            this.oneBehavior();
-        }
-    }
-}

+ 0 - 10
airPlay/assets/Script/game/monster/nest.ts.meta

@@ -1,10 +0,0 @@
-{
-  "ver": "1.1.0",
-  "uuid": "3bf2f8b4-591f-4f17-9b44-52c459e5aaee",
-  "importer": "typescript",
-  "isPlugin": false,
-  "loadPluginInWeb": true,
-  "loadPluginInNative": true,
-  "loadPluginInEditor": false,
-  "subMetas": {}
-}

+ 4 - 4
airPlay/assets/Script/game/nest/barrage.ts

@@ -103,7 +103,7 @@ export class Barrage extends GameSysLogic{
         let worldPos = data.worldPos;
         let dirction = data.dirction;
         let bulletCpt = bulletNode.getComponent(monsterbullet);
-        bulletCpt.atk = Utils.intDefault(bulletData.data.effect1) * data.atk;
+        bulletCpt.atk = Utils.intDefault(bulletData.data.effect1) / 100 * data.atk;
 
         bulletNode.zIndex = EBulletZ.monster;
         let moveCpt = Utils.getCpt(Move, bulletNode);
@@ -150,7 +150,7 @@ export class Barrage extends GameSysLogic{
             let bulletNode = ResMgr.inst.createNode(prefab, this.layer)
 
             let bulletCpt = bulletNode.getComponent(monsterbullet);
-            bulletCpt.atk = Utils.intDefault(bulletData.data.effect1) * data.atk;
+            bulletCpt.atk = Utils.intDefault(bulletData.data.effect1)/ 100 * data.atk;
 
             bulletNode.zIndex = EBulletZ.monster;
             let moveCpt = Utils.getCpt(Move, bulletNode);
@@ -207,7 +207,7 @@ export class Barrage extends GameSysLogic{
         bulletNode.zIndex = EBulletZ.monster;
 
         let bulletCpt = bulletNode.getComponent(monsterbullet);
-        bulletCpt.atk = Utils.intDefault(bulletData.data.effect1) * data.atk;
+        bulletCpt.atk = Utils.intDefault(bulletData.data.effect1)/ 100 * data.atk;
         
         let paramJson = Utils.strToJson(bulletData.data.param);
         let speed = Utils.intDefault(bulletData.data.speed, 500);
@@ -318,7 +318,7 @@ export class Barrage extends GameSysLogic{
             let bulletNode = ResMgr.inst.createNode(prefab, cricleNode)
             let bulletCpt = bulletNode.getComponent(monsterbullet);
 
-            bulletCpt.atk = Utils.intDefault(bulletData.data.effect1) * data.atk;
+            bulletCpt.atk = Utils.intDefault(bulletData.data.effect1)/ 100 * data.atk;
             bulletNode.zIndex = EBulletZ.monster;
 
             let dirction = leftVec2.rotate(Utils.radian(-angle / (num) * index));

+ 2 - 2
airPlay/assets/Script/game/nest/mainGame.ts

@@ -47,8 +47,8 @@ export class MainGame extends cc.Component{
         this.setup();
 
         LQCollideSystem.is_enable = true;
-        cc.director.getPhysicsManager().enabled = true; 
-        cc.director.getPhysicsManager().gravity = cc.v2(0, 0);
+        // cc.director.getPhysicsManager().enabled = true; 
+        // cc.director.getPhysicsManager().gravity = cc.v2(0, 0);
 
         await ConfigMgr.inst.init();
 

+ 3 - 24
airPlay/assets/Script/game/player.ts

@@ -23,10 +23,7 @@ export default class player extends GameLogic {
     /*===========================自动生成按钮事件开始==========================*/
 
 	/*===========================自动生成按钮事件结束==========================*/
-
-    // moveCpt: move = null;
     moveCpt: MoveDest = null;
-    // dirction: cc.Vec2 = cc.v2(0,1);
     bulletCD:number = 0.2;
     bulletCDTime: number = 0;
 
@@ -35,12 +32,6 @@ export default class player extends GameLogic {
     static PlayerAttack = false;
 
     protected onLoad(): void {
-        // this.moveCpt = this.node.getComponent(move);
-        // if(!this.moveCpt) {
-        //     this.moveCpt = this.node.addComponent(move);
-        // }
-        // this.moveCpt.speed=500;
-
         this.moveCpt = this.node.getComponent(MoveDest);
         if(!this.moveCpt) {
             this.moveCpt = this.node.addComponent(MoveDest);
@@ -52,10 +43,6 @@ export default class player extends GameLogic {
 
 
     protected onEnable(): void {
-        // 摇杆操作
-        // EventMgr.inst.on(Roker_Move, this.onRokerMove, this);
-        // EventMgr.inst.on(Roker_End, this.onRokerEnd, this);
-
         // 跟随手指移动
         EventMgr.inst.on(Touch_Start, this.onTouchStart, this);
         EventMgr.inst.on(Touch_Move, this.onTouchMove, this);
@@ -63,8 +50,9 @@ export default class player extends GameLogic {
     }
     
     protected onDisable(): void {
-        // EventMgr.inst.off(Roker_Move, this.onRokerMove, this);
-        // EventMgr.inst.off(Roker_End, this.onRokerEnd, this);
+        EventMgr.inst.off(Touch_Start, this.onTouchStart, this);
+        EventMgr.inst.off(Touch_Move, this.onTouchMove, this);
+        EventMgr.inst.off(Touch_End, this.onTouchEnd, this);
         
     }
 
@@ -76,15 +64,6 @@ export default class player extends GameLogic {
         }
     }
 
-    // onRokerMove(dirction: cc.Vec2){
-    //     this.moveCpt.dirction = dirction;
-    //     this.dirction = dirction;
-    // }
-
-    // onRokerEnd(){
-    //     this.moveCpt.dirction = cc.v2(0,0);
-    // }
-
     onTouchStart(){
         this.airStartPos = this.node.getPosition();
         this.moveCpt.destination = this.airStartPos;

+ 19 - 0
airPlay/assets/Script/game/update/moveDest.ts

@@ -22,6 +22,17 @@ export default class MoveDest extends GameLogic {
         this._destination = value;
     }
 
+    x_max: number;
+    y_max: number;
+
+    protected onLoad(): void {
+        let parentSize = this.node.parent.getContentSize();
+        let selfSize = this.node.getContentSize();
+
+        this.x_max = (parentSize.width - selfSize.width)/2;
+        this.y_max = (parentSize.height - selfSize.height)/2;
+    }
+
     gameUpdate(dt: number): void {
         let offset = this.destination.sub(this.node.getPosition());
         if(offset.mag() <= this.speed * dt) {
@@ -32,6 +43,14 @@ export default class MoveDest extends GameLogic {
             this.node.x += this.speed * dt * dirction.x;
             this.node.y += this.speed * dt * dirction.y;
         }
+
+        cc.log('@@ -- ', this.node.position.toString());
+        this.node.x = Math.max(-this.x_max , this.node.x);
+        this.node.x = Math.min(this.x_max , this.node.x);
+
+        this.node.y = Math.max(-this.y_max , this.node.y);
+        this.node.y = Math.min(this.y_max , this.node.y);
+        
     }
 
     isDone(): boolean {

+ 2 - 2
airPlay/assets/game/player.prefab

@@ -52,8 +52,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
+      "width": 77,
+      "height": 85
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 58 - 0
airPlay/build-templates/web-desktop/json/all.json

@@ -0,0 +1,58 @@
+{
+    "1":{
+        "name":"体力上限",
+        "value":""
+    },
+    "2":{
+        "name":"自然恢复1体力需要多少秒",
+        "value":""
+    },
+    "3":{
+        "name":"表示玩家关卡内战机升级所需经验值",
+        "value":""
+    },
+    "4":{
+        "name":"表示玩家关卡内母舰升级所需经验值",
+        "value":""
+    },
+    "5":{
+        "name":"玩家战机在战场的初始位置",
+        "value":""
+    },
+    "6":{
+        "name":"战机的移动速度,像素/帧",
+        "value":""
+    },
+    "7":{
+        "name":"初级母舰道具奖励的ID+美术资源ID+奖励经验",
+        "value":""
+    },
+    "8":{
+        "name":"中级母舰道具奖励的ID+美术资源ID+奖励经验",
+        "value":""
+    },
+    "9":{
+        "name":"超级母舰道具奖励的ID+美术资源ID+奖励经验",
+        "value":""
+    },
+    "10":{
+        "name":"玩家初始战机ID,对应战机表",
+        "value":""
+    },
+    "11":{
+        "name":"设置为200,除以100意为爆伤结果是2倍普通伤害值",
+        "value":""
+    },
+    "12":{
+        "name":"关卡内道具掉落后下坠速度,像素/帧",
+        "value":""
+    },
+    "13":{
+        "name":"boss出场玩家锁血时间,除100,S",
+        "value":""
+    },
+    "14":{
+        "name":"boss死亡场面冻结时间,除100,S",
+        "value":""
+    }
+}

+ 56 - 0
airPlay/build-templates/web-desktop/json/bullet.json

@@ -0,0 +1,56 @@
+{
+    "1001":{
+        "travel":1,
+        "param":"[0;0;0]",
+        "speed":500,
+        "end":"[2;300]",
+        "volume":5,
+        "effect1":10,
+        "cd":5
+    },
+    "2001":{
+        "travel":2,
+        "param":"[0;90;3]",
+        "speed":500,
+        "end":"[2;300]",
+        "volume":5,
+        "effect1":10,
+        "cd":5
+    },
+    "2002":{
+        "travel":2,
+        "param":"[0;120;7]",
+        "speed":500,
+        "end":"[2;300]",
+        "volume":5,
+        "effect1":10,
+        "cd":2
+    },
+    "2003":{
+        "travel":2,
+        "param":"[0;360;12]",
+        "speed":500,
+        "end":"[2;300]",
+        "volume":5,
+        "effect1":10,
+        "cd":1
+    },
+    "3001":{
+        "travel":3,
+        "param":"[0;30;8]",
+        "speed":500,
+        "end":"[2;300]",
+        "volume":5,
+        "effect1":10,
+        "cd":2
+    },
+    "4001":{
+        "travel":4,
+        "param":"[0;60;2003]",
+        "speed":500,
+        "end":"[2;300]",
+        "volume":5,
+        "effect1":10,
+        "cd":1
+    }
+}

+ 14 - 0
airPlay/build-templates/web-desktop/json/monster.json

@@ -0,0 +1,14 @@
+{
+    "1001":{
+        "atk":"[100;10]",
+        "hp":"[100;10]"
+    },
+    "2001":{
+        "atk":"[150;15]",
+        "hp":"[150;15]"
+    },
+    "3001":{
+        "atk":"[200;20]",
+        "hp":"[200;20]"
+    }
+}

+ 239 - 59
airPlay/build-templates/web-desktop/json/nest.json

@@ -1,82 +1,262 @@
 {
-    "1":{
-        "pos":"160;0",
+    "101":{
+        "pos":"[160;0]",
         "type":1,
-        "num":1, 
-        "time":1,
-        "delay":0,
-        "pattern":2
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[]]",
+        "time":20,
+        "num":3
     },
-    "2":{
-        "pos":"480;0",
+    "102":{
+        "pos":"[320;0]",
         "type":1,
-        "num":1,
-        "time":0,
-        "delay":0,
-        "pattern":2
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[]]",
+        "time":20,
+        "num":3
+    },
+    "103":{
+        "pos":"[480;0]",
+        "type":1,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[]]",
+        "time":20,
+        "num":3
+    },
+    "104":{
+        "pos":"[-50;900]",
+        "type":5,
+        "shape":201,
+        "atktiming":"",
+        "pattern":"[[2;1001]]",
+        "bullet":"[[2;1001;0]]",
+        "time":20,
+        "num":3
+    },
+    "105":{
+        "pos":"[690;900]",
+        "type":6,
+        "shape":202,
+        "atktiming":"",
+        "pattern":"[[2;1001]]",
+        "bullet":"[[2;1001;0]]",
+        "time":20,
+        "num":3
+    },
+    "106":{
+        "pos":"[160;0]",
+        "type":1,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[1;1001]]",
+        "time":20,
+        "num":3
+    },
+    "107":{
+        "pos":"[320;-50]",
+        "type":1,
+        "shape":102,
+        "atktiming":"",
+        "pattern":"[[1;2001]]",
+        "bullet":"[[1;2002]]",
+        "time":20,
+        "num":3
     },
-    "3":{
-        "pos":"320;0",
+    "108":{
+        "pos":"[480;0]",
         "type":1,
-        "num":1,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[1;1001]]",
+        "time":20,
+        "num":3
+    },
+    "109":{
+        "pos":"[0;300]",
+        "type":11,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[]]",
+        "time":20,
+        "num":3
+    },
+    "110":{
+        "pos":"[320;0]",
+        "type":7,
+        "shape":103,
+        "atktiming":"",
+        "pattern":"[[1;3001]]",
+        "bullet":"[[1;3001]]",
         "time":0,
-        "delay":0,
-        "pattern":1
+        "num":1
     },
-    "4":{
-        "pos":"160;0",
-        "type":2,
-        "num":1,
+    "111":{
+        "pos":"[160;0]",
+        "type":13,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[]]",
         "time":0,
-        "delay":0,
-        "pattern":3
+        "num":4
     },
-    "5":{
-        "pos":"480;0",
-        "type":2,
-        "num":1,
+    "112":{
+        "pos":"[480;0]",
+        "type":14,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[]]",
         "time":0,
-        "delay":0,
-        "pattern":3
+        "num":4
     },
-    "6":{
-        "pos":"0;200",
+    "113":{
+        "pos":"[0;200]",
         "type":3,
-        "num":4,
+        "shape":201,
+        "atktiming":"",
+        "pattern":"[[2;1001]]",
+        "bullet":"[[2;1001;0]]",
         "time":0.2,
-        "delay":0,
-        "pattern":1
+        "num":4
     },
-    "7":{
-        "pos":"640;200",
+    "114":{
+        "pos":"[640;200]",
         "type":4,
-        "num":4,
+        "shape":202,
+        "atktiming":"",
+        "pattern":"[[2;1001]]",
+        "bullet":"[[2;1001;0]]",
         "time":0.2,
-        "delay":0,
-        "pattern":1
+        "num":4
     },
-    "8":{
-        "pos":"-50;900",
-        "type":5,
-        "num":4,
-        "time":0.2,
-        "delay":0,
-        "pattern":1
+    "115":{
+        "pos":"[160;0]",
+        "type":2,
+        "shape":102,
+        "atktiming":"",
+        "pattern":"[[1;2001]]",
+        "bullet":"[[1;2001;0;3001;2]]",
+        "time":1,
+        "num":1
     },
-    "9":{
-        "pos":"690;900",
-        "type":6,
-        "num":4,
-        "time":0.2,
-        "delay":0,
-        "pattern":1
+    "116":{
+        "pos":"[480;0]",
+        "type":2,
+        "shape":102,
+        "atktiming":"",
+        "pattern":"[[1;2001]]",
+        "bullet":"[[1;2001;0;3001;2]]",
+        "time":1,
+        "num":1
     },
-    "10":{
-        "pos":"320;0",
-        "type":7,
-        "num":1,
+    "117":{
+        "pos":"[0;200]",
+        "type":8,
+        "shape":201,
+        "atktiming":"",
+        "pattern":"[[2;1001]]",
+        "bullet":"[[]]",
+        "time":20,
+        "num":3
+    },
+    "118":{
+        "pos":"[640;200]",
+        "type":9,
+        "shape":202,
+        "atktiming":"",
+        "pattern":"[[2;1001]]",
+        "bullet":"[[]]",
+        "time":20,
+        "num":3
+    },
+    "119":{
+        "pos":"[160;0]",
+        "type":15,
+        "shape":201,
+        "atktiming":"",
+        "pattern":"[[2;1001]]",
+        "bullet":"[[]]",
+        "time":0,
+        "num":4
+    },
+    "120":{
+        "pos":"[80;0]",
+        "type":1,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[1;1001]]",
+        "time":0,
+        "num":1
+    },
+    "121":{
+        "pos":"[160;-50]",
+        "type":1,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[1;1001]]",
+        "time":0,
+        "num":1
+    },
+    "122":{
+        "pos":"[480;-50]",
+        "type":1,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[1;1001]]",
+        "time":0,
+        "num":1
+    },
+    "123":{
+        "pos":"[540;0]",
+        "type":1,
+        "shape":101,
+        "atktiming":"",
+        "pattern":"[[1;1001]]",
+        "bullet":"[[1;1001]]",
+        "time":0,
+        "num":1
+    },
+    "124":{
+        "pos":"[320;0]",
+        "type":16,
+        "shape":103,
+        "atktiming":"",
+        "pattern":"[[1;3001]]",
+        "bullet":"[[1;4001]]",
+        "time":0,
+        "num":1
+    },
+    "125":{
+        "pos":"[320;0]",
+        "type":17,
+        "shape":102,
+        "atktiming":"",
+        "pattern":"[[1;2001]]",
+        "bullet":"[[1;2001]]",
+        "time":0,
+        "num":1
+    },
+    "126":{
+        "pos":"[320;0]",
+        "type":18,
+        "shape":102,
+        "atktiming":"",
+        "pattern":"[[1;2001]]",
+        "bullet":"[[1;2001]]",
         "time":0,
-        "delay":0,
-        "pattern":4
+        "num":1
     }
 }

+ 33 - 9
airPlay/build-templates/web-desktop/json/smallLevel.json

@@ -1,17 +1,41 @@
 {
     "1":{
-        "nest":"4;5"
+        "nest1":"[[101;1][102;1][103;1]]",
+        "interval2":"[5;99]",
+        "nest2":"[[104;2][105;2]]",
+        "interval3":"[5;99]",
+        "nest3":"[[106;3][107;3][108;3]]",
+        "interval4":"[5;99]",
+        "nest4":"",
+        "interval5":"[5;99]",
+        "nest5":"",
+        "interval6":"",
+        "nest6":""
     },
     "2":{
-        "nest":"1;2" 
+        "nest1":"[[109;2]]",
+        "interval2":"[2;99]",
+        "nest2":"[[110;2]]",
+        "interval3":"[5;99]",
+        "nest3":"[[111;3][112;3]]",
+        "interval4":"[5;99]",
+        "nest4":"[[113;4][114;4]]",
+        "interval5":"[3;99]",
+        "nest5":"[[115;5][116;5]]",
+        "interval6":"",
+        "nest6":""
     },
     "3":{
-        "nest":"6;7"
-    },
-    "4":{
-        "nest":"8;9"
-    },
-    "5":{
-        "nest":10
+        "nest1":"[[117;3]]",
+        "interval2":"[2;99]",
+        "nest2":"[[118;3]]",
+        "interval3":"[3;99]",
+        "nest3":"[[119;4]]",
+        "interval4":"[5;99]",
+        "nest4":"[[120;4][121;4][122;4][123;4]]",
+        "interval5":"[5;99]",
+        "nest5":"[[124;5]]",
+        "interval6":"[3;99]",
+        "nest6":"[[125;4][126;4]]"
     }
 }

+ 6 - 5
airPlay/client-editor/excel.js

@@ -34,7 +34,7 @@ let excelArray = [
     },
 ];
 
-jsonSavePath = path.join(cwd, '../preview-templates/json');
+jsonSavePath = [path.join(cwd, '../preview-templates/json'), path.join(cwd, '../build-templates/web-desktop/json')]
 
 excelArray = excelArray.map((v)=>{
     v.fullPath = path.join(cwd, v.fullPath);
@@ -123,10 +123,11 @@ for (let k in excelArray) {
                 let saveStr = JSON.stringify(jsonSaveData);
 
                 saveStr = jsonBeautifully(saveStr);
-                
-                let saveFileFullPath = path.join(jsonSavePath, itemSheet.sheet + ".json");
-                fs.writeFileSync(saveFileFullPath, saveStr);
-                _addLog("[Json]:" + saveFileFullPath);
+                jsonSavePath.forEach(element => {
+                    let saveFileFullPath = path.join(element, itemSheet.sheet + ".json");
+                    fs.writeFileSync(saveFileFullPath, saveStr);
+                    _addLog("[Json]:" + saveFileFullPath);
+                });
             }
         } else {
             _addLog("行数低于2行,无效sheet:" + itemSheet.sheet);