战斗系统 重构继续
This commit is contained in:
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -955,24 +952,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -983,7 +962,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1017,7 +996,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1051,7 +1030,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1069,7 +1048,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,13 +56,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 65
|
"__id__": 65
|
||||||
},
|
|
||||||
{
|
|
||||||
"__id__": 67
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 69
|
"__id__": 67
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -958,24 +955,6 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
"fileId": "ae2ywFEqlJ26Sq7z7AtGgk"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"__type__": "7eb34NR6XVEf78HCi5eAKLm",
|
|
||||||
"_name": "",
|
|
||||||
"_objFlags": 0,
|
|
||||||
"__editorExtras__": {},
|
|
||||||
"node": {
|
|
||||||
"__id__": 1
|
|
||||||
},
|
|
||||||
"_enabled": true,
|
|
||||||
"__prefab": {
|
|
||||||
"__id__": 60
|
|
||||||
},
|
|
||||||
"_id": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__type__": "cc.CompPrefabInfo",
|
|
||||||
"fileId": "654wWWbWpMeYe/ywRBGTMP"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"__type__": "cc.RigidBody2D",
|
"__type__": "cc.RigidBody2D",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -986,7 +965,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 62
|
"__id__": 60
|
||||||
},
|
},
|
||||||
"enabledContactListener": true,
|
"enabledContactListener": true,
|
||||||
"bullet": false,
|
"bullet": false,
|
||||||
@@ -1020,7 +999,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 64
|
"__id__": 62
|
||||||
},
|
},
|
||||||
"tag": 0,
|
"tag": 0,
|
||||||
"_group": 4,
|
"_group": 4,
|
||||||
@@ -1054,7 +1033,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 66
|
"__id__": 64
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
@@ -1072,7 +1051,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 68
|
"__id__": 66
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,212 +0,0 @@
|
|||||||
import { _decorator, Component, instantiate, Label, Node, Prefab, ProgressBar, tween, UITransform, v3, Vec3 } from 'cc';
|
|
||||||
import { oops } from 'db://oops-framework/core/Oops';
|
|
||||||
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
|
||||||
import { Tooltip } from '../skill/Tooltip';
|
|
||||||
import { timedCom } from '../skill/timedCom';
|
|
||||||
import { smc } from '../common/SingletonModuleComp';
|
|
||||||
import { Timer } from 'db://oops-framework/core/common/timer/Timer';
|
|
||||||
const { ccclass, property } = _decorator;
|
|
||||||
|
|
||||||
@ccclass('BuffComp')
|
|
||||||
export class BuffComp extends Component {
|
|
||||||
top_node:any=null;
|
|
||||||
ap_node:any=null;
|
|
||||||
cd_node:any=null;
|
|
||||||
def_node:any=null;
|
|
||||||
hp_node:any=null;
|
|
||||||
crit_node:any=null;
|
|
||||||
ap_cd:number=0;
|
|
||||||
cd_cd:number=0;
|
|
||||||
def_cd:number=0;
|
|
||||||
hp_cd:number=0;
|
|
||||||
crit_cd:number=0;
|
|
||||||
|
|
||||||
deap_cd:number=0;
|
|
||||||
decd_cd:number=0;
|
|
||||||
dedef_cd:number=0;
|
|
||||||
dehp_cd:number=0;
|
|
||||||
decrit_cd:number=0;
|
|
||||||
|
|
||||||
buff_cd:number=0;
|
|
||||||
wind_cd:number=0;
|
|
||||||
speek_time:number=0;
|
|
||||||
|
|
||||||
timer:Timer=new Timer(2);
|
|
||||||
buff_keys:any[]=["by1","by2","by3"]
|
|
||||||
key_index:number=0;
|
|
||||||
protected onLoad(): void {
|
|
||||||
}
|
|
||||||
start() {
|
|
||||||
this.info_init()
|
|
||||||
}
|
|
||||||
|
|
||||||
info_init(){
|
|
||||||
this.top_node = this.node.getChildByName("top");
|
|
||||||
let hp_y=this.node.getComponent(UITransform).height
|
|
||||||
this.top_node.setPosition(0,hp_y,0)
|
|
||||||
|
|
||||||
// this.top_node.getChildByName("hp").active=(this.node.getComponent(HeroViewComp).fac == 1 ? true : false)
|
|
||||||
|
|
||||||
// this.vmdata_update()
|
|
||||||
}
|
|
||||||
|
|
||||||
to_update_vmdata(){
|
|
||||||
// this.vmdata_update(false)
|
|
||||||
}
|
|
||||||
update(deltaTime: number) {
|
|
||||||
if(smc.mission.pause) return
|
|
||||||
|
|
||||||
|
|
||||||
// if(this.timer.update(deltaTime)){
|
|
||||||
// this.timer.reset()
|
|
||||||
// this.key_index++
|
|
||||||
// if(this.key_index>=this.buff_keys.length) this.key_index=0
|
|
||||||
// }
|
|
||||||
|
|
||||||
// this.in_speek(deltaTime)
|
|
||||||
// this.vmdata_update()
|
|
||||||
}
|
|
||||||
|
|
||||||
show_shield(shield:number=0,shield_max:number=0){
|
|
||||||
let shield_progress= shield/shield_max;
|
|
||||||
this.node.getChildByName("shielded").active=shield > 0
|
|
||||||
this.node.getChildByName("top").getChildByName("shield").active=shield > 0
|
|
||||||
this.node.getChildByName("top").getChildByName("shield").getComponent(ProgressBar).progress = shield_progress;
|
|
||||||
this.scheduleOnce(()=>{
|
|
||||||
this.node.getChildByName("top").getChildByName("shield").getChildByName("pb").getComponent(ProgressBar).progress = shield_progress;
|
|
||||||
},0.15)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
hp_show(hp:number,hp_max:number){
|
|
||||||
// if(this.node.getComponent(HeroViewComp).fac == 0) return
|
|
||||||
let hp_progress= hp/hp_max;
|
|
||||||
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar).progress = hp_progress;
|
|
||||||
this.scheduleOnce(()=>{
|
|
||||||
this.node.getChildByName("top").getChildByName("hp").getChildByName("hpb").getComponent(ProgressBar).progress = hp_progress;
|
|
||||||
},0.15)
|
|
||||||
// this.node.getChildByName("top").getChildByName("hp").active = (hp == hp_max) ? false : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
mp_show(mp:number,mp_max:number){
|
|
||||||
this.node.getChildByName("top").getChildByName("pow").getComponent(ProgressBar).progress = mp/mp_max;
|
|
||||||
this.scheduleOnce(()=>{
|
|
||||||
this.node.getChildByName("top").getChildByName("pow").getChildByName("mpb").getComponent(ProgressBar).progress = mp/mp_max;
|
|
||||||
},0.15)
|
|
||||||
}
|
|
||||||
|
|
||||||
update_info_lv(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
show_wind(t:number=1){
|
|
||||||
this.wind_cd = t;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lv_up(){
|
|
||||||
var path = "game/skill/buff/buff_lvup";
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
node.parent = this.node;
|
|
||||||
}
|
|
||||||
ap_up(){
|
|
||||||
var path = "game/skill/buff/buff_apup";
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
node.parent = this.node;
|
|
||||||
}
|
|
||||||
|
|
||||||
show_do_buff(name:string){
|
|
||||||
var path = "game/skill/buff/"+name;
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
let pos = v3(this.node.position.x,this.node.position.y+20,this.node.position.z);
|
|
||||||
node.parent = this.node.parent;
|
|
||||||
node.setPosition(pos);
|
|
||||||
}
|
|
||||||
dead(){
|
|
||||||
var path = "game/skill/buff/dead";
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
node.parent = this.node.parent;
|
|
||||||
node.setScale(node.scale.x*0.5,node.scale.y*0.5)
|
|
||||||
let pos = v3(this.node.position.x,this.node.position.y+30,this.node.position.z);
|
|
||||||
node.setPosition(pos);
|
|
||||||
}
|
|
||||||
in_atked(anm:string="atked",scale:number=1) {
|
|
||||||
var path = "game/skill/boom/"+anm;
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
node.setScale(node.scale.x*scale,node.scale.y)
|
|
||||||
node.setPosition(this.node.position.x,this.node.position.y+30,this.node.position.z)
|
|
||||||
node.parent = this.node.parent;
|
|
||||||
}
|
|
||||||
in_iced(t:number=1,ap:number=0) {
|
|
||||||
var path = "game/skill/buff/buff_iced";
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
node.getComponent(timedCom).time = t;
|
|
||||||
node.getComponent(timedCom).ap = ap;
|
|
||||||
node.parent = this.node;
|
|
||||||
}
|
|
||||||
in_fired(t:number=1,ap:number=0) {
|
|
||||||
// var path = "game/skills/fired";
|
|
||||||
// var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
// var node = instantiate(prefab);
|
|
||||||
// node.getComponent(timedCom).time = t;
|
|
||||||
// node.getComponent(timedCom).ap = ap;
|
|
||||||
// node.parent = this.node;
|
|
||||||
}
|
|
||||||
in_yun(t:number=1,ap:number=0) {
|
|
||||||
var path = "game/skill/buff/buff_yun";
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
let height=this.node.getComponent(UITransform).height
|
|
||||||
node.setPosition(v3(0,height));
|
|
||||||
node.getComponent(timedCom).time = t;
|
|
||||||
node.getComponent(timedCom).ap = ap;
|
|
||||||
node.parent = this.node;
|
|
||||||
}
|
|
||||||
to_speek(words:string,time:number=0.5){
|
|
||||||
this.speek_time=0.5
|
|
||||||
this.node.getChildByName("tooltip").active=true
|
|
||||||
this.node.getChildByName("tooltip").getChildByName("words").getComponent(Label)!.string = words
|
|
||||||
}
|
|
||||||
in_speek(dt: number){
|
|
||||||
if(this.speek_time <= 0){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.speek_time -= dt;
|
|
||||||
if(this.speek_time <= 0){
|
|
||||||
this.speek_time = 0;
|
|
||||||
this.node.getChildByName("tooltip").getChildByName("words").getComponent(Label)!.string = "";
|
|
||||||
this.node.getChildByName("tooltip").active=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tooltip(type:number=1,value:string="",s_uuid:number=1001,y:number=90){
|
|
||||||
// console.log("tooltip",type);
|
|
||||||
let tip =ecs.getEntity<Tooltip>(Tooltip);
|
|
||||||
let pos = v3(0,10);
|
|
||||||
pos.y=pos.y+y;
|
|
||||||
tip.load(pos,type,value,s_uuid,this.node);
|
|
||||||
}
|
|
||||||
hp_tip(type:number=1,value:string="",s_uuid:number=1001,y:number=90){
|
|
||||||
let tip =ecs.getEntity<Tooltip>(Tooltip);
|
|
||||||
let x=this.node.position.x;
|
|
||||||
let ny=this.node.getComponent(UITransform).height+20;
|
|
||||||
let pos = v3(x,ny,0);
|
|
||||||
tip.load(pos,type,value,s_uuid,this.node.parent);
|
|
||||||
}
|
|
||||||
heathed(){
|
|
||||||
var path = "game/skill/buff/heathed";
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
node.parent = this.node;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ import { instantiate, Node, Prefab, Vec3 ,v3,resources,SpriteFrame,Sprite,Sprite
|
|||||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { HeroModelComp } from "./HeroModelComp";
|
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||||
import { HeroViewComp } from "./HeroViewComp";
|
import { HeroViewComp } from "./HeroViewComp";
|
||||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||||
import { HeroInfo, HeroPos, HType } from "../common/config/heroSet";
|
import { HeroInfo, HeroPos, HType } from "../common/config/heroSet";
|
||||||
@@ -17,13 +17,13 @@ import { EBusComp } from "./EBusComp";
|
|||||||
@ecs.register(`Hero`)
|
@ecs.register(`Hero`)
|
||||||
|
|
||||||
export class Hero extends ecs.Entity {
|
export class Hero extends ecs.Entity {
|
||||||
HeroModel!: HeroModelComp;
|
HeroModel!: HeroAttrsComp;
|
||||||
View!: HeroViewComp;
|
View!: HeroViewComp;
|
||||||
BattleMove!: BattleMoveComp;
|
BattleMove!: BattleMoveComp;
|
||||||
protected init() {
|
protected init() {
|
||||||
this.addComponents<ecs.Comp>(
|
this.addComponents<ecs.Comp>(
|
||||||
BattleMoveComp,
|
BattleMoveComp,
|
||||||
HeroModelComp,
|
HeroAttrsComp,
|
||||||
TalComp,
|
TalComp,
|
||||||
EBusComp,
|
EBusComp,
|
||||||
);
|
);
|
||||||
@@ -31,7 +31,7 @@ export class Hero extends ecs.Entity {
|
|||||||
|
|
||||||
destroy(): void {
|
destroy(): void {
|
||||||
this.remove(HeroViewComp);
|
this.remove(HeroViewComp);
|
||||||
this.remove(HeroModelComp);
|
this.remove(HeroAttrsComp);
|
||||||
this.remove(TalComp);
|
this.remove(TalComp);
|
||||||
this.remove(EBusComp);
|
this.remove(EBusComp);
|
||||||
super.destroy();
|
super.destroy();
|
||||||
@@ -53,7 +53,7 @@ export class Hero extends ecs.Entity {
|
|||||||
node.setPosition(pos)
|
node.setPosition(pos)
|
||||||
// console.log("hero load",pos)
|
// console.log("hero load",pos)
|
||||||
var hv = node.getComponent(HeroViewComp)!;
|
var hv = node.getComponent(HeroViewComp)!;
|
||||||
const model = this.get(HeroModelComp);
|
const model = this.get(HeroAttrsComp);
|
||||||
let hero = HeroInfo[uuid]; // 共用英雄数据
|
let hero = HeroInfo[uuid]; // 共用英雄数据
|
||||||
|
|
||||||
// 设置 View 层属性(表现相关)
|
// 设置 View 层属性(表现相关)
|
||||||
@@ -127,16 +127,16 @@ export class HeroLifecycleSystem extends ecs.ComblockSystem
|
|||||||
implements ecs.IEntityEnterSystem, ecs.IEntityRemoveSystem {
|
implements ecs.IEntityEnterSystem, ecs.IEntityRemoveSystem {
|
||||||
|
|
||||||
filter() {
|
filter() {
|
||||||
return ecs.allOf(HeroModelComp);
|
return ecs.allOf(HeroAttrsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
entityEnter(e: ecs.Entity): void {
|
entityEnter(e: ecs.Entity): void {
|
||||||
// 英雄实体创建时的特殊处理
|
// 英雄实体创建时的特殊处理
|
||||||
console.log(`英雄进入世界: ${e.get(HeroModelComp).hero_name}`);
|
console.log(`英雄进入世界: ${e.get(HeroAttrsComp).hero_name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
entityRemove(e: ecs.Entity): void {
|
entityRemove(e: ecs.Entity): void {
|
||||||
// 英雄实体销毁时的清理工作
|
// 英雄实体销毁时的清理工作
|
||||||
console.log(`英雄离开世界: ${e.get(HeroModelComp).hero_name}`);
|
console.log(`英雄离开世界: ${e.get(HeroAttrsComp).hero_name}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
235
assets/script/game/hero/HeroAtk.ts
Normal file
235
assets/script/game/hero/HeroAtk.ts
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
|
import { FacSet } from "../common/config/BoxSet";
|
||||||
|
import { Attrs } from "../common/config/HeroAttrs";
|
||||||
|
import { FightSet } from "../common/config/Mission";
|
||||||
|
import { SkillSet } from "../common/config/SkillSet";
|
||||||
|
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||||
|
|
||||||
|
/** 业务层对象 */
|
||||||
|
@ecs.register('HeroAtk')
|
||||||
|
export class HeroAtkComp extends ecs.Comp {
|
||||||
|
/** 业务层组件移除时,重置所有数据为默认值 */
|
||||||
|
reset() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 业务层业务逻辑处理对象 */
|
||||||
|
export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate, ecs.IEntityEnterSystem {
|
||||||
|
|
||||||
|
private debugMode: boolean = false; // 是否启用调试模式
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤器:只处理拥有 HeroAttrsComp 的实体
|
||||||
|
*/
|
||||||
|
filter(): ecs.IMatcher {
|
||||||
|
return ecs.allOf(HeroAttrsComp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体首次进入系统时调用(每个实体只调用一次)
|
||||||
|
*/
|
||||||
|
entityEnter(e: ecs.Entity): void {
|
||||||
|
const model = e.get(HeroAttrsComp);
|
||||||
|
if (!model) return;
|
||||||
|
|
||||||
|
console.log(`[HeroBattleSystem] 英雄进入战斗系统: ${model.hero_name} (uuid: ${model.hero_uuid})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理角色被攻击
|
||||||
|
* @param target 被攻击的目标实体
|
||||||
|
* @param remainingDamage 基础伤害值
|
||||||
|
* @param attackerAttrs 攻击者的属性
|
||||||
|
* @param skillId 技能ID
|
||||||
|
* @returns 实际造成的伤害
|
||||||
|
*/
|
||||||
|
public doAttack(target: ecs.Entity, remainingDamage: number, attackerAttrs: any, skillId: number): number {
|
||||||
|
const targetModel = target.get(HeroAttrsComp);
|
||||||
|
if (!targetModel || targetModel.is_dead) return 0;
|
||||||
|
|
||||||
|
// 获取技能配置
|
||||||
|
const skillConf = SkillSet[skillId];
|
||||||
|
|
||||||
|
// 触发被攻击事件
|
||||||
|
this.onAttacked(target);
|
||||||
|
|
||||||
|
// 闪避判定
|
||||||
|
if (this.checkDodge(targetModel)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴击判定
|
||||||
|
const isCrit = this.checkCrit(attackerAttrs[Attrs.CRITICAL]);
|
||||||
|
let damage = remainingDamage;
|
||||||
|
|
||||||
|
if (isCrit) {
|
||||||
|
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE + attackerAttrs[Attrs.CRITICAL_DMG]) / 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 伤害计算(考虑易伤等debuff)
|
||||||
|
damage = this.calculateDamage(targetModel, damage);
|
||||||
|
|
||||||
|
// 护盾吸收
|
||||||
|
damage = this.absorbShield(targetModel, damage);
|
||||||
|
|
||||||
|
if (damage <= 0) return 0;
|
||||||
|
|
||||||
|
// 应用伤害
|
||||||
|
targetModel.hp -= damage;
|
||||||
|
targetModel.atked_count++;
|
||||||
|
|
||||||
|
// 检查死亡
|
||||||
|
if (targetModel.hp <= 0) {
|
||||||
|
this.doDead(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.debugMode) {
|
||||||
|
console.log(`[HeroBattleSystem] ${targetModel.hero_name} 受到 ${damage} 点伤害 (暴击: ${isCrit})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理角色死亡
|
||||||
|
*/
|
||||||
|
private doDead(entity: ecs.Entity): void {
|
||||||
|
const model = entity.get(HeroAttrsComp);
|
||||||
|
if (!model || model.is_dead) return;
|
||||||
|
|
||||||
|
model.is_dead = true;
|
||||||
|
|
||||||
|
// 触发死亡事件
|
||||||
|
this.onDeath(entity);
|
||||||
|
|
||||||
|
if (this.debugMode) {
|
||||||
|
console.log(`[HeroBattleSystem] ${model.hero_name} 死亡`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 闪避判定
|
||||||
|
*/
|
||||||
|
private checkDodge(model: HeroAttrsComp): boolean {
|
||||||
|
if (model.Attrs[Attrs.DODGE] > 0) {
|
||||||
|
const random = Math.random() * 100;
|
||||||
|
if (random < model.Attrs[Attrs.DODGE]) {
|
||||||
|
if (this.debugMode) {
|
||||||
|
console.log(`[HeroBattleSystem] ${model.hero_name} 闪避了攻击`);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暴击判定
|
||||||
|
*/
|
||||||
|
private checkCrit(critRate: number): boolean {
|
||||||
|
if (critRate > 0) {
|
||||||
|
const random = Math.random() * 100;
|
||||||
|
return random < critRate;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 伤害计算(考虑易伤等debuff)
|
||||||
|
*/
|
||||||
|
private calculateDamage(model: HeroAttrsComp, baseDamage: number): number {
|
||||||
|
// 这里可以添加易伤等debuff的计算逻辑
|
||||||
|
// 例如:如果目标有易伤buff,增加受到的伤害
|
||||||
|
return baseDamage;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护盾吸收伤害
|
||||||
|
*/
|
||||||
|
private absorbShield(model: HeroAttrsComp, damage: number): number {
|
||||||
|
if (model.shield <= 0) return damage;
|
||||||
|
|
||||||
|
if (model.shield >= damage) {
|
||||||
|
model.shield -= damage;
|
||||||
|
if (model.shield <= 0) {
|
||||||
|
model.shield = 0;
|
||||||
|
model.Attrs[Attrs.SHIELD_MAX] = 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
const remainingDamage = damage - model.shield;
|
||||||
|
model.shield = 0;
|
||||||
|
model.Attrs[Attrs.SHIELD_MAX] = 0;
|
||||||
|
return remainingDamage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被攻击时触发的事件
|
||||||
|
*/
|
||||||
|
private onAttacked(entity: ecs.Entity): void {
|
||||||
|
const model = entity.get(HeroAttrsComp);
|
||||||
|
if (!model || model.is_dead) return;
|
||||||
|
|
||||||
|
// 这里可以添加被攻击时的特殊处理逻辑
|
||||||
|
if (model.fac === FacSet.MON) return;
|
||||||
|
|
||||||
|
// 例如:触发某些天赋效果、反击逻辑等
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 死亡时触发的事件
|
||||||
|
*/
|
||||||
|
private onDeath(entity: ecs.Entity): void {
|
||||||
|
const model = entity.get(HeroAttrsComp);
|
||||||
|
if (!model) return;
|
||||||
|
|
||||||
|
if (model.fac === FacSet.MON) {
|
||||||
|
// 怪物死亡处理
|
||||||
|
this.scheduleDrop(entity);
|
||||||
|
} else if (model.fac === FacSet.HERO) {
|
||||||
|
// 英雄死亡处理
|
||||||
|
this.scheduleHeroDeath(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 延迟执行掉落逻辑
|
||||||
|
*/
|
||||||
|
private scheduleDrop(entity: ecs.Entity): void {
|
||||||
|
// 这里可以添加掉落逻辑
|
||||||
|
// 例如:延迟一段时间后生成掉落物品
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 延迟执行英雄死亡逻辑
|
||||||
|
*/
|
||||||
|
private scheduleHeroDeath(entity: ecs.Entity): void {
|
||||||
|
// 这里可以添加英雄死亡的特殊处理
|
||||||
|
// 例如:触发游戏结束、复活机制等
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用调试模式
|
||||||
|
*/
|
||||||
|
enableDebug() {
|
||||||
|
this.debugMode = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 禁用调试模式
|
||||||
|
*/
|
||||||
|
disableDebug() {
|
||||||
|
this.debugMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统更新(每帧调用)
|
||||||
|
* 可以在这里添加需要每帧处理的战斗逻辑
|
||||||
|
*/
|
||||||
|
update(e: ecs.Entity): void {
|
||||||
|
// 这里可以添加需要每帧处理的战斗逻辑
|
||||||
|
// 例如:持续伤害、战斗状态检查等
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"ver": "4.0.24",
|
"ver": "4.0.24",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "118ca580-773a-458b-8544-ab6c3cb2b376",
|
"uuid": "85d8a2e5-f2a1-49b0-9439-fe9e1e98b7d9",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {}
|
"userData": {}
|
||||||
@@ -2,14 +2,12 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
|||||||
import { Attrs, AttrsType, BType, NeAttrs } from "../common/config/HeroAttrs";
|
import { Attrs, AttrsType, BType, NeAttrs } from "../common/config/HeroAttrs";
|
||||||
import { BuffConf, SkillSet } from "../common/config/SkillSet";
|
import { BuffConf, SkillSet } from "../common/config/SkillSet";
|
||||||
import { HeroInfo, AttrSet, HeroUpSet } from "../common/config/heroSet";
|
import { HeroInfo, AttrSet, HeroUpSet } from "../common/config/heroSet";
|
||||||
import { MonModelComp } from "./MonModelComp";
|
import { EBusComp } from "./EBusComp";
|
||||||
import { FacSet } from "../common/config/BoxSet";
|
|
||||||
import { FightSet } from "../common/config/Mission";
|
|
||||||
|
|
||||||
|
|
||||||
@ecs.register('HeroModel')
|
@ecs.register('HeroAttrs')
|
||||||
export class HeroModelComp extends ecs.Comp {
|
export class HeroAttrsComp extends ecs.Comp {
|
||||||
|
Ebus:any=null!
|
||||||
// ==================== 角色基础信息 ====================
|
// ==================== 角色基础信息 ====================
|
||||||
hero_uuid: number = 1001;
|
hero_uuid: number = 1001;
|
||||||
hero_name: string = "hero";
|
hero_name: string = "hero";
|
||||||
@@ -55,7 +53,9 @@ export class HeroModelComp extends ecs.Comp {
|
|||||||
|
|
||||||
// ==================== 技能配置 ====================
|
// ==================== 技能配置 ====================
|
||||||
skills: any = [];
|
skills: any = [];
|
||||||
|
start(){
|
||||||
|
this.Ebus=this.ent.get(EBusComp);
|
||||||
|
}
|
||||||
// ==================== BUFF 系统初始化 ====================
|
// ==================== BUFF 系统初始化 ====================
|
||||||
/**
|
/**
|
||||||
* 初始化角色的 buff debuff
|
* 初始化角色的 buff debuff
|
||||||
@@ -384,7 +384,7 @@ export class HeroModelComp extends ecs.Comp {
|
|||||||
* ==================== 英雄属性更新系统 ====================
|
* ==================== 英雄属性更新系统 ====================
|
||||||
*
|
*
|
||||||
* 按照 ECS 设计理念:
|
* 按照 ECS 设计理念:
|
||||||
* - Component(HeroModelComp):存储数据
|
* - Component(HeroAttrsComp):存储数据
|
||||||
* - System(HeroAttrSystem):处理业务逻辑
|
* - System(HeroAttrSystem):处理业务逻辑
|
||||||
*
|
*
|
||||||
* 系统职责:
|
* 系统职责:
|
||||||
@@ -393,7 +393,7 @@ export class HeroModelComp extends ecs.Comp {
|
|||||||
* 3. 限制属性值在合理范围内
|
* 3. 限制属性值在合理范围内
|
||||||
*
|
*
|
||||||
* 使用方式:
|
* 使用方式:
|
||||||
* 在 RootSystem 中注册此系统,它会自动每帧更新所有拥有 HeroModelComp 的实体
|
* 在 RootSystem 中注册此系统,它会自动每帧更新所有拥有 HeroAttrsComp 的实体
|
||||||
*/
|
*/
|
||||||
export class HeroAttrSystem extends ecs.ComblockSystem
|
export class HeroAttrSystem extends ecs.ComblockSystem
|
||||||
implements ecs.ISystemUpdate, ecs.IEntityEnterSystem, ecs.ISystemFirstUpdate {
|
implements ecs.ISystemUpdate, ecs.IEntityEnterSystem, ecs.ISystemFirstUpdate {
|
||||||
@@ -404,17 +404,17 @@ export class HeroAttrSystem extends ecs.ComblockSystem
|
|||||||
private debugMode: boolean = false; // 是否启用调试模式
|
private debugMode: boolean = false; // 是否启用调试模式
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过滤器:只处理拥有 HeroModelComp 的实体
|
* 过滤器:只处理拥有 HeroAttrsComp 的实体
|
||||||
*/
|
*/
|
||||||
filter(): ecs.IMatcher {
|
filter(): ecs.IMatcher {
|
||||||
return ecs.allOf(HeroModelComp);
|
return ecs.allOf(HeroAttrsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实体首次进入系统时调用(每个实体只调用一次)
|
* 实体首次进入系统时调用(每个实体只调用一次)
|
||||||
*/
|
*/
|
||||||
entityEnter(e: ecs.Entity): void {
|
entityEnter(e: ecs.Entity): void {
|
||||||
const model = e.get(HeroModelComp);
|
const model = e.get(HeroAttrsComp);
|
||||||
if (!model) return;
|
if (!model) return;
|
||||||
|
|
||||||
console.log(`[HeroAttrSystem] 英雄进入系统: ${model.hero_name} (uuid: ${model.hero_uuid})`);
|
console.log(`[HeroAttrSystem] 英雄进入系统: ${model.hero_name} (uuid: ${model.hero_uuid})`);
|
||||||
@@ -436,7 +436,7 @@ export class HeroAttrSystem extends ecs.ComblockSystem
|
|||||||
* - 这是正确的设计,不是 bug
|
* - 这是正确的设计,不是 bug
|
||||||
*/
|
*/
|
||||||
update(e: ecs.Entity): void {
|
update(e: ecs.Entity): void {
|
||||||
const model = e.get(HeroModelComp);
|
const model = e.get(HeroAttrsComp);
|
||||||
if (!model || model.is_dead) return;
|
if (!model || model.is_dead) return;
|
||||||
|
|
||||||
// 统计:记录本帧处理的实体数
|
// 统计:记录本帧处理的实体数
|
||||||
@@ -485,240 +485,3 @@ export class HeroAttrSystem extends ecs.ComblockSystem
|
|||||||
this.debugMode = false;
|
this.debugMode = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ==================== 英雄战斗系统 ====================
|
|
||||||
*
|
|
||||||
* 按照 ECS 设计理念:
|
|
||||||
* - Component(HeroModelComp):存储数据
|
|
||||||
* - System(HeroBattleSystem):处理战斗业务逻辑
|
|
||||||
*
|
|
||||||
* 系统职责:
|
|
||||||
* 1. 处理角色被攻击逻辑(伤害计算、暴击判定、闪避判定)
|
|
||||||
* 2. 处理护盾吸收逻辑
|
|
||||||
* 3. 处理角色死亡逻辑
|
|
||||||
* 4. 处理战斗状态管理
|
|
||||||
*
|
|
||||||
* 使用方式:
|
|
||||||
* 在 RootSystem 中注册此系统,它会自动处理所有拥有 HeroModelComp 的实体的战斗逻辑
|
|
||||||
*/
|
|
||||||
export class HeroBattleSystem extends ecs.ComblockSystem
|
|
||||||
implements ecs.ISystemUpdate, ecs.IEntityEnterSystem {
|
|
||||||
|
|
||||||
private debugMode: boolean = false; // 是否启用调试模式
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 过滤器:只处理拥有 HeroModelComp 的实体
|
|
||||||
*/
|
|
||||||
filter(): ecs.IMatcher {
|
|
||||||
return ecs.allOf(HeroModelComp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实体首次进入系统时调用(每个实体只调用一次)
|
|
||||||
*/
|
|
||||||
entityEnter(e: ecs.Entity): void {
|
|
||||||
const model = e.get(HeroModelComp);
|
|
||||||
if (!model) return;
|
|
||||||
|
|
||||||
console.log(`[HeroBattleSystem] 英雄进入战斗系统: ${model.hero_name} (uuid: ${model.hero_uuid})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理角色被攻击
|
|
||||||
* @param target 被攻击的目标实体
|
|
||||||
* @param remainingDamage 基础伤害值
|
|
||||||
* @param attackerAttrs 攻击者的属性
|
|
||||||
* @param skillId 技能ID
|
|
||||||
* @returns 实际造成的伤害
|
|
||||||
*/
|
|
||||||
public doAttack(target: ecs.Entity, remainingDamage: number, attackerAttrs: any, skillId: number): number {
|
|
||||||
const targetModel = target.get(HeroModelComp);
|
|
||||||
if (!targetModel || targetModel.is_dead) return 0;
|
|
||||||
|
|
||||||
// 获取技能配置
|
|
||||||
const skillConf = SkillSet[skillId];
|
|
||||||
|
|
||||||
// 触发被攻击事件
|
|
||||||
this.onAttacked(target);
|
|
||||||
|
|
||||||
// 闪避判定
|
|
||||||
if (this.checkDodge(targetModel)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 暴击判定
|
|
||||||
const isCrit = this.checkCrit(attackerAttrs[Attrs.CRITICAL]);
|
|
||||||
let damage = remainingDamage;
|
|
||||||
|
|
||||||
if (isCrit) {
|
|
||||||
damage = Math.floor(damage * (1 + (FightSet.CRIT_DAMAGE + attackerAttrs[Attrs.CRITICAL_DMG]) / 100));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 伤害计算(考虑易伤等debuff)
|
|
||||||
damage = this.calculateDamage(targetModel, damage);
|
|
||||||
|
|
||||||
// 护盾吸收
|
|
||||||
damage = this.absorbShield(targetModel, damage);
|
|
||||||
|
|
||||||
if (damage <= 0) return 0;
|
|
||||||
|
|
||||||
// 应用伤害
|
|
||||||
targetModel.hp -= damage;
|
|
||||||
targetModel.atked_count++;
|
|
||||||
|
|
||||||
// 检查死亡
|
|
||||||
if (targetModel.hp <= 0) {
|
|
||||||
this.doDead(target);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.debugMode) {
|
|
||||||
console.log(`[HeroBattleSystem] ${targetModel.hero_name} 受到 ${damage} 点伤害 (暴击: ${isCrit})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return damage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理角色死亡
|
|
||||||
*/
|
|
||||||
private doDead(entity: ecs.Entity): void {
|
|
||||||
const model = entity.get(HeroModelComp);
|
|
||||||
if (!model || model.is_dead) return;
|
|
||||||
|
|
||||||
model.is_dead = true;
|
|
||||||
|
|
||||||
// 触发死亡事件
|
|
||||||
this.onDeath(entity);
|
|
||||||
|
|
||||||
if (this.debugMode) {
|
|
||||||
console.log(`[HeroBattleSystem] ${model.hero_name} 死亡`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 闪避判定
|
|
||||||
*/
|
|
||||||
private checkDodge(model: HeroModelComp): boolean {
|
|
||||||
if (model.Attrs[Attrs.DODGE] > 0) {
|
|
||||||
const random = Math.random() * 100;
|
|
||||||
if (random < model.Attrs[Attrs.DODGE]) {
|
|
||||||
if (this.debugMode) {
|
|
||||||
console.log(`[HeroBattleSystem] ${model.hero_name} 闪避了攻击`);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 暴击判定
|
|
||||||
*/
|
|
||||||
private checkCrit(critRate: number): boolean {
|
|
||||||
if (critRate > 0) {
|
|
||||||
const random = Math.random() * 100;
|
|
||||||
return random < critRate;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 伤害计算(考虑易伤等debuff)
|
|
||||||
*/
|
|
||||||
private calculateDamage(model: HeroModelComp, baseDamage: number): number {
|
|
||||||
// 这里可以添加易伤等debuff的计算逻辑
|
|
||||||
// 例如:如果目标有易伤buff,增加受到的伤害
|
|
||||||
return baseDamage;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 护盾吸收伤害
|
|
||||||
*/
|
|
||||||
private absorbShield(model: HeroModelComp, damage: number): number {
|
|
||||||
if (model.shield <= 0) return damage;
|
|
||||||
|
|
||||||
if (model.shield >= damage) {
|
|
||||||
model.shield -= damage;
|
|
||||||
if (model.shield <= 0) {
|
|
||||||
model.shield = 0;
|
|
||||||
model.Attrs[Attrs.SHIELD_MAX] = 0;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
const remainingDamage = damage - model.shield;
|
|
||||||
model.shield = 0;
|
|
||||||
model.Attrs[Attrs.SHIELD_MAX] = 0;
|
|
||||||
return remainingDamage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 被攻击时触发的事件
|
|
||||||
*/
|
|
||||||
private onAttacked(entity: ecs.Entity): void {
|
|
||||||
const model = entity.get(HeroModelComp);
|
|
||||||
if (!model || model.is_dead) return;
|
|
||||||
|
|
||||||
// 这里可以添加被攻击时的特殊处理逻辑
|
|
||||||
if (model.fac === FacSet.MON) return;
|
|
||||||
|
|
||||||
// 例如:触发某些天赋效果、反击逻辑等
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 死亡时触发的事件
|
|
||||||
*/
|
|
||||||
private onDeath(entity: ecs.Entity): void {
|
|
||||||
const model = entity.get(HeroModelComp);
|
|
||||||
if (!model) return;
|
|
||||||
|
|
||||||
if (model.fac === FacSet.MON) {
|
|
||||||
// 怪物死亡处理
|
|
||||||
this.scheduleDrop(entity);
|
|
||||||
} else if (model.fac === FacSet.HERO) {
|
|
||||||
// 英雄死亡处理
|
|
||||||
this.scheduleHeroDeath(entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 延迟执行掉落逻辑
|
|
||||||
*/
|
|
||||||
private scheduleDrop(entity: ecs.Entity): void {
|
|
||||||
// 这里可以添加掉落逻辑
|
|
||||||
// 例如:延迟一段时间后生成掉落物品
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 延迟执行英雄死亡逻辑
|
|
||||||
*/
|
|
||||||
private scheduleHeroDeath(entity: ecs.Entity): void {
|
|
||||||
// 这里可以添加英雄死亡的特殊处理
|
|
||||||
// 例如:触发游戏结束、复活机制等
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 启用调试模式
|
|
||||||
*/
|
|
||||||
enableDebug() {
|
|
||||||
this.debugMode = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 禁用调试模式
|
|
||||||
*/
|
|
||||||
disableDebug() {
|
|
||||||
this.debugMode = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统更新(每帧调用)
|
|
||||||
* 可以在这里添加需要每帧处理的战斗逻辑
|
|
||||||
*/
|
|
||||||
update(e: ecs.Entity): void {
|
|
||||||
// 这里可以添加需要每帧处理的战斗逻辑
|
|
||||||
// 例如:持续伤害、战斗状态检查等
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"ver": "4.0.24",
|
"ver": "4.0.24",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "7eb34351-e975-447f-bf07-0a2e5e00a2e6",
|
"uuid": "2b2c4ea3-3baf-4136-aca4-9a6a09d29e99",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {}
|
"userData": {}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Color, BoxCollider2D} from "cc";
|
import { Vec3, _decorator , v3,Collider2D,Contact2DType,Label ,Node,Prefab,instantiate,ProgressBar, Component, Material, Sprite, math, clamp, Game, tween, Color, BoxCollider2D, UITransform} from "cc";
|
||||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { HeroSpine } from "./HeroSpine";
|
import { HeroSpine } from "./HeroSpine";
|
||||||
@@ -6,7 +6,6 @@ import { BoxSet, FacSet } from "../common/config/BoxSet";
|
|||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||||
import { SkillSet,BuffConf,} from "../common/config/SkillSet";
|
import { SkillSet,BuffConf,} from "../common/config/SkillSet";
|
||||||
import { BuffComp } from "./BuffComp";
|
|
||||||
import { oops } from "db://oops-framework/core/Oops";
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { FightSet, TooltipTypes } from "../common/config/Mission";
|
import { FightSet, TooltipTypes } from "../common/config/Mission";
|
||||||
@@ -14,7 +13,12 @@ import { RandomManager } from "db://oops-framework/core/common/random/RandomMana
|
|||||||
import { AttrSet, HeroInfo, HeroUpSet } from "../common/config/heroSet";
|
import { AttrSet, HeroInfo, HeroUpSet } from "../common/config/heroSet";
|
||||||
import { Attrs, AttrsType, BType, NeAttrs } from "../common/config/HeroAttrs";
|
import { Attrs, AttrsType, BType, NeAttrs } from "../common/config/HeroAttrs";
|
||||||
import { TalComp } from "./TalComp";
|
import { TalComp } from "./TalComp";
|
||||||
import { HeroModelComp, HeroBattleSystem } from "./HeroModelComp";
|
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||||
|
import { EBusComp } from "./EBusComp";
|
||||||
|
import { HeroAtkSystem } from "./HeroAtk";
|
||||||
|
import { Tooltip } from "../skill/Tooltip";
|
||||||
|
import { timedCom } from "../skill/timedCom";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
/** 角色显示组件 */
|
/** 角色显示组件 */
|
||||||
@@ -27,18 +31,18 @@ export interface BuffInfo {
|
|||||||
@ecs.register('HeroView', false) // 定义ECS 组件
|
@ecs.register('HeroView', false) // 定义ECS 组件
|
||||||
export class HeroViewComp extends CCComp {
|
export class HeroViewComp extends CCComp {
|
||||||
// ==================== View 层属性(表现相关)====================
|
// ==================== View 层属性(表现相关)====================
|
||||||
BUFFCOMP:BuffComp=null!
|
EBus:any=null!
|
||||||
TALCOMP:any=null!
|
|
||||||
as: HeroSpine = null!
|
as: HeroSpine = null!
|
||||||
status:String = "idle"
|
status:String = "idle"
|
||||||
scale: number = 1; // 显示方向
|
scale: number = 1; // 显示方向
|
||||||
box_group:number = BoxSet.HERO; // 碰撞组
|
box_group:number = BoxSet.HERO; // 碰撞组
|
||||||
is_stop:boolean = false;
|
|
||||||
is_atking:boolean = false;
|
|
||||||
|
|
||||||
// ==================== 直接访问 HeroModelComp ====================
|
// ==================== UI 节点引用 ====================
|
||||||
|
private top_node: Node = null!;
|
||||||
|
|
||||||
|
// ==================== 直接访问 HeroAttrsComp ====================
|
||||||
private get model() {
|
private get model() {
|
||||||
return this.ent.get(HeroModelComp);
|
return this.ent.get(HeroAttrsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private damageQueue: Array<{
|
private damageQueue: Array<{
|
||||||
@@ -51,6 +55,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
private damageInterval: number = 0.01; // 伤害数字显示间隔
|
private damageInterval: number = 0.01; // 伤害数字显示间隔
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.as = this.getComponent(HeroSpine);
|
this.as = this.getComponent(HeroSpine);
|
||||||
|
this.EBus=this.ent.get(EBusComp);
|
||||||
//console.log("[HeroViewComp]:hero view comp ",this.FIGHTCON)
|
//console.log("[HeroViewComp]:hero view comp ",this.FIGHTCON)
|
||||||
this.on(GameEvent.FightEnd,this.do_fight_end,this)
|
this.on(GameEvent.FightEnd,this.do_fight_end,this)
|
||||||
const collider = this.node.getComponent(BoxCollider2D);
|
const collider = this.node.getComponent(BoxCollider2D);
|
||||||
@@ -63,91 +68,30 @@ export class HeroViewComp extends CCComp {
|
|||||||
/** 视图层逻辑代码分离演示 */
|
/** 视图层逻辑代码分离演示 */
|
||||||
start () {
|
start () {
|
||||||
this.as.idle()
|
this.as.idle()
|
||||||
this.BUFFCOMP=this.node.getComponent(BuffComp);
|
|
||||||
this.TALCOMP=this.ent.get(TalComp);
|
// 初始化 UI 节点
|
||||||
// console.log("[HeroViewComp]:heroview"+this.hero_name,this.Attrs)
|
this.initUINodes();
|
||||||
|
|
||||||
/** 方向 */
|
/** 方向 */
|
||||||
this.node.setScale(this.scale,1);
|
this.node.setScale(this.scale,1);
|
||||||
this.node.getChildByName("top").setScale(this.scale,1);
|
this.top_node.setScale(this.scale,1);
|
||||||
if(this.is_boss){
|
if(this.model.is_boss){
|
||||||
this.node.getChildByName("top").position=v3(this.node.position.x,this.node.position.y+100,0)
|
this.top_node.position=v3(this.node.position.x,this.node.position.y+100,0)
|
||||||
}
|
}
|
||||||
/* 显示角色血*/
|
/* 显示角色血*/
|
||||||
this.node.getChildByName("top").getChildByName("hp").active = true;
|
this.top_node.getChildByName("hp").active = true;
|
||||||
this.node.getChildByName("top").getChildByName("pow").active = true;
|
this.top_node.getChildByName("pow").active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== BUFF 系统方法直接调用 ====================
|
/** 初始化 UI 节点引用 */
|
||||||
/**
|
private initUINodes() {
|
||||||
* 初始化角色的 buff debuff(直接调用 Model)
|
this.top_node = this.node.getChildByName("top");
|
||||||
*/
|
let hp_y = this.node.getComponent(UITransform).height;
|
||||||
initAttrs() {
|
this.top_node.setPosition(0, hp_y, 0);
|
||||||
if (this.model) {
|
|
||||||
this.model.initAttrs();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加 buff 效果(直接调用 Model)
|
|
||||||
*/
|
|
||||||
addBuff(buffConf: BuffConf) {
|
|
||||||
if (this.model) {
|
|
||||||
this.model.addBuff(buffConf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 属性计算方法已迁移到 Model,这里不再需要
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新临时 buff/debuff(直接调用 Model)
|
|
||||||
*/
|
|
||||||
updateTemporaryBuffsDebuffs(dt: number) {
|
|
||||||
if (this.model) {
|
|
||||||
this.model.updateTemporaryBuffsDebuffs(dt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清空buff(直接调用 Model)
|
|
||||||
*/
|
|
||||||
clearBuffs(attrIndex?: number, isBuff: boolean = true): void {
|
|
||||||
if (this.model) {
|
|
||||||
this.model.clearBuffs(attrIndex, isBuff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清理单个NeAttr(直接调用 Model)
|
|
||||||
*/
|
|
||||||
clearNeAttr(neAttrIndex: number): void {
|
|
||||||
if (this.model) {
|
|
||||||
this.model.clearNeAttr(neAttrIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清理所有NeAttrs(直接调用 Model)
|
|
||||||
*/
|
|
||||||
clearAllNeAttrs(): void {
|
|
||||||
if (this.model) {
|
|
||||||
this.model.clearAllNeAttrs();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查是否眩晕(直接调用 Model)
|
|
||||||
*/
|
|
||||||
public isStun(): boolean {
|
|
||||||
return this.model?.isStun() ?? false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查是否冰冻(直接调用 Model)
|
|
||||||
*/
|
|
||||||
public isFrost(): boolean {
|
|
||||||
return this.model?.isFrost() ?? false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View 层每帧更新
|
* View 层每帧更新
|
||||||
@@ -161,9 +105,132 @@ export class HeroViewComp extends CCComp {
|
|||||||
this.processDamageQueue(); // 伤害数字显示队列
|
this.processDamageQueue(); // 伤害数字显示队列
|
||||||
|
|
||||||
// ✅ 更新显示(数据由 HeroAttrSystem 更新)
|
// ✅ 更新显示(数据由 HeroAttrSystem 更新)
|
||||||
this.BUFFCOMP.hp_show(this.hp, this.Attrs[Attrs.HP_MAX]);
|
this.hp_show(this.model.hp, this.model.Attrs[Attrs.HP_MAX]);
|
||||||
this.BUFFCOMP.mp_show(this.mp, this.Attrs[Attrs.MP_MAX]);
|
this.mp_show(this.model.mp, this.model.Attrs[Attrs.MP_MAX]);
|
||||||
this.BUFFCOMP.show_shield(this.shield, this.Attrs[Attrs.SHIELD_MAX]);
|
this.show_shield(this.model.shield, this.model.Attrs[Attrs.SHIELD_MAX]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 显示护盾 */
|
||||||
|
private show_shield(shield: number = 0, shield_max: number = 0) {
|
||||||
|
let shield_progress = shield / shield_max;
|
||||||
|
this.node.getChildByName("shielded").active = shield > 0;
|
||||||
|
this.top_node.getChildByName("shield").active = shield > 0;
|
||||||
|
this.top_node.getChildByName("shield").getComponent(ProgressBar).progress = shield_progress;
|
||||||
|
this.scheduleOnce(() => {
|
||||||
|
this.top_node.getChildByName("shield").getChildByName("pb").getComponent(ProgressBar).progress = shield_progress;
|
||||||
|
}, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 显示血量 */
|
||||||
|
private hp_show(hp: number, hp_max: number) {
|
||||||
|
let hp_progress = hp / hp_max;
|
||||||
|
this.top_node.getChildByName("hp").getComponent(ProgressBar).progress = hp_progress;
|
||||||
|
this.scheduleOnce(() => {
|
||||||
|
this.top_node.getChildByName("hp").getChildByName("hpb").getComponent(ProgressBar).progress = hp_progress;
|
||||||
|
}, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 显示魔法值 */
|
||||||
|
private mp_show(mp: number, mp_max: number) {
|
||||||
|
this.top_node.getChildByName("pow").getComponent(ProgressBar).progress = mp / mp_max;
|
||||||
|
this.scheduleOnce(() => {
|
||||||
|
this.top_node.getChildByName("pow").getChildByName("mpb").getComponent(ProgressBar).progress = mp / mp_max;
|
||||||
|
}, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 升级特效 */
|
||||||
|
private lv_up() {
|
||||||
|
var path = "game/skill/buff/buff_lvup";
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
node.parent = this.node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 攻击力提升特效 */
|
||||||
|
private ap_up() {
|
||||||
|
var path = "game/skill/buff/buff_apup";
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
node.parent = this.node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 显示 Buff 特效 */
|
||||||
|
private show_do_buff(name: string) {
|
||||||
|
var path = "game/skill/buff/" + name;
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
let pos = v3(this.node.position.x, this.node.position.y + 20, this.node.position.z);
|
||||||
|
node.parent = this.node.parent;
|
||||||
|
node.setPosition(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 死亡特效 */
|
||||||
|
private dead() {
|
||||||
|
var path = "game/skill/buff/dead";
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
node.parent = this.node.parent;
|
||||||
|
node.setScale(node.scale.x * 0.5, node.scale.y * 0.5);
|
||||||
|
let pos = v3(this.node.position.x, this.node.position.y + 30, this.node.position.z);
|
||||||
|
node.setPosition(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 受击特效 */
|
||||||
|
private in_atked(anm: string = "atked", scale: number = 1) {
|
||||||
|
var path = "game/skill/boom/" + anm;
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
node.setScale(node.scale.x * scale, node.scale.y);
|
||||||
|
node.setPosition(this.node.position.x, this.node.position.y + 30, this.node.position.z);
|
||||||
|
node.parent = this.node.parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 冰冻特效 */
|
||||||
|
private in_iced(t: number = 1, ap: number = 0) {
|
||||||
|
var path = "game/skill/buff/buff_iced";
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
node.getComponent(timedCom).time = t;
|
||||||
|
node.getComponent(timedCom).ap = ap;
|
||||||
|
node.parent = this.node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 眩晕特效 */
|
||||||
|
private in_yun(t: number = 1, ap: number = 0) {
|
||||||
|
var path = "game/skill/buff/buff_yun";
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
let height = this.node.getComponent(UITransform).height;
|
||||||
|
node.setPosition(v3(0, height));
|
||||||
|
node.getComponent(timedCom).time = t;
|
||||||
|
node.getComponent(timedCom).ap = ap;
|
||||||
|
node.parent = this.node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 技能提示 */
|
||||||
|
private tooltip(type: number = 1, value: string = "", s_uuid: number = 1001, y: number = 90) {
|
||||||
|
let tip = ecs.getEntity<Tooltip>(Tooltip);
|
||||||
|
let pos = v3(0, 10);
|
||||||
|
pos.y = pos.y + y;
|
||||||
|
tip.load(pos, type, value, s_uuid, this.node);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 血量提示(伤害数字) */
|
||||||
|
private hp_tip(type: number = 1, value: string = "", s_uuid: number = 1001, y: number = 90) {
|
||||||
|
let tip = ecs.getEntity<Tooltip>(Tooltip);
|
||||||
|
let x = this.node.position.x;
|
||||||
|
let ny = this.node.getComponent(UITransform).height + 20;
|
||||||
|
let pos = v3(x, ny, 0);
|
||||||
|
tip.load(pos, type, value, s_uuid, this.node.parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 治疗特效 */
|
||||||
|
private heathed() {
|
||||||
|
var path = "game/skill/buff/heathed";
|
||||||
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||||
|
var node = instantiate(prefab);
|
||||||
|
node.parent = this.node;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注意:BaseUp 逻辑已移到 HeroAttrSystem.update()
|
// 注意:BaseUp 逻辑已移到 HeroAttrSystem.update()
|
||||||
@@ -188,13 +255,13 @@ export class HeroViewComp extends CCComp {
|
|||||||
}
|
}
|
||||||
add_shield(shield:number){
|
add_shield(shield:number){
|
||||||
// 护盾数据更新由 Model 层处理,这里只负责视图表现
|
// 护盾数据更新由 Model 层处理,这里只负责视图表现
|
||||||
if(this.shield>0) this.BUFFCOMP.show_shield(this.shield,this.Attrs[Attrs.SHIELD_MAX])
|
if(this.model.shield>0) this.show_shield(this.model.shield, this.model.Attrs[Attrs.SHIELD_MAX]);
|
||||||
}
|
}
|
||||||
|
|
||||||
health(hp: number = 0, is_num:boolean=true) {
|
health(hp: number = 0, is_num:boolean=true) {
|
||||||
// 生命值更新由 Model 层处理,这里只负责视图表现
|
// 生命值更新由 Model 层处理,这里只负责视图表现
|
||||||
this.BUFFCOMP.heathed();
|
this.heathed();
|
||||||
this.BUFFCOMP.show_heal(hp);
|
this.hp_show(hp, this.model.Attrs[Attrs.HP_MAX]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -202,25 +269,21 @@ export class HeroViewComp extends CCComp {
|
|||||||
in_stop (dt: number) {
|
in_stop (dt: number) {
|
||||||
|
|
||||||
}
|
}
|
||||||
count_atk_count(){ //主将攻击
|
|
||||||
if(this.fac==FacSet.MON) return
|
|
||||||
this.atk_count+=1
|
|
||||||
}
|
|
||||||
|
|
||||||
do_dead(){
|
do_dead(){
|
||||||
// 死亡逻辑主要由 HeroBattleSystem 处理
|
// 死亡逻辑主要由 HeroBattleSystem 处理
|
||||||
// 这里只保留视图层的表现逻辑
|
// 这里只保留视图层的表现逻辑
|
||||||
if(this.is_count_dead) return
|
if(this.model.is_count_dead) return
|
||||||
this.is_count_dead=true
|
|
||||||
|
|
||||||
if(this.fac==FacSet.MON){
|
if(this.model.fac==FacSet.MON){
|
||||||
this.scheduleOnce(()=>{
|
this.scheduleOnce(()=>{
|
||||||
this.do_drop()
|
this.do_drop()
|
||||||
},0.1)
|
},0.1)
|
||||||
}
|
}
|
||||||
if(this.fac==FacSet.HERO){
|
if(this.model.fac==FacSet.HERO){
|
||||||
this.scheduleOnce(()=>{
|
this.scheduleOnce(()=>{
|
||||||
oops.message.dispatchEvent(GameEvent.HeroDead,{hero_uuid:this.hero_uuid})
|
oops.message.dispatchEvent(GameEvent.HeroDead,{hero_uuid:this.model.hero_uuid})
|
||||||
},0.1)
|
},0.1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,7 +293,6 @@ export class HeroViewComp extends CCComp {
|
|||||||
|
|
||||||
do_atked(remainingDamage:number,CAttrs:any,s_uuid:number){
|
do_atked(remainingDamage:number,CAttrs:any,s_uuid:number){
|
||||||
// 使用战斗系统处理攻击逻辑
|
// 使用战斗系统处理攻击逻辑
|
||||||
const battleSystem = this.ent.ecs.getSystem(HeroBattleSystem);
|
|
||||||
if (!battleSystem) {
|
if (!battleSystem) {
|
||||||
console.error("[HeroViewComp] HeroBattleSystem 未找到");
|
console.error("[HeroViewComp] HeroBattleSystem 未找到");
|
||||||
return;
|
return;
|
||||||
@@ -246,12 +308,12 @@ export class HeroViewComp extends CCComp {
|
|||||||
}
|
}
|
||||||
//后退
|
//后退
|
||||||
back(){
|
back(){
|
||||||
if(this.fac==FacSet.MON) {
|
if(this.model.fac==FacSet.MON) {
|
||||||
let tx=this.node.position.x+5
|
let tx=this.node.position.x+5
|
||||||
if(tx > 320) tx=320
|
if(tx > 320) tx=320
|
||||||
tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start()
|
tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start()
|
||||||
}
|
}
|
||||||
if(this.fac==FacSet.HERO) {
|
if(this.model.fac==FacSet.HERO) {
|
||||||
let tx=this.node.position.x-5
|
let tx=this.node.position.x-5
|
||||||
if(tx < -320) tx=-320
|
if(tx < -320) tx=-320
|
||||||
tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start()
|
tween(this.node).to(0.1, { position:v3(tx,this.node.position.y,0)}).start()
|
||||||
@@ -260,11 +322,11 @@ export class HeroViewComp extends CCComp {
|
|||||||
// 伤害计算和战斗逻辑已迁移到 HeroBattleSystem
|
// 伤害计算和战斗逻辑已迁移到 HeroBattleSystem
|
||||||
|
|
||||||
do_dead_trigger(){ //死亡特殊处理
|
do_dead_trigger(){ //死亡特殊处理
|
||||||
if(this.is_dead||this.fac==FacSet.MON) return
|
if(this.model.is_dead||this.model.fac==FacSet.MON) return
|
||||||
|
|
||||||
}
|
}
|
||||||
do_atked_trigger(){ //受伤特殊处理
|
do_atked_trigger(){ //受伤特殊处理
|
||||||
if(this.is_dead||this.fac==FacSet.MON) return
|
if(this.model.is_dead||this.model.fac==FacSet.MON) return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,20 +337,14 @@ export class HeroViewComp extends CCComp {
|
|||||||
}
|
}
|
||||||
}).start()
|
}).start()
|
||||||
}
|
}
|
||||||
// to_alive(){
|
|
||||||
// this.is_dead=false
|
|
||||||
// this.currentHp=this.currentHpMax*(100+this.hp_buff)/100
|
|
||||||
// this.BUFFCOMP.vmdata_update(true)
|
|
||||||
// this.node.setPosition(HeroPos[this.fight_pos].pos)
|
|
||||||
// this.BUFFCOMP.heathed()
|
|
||||||
// }
|
|
||||||
|
|
||||||
to_console(value:any,value2:any=null,value3:any=null){
|
to_console(value:any,value2:any=null,value3:any=null){
|
||||||
//console.log("["+this.scale+this.hero_name+']'+value,value2,value3)
|
//console.log("["+this.scale+this.hero_name+']'+value,value2,value3)
|
||||||
}
|
}
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.is_dead = false;
|
this.model.is_dead = false;
|
||||||
const collider = this.getComponent(Collider2D);
|
const collider = this.getComponent(Collider2D);
|
||||||
if (collider) {
|
if (collider) {
|
||||||
collider.off(Contact2DType.BEGIN_CONTACT);
|
collider.off(Contact2DType.BEGIN_CONTACT);
|
||||||
@@ -303,7 +359,7 @@ export class HeroViewComp extends CCComp {
|
|||||||
switch(skill.act){
|
switch(skill.act){
|
||||||
case "max":
|
case "max":
|
||||||
this.as.max()
|
this.as.max()
|
||||||
this.BUFFCOMP.tooltip(TooltipTypes.skill,skill.name,skill_id)
|
this.tooltip(TooltipTypes.skill, skill.name, skill_id)
|
||||||
break
|
break
|
||||||
case "atk":
|
case "atk":
|
||||||
this.as.atk()
|
this.as.atk()
|
||||||
@@ -340,15 +396,12 @@ export class HeroViewComp extends CCComp {
|
|||||||
|
|
||||||
/** 立即显示伤害效果 */
|
/** 立即显示伤害效果 */
|
||||||
private showDamageImmediate(damage: number, isCrit: boolean, anm:string="atked") {
|
private showDamageImmediate(damage: number, isCrit: boolean, anm:string="atked") {
|
||||||
this.BUFFCOMP.hp_show(this.hp,this.Attrs[Attrs.HP_MAX])
|
this.hp_show(this.model.hp, this.model.Attrs[Attrs.HP_MAX]);
|
||||||
this.BUFFCOMP.in_atked(anm,this.fac==FacSet.HERO?1:-1)
|
this.in_atked(anm, this.model.fac==FacSet.HERO?1:-1);
|
||||||
this.atked_count++;
|
|
||||||
if (isCrit) {
|
if (isCrit) {
|
||||||
this.BUFFCOMP.hp_tip(TooltipTypes.crit, damage.toFixed(0), damage);
|
this.hp_tip(TooltipTypes.crit, damage.toFixed(0), damage);
|
||||||
// //console.log("暴击伤害 + damage);
|
|
||||||
} else {
|
} else {
|
||||||
this.BUFFCOMP.hp_tip(TooltipTypes.life, damage.toFixed(0), damage);
|
this.hp_tip(TooltipTypes.life, damage.toFixed(0), damage);
|
||||||
// //console.log("普通伤害:" + damage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
|||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||||
import { HeroInfo } from "../common/config/heroSet";
|
import { HeroInfo } from "../common/config/heroSet";
|
||||||
import { MonModelComp } from "./MonModelComp";
|
import { MonAttrsComp } from "./MonAttrsComp";
|
||||||
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
|
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
|
||||||
import { SkillConComp } from "./SkillConComp";
|
import { SkillConComp } from "./SkillConComp";
|
||||||
import { BuffConf, SkillSet } from "../common/config/SkillSet";
|
import { BuffConf, SkillSet } from "../common/config/SkillSet";
|
||||||
@@ -12,26 +12,26 @@ import { getNeAttrs, getAttrs ,Attrs} from "../common/config/HeroAttrs";
|
|||||||
import { TalComp } from "./TalComp";
|
import { TalComp } from "./TalComp";
|
||||||
import { getMonAttr, MonType } from "../map/RogueConfig";
|
import { getMonAttr, MonType } from "../map/RogueConfig";
|
||||||
import { EBusComp } from "./EBusComp";
|
import { EBusComp } from "./EBusComp";
|
||||||
import { MonViewComp } from "./MonViewComp";
|
import { HeroViewComp } from "./HeroViewComp";
|
||||||
/** 角色实体 */
|
/** 角色实体 */
|
||||||
@ecs.register(`Monster`)
|
@ecs.register(`Monster`)
|
||||||
export class Monster extends ecs.Entity {
|
export class Monster extends ecs.Entity {
|
||||||
HeroModel!: MonModelComp;
|
HeroModel!: MonAttrsComp;
|
||||||
HeroView!: MonViewComp;
|
HeroView!: HeroViewComp;
|
||||||
BattleMove!: BattleMoveComp;
|
BattleMove!: BattleMoveComp;
|
||||||
|
|
||||||
protected init() {
|
protected init() {
|
||||||
this.addComponents<ecs.Comp>(
|
this.addComponents<ecs.Comp>(
|
||||||
BattleMoveComp,
|
BattleMoveComp,
|
||||||
MonModelComp,
|
MonAttrsComp,
|
||||||
TalComp,
|
TalComp,
|
||||||
EBusComp,
|
EBusComp,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy(): void {
|
destroy(): void {
|
||||||
this.remove(MonViewComp);
|
this.remove(HeroViewComp);
|
||||||
this.remove(MonModelComp);
|
this.remove(MonAttrsComp);
|
||||||
this.remove(TalComp);
|
this.remove(TalComp);
|
||||||
this.remove(EBusComp);
|
this.remove(EBusComp);
|
||||||
super.destroy();
|
super.destroy();
|
||||||
@@ -52,8 +52,8 @@ export class Monster extends ecs.Entity {
|
|||||||
node.setPosition(pos)
|
node.setPosition(pos)
|
||||||
|
|
||||||
|
|
||||||
var view = node.getComponent(MonViewComp)!;
|
var view = node.getComponent(HeroViewComp)!;
|
||||||
const model = this.get(MonModelComp);
|
const model = this.get(MonAttrsComp);
|
||||||
let hero = HeroInfo[uuid]; // 共用英雄数据
|
let hero = HeroInfo[uuid]; // 共用英雄数据
|
||||||
// 设置 View 层属性(表现相关)
|
// 设置 View 层属性(表现相关)
|
||||||
view.scale = scale;
|
view.scale = scale;
|
||||||
@@ -116,16 +116,16 @@ export class MonLifecycleSystem extends ecs.ComblockSystem
|
|||||||
implements ecs.IEntityEnterSystem, ecs.IEntityRemoveSystem {
|
implements ecs.IEntityEnterSystem, ecs.IEntityRemoveSystem {
|
||||||
|
|
||||||
filter() {
|
filter() {
|
||||||
return ecs.allOf(MonModelComp);
|
return ecs.allOf(MonAttrsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
entityEnter(e: ecs.Entity): void {
|
entityEnter(e: ecs.Entity): void {
|
||||||
// 英雄实体创建时的特殊处理
|
// 英雄实体创建时的特殊处理
|
||||||
console.log(`怪物进入世界: ${e.get(MonModelComp).hero_name}`);
|
console.log(`怪物进入世界: ${e.get(MonAttrsComp).hero_name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
entityRemove(e: ecs.Entity): void {
|
entityRemove(e: ecs.Entity): void {
|
||||||
// 英雄实体销毁时的清理工作
|
// 英雄实体销毁时的清理工作
|
||||||
console.log(`怪物离开世界: ${e.get(MonModelComp).hero_name}`);
|
console.log(`怪物离开世界: ${e.get(MonAttrsComp).hero_name}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,10 +13,10 @@ import { HeroInfo, AttrSet } from "../common/config/heroSet";
|
|||||||
* 怪物属性数据模型 - 存储纯数据,不含表现逻辑
|
* 怪物属性数据模型 - 存储纯数据,不含表现逻辑
|
||||||
* 简化版本:只保留临时buff系统,移除持久型buff
|
* 简化版本:只保留临时buff系统,移除持久型buff
|
||||||
*
|
*
|
||||||
* 注意:HeroModelComp 中有详细的 ECS 架构分析,迁移方案见那个文件
|
* 注意:HeroAttrsComp 中有详细的 ECS 架构分析,迁移方案见那个文件
|
||||||
*/
|
*/
|
||||||
@ecs.register('MonModel')
|
@ecs.register('MonAttrsComp')
|
||||||
export class MonModelComp extends ecs.Comp {
|
export class MonAttrsComp extends ecs.Comp {
|
||||||
|
|
||||||
// ==================== 角色基础信息 ====================
|
// ==================== 角色基础信息 ====================
|
||||||
hero_uuid: number = 1001;
|
hero_uuid: number = 1001;
|
||||||
@@ -64,7 +64,7 @@ export class MonModelComp extends ecs.Comp {
|
|||||||
|
|
||||||
recalculateSingleAttr(attrIndex: number) {
|
recalculateSingleAttr(attrIndex: number) {
|
||||||
const baseValues: Record<number, number> = {
|
const baseValues: Record<number, number> = {
|
||||||
[Attrs.HP_MAX]: this.base_hp, [Attrs.MP_MAX]: this.base_mp, [Attrs.DEF]: this.base_def,
|
[Attrs.HP_MAX]: this.hp, [Attrs.MP_MAX]: this.mp, [Attrs.DEF]: this.def,
|
||||||
[Attrs.AP]: this.base_ap, [Attrs.MAP]: this.base_map, [Attrs.SPEED]: this.base_speed, [Attrs.SHIELD_MAX]: 0
|
[Attrs.AP]: this.base_ap, [Attrs.MAP]: this.base_map, [Attrs.SPEED]: this.base_speed, [Attrs.SHIELD_MAX]: 0
|
||||||
};
|
};
|
||||||
const baseVal = baseValues[attrIndex] !== undefined ? baseValues[attrIndex] : 0;
|
const baseVal = baseValues[attrIndex] !== undefined ? baseValues[attrIndex] : 0;
|
||||||
@@ -187,11 +187,11 @@ export class MonAttrSystem extends ecs.ComblockSystem
|
|||||||
implements ecs.ISystemUpdate {
|
implements ecs.ISystemUpdate {
|
||||||
|
|
||||||
filter(): ecs.IMatcher {
|
filter(): ecs.IMatcher {
|
||||||
return ecs.allOf(MonModelComp);
|
return ecs.allOf(MonAttrsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
update(e: ecs.Entity): void {
|
update(e: ecs.Entity): void {
|
||||||
const model = e.get(MonModelComp);
|
const model = e.get(MonAttrsComp);
|
||||||
if (!model || model.is_dead) return;
|
if (!model || model.is_dead) return;
|
||||||
|
|
||||||
// 怪物的属性更新逻辑(可以与英雄不同)
|
// 怪物的属性更新逻辑(可以与英雄不同)
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"ver": "4.0.24",
|
"ver": "4.0.24",
|
||||||
"importer": "typescript",
|
"importer": "typescript",
|
||||||
"imported": true,
|
"imported": true,
|
||||||
"uuid": "c9121e83-b457-492d-aa56-2119d79a3360",
|
"uuid": "b2b785de-2ec9-49ca-a015-b56c5fe19a50",
|
||||||
"files": [],
|
"files": [],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {}
|
"userData": {}
|
||||||
@@ -6,8 +6,8 @@ import { GameEvent } from '../common/config/GameEvent';
|
|||||||
import { FacSet } from '../common/config/BoxSet';
|
import { FacSet } from '../common/config/BoxSet';
|
||||||
import { smc } from '../common/SingletonModuleComp';
|
import { smc } from '../common/SingletonModuleComp';
|
||||||
import { CCComp } from 'db://oops-framework/module/common/CCComp';
|
import { CCComp } from 'db://oops-framework/module/common/CCComp';
|
||||||
import { MonModelComp } from './MonModelComp';
|
import { MonAttrsComp } from './MonAttrsComp';
|
||||||
import { HeroModelComp } from './HeroModelComp';
|
import { HeroAttrsComp } from './HeroAttrsComp';
|
||||||
import { SkillEnt } from '../skill/SkillEnt';
|
import { SkillEnt } from '../skill/SkillEnt';
|
||||||
import { Attrs } from '../common/config/HeroAttrs';
|
import { Attrs } from '../common/config/HeroAttrs';
|
||||||
import { TalComp } from './TalComp';
|
import { TalComp } from './TalComp';
|
||||||
@@ -18,7 +18,6 @@ const { ccclass, property } = _decorator;
|
|||||||
export class SkillConComp extends CCComp {
|
export class SkillConComp extends CCComp {
|
||||||
HeroView:any=null;
|
HeroView:any=null;
|
||||||
HeroEntity:any=null;
|
HeroEntity:any=null;
|
||||||
TALCOMP:any=null;
|
|
||||||
skill_cd=0
|
skill_cd=0
|
||||||
private _timers: { [key: string]: any } = {};
|
private _timers: { [key: string]: any } = {};
|
||||||
init(): void {
|
init(): void {
|
||||||
@@ -26,7 +25,6 @@ export class SkillConComp extends CCComp {
|
|||||||
}
|
}
|
||||||
onLoad(){
|
onLoad(){
|
||||||
this.HeroView=this.node.getComponent(HeroViewComp)
|
this.HeroView=this.node.getComponent(HeroViewComp)
|
||||||
this.TALCOMP=this.node.getComponent(TalComp)
|
|
||||||
}
|
}
|
||||||
start() {
|
start() {
|
||||||
this.HeroEntity=this.HeroView.ent
|
this.HeroEntity=this.HeroView.ent
|
||||||
@@ -109,9 +107,9 @@ export class SkillConComp extends CCComp {
|
|||||||
|
|
||||||
check_target(){
|
check_target(){
|
||||||
if(this.HeroView.fac==FacSet.HERO){
|
if(this.HeroView.fac==FacSet.HERO){
|
||||||
return ecs.query(ecs.allOf(MonModelComp))
|
return ecs.query(ecs.allOf(MonAttrsComp))
|
||||||
}else{
|
}else{
|
||||||
return ecs.query(ecs.allOf(HeroModelComp))
|
return ecs.query(ecs.allOf(HeroAttrsComp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get_front(entities:any){
|
get_front(entities:any){
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import { smc } from "../common/SingletonModuleComp";
|
|||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
// 导入肉鸽配置
|
// 导入肉鸽配置
|
||||||
import { MonType, EventType, getStageMonConfigs} from "./RogueConfig";
|
import { MonType, EventType, getStageMonConfigs} from "./RogueConfig";
|
||||||
import { MonModelComp } from "../hero/MonModelComp";
|
|
||||||
import { BuffConf } from "../common/config/SkillSet";
|
import { BuffConf } from "../common/config/SkillSet";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
/** 视图层对象 */
|
/** 视图层对象 */
|
||||||
|
|||||||
Reference in New Issue
Block a user