3 次代码提交 6ac0ba3296 ... 93d36c2225

作者 SHA1 备注 提交日期
  txq 93d36c2225 Merge branch 'master' of http://118.178.135.110:3000/fish/tower_client 6 月之前
  txq 62d7a2754c Merge branch 'master' of http://118.178.135.110:3000/fish/tower_client 6 月之前
  txq c9f8b9442e 修改战斗属性受加成影响 6 月之前

二进制
assets/package/audio/tututu.mp3


+ 2 - 2
assets/package/audio/tututu.wav.meta → assets/package/audio/tututu.mp3.meta

@@ -2,10 +2,10 @@
   "ver": "1.0.0",
   "importer": "audio-clip",
   "imported": true,
-  "uuid": "7d669d5f-ce0a-4962-8e77-c096086481ce",
+  "uuid": "cf9f1434-7833-48d0-8f3a-5df937d897bb",
   "files": [
     ".json",
-    ".wav"
+    ".mp3"
   ],
   "subMetas": {},
   "userData": {

二进制
assets/package/audio/tututu.wav


+ 260 - 0
assets/package/prefab/ui/tower/hero/bullet.prefab

@@ -0,0 +1,260 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "bullet",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "bullet",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 8
+      },
+      {
+        "__id__": 10
+      }
+    ],
+    "_prefab": {
+      "__id__": 12
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "SpriteSplash",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 4
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 10,
+      "height": 10
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "389Onq+LBMupoQoxiwCZwN"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 6
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "cehWc3/7ZFe73C6n7zuXM9"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "1eEYLApNhB7YP4yngj3unZ",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 9
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 10,
+      "height": 10
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c2aFUu6jBJg5uJ60FKMad/"
+  },
+  {
+    "__type__": "730cdxk+9xNDKpAnDy++yoT",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 11
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5cFwo9acBPVp81BFuNkJ7U"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "4cbne1jbpGk4QF3TRtbCOc",
+    "instance": null,
+    "targetOverrides": null
+  }
+]

+ 13 - 0
assets/package/prefab/ui/tower/hero/bullet.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "6dcb113f-8266-41e6-b6da-5ce194d18d3e",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "bullet"
+  }
+}

+ 193 - 47
assets/package/prefab/ui/tower/hero/role101.prefab

@@ -25,26 +25,26 @@
         "__id__": 23
       },
       {
-        "__id__": 29
+        "__id__": 35
       },
       {
-        "__id__": 33
+        "__id__": 39
       },
       {
-        "__id__": 37
+        "__id__": 43
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 43
+        "__id__": 49
       },
       {
-        "__id__": 45
+        "__id__": 51
       }
     ],
     "_prefab": {
-      "__id__": 47
+      "__id__": 53
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -518,29 +518,83 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "fightforce",
+    "_name": "btn_bg",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
       "__id__": 1
     },
+    "_children": [
+      {
+        "__id__": 24
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 30
+      },
+      {
+        "__id__": 32
+      }
+    ],
+    "_prefab": {
+      "__id__": 34
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 27.475000000000023,
+      "y": 2.576000000000022,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1.5,
+      "y": 1.5,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "fightforce",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 23
+    },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 24
+        "__id__": 25
       },
       {
-        "__id__": 26
+        "__id__": 27
       }
     ],
     "_prefab": {
-      "__id__": 28
+      "__id__": 29
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 30,
-      "y": -30,
+      "x": -0.10200000000008913,
+      "y": -0.3520000000000323,
       "z": 0
     },
     "_lrot": {
@@ -572,15 +626,15 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 23
+      "__id__": 24
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 25
+      "__id__": 26
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 18.69,
+      "width": 18,
       "height": 40
     },
     "_anchorPoint": {
@@ -600,11 +654,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 23
+      "__id__": 24
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 27
+      "__id__": 28
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -616,18 +670,18 @@
       "b": 255,
       "a": 255
     },
-    "_string": "1",
+    "_string": "99",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 26,
-    "_fontSize": 26,
+    "_actualFontSize": 11,
+    "_fontSize": 20,
     "_fontFamily": "Arial",
     "_lineHeight": 40,
-    "_overflow": 0,
-    "_enableWrapText": true,
+    "_overflow": 2,
+    "_enableWrapText": false,
     "_font": {
-      "__uuid__": "65941af8-fc7e-447d-a557-0406909c778c",
-      "__expectedType__": "cc.BitmapFont"
+      "__uuid__": "20e32a4b-c53f-43f1-afa0-30a906b3e3e8",
+      "__expectedType__": "cc.TTFFont"
     },
     "_isSystemFontUsed": false,
     "_spacingX": 0,
@@ -636,7 +690,7 @@
     "_isUnderline": false,
     "_underlineHeight": 2,
     "_cacheMode": 0,
-    "_enableOutline": false,
+    "_enableOutline": true,
     "_outlineColor": {
       "__type__": "cc.Color",
       "r": 0,
@@ -678,6 +732,92 @@
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 31
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 22,
+      "height": 22
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "01eNriUlRIqI4YW1dij2AG"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 33
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "2ef432e1-e5ce-46c9-9965-3ce7389cf07a@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "daA4gJIRBBopwyIO1aJ0Sd"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "5aSezbY4BNwrP19Qm7NDIf",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
   {
     "__type__": "cc.Node",
     "_name": "Node",
@@ -690,11 +830,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 30
+        "__id__": 36
       }
     ],
     "_prefab": {
-      "__id__": 32
+      "__id__": 38
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -731,11 +871,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 29
+      "__id__": 35
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 31
+      "__id__": 37
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -778,11 +918,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 34
+        "__id__": 40
       }
     ],
     "_prefab": {
-      "__id__": 36
+      "__id__": 42
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -819,11 +959,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 33
+      "__id__": 39
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 35
+      "__id__": 41
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -866,14 +1006,14 @@
     "_active": false,
     "_components": [
       {
-        "__id__": 38
+        "__id__": 44
       },
       {
-        "__id__": 40
+        "__id__": 46
       }
     ],
     "_prefab": {
-      "__id__": 42
+      "__id__": 48
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -910,11 +1050,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 37
+      "__id__": 43
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 39
+      "__id__": 45
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -938,11 +1078,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 37
+      "__id__": 43
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 41
+      "__id__": 47
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -1023,7 +1163,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 44
+      "__id__": 50
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1051,19 +1191,25 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 46
+      "__id__": 52
     },
     "modelSpine": {
       "__id__": 17
     },
     "levelLabel": {
-      "__id__": 26
+      "__id__": 27
+    },
+    "gunNode1": {
+      "__id__": 3
+    },
+    "gunNode2": {
+      "__id__": 7
+    },
+    "gunNode3": {
+      "__id__": 11
     },
-    "gunNode1": null,
-    "gunNode2": null,
-    "gunNode3": null,
     "clickBox": {
-      "__id__": 34
+      "__id__": 40
     },
     "_id": ""
   },

+ 14 - 14
assets/package/prefab/ui/tower/hurt.prefab

@@ -266,8 +266,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 14,
-      "height": 52.4
+      "width": 28.75,
+      "height": 40
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -298,39 +298,39 @@
     "_color": {
       "__type__": "cc.Color",
       "r": 255,
-      "g": 0,
-      "b": 0,
+      "g": 255,
+      "b": 255,
       "a": 255
     },
     "_string": "0",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
-    "_actualFontSize": 20,
-    "_fontSize": 20,
+    "_actualFontSize": 40,
+    "_fontSize": 40,
     "_fontFamily": "Arial",
     "_lineHeight": 40,
     "_overflow": 0,
     "_enableWrapText": true,
     "_font": {
-      "__uuid__": "20e32a4b-c53f-43f1-afa0-30a906b3e3e8",
-      "__expectedType__": "cc.TTFFont"
+      "__uuid__": "65941af8-fc7e-447d-a557-0406909c778c",
+      "__expectedType__": "cc.BitmapFont"
     },
     "_isSystemFontUsed": false,
     "_spacingX": 0,
     "_isItalic": false,
-    "_isBold": false,
+    "_isBold": true,
     "_isUnderline": false,
     "_underlineHeight": 2,
     "_cacheMode": 0,
-    "_enableOutline": true,
+    "_enableOutline": false,
     "_outlineColor": {
       "__type__": "cc.Color",
-      "r": 163,
-      "g": 76,
-      "b": 76,
+      "r": 0,
+      "g": 0,
+      "b": 0,
       "a": 255
     },
-    "_outlineWidth": 1,
+    "_outlineWidth": 2,
     "_enableShadow": false,
     "_shadowColor": {
       "__type__": "cc.Color",

+ 6 - 6
assets/package/prefab/ui/tower/tower.prefab

@@ -5418,8 +5418,8 @@
     },
     "_lscale": {
       "__type__": "cc.Vec3",
-      "x": 0.5,
-      "y": 0.5,
+      "x": 1,
+      "y": 1,
       "z": 1
     },
     "_mobility": 0,
@@ -5446,8 +5446,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 323.9100036621094,
-      "height": 474
+      "width": 1061.550048828125,
+      "height": 335.8599853515625
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -5483,11 +5483,11 @@
       "a": 255
     },
     "_skeletonData": {
-      "__uuid__": "e467e1c9-92d1-4e68-81aa-22571424ff2a",
+      "__uuid__": "3edda31b-9168-43f9-a212-1df27f56441d",
       "__expectedType__": "sp.SkeletonData"
     },
     "defaultSkin": "default",
-    "defaultAnimation": "stand",
+    "defaultAnimation": "stand_right",
     "_premultipliedAlpha": false,
     "_timeScale": 1,
     "_preCacheMode": 0,

+ 21 - 1
assets/script/game/common/InterfaceAddEnum.ts

@@ -129,4 +129,24 @@ export const AttrConf = {
     [AttrEnum.suck]: { type: AttrAddTypeEnum.percent, name: "吸血", desc: "吸血", url: "suck_ico" },
     [AttrEnum.thorns]: { type: AttrAddTypeEnum.percent, name: "反伤", desc: "反伤", url: "thorns_ico" },
     [AttrEnum.block]: { type: AttrAddTypeEnum.percent, name: "反伤", desc: "反伤", url: "thorns_ico" },
-}
+}
+
+//服务器端返回的英雄数据
+export interface RoleServer {
+    id: string; //英雄id 动物形象id
+    grade: number;  //星级
+    dna_lv: string;   //基因等级
+    dna_attr: { any }   //基因属性
+    equip: [];//读取状态
+    skin: [];//皮肤
+    fight_force: number;//战力
+}
+
+export interface Role extends RoleServer {
+    conf:any;//配置 RoleConf.data[rid]
+    attr: AttrBaseData;//属性
+    type:ItemEnum
+}
+
+//出战英雄数据[种族1 typeID,种族2 typeID,种族3 typeID,种族4 typeID]
+export type FightRole = [number, number, number, number]

+ 1 - 21
assets/script/game/data/RoleData.ts

@@ -1,26 +1,6 @@
-import { ItemEnum } from "../common/InterfaceAddEnum";
+import { FightRole, ItemEnum, Role } from "../common/InterfaceAddEnum";
 import { RoleConf } from "../ui/tower/conf/RoleConf";
 
-//服务器端返回的英雄数据
-export interface RoleServer {
-    id: string; //英雄id 动物形象id
-    grade: number;  //星级
-    dna_lv: string;   //基因等级
-    dna_attr: { any }   //基因属性
-    equip: [];//读取状态
-    skin: [];//皮肤
-    fight_force: number;//战力
-}
-
-export interface Role extends RoleServer {
-    conf: {};//配置
-    attr: {};//属性
-    type:ItemEnum
-}
-
-//出战英雄数据[种族1 typeID,种族2 typeID,种族3 typeID,种族4 typeID]
-export type FightRole = [number, number, number, number]
-
 class Data {
 
     private _roles: { [id: string]: Role } = {};

+ 2 - 2
assets/script/game/manager/RoleManager.ts

@@ -1,10 +1,10 @@
 import { Framework } from "../../framework/Framework";
-import { AttrBaseData, AttrConf, AttrEnum, ItemEnum } from "../common/InterfaceAddEnum";
+import { AttrBaseData, AttrConf, AttrEnum, ItemEnum, Role, RoleServer } from "../common/InterfaceAddEnum";
 import { LoginMgr } from "../common/LoginManager";
 import { FateattridConf } from "../config/FateattridConf";
 import { FateConf } from "../config/FateConf";
 import { RolegradeConf } from "../config/RolegradeConf";
-import { Role, RoleData, RoleServer } from "../data/RoleData";
+import { RoleData } from "../data/RoleData";
 import { RoleConf } from "../ui/tower/conf/RoleConf";
 import { EquipManager } from "./EquipManager";
 

+ 4 - 1
assets/script/game/manager/UnionManager.ts

@@ -7,6 +7,8 @@ import { GoodsData } from "../data/GoodsData";
 import { MailData } from "../data/MailData";
 import { RoleData } from "../data/RoleData";
 import { UserData } from "../data/UserData";
+import { BattleEventManager } from "../ui/tower/base/BattleEventManager";
+import { BattleEventTarget } from "../ui/tower/base/BattleEventUtil";
 import { RoleConf } from "../ui/tower/conf/RoleConf";
 import { EquipManager } from "./EquipManager";
 import { GoodsManager } from "./GoodsManager";
@@ -120,7 +122,8 @@ export class UnionManager {
             let role = RoleData.getRoleDataByID(rId);
             let newAttr = RoleManager.CalcRoleAttr(role);
             role.attr = newAttr;
-            Framework.event.fireEvent(GameEvent.RoleAttrChange, rId)
+            BattleEventManager.instance.fireEvent(BattleEventTarget.HeroAttr,role)
+            Framework.event.fireEvent(GameEvent.RoleAttrChange, role)
         }
     }
 

+ 32 - 28
assets/script/game/ui/tower/TowerUI.ts

@@ -25,13 +25,14 @@ import { MailManager } from '../../manager/MailManager';
 import { ViewID } from '../../../framework/config/LayerConf';
 import { MailData } from '../../data/MailData';
 import { RoleManager } from '../../manager/RoleManager';
-import { FightRole, RoleData } from '../../data/RoleData';
+import { RoleData } from '../../data/RoleData';
 import { BattleData, BattleLayoutPos, BattleLayoutScale, BattleOptsBase, BattleOptsKill, BattleOptsMerge, BattleOptsMove, BattleOptsNew, BattleOptsRemove, BattleOptsType } from '../../data/BattleData';
 import { BattleManager } from '../../manager/BattleManager';
 import { UserData } from '../../data/UserData';
 import { ResultUI } from './node/ResultUI';
 import { ChangeChapter } from './node/ChangeChapter';
 import { RewardChapter } from './node/RewardChapter';
+import { FightRole } from '../../common/InterfaceAddEnum';
 
 //地图比例尺 1:70
 let mapScale = 72;
@@ -199,7 +200,6 @@ export class TowerUI extends BaseView {
 		
 		this.battleControl = BattleControl.GetInstance()
 		BattleEventManager.instance.addEvent(BattleEventTarget.Update, this.updateDataEvent.bind(this), TowerUUID);
-
 		Framework.event.addEvent(GameEvent.BossUpdate, this.bossUpdate.bind(this),this)
 		
 		
@@ -391,7 +391,6 @@ export class TowerUI extends BaseView {
 				console.log(winStr)
 				this.bBattleOverAnimBack = false
 				this.bBattleOverMessageBack = false
-				
 				let battlesConf = BattlesConf.data[this.battlesID];
 				if(attackData.bWin &&(this.battlesID==battlesConf.BossProcess)){
 					this.changeChapterNode.getComponent(ChangeChapter).show(()=>{
@@ -430,9 +429,11 @@ export class TowerUI extends BaseView {
 				for(let index = 0; index < BattleUtil.BagListSize; index++){
 					let posData = this.attackPosList[index]
 					let key = BattleLayoutPos[index+BattleUtil.BagListSize]
+					console.log(key,index)
 					if(key){
 						if(posData && posData.hero){
 							let heroData = posData.hero.getComponent(Hero)
+							console.log(heroData.level,heroData.raceID)
 							let value = heroData.level + heroData.raceID *BattleLayoutScale
 							layout[key] = value
 						}
@@ -735,19 +736,19 @@ export class TowerUI extends BaseView {
 			}
 		}
 
-		let heroData = HeroDataPool.getObject();
-		for (let i = 0; i < BattleUtil.BagListSize; i++) {
-			let bagPos = this.bagPosList[i];
-			if(bagPos.hero){
-				let value = BattleData.layout[i];
-				let battleLayoutData = BattleManager.getDataWithLayoutValue(value)
-				bagPos.hero.position = bagPos.pos;
-				let hero = bagPos.hero.getComponent(Hero);
+		//let heroData = HeroDataPool.getObject();
+		// for (let i = 0; i < BattleUtil.BagListSize; i++) {
+		// 	let bagPos = this.bagPosList[i];
+		// 	if(bagPos.hero){
+		// 		let value = BattleData.layout[i];
+		// 		let battleLayoutData = BattleManager.getDataWithLayoutValue(value)
+		// 		bagPos.hero.position = bagPos.pos;
+		// 		let hero = bagPos.hero.getComponent(Hero);
 				
-				heroData.init(battleLayoutData.typeID,battleLayoutData.level,-1)
-				hero.resetData(heroData);
-			}
-		}
+		// 		heroData.init(RoleData.getRoleDataByID(battleLayoutData.typeID),battleLayoutData.level,-1)
+		// 		hero.resetData(heroData);
+		// 	}
+		// }
 		for (let i = 0; i < BattleUtil.AttackListSize; i++) {
 			let node = attackChildren[i];
 			if(!node){
@@ -780,15 +781,15 @@ export class TowerUI extends BaseView {
 						posData.posIndex = BattleUtil.BagListSize+i;
 						posData.pos = new Vec3(pos.x, pos.y, 0);
 						posData.posNumber = posNumber;
-						if(posData.hero){
-							let value = BattleData.layout[i+BattleUtil.BagListSize];
-							let battleLayoutData = BattleManager.getDataWithLayoutValue(value)
-							posData.hero.position = posData.pos;
-							let hero = posData.hero.getComponent(Hero);
+						// if(posData.hero){
+						// 	let value = BattleData.layout[i+BattleUtil.BagListSize];
+						// 	let battleLayoutData = BattleManager.getDataWithLayoutValue(value)
+						// 	posData.hero.position = posData.pos;
+						// 	let hero = posData.hero.getComponent(Hero);
 							
-							heroData.init(battleLayoutData.typeID,battleLayoutData.level,posNumber)
-							hero.resetData(heroData);
-						}
+						// 	heroData.init(RoleData.getRoleDataByID(battleLayoutData.typeID),battleLayoutData.level,posNumber)
+						// 	hero.resetData(heroData);
+						// }
 					}
 					this.attackPosMap.set(posNumber, posData);
 				}
@@ -807,7 +808,9 @@ export class TowerUI extends BaseView {
 			}
 			
 		}
-		HeroDataPool.putObject(heroData);
+		//HeroDataPool.putObject(heroData);
+
+		this.resetBattleLayout()
 
 		let path = "texture/tower/"+mapConf.Background+"/spriteFrame"
 
@@ -903,7 +906,7 @@ export class TowerUI extends BaseView {
 			}
 		}
 		let heroData = HeroDataPool.getObject();
-		heroData.init(heroID,1,1)
+		heroData.init(RoleData.getRoleDataByID(heroID),1,1)
 		
 		let node:Node = null;
 		if(this.heroPool[heroID] == null){
@@ -968,7 +971,7 @@ export class TowerUI extends BaseView {
 		// let heroIndex = Math.floor(Math.random() * this.loadHeroModelNum)%this.loadHeroModelNum;
 		let heroID = typeID;
 		let heroData = HeroDataPool.getObject();
-		heroData.init(heroID,level,1)
+		heroData.init(RoleData.getRoleDataByID(heroID),level,1)
 		
 		let posData = this.bagPosList[posIndex];
 		
@@ -1009,7 +1012,7 @@ export class TowerUI extends BaseView {
 		
 		posData.hero = node;
 		
-		let scale = posIndex > BattleUtil.BagListSize ? 1.2 : 1;
+		let scale = posIndex > BattleUtil.BagListSize-1 ? 1.2 : 1;
 		node.scale = v3(scale,scale,1);
 
 		node.position = posData.pos;
@@ -1281,7 +1284,7 @@ export class TowerUI extends BaseView {
 			node.parent = this.roleNode;
 		}
 		
-		node.position = pos;
+		node.position = v3(pos.x,pos.y+40,pos.z);
 		this.hurtList.push(node);
 		node.getComponent(Hurt).hurt(value,()=>{
 			this.hurtList.splice(this.hurtList.indexOf(node), 1)
@@ -1411,6 +1414,7 @@ export class TowerUI extends BaseView {
 				break;
 		}
 	}
+	
 
 	private loadHeroModel(){
 		let fightRole = RoleData.fightRole

+ 3 - 0
assets/script/game/ui/tower/base/BattleEventUtil.ts

@@ -4,7 +4,10 @@ export const TowerUUID = -1;
 //战斗消息工具类
 export enum BattleEventTarget{
     Update = "update",
+    //攻击动作事件
     HeroAction = "hero_action",
+    //英雄属性变化
+    HeroAttr = "hero_Attr",
     
 }
 export enum BattleEventType{

+ 3 - 1
assets/script/game/ui/tower/control/BattleControl.ts

@@ -1,3 +1,4 @@
+import { RoleData } from "../../../data/RoleData";
 import { BattleBase } from "../base/BattleBase";
 import { BattleEventManager } from "../base/BattleEventManager";
 import { BattleEventData_Over, BattleEventTarget, BattleEventType } from "../base/BattleEventUtil";
@@ -132,7 +133,8 @@ export class BattleControl extends BattleBase{
                         let startPosID = heroDataChange.changeValueLlist[2] 
                         let startPos = this.map.attackPosDataMap.get(startPosID)
                         if(startPos){
-                            let heroData = this.map.addHero(heroDataChange.changeValueLlist[0],heroDataChange.changeValueLlist[1],heroDataChange.changeValueLlist[2])
+                            let role = RoleData.getRoleDataByID(heroDataChange.changeValueLlist[0])
+                            let heroData = this.map.addHero(role,heroDataChange.changeValueLlist[1],heroDataChange.changeValueLlist[2])
                             startPos.hero = heroData
                         }
                         break

+ 17 - 1
assets/script/game/ui/tower/control/HeroControl.ts

@@ -1,3 +1,4 @@
+import { Role } from "../../../common/InterfaceAddEnum";
 import { BattleBase } from "../base/BattleBase";
 import { BattleEventManager } from "../base/BattleEventManager";
 import { BattleEventData_EnemyHurt, BattleEventData_HeroAction, BattleEventData_HeroAttack, BattleEventData_HeroAttackBullet, BattleEventHeroAction, BattleEventTarget, BattleEventType, HeroActionType, HurtEventState } from "../base/BattleEventUtil";
@@ -24,7 +25,9 @@ export class HeroControl extends BattleBase{
     constructor(){
         super();
         this.battleEventManager = BattleEventManager.instance
-        BattleEventManager.instance.addEvent(BattleEventTarget.HeroAction, this.heroActionEvent.bind(this), -1);
+        BattleEventManager.instance.addEvent(BattleEventTarget.HeroAction, this.heroActionEvent.bind(this), this);
+        BattleEventManager.instance.addEvent(BattleEventTarget.HeroAttr, this.heroAttrEvent.bind(this), this);
+        
     }
 
     init(){
@@ -170,4 +173,17 @@ export class HeroControl extends BattleBase{
     }
 
     
+    //属性变化事件
+    heroAttrEvent(role:Role){
+        let rid = Number(role.id)
+        this.attackPosDataMap.forEach((posData:PosData)=>{
+            let hero = posData.hero
+
+            if(hero && hero.typeID == rid){
+                hero.updateRole(role)
+            }
+        })
+    }
+
+    
 }

+ 27 - 13
assets/script/game/ui/tower/data/HeroData.ts

@@ -1,5 +1,5 @@
 
-import { RoleConf } from "../conf/RoleConf";
+import { Role } from "../../../common/InterfaceAddEnum";
 import { UptypeConf } from "../conf/UptypeConf";
 import { BattleDataPool } from "./BattleDataPool";
 import { BulletType, ObjectValueType } from "./BattleEnum";
@@ -73,23 +73,24 @@ export class HeroData extends DataBase{
     coolDown: number;
 
 
-    init(typeID:number, level:number, posID: number) {
+    init(role:Role, level:number, posID: number) {
         super._init();
         this.level = level;
-        this.typeID = typeID;
+        this.typeID = Number(role.id);
         this.posID = posID;
-        this._raceID = (typeID - typeID%HeroRaceSacle)/HeroRaceSacle
+        this._raceID = role.conf.Race
+        // let roleData = RoleData.getRoleDataByID(this.typeID)
         //读地图
         this.position = new BattleUtil.Vector2(0, 0);
-        let heroConf = RoleConf.data[typeID]
+        let heroConf = role.conf
         if (heroConf) {
             this.attackType = heroConf.AttackType;
-            this._speed = heroConf.Speed;
+            this._speed = role.attr.speed;
             this.coolDown = this._speed
             this._attackRadius = heroConf.Radius;
-            this._attackDamage = heroConf.Damage;
-            this._critical = heroConf.Critical;
-            this._criticalDamage = heroConf.CriticalDamage;
+            this._attackDamage = role.attr.attack;
+            this._critical = role.attr.crite;
+            this._criticalDamage = role.attr.critedamage;
             this.skillList = heroConf.SkillArray
 
             if(this.skillList && this.skillList.length > 0){
@@ -112,7 +113,7 @@ export class HeroData extends DataBase{
 
             }
 
-            this.upDataLevel()
+            this.updataLevel()
             return this;
         }
         return null;
@@ -159,13 +160,13 @@ export class HeroData extends DataBase{
 
     levelUp() {
         this.level++;
-        this.upDataLevel()
+        this.updataLevel()
     }
     levelTo(newLevel: number){
         this.level = newLevel;   
-        this.upDataLevel()
+        this.updataLevel()
     }
-    upDataLevel() {
+    updataLevel() {
 
         let conf = UptypeConf.data
         this._speedCur = this._speed / (conf.HeroSpeedColArr[this.level]||1);
@@ -175,6 +176,19 @@ export class HeroData extends DataBase{
         this._criticalDamageCur = this._criticalDamage;
     }
 
+    updateRole(role:Role){
+        let heroConf = role.conf
+        if (heroConf) {
+            this._speed = role.attr.speed;
+            this._attackDamage = role.attr.attack;
+            this._critical = role.attr.crite;
+            this._criticalDamage = role.attr.critedamage;
+            this.updataLevel()
+            return this;
+        }
+        return null;
+    }
+
     removeBuff(ID: number) {
         for (let i = 0; i < this.buffList.length; i++) {
             let buff = this.buffList[i];

+ 3 - 2
assets/script/game/ui/tower/data/MapData.ts

@@ -1,3 +1,4 @@
+import { Role } from "../../../common/InterfaceAddEnum";
 import { BattlesConf } from "../conf/BattlesConf";
 import { EnemyConf } from "../conf/EnemyConf";
 import { MapConf } from "../conf/MapConf";
@@ -279,9 +280,9 @@ export class MapData {
    }
 
    //添加到地图上
-   addHero(typeID:number,level:number,posID:number){
+   addHero(role:Role,level:number,posID:number){
         let hero = HeroDataPool.getObject()
-        hero.init(typeID,level,posID);
+        hero.init(role,level,posID);
         console.log(typeof(posID),posID)
        if(this.attackPosDataMap.has(posID)){
             let posData = this.attackPosDataMap.get(posID)

+ 0 - 10
assets/script/game/ui/tower/node/Bullet.ts

@@ -8,9 +8,6 @@ const { ccclass, property } = _decorator;
 export class Bullet extends BattleNodeBase {
 
 
-    @property({ type: sp.Skeleton, tooltip: '骨骼动画' })
-    modelSpine: sp.Skeleton = null;
-
     speedVector: Vec2 = new Vec2(0, 0);
 
     bStand: boolean = false;
@@ -21,8 +18,6 @@ export class Bullet extends BattleNodeBase {
 
     protected onLoad(): void {
         this.priority = RenderPriority.Bullet;
-        this.modelSpine.setCompleteListener(this.actionComplete.bind(this))
-
     }
 
     start() {
@@ -52,10 +47,6 @@ export class Bullet extends BattleNodeBase {
 
     stand() {
         this.bStand = true;
-        if(!this.modelSpine.node.active) return;
-        this.modelSpine.setAnimation(0, 'idle', true);
-        this.modelSpine.color = Color.WHITE;
-        // this._attackCallback = null;
     }
 
    
@@ -68,7 +59,6 @@ export class Bullet extends BattleNodeBase {
         this.dieCallback = callback;
         tween(this.node).delay(0.5).call(() =>  {
             this.node.active = false
-            this.modelSpine.color = Color.WHITE;
             this.dieCallback && this.dieCallback()
         }).start()
     }

+ 38 - 26
assets/script/game/ui/tower/node/Hero.ts

@@ -63,6 +63,8 @@ export class Hero extends BattleNodeBase {
 
     battleEventManager: BattleEventManager;
 
+    private _nextAnimName: string = "idle";
+
 
     set posIndex(posIndx:number){
         this._posIndex = posIndx;
@@ -76,6 +78,7 @@ export class Hero extends BattleNodeBase {
     }
 
     protected onLoad(): void {
+         this.modelSpine.setStartListener(this.actionStart.bind(this))
          this.modelSpine.setCompleteListener(this.actionComplete.bind(this))
         this.modelSpine.setEventListener(this.actionCallback.bind(this))
 
@@ -156,41 +159,30 @@ export class Hero extends BattleNodeBase {
             this.attackBone2.rotation = 0
             this.attackBone3.rotation = 0
             this.attackBone4.rotation = 0
-            let bChange = false
+            let curAnimName = this.modelSpine.animation
             if(rotationAngleDegrees<67.5 || rotationAngleDegrees > 292.5){
                 let rotationAngle = this.getRotationAngle(this.gunNode1,pos)
                 this.attackBone1.rotation = (rotationAngle+this.attackAngle1)
-                if(this.modelSpine.animation != "atk_right"){
-                    this.modelSpine.setAnimation(0, 'atk_right', true);
-                    bChange = true
-                }
+                this._nextAnimName = "atk_right"
             }
             else if(rotationAngleDegrees < 112.5){
                 let rotationAngle = this.getRotationAngle(this.gunNode3,pos)
                 this.attackBone3.rotation = rotationAngle+this.attackAngle3-90
-                if(this.modelSpine.animation != "atk_up"){
-                    this.modelSpine.setAnimation(0, 'atk_up', true);
-                    bChange = true
-                }
+                this._nextAnimName = "atk_up"
             }
             else if(rotationAngleDegrees < 247.5){
                 let rotationAngle = this.getRotationAngle(this.gunNode1,pos)
                 this.attackBone4.rotation = 180-rotationAngle+this.attackAngle4
-                if(this.modelSpine.animation != "atk_left"){
-                    this.modelSpine.setAnimation(0, 'atk_left', true);
-                    bChange = true
-                }
+                this._nextAnimName = "atk_left"
             }
             else if(rotationAngleDegrees < 292.5){
                 let rotationAngle = this.getRotationAngle(this.gunNode2,pos)
                 this.attackBone2.rotation = rotationAngle+this.attackAngle2-270
-                if(this.modelSpine.animation != "atk_down"){
-                    this.modelSpine.setAnimation(0, 'atk_down', true);
-                    bChange = true
-                }
+                this._nextAnimName = "atk_down"
             }
 
-            if(bChange){
+            if(!curAnimName.includes("atk_") && this._nextAnimName.includes("atk_")){
+                this.modelSpine.setAnimation(0,this._nextAnimName, true);
                 let conf = UptypeConf.data
                 let speedScale = conf.HeroSpeedColArr[this.level]
                 this.modelSpine.timeScale = speedScale;
@@ -213,12 +205,11 @@ export class Hero extends BattleNodeBase {
     attack(attackNode:Node){
         if(!this.modelSpine.node.active) return;
         
+        
+        this.attackNode = attackNode;
+        
         // if(this._bAttackAnimation) return; 
         this._bAttackAnimation = true;
-
-        this.attackNode = attackNode;
-
-        Framework.audio.playEffect(AudioID.Tututu);
     }
 
     stand() {
@@ -235,23 +226,29 @@ export class Hero extends BattleNodeBase {
         if(animationName.includes("idle")) return; 
         switch(animationName){
             case "atk_right":
+                this._nextAnimName = "atk_right";
                 this.modelSpine.setAnimation(0, 'idle_right', true);
                 break;
             case "atk_left":
+                this._nextAnimName = "atk_left";
                 this.modelSpine.setAnimation(0, 'idle_left', true);
                 break;
             case "atk_up":
+                this._nextAnimName = "atk_up";
                 this.modelSpine.setAnimation(0, 'idle_up', true);
                 break;
             case "atk_down":
+                this._nextAnimName = "atk_down";
                 this.modelSpine.setAnimation(0, 'idle_down', true);
                 break;
             default:
+                this._nextAnimName = "idk_right";
                 this.modelSpine.setAnimation(0, 'idle_right', true);
                 break;
         }
         this.modelSpine.timeScale = 1;
-        // if(this.modelSpine.node.scale.x < 0)
+                // this.modelSpine.setAnimation(0, 'idle_up', true);
+                // if(this.modelSpine.node.scale.x < 0)
         //     this.modelSpine.node.scale = new Vec3(-this.modelSpine.node.scale.x,this.modelSpine.node.scale.y,this.modelSpine.node.scale.z);
 
     }
@@ -261,8 +258,8 @@ export class Hero extends BattleNodeBase {
         this.levelLabel.string = this.level.toString();
     }
 
-    actionCallback(trackEntry){
-        //  console.log("动作回调:",trackEntry.animation.name)
+    actionCallback(trackEntry: sp.spine.TrackEntry,ev: sp.spine.Event){
+         console.log("动作回调:",trackEntry.animation.name,ev)
         if (trackEntry.animation.name && trackEntry.animation.name.includes("atk")) {
 
             // if (this._attackCallback) {
@@ -279,10 +276,25 @@ export class Hero extends BattleNodeBase {
         } 
     }
 
+    actionStart(trackEntry:sp.spine.TrackEntry){
+        // console.log("动作完成:",trackEntry.animation.name,this._posID)
+        if (trackEntry.animation.name && trackEntry.animation.name.includes("atk_")) {
+
+            Framework.audio.playEffect(AudioID.Tututu);
+           
+        } 
+    }
+
     actionComplete(trackEntry:sp.spine.TrackEntry){
         // console.log("动作完成:",trackEntry.animation.name,this._posID)
-        if (trackEntry.animation.name && trackEntry.animation.name.includes("fire")) {
+        if (trackEntry.animation.name && trackEntry.animation.name.includes("atk_")) {
 
+            if( this._nextAnimName.includes("atk_")){
+                this.modelSpine.setAnimation(0,this._nextAnimName, true);
+                let conf = UptypeConf.data
+                let speedScale = conf.HeroSpeedColArr[this.level]
+                this.modelSpine.timeScale = speedScale;
+            }
             // this._bAttackAnimation = false;
             // // this.gunNode.angle = 0;
             // // this.gunNode.active = false;

+ 2 - 2
assets/script/game/ui/tower/node/Hurt.ts

@@ -16,8 +16,8 @@ export class Hurt extends BattleNodeBase {
     }
     hurt(hurt:number,onComplete:Function){
         this.node.active = true;
-        this.label.string = hurt.toFixed(0);
-        this.label.node.qtJumpPosition(new Vec3(Math.random()*60-30, Math.random()*20+10, 0), 20, 1, 0.5,{onComplete : ()=>{
+        this.label.string = (hurt*100).toFixed(0);
+        this.label.node.qtJumpPosition(new Vec3(Math.random()*10, Math.random()*10+80, 0), 20, 1, 0.5,{onComplete : ()=>{
             this.node.active = false;
             onComplete&&onComplete()
         }}).start()

+ 1 - 1
assets/script/game/ui/zombie/data/ZombieHeroData.ts

@@ -34,7 +34,7 @@ export class ZombieHeroData extends HeroData{
                 this.skillDataList.push(skillData);
             }
 
-            this.upDataLevel()
+            this.updataLevel()
             return this;
         }
         return null;

+ 0 - 4
assets/sub_bundle/hero/prefab/HeroAttr.prefab

@@ -447,8 +447,6 @@
       "__id__": 0
     },
     "fileId": "c9fhluvfVKyKBbrSDpvXph",
-    "instance": null,
-    "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
   {
@@ -16317,8 +16315,6 @@
       "__id__": 0
     },
     "fileId": "16osAoBkdHlKLt3lxNjBsc",
-    "instance": null,
-    "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
   {