英雄召唤精简+ 清理无用技能文件

This commit is contained in:
2025-08-15 17:06:18 +08:00
parent a2db298fcd
commit eddc1cadde
32 changed files with 26 additions and 1478 deletions

View File

@@ -1,331 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "shoot1",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "shoot1",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 8
},
{
"__id__": 10
},
{
"__id__": 12
},
{
"__id__": 14
},
{
"__id__": 16
}
],
"_prefab": {
"__id__": 18
},
"_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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "skill",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 50,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 2,
"y": 2,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_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": 84,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.49367133720771417,
"y": 0.5723333146837023
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "43ucwKXvZIjpuRMb6AMdcx"
},
{
"__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": null,
"_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": "62kIaCLMJIDKY/ceTYVdJH"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b05wpkPXFJqK6/PzoIxCfr",
"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": 120,
"height": 80
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.49664333316829656,
"y": 0.5156666649712457
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "63NP9yq3hEUKD/OZZZ5t7x"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"playOnLoad": true,
"_clips": [
{
"__uuid__": "1badb6e0-6f9b-47db-81ec-4ae15720ceb3",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": {
"__uuid__": "1badb6e0-6f9b-47db-81ec-4ae15720ceb3",
"__expectedType__": "cc.AnimationClip"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "740VLvDr9KhoDhfPiTCnnK"
},
{
"__type__": "45646oIyIdA24W+0c5rdELD",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8ahZv91itPcYJm8S0veHYl"
},
{
"__type__": "f5c0acU9TtA5JBGObMPOZe3",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": false,
"__prefab": {
"__id__": 15
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "14s7KpM7tDnqD8mx0vPHt/"
},
{
"__type__": "9e0d3yayihFMKm6st+kCG3D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": false,
"__prefab": {
"__id__": 17
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "cdzG46A0NJkodHq6XNVPWt"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c46/YsCPVOJYA4mWEpNYRx",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "b7482f08-1915-4885-aaf3-1963c0265147",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "shoot1"
}
}

View File

@@ -1,470 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "shoot2",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "shoot2",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
},
{
"__id__": 22
}
],
"_prefab": {
"__id__": 24
},
"_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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "skill",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 70,
"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": 1073741824,
"_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": 84,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5723333146837023
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "43ucwKXvZIjpuRMb6AMdcx"
},
{
"__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": null,
"_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": "62kIaCLMJIDKY/ceTYVdJH"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b05wpkPXFJqK6/PzoIxCfr",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Node",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 113.381,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 0.6,
"y": 0.6,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 164,
"height": 164
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "75fF1JcH1JRLeWcFeWbzln"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 0,
"b": 0,
"a": 255
},
"_spriteFrame": {
"__uuid__": "093403fd-fec9-42ef-b952-5831234ff06e@327ab",
"__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": "16EFOyuTtN2aX3AIBvAkRS"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "d7rFJTJ8RC9oChyvJhcVEo",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 10
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.49664333316829656,
"y": 0.5156666649712457
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "63NP9yq3hEUKD/OZZZ5t7x"
},
{
"__type__": "45646oIyIdA24W+0c5rdELD",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8ahZv91itPcYJm8S0veHYl"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"playOnLoad": true,
"_clips": [
{
"__uuid__": "f8336711-584e-45c3-bd16-3f9b1ad084d0",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": {
"__uuid__": "f8336711-584e-45c3-bd16-3f9b1ad084d0",
"__expectedType__": "cc.AnimationClip"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "740VLvDr9KhoDhfPiTCnnK"
},
{
"__type__": "2e239CwoM1FmoR8QJ5eOtPz",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": false,
"__prefab": {
"__id__": 21
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "124to0krdBXqGfGZqRI7GY"
},
{
"__type__": "45555O5rSNCoInYTSkGkxIS",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": false,
"__prefab": {
"__id__": 23
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2eOtnCTuhEwp9OyfzhuUCr"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c46/YsCPVOJYA4mWEpNYRx",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "9625da0e-f667-495f-981b-6dad139a65d8",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "shoot2"
}
}

View File

@@ -1,184 +0,0 @@
[
{
"__type__": "cc.Prefab",
"_name": "wind",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "wind",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": false,
"_components": [
{
"__id__": 2
},
{
"__id__": 4
},
{
"__id__": 6
}
],
"_prefab": {
"__id__": 8
},
"_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": 0.7,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 106.70999908447266,
"height": 108
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5000468659746804,
"y": 0.11898148501360858
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "92iyOUSpROt5I/Qbr0n0VR"
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 5
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_skeletonData": {
"__uuid__": "af716091-7de8-4a09-9f4e-bb7c9c40d0db",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "show",
"_premultipliedAlpha": true,
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
"_debugSlots": false,
"_enableBatch": false,
"loop": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "a32g1O2bxLI6D28EOYFjld"
},
{
"__type__": "f680dkagx9PmbfqtF463/Ua",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 7
},
"speed": 600,
"controlPointSide": 1,
"controlPointOffset": 0.5,
"controlPointRandomness": 0.3,
"autoRotate": true,
"showTrajectory": true,
"trajectoryColor": {
"__type__": "cc.Color",
"r": 0,
"g": 255,
"b": 0,
"a": 255
},
"trajectoryWidth": 3,
"easing": "linear",
"rotationSmoothness": 0.6,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c7oqZKuutF/aQd3exMADCG"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "733PKzwANLyJWD2ume4u5f",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -1,13 +0,0 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "afb84e4d-b478-4ab6-8f14-4f69d7a2c57f",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "wind"
}
}

View File

@@ -366,15 +366,15 @@ export const UpgradeResourceConfig = {
// 经验值配置 // 经验值配置
experience: { experience: {
base: 100, // 初始值1级升2级所需经验 base: 100, // 初始值1级升2级所需经验
growth: 1.5, // 增长值:每级增长倍数 growth: 50, // 增长值:每级增长倍数
bonus: 0.2 // 增长值提升比例5级倍数提升20% bonus: 100 // 增长值提升比例5级倍数提升20%
}, },
// 金币配置 // 金币配置
gold: { gold: {
base: 50, // 初始值1级升2级所需金币 base: 50, // 初始值1级升2级所需金币
growth: 1.3, // 增长值:每级增长倍数 growth: 100, // 增长值:每级增长倍数
bonus: 0.15 // 增长值提升比例5级倍数提升15% bonus: 500 // 增长值提升比例5级倍数提升15%
} }
}; };
@@ -385,13 +385,13 @@ export const UpgradeResourceConfig = {
*/ */
export const getUpgradeExperience = (level: number): number => { export const getUpgradeExperience = (level: number): number => {
if (level <= 0) return 0; if (level <= 0) return 0;
let next_level=level+1
const config = UpgradeResourceConfig.experience; const config = UpgradeResourceConfig.experience;
let result = config.base * Math.pow(config.growth, level - 1); let result = config.base + config.growth * (next_level - 1);
// 5级倍数提升 // 5级倍数提升
if (level % 5 === 0) { if (next_level % 5 === 0) {
result = result * (1 + config.bonus); result = result + config.bonus*next_level;
} }
return Math.floor(result); return Math.floor(result);
@@ -404,13 +404,13 @@ export const getUpgradeExperience = (level: number): number => {
*/ */
export const getUpgradeGold = (level: number): number => { export const getUpgradeGold = (level: number): number => {
if (level <= 0) return 0; if (level <= 0) return 0;
let next_level=level+1
const config = UpgradeResourceConfig.gold; const config = UpgradeResourceConfig.gold;
let result = config.base * Math.pow(config.growth, level - 1); let result = config.base + config.growth * (next_level - 1);
// 5级倍数提升 // 5级倍数提升
if (level % 5 === 0) { if (next_level % 5 === 0) {
result = result * (1 + config.bonus); result = result + config.bonus*next_level;
} }
return Math.floor(result); return Math.floor(result);

View File

@@ -5,7 +5,7 @@ import { smc } from "../common/SingletonModuleComp";
import { HeroModelComp } from "./HeroModelComp"; import { HeroModelComp } from "./HeroModelComp";
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 { getHeroStatsByLevel, HeroInfo, HeroPos, HType } from "../common/config/heroSet";
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp"; import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
import { GameEvent } from "../common/config/GameEvent"; import { GameEvent } from "../common/config/GameEvent";
import { BuffAttr, getBuffNum, SkillSet } from "../common/config/SkillSet"; import { BuffAttr, getBuffNum, SkillSet } from "../common/config/SkillSet";
@@ -36,7 +36,7 @@ export class Hero extends ecs.Entity {
/** 加载角色 */ /** 加载角色 */
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,info:any={ap:0,hp:0,lv:1,crit:0,crit_d:0,dod:0,dod_no:false,crit_no:false},fight_pos:number=1) { load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,fight_pos:number=1) {
// console.log("英雄加载:",uuid,pos,scale,info) // console.log("英雄加载:",uuid,pos,scale,info)
scale = 1 scale = 1
// 查找空闲英雄槽位 // 查找空闲英雄槽位
@@ -48,7 +48,7 @@ export class Hero extends ecs.Entity {
node.parent = scene.entityLayer!.node! node.parent = scene.entityLayer!.node!
node.setPosition(pos) node.setPosition(pos)
// console.log("hero load",pos) // console.log("hero load",pos)
var hv = this.hero_init(uuid,node,info) var hv = this.hero_init(uuid,node)
this.add(hv); this.add(hv);
oops.message.dispatchEvent(GameEvent.MasterCalled,{uuid:uuid}) oops.message.dispatchEvent(GameEvent.MasterCalled,{uuid:uuid})
const move = this.get(BattleMoveComp); const move = this.get(BattleMoveComp);
@@ -62,13 +62,15 @@ export class Hero extends ecs.Entity {
} }
smc.vmdata.mission_data.hero_num++ smc.vmdata.mission_data.hero_num++
} }
hero_init(uuid:number=1001,node:Node,info:any={ap:0,hp:0,lv:1,crit:0,crit_d:0,dod:0,dod_no:false,crit_no:false}) { hero_init(uuid:number=1001,node:Node) {
var hv = node.getComponent(HeroViewComp)!; var hv = node.getComponent(HeroViewComp)!;
let hero= HeroInfo[uuid] // 共用英雄数据 let hero= HeroInfo[uuid] // 共用英雄数据
let hero_lv=smc.heros[uuid].lv
let {hp,ap,def}=getHeroStatsByLevel(uuid,hero_lv)
hv.scale = 1; hv.scale = 1;
hv.is_master=true; hv.is_master=true;
hv.lv=1 hv.lv=1
hv.lv=info.lv hv.lv=hero_lv
hv.fac = FacSet.HERO; hv.fac = FacSet.HERO;
hv.type = hero.type; hv.type = hero.type;
hv.box_group = BoxSet.HERO; hv.box_group = BoxSet.HERO;
@@ -78,8 +80,9 @@ export class Hero extends ecs.Entity {
hv.Attrs[BuffAttr.SPEED]=hv.speed = hero.speed; hv.Attrs[BuffAttr.SPEED]=hv.speed = hero.speed;
hv.Attrs[BuffAttr.DIS]=hv.dis=hero.dis; hv.Attrs[BuffAttr.DIS]=hv.dis=hero.dis;
hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd
hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hero.hp+info.hp hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hp
hv.Attrs[BuffAttr.AP]=hv.ap=hero.ap+info.ap; hv.Attrs[BuffAttr.AP]=hv.ap=ap;
hv.Attrs[BuffAttr.DEF]=def
hero.buff.forEach((buff:any)=>{ hero.buff.forEach((buff:any)=>{
hv.apply_buff(buff.type,buff.value) hv.apply_buff(buff.type,buff.value)
}) })

View File

@@ -30,7 +30,7 @@ export class Monster extends ecs.Entity {
} }
/** 加载角色 */ /** 加载角色 */
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,lv:number=1,enhancement?: any, stageMultipliers?: any) { load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) {
scale=-1 scale=-1
let box_group=BoxSet.MONSTER let box_group=BoxSet.MONSTER
console.log("mon load",uuid) console.log("mon load",uuid)
@@ -45,7 +45,7 @@ export class Monster extends ecs.Entity {
const collider = node.getComponent(BoxCollider2D); const collider = node.getComponent(BoxCollider2D);
if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体 if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体
node.setPosition(pos) node.setPosition(pos)
this.hero_init(uuid,node,scale,box_group,is_boss,is_call,lv,enhancement,stageMultipliers) this.hero_init(uuid,node,scale,box_group,is_boss,is_call,enhancement,stageMultipliers)
oops.message.dispatchEvent("monster_load",this) oops.message.dispatchEvent("monster_load",this)
// 初始化移动参数 // 初始化移动参数
@@ -62,7 +62,7 @@ export class Monster extends ecs.Entity {
node.parent = scene.entityLayer!.node! node.parent = scene.entityLayer!.node!
node.setPosition(pos) node.setPosition(pos)
} }
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,lv:number=1,enhancement?: any, stageMultipliers?: any) { hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) {
var hv = node.getComponent(HeroViewComp)!; var hv = node.getComponent(HeroViewComp)!;
hv.hide_info() hv.hide_info()
// console.log("hero_init",buff) // console.log("hero_init",buff)

View File

@@ -206,7 +206,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
let pos: Vec3 = v3(MonSet[i].pos); let pos: Vec3 = v3(MonSet[i].pos);
// 生成怪物,传递增强属性和关卡倍数 // 生成怪物,传递增强属性和关卡倍数
mon.load(pos, scale, uuid, is_boss, is_call, lv, enhancement, stageMultipliers); mon.load(pos,scale,uuid,is_boss,is_call,enhancement, stageMultipliers);
// 如果有增强属性,记录到控制台 // 如果有增强属性,记录到控制台
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) { if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {

View File

@@ -1,73 +0,0 @@
import { _decorator, Animation, Collider2D, Component, Node, RigidBody2D, sp } from 'cc';
import { SkillCom } from './SkillCom';
import { BoxSet } from '../common/config/BoxSet';
import { Hero } from '../hero/Hero';
const { ccclass, property } = _decorator;
@ccclass('EndAnmBomCom')
export class EndAnmBomCom extends Component {
time:number = 0
base:SkillCom = null
collider:Collider2D = null
is_complete:boolean = false
start() {
this.base =this.node.getComponent(SkillCom)
this.collider = this.getComponent(Collider2D);
// this.collider.enabled = false
// if(this.base.box_group ==BoxSet.HERO) this.collider.group = BoxSet.MONSTER
// if(this.base.box_group ==BoxSet.MONSTER) this.collider.group = BoxSet.HERO
if(this.node.getComponent(Animation)){
let anim = this.node.getComponent(Animation);
console.log("has anim",anim)
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
if(this.node.getChildByName('anm')){
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton;
console.log("has spine",spine)
spine.setCompleteListener((trackEntry) => {
this.onAnimationFinished()
console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex);
});
// spine.setEventListener((trackEntry, event:any) => {
// this.onEnvent(event)
// // console.log("[track %s][animation %s] event: %s", trackEntry.trackIndex, event.data.name, event.intValue);
// });
}
}
}
onAnimationFinished(){
// if(!this.is_complete){
// // this.collider.group = this.base.box_group
// // this.node.active=false
// // this.node.active=true
// this.rigid.wakeUp()
// // this.collider.enabled = true
// console.log("动画结束,开始伤害")
// }
// this.collider.enabled = true
console.log("动画结束,开始伤害")
this.base.is_destroy = true
}
onEnvent(event:any){
if(event.data.name == "atk_event"){
// this.collider.group = this.base.box_group
// this.node.active=false
// this.node.active=true
// this.collider.enabled = true
console.log("onEnvent,开始伤害",event)
this.is_complete=true
}
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "455553b9-ad23-42a0-89d8-4d2906931212",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,36 +0,0 @@
import { _decorator, Animation, Component, Node, sp } from 'cc';
import { SkillCom } from './SkillCom';
const { ccclass, property } = _decorator;
@ccclass('EndAnmCom')
export class EndAnmCom extends Component {
start() {
if(this.node.getComponent(Animation)){
let anim = this.node.getComponent(Animation);
console.log("has anim",anim)
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
if(this.node.getChildByName('anm')){
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton;
console.log("has spine",spine)
spine.setCompleteListener((trackEntry) => {
this.onAnimationFinished()
console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex);
});
}
}
}
onAnimationFinished(){
console.log("动画播放完毕")
let bese = this.node.getComponent(SkillCom)
bese.is_destroy = true
}
update(deltaTime: number) {
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "9e0d3c9a-ca28-4530-a9ba-b2dfa4086dc3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,20 +0,0 @@
import { _decorator, Collider2D, Component, Contact2DType, Node } from 'cc';
import { SkillCom } from './SkillCom';
const { ccclass, property } = _decorator;
@ccclass('EndBoxCom')
export class EndBoxCom extends Component {
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
let collider = this.getComponent(Collider2D);
if (collider) {
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
}
}
onBeginContact (seCol: Collider2D, otCol: Collider2D) {
if(otCol.group != seCol.group&&otCol.tag ==0)this.base.is_destroy=true
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "2332add2-8701-4636-bd89-184f6f4893de",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,22 +0,0 @@
import { _decorator, Component, Node } from 'cc';
import { SkillCom } from './SkillCom';
import { smc } from '../common/SingletonModuleComp';
const { ccclass, property } = _decorator;
@ccclass('EndLineCom')
export class EndLineCom extends Component {
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
}
update(deltaTime: number) {
if(smc.mission.pause) return
if(this.node.position.x > 500 || this.node.position.x<-500){
this.base.is_destroy = true
}
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "c92ad7af-330c-4161-86c5-8d5736e5e57d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,23 +0,0 @@
import { _decorator, Component, Node } from 'cc';
import { SkillCom } from './SkillCom';
import { smc } from '../common/SingletonModuleComp';
const { ccclass, property } = _decorator;
@ccclass('EndTimeCom')
export class EndTimeCom extends Component {
time:number = 0
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
}
update(deltaTime: number) {
if(smc.mission.pause) return
this.time+=deltaTime
if(this.time>=this.base.in_time){
this.base.is_destroy = true
}
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "6a7fe8c9-c479-4ce6-bfd3-4bc2051752aa",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,20 +0,0 @@
import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc';
import { SkillCom } from './SkillCom';
import { smc } from '../common/SingletonModuleComp';
const { ccclass, property } = _decorator;
@ccclass('LineCom')
export class LineCom extends Component {
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
this.node.setPosition(this.node.position.x,this.node.position.y+50,this.node.position.z)
}
update(deltaTime: number) {
if(smc.mission.pause) return
this.node.setPosition(this.node.position.x+this.base.speed*deltaTime*this.base.scale,this.node.position.y,this.node.position.z)
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "2050354e-73b6-40f3-8b1b-a7c1bbda9c59",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,17 +0,0 @@
import { _decorator, Component, Node } from 'cc';
import { SkillCom } from './SkillCom';
import { BoxSet } from '../common/config/BoxSet';
const { ccclass, property } = _decorator;
@ccclass('StartCom')
export class StartCom extends Component {
start() {
this.node.setPosition(0,0)
}
update(deltaTime: number) {
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "61a5611c-1772-4c97-be58-795e13f763f3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,22 +0,0 @@
import { _decorator, Component, Node, v3 } from 'cc';
import { SkillCom } from './SkillCom';
import { BoxSet } from '../common/config/BoxSet';
import { smc } from '../common/SingletonModuleComp';
const { ccclass, property } = _decorator;
@ccclass('TgCom')
export class TgCom extends Component {
time:number = 0
cd:number = 0
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
this.node.setPosition(this.base.t_pos)
}
update(deltaTime: number) {
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "2e2390b0-a0cd-459a-847c-409e5e3ad3f3",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,14 +0,0 @@
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('TgLineCom')
export class TgLineCom extends Component {
start() {
}
update(deltaTime: number) {
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "b7a2bf85-f71f-4c4c-bda0-e13e8730dd43",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,42 +0,0 @@
import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
import { SkillCom } from './SkillCom';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { Hero } from '../hero/Hero';
import { BoxSet, FacSet } from '../common/config/BoxSet';
import { Monster } from '../hero/Mon';
import { HeroViewComp } from '../hero/HeroViewComp';
import { smc } from '../common/SingletonModuleComp';
import { oops } from 'db://oops-framework/core/Oops';
import { HeroInfo } from '../common/config/heroSet';
const { ccclass, property } = _decorator;
//这是召唤技能
@ccclass('ZhanCom')
export class ZhanCom extends Component {
base:SkillCom = null
start() {
console.log("ZhanCom:",this.base)
this.base =this.node.getComponent(SkillCom)
let pos = this.node.position
let hero:any=null
var path = "game/skills/dead";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.parent = this.node.parent;
node.setPosition(pos);
if(this.base.fac==FacSet.HERO) {
hero = ecs.getEntity<Hero>(Hero);
let scale = 1
hero.load(pos,scale,this.base.hero,true,HeroInfo[this.base.hero].lv);
}
if(this.base.fac==FacSet.MON) {
hero = ecs.getEntity<Monster>(Monster);
}
}
update(deltaTime: number) {
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "eb0df9e9-d129-4d4b-b5ef-e63d068942e6",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -1,43 +0,0 @@
import { _decorator, Animation, Component, Node, sp } from 'cc';
import { SkillCom } from './SkillCom';
import { SkillSet } from '../common/config/SkillSet';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { Skill } from './Skill';
const { ccclass, property } = _decorator;
@ccclass('seCom')
export class seCom extends Component {
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
if(this.node.getComponent(Animation)){
let anim = this.node.getComponent(Animation);
console.log("has anim",anim)
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
if(this.node.getChildByName('anm')){
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton;
console.log("has spine",spine)
spine.setCompleteListener((trackEntry) => {
this.onAnimationFinished()
console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex);
});
}
}
}
update(deltaTime: number) {
}
onAnimationFinished(){
let skill = ecs.getEntity<Skill>(Skill);
this.base.to_console("=>技能二段触发=>"+SkillSet[this.base.s_uuid].sonsk)
skill.load(this.node.position,this.base.box_group,this.base.node,SkillSet[this.base.s_uuid].sonsk,this.base.ap,this.base.t_pos,this.base.is_crit,this.base.crit_add);
this.base.is_destroy=true
}
}

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "f5c0a714-f53b-40e4-9046-39b30f3997b7",
"files": [],
"subMetas": {},
"userData": {}
}