From 518a9a1ce97dab6d2f5eca4cea1b4ca1ad69f749 Mon Sep 17 00:00:00 2001 From: walkpan Date: Sun, 24 May 2026 23:21:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E5=B1=9E=E6=80=A7=E5=AD=98=E6=A1=A3=E4=B8=8E?= =?UTF-8?q?UI=E5=B1=9E=E6=80=A7=E5=8A=A0=E6=88=90=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增base_ap和base_hp属性存储英雄原始基础攻防属性 2. 实现属性加成差值显示,展示当前属性与基础属性的差异 3. 重构英雄信息UI,新增名字、关闭按钮等节点绑定 4. 调整英雄预制体布局,适配新的UI展示需求 5. 补充战斗触发类型注释文档 --- assets/resources/gui/element/hnode.prefab | 411 ++++++++++---------- assets/script/game/common/config/heroSet.ts | 13 + assets/script/game/hero/Hero.ts | 3 + assets/script/game/hero/HeroAttrsComp.ts | 4 + assets/script/game/map/HInfoComp.ts | 88 ++++- 5 files changed, 293 insertions(+), 226 deletions(-) diff --git a/assets/resources/gui/element/hnode.prefab b/assets/resources/gui/element/hnode.prefab index 2f06363e..f1b3cabe 100644 --- a/assets/resources/gui/element/hnode.prefab +++ b/assets/resources/gui/element/hnode.prefab @@ -46,29 +46,29 @@ "__id__": 449 }, { - "__id__": 466 + "__id__": 465 }, { - "__id__": 483 + "__id__": 481 }, { - "__id__": 559 + "__id__": 557 } ], "_active": true, "_components": [ + { + "__id__": 577 + }, { "__id__": 579 }, { "__id__": 581 - }, - { - "__id__": 583 } ], "_prefab": { - "__id__": 585 + "__id__": 583 }, "_lpos": { "__type__": "cc.Vec3", @@ -9300,7 +9300,7 @@ "__id__": 1 }, "_children": [], - "_active": false, + "_active": true, "_components": [ { "__id__": 406 @@ -9314,8 +9314,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": 46.513, + "x": -230.098, + "y": -50.4, "z": 0 }, "_lrot": { @@ -9475,7 +9475,7 @@ "__id__": 436 } ], - "_active": true, + "_active": false, "_components": [ { "__id__": 442 @@ -10354,11 +10354,11 @@ "__id__": 460 }, { - "__id__": 463 + "__id__": 462 } ], "_prefab": { - "__id__": 465 + "__id__": 464 }, "_lpos": { "__type__": "cc.Vec3", @@ -10636,11 +10636,7 @@ "__prefab": { "__id__": 461 }, - "clickEvents": [ - { - "__id__": 462 - } - ], + "clickEvents": [], "_interactable": true, "_transition": 3, "_normalColor": { @@ -10686,16 +10682,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "56wpoEM/ZMrpxad3T7+vHu" }, - { - "__type__": "cc.ClickEvent", - "target": { - "__id__": 1 - }, - "component": "", - "_componentId": "a832fh9yR9LJK1kR+tZ1lin", - "handler": "onSellHero", - "customEventData": "" - }, { "__type__": "cc.Widget", "_name": "", @@ -10706,7 +10692,7 @@ }, "_enabled": false, "__prefab": { - "__id__": 464 + "__id__": 463 }, "_alignFlags": 44, "_target": null, @@ -10755,26 +10741,26 @@ }, "_children": [ { - "__id__": 467 + "__id__": 466 } ], "_active": true, "_components": [ { - "__id__": 473 + "__id__": 472 }, { - "__id__": 475 + "__id__": 474 }, { - "__id__": 477 + "__id__": 476 }, { - "__id__": 480 + "__id__": 478 } ], "_prefab": { - "__id__": 482 + "__id__": 480 }, "_lpos": { "__type__": "cc.Vec3", @@ -10811,20 +10797,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 466 + "__id__": 465 }, "_children": [], "_active": true, "_components": [ { - "__id__": 468 + "__id__": 467 }, { - "__id__": 470 + "__id__": 469 } ], "_prefab": { - "__id__": 472 + "__id__": 471 }, "_lpos": { "__type__": "cc.Vec3", @@ -10861,11 +10847,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 467 + "__id__": 466 }, "_enabled": true, "__prefab": { - "__id__": 469 + "__id__": 468 }, "_contentSize": { "__type__": "cc.Size", @@ -10889,11 +10875,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 467 + "__id__": 466 }, "_enabled": true, "__prefab": { - "__id__": 471 + "__id__": 470 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -10970,11 +10956,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 466 + "__id__": 465 }, "_enabled": true, "__prefab": { - "__id__": 474 + "__id__": 473 }, "_contentSize": { "__type__": "cc.Size", @@ -10998,11 +10984,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 466 + "__id__": 465 }, "_enabled": true, "__prefab": { - "__id__": 476 + "__id__": 475 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11046,17 +11032,13 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 466 + "__id__": 465 }, "_enabled": true, "__prefab": { - "__id__": 478 + "__id__": 477 }, - "clickEvents": [ - { - "__id__": 479 - } - ], + "clickEvents": [], "_interactable": true, "_transition": 3, "_normalColor": { @@ -11094,7 +11076,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 466 + "__id__": 465 }, "_id": "" }, @@ -11102,27 +11084,17 @@ "__type__": "cc.CompPrefabInfo", "fileId": "00TM0QJRdFTqMlhIrIiPZn" }, - { - "__type__": "cc.ClickEvent", - "target": { - "__id__": 1 - }, - "component": "", - "_componentId": "a832fh9yR9LJK1kR+tZ1lin", - "handler": "onSellHero", - "customEventData": "" - }, { "__type__": "cc.Widget", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 466 + "__id__": 465 }, "_enabled": false, "__prefab": { - "__id__": 481 + "__id__": 479 }, "_alignFlags": 44, "_target": null, @@ -11171,26 +11143,26 @@ }, "_children": [ { - "__id__": 484 + "__id__": 482 }, { - "__id__": 518 + "__id__": 516 } ], "_active": true, "_components": [ + { + "__id__": 550 + }, { "__id__": 552 }, { "__id__": 554 - }, - { - "__id__": 556 } ], "_prefab": { - "__id__": 558 + "__id__": 556 }, "_lpos": { "__type__": "cc.Vec3", @@ -11227,36 +11199,36 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 483 + "__id__": 481 }, "_children": [ { - "__id__": 485 + "__id__": 483 }, { - "__id__": 493 + "__id__": 491 }, { - "__id__": 499 + "__id__": 497 }, { - "__id__": 505 + "__id__": 503 } ], "_active": true, "_components": [ + { + "__id__": 509 + }, { "__id__": 511 }, { "__id__": 513 - }, - { - "__id__": 515 } ], "_prefab": { - "__id__": 517 + "__id__": 515 }, "_lpos": { "__type__": "cc.Vec3", @@ -11293,23 +11265,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 484 + "__id__": 482 }, "_children": [], "_active": true, "_components": [ + { + "__id__": 484 + }, { "__id__": 486 }, { "__id__": 488 - }, - { - "__id__": 490 } ], "_prefab": { - "__id__": 492 + "__id__": 490 }, "_lpos": { "__type__": "cc.Vec3", @@ -11346,11 +11318,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 485 + "__id__": 483 }, "_enabled": true, "__prefab": { - "__id__": 487 + "__id__": 485 }, "_contentSize": { "__type__": "cc.Size", @@ -11374,11 +11346,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 485 + "__id__": 483 }, "_enabled": true, "__prefab": { - "__id__": 489 + "__id__": 487 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11422,11 +11394,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 485 + "__id__": 483 }, "_enabled": true, "__prefab": { - "__id__": 491 + "__id__": 489 }, "_alignFlags": 45, "_target": null, @@ -11471,20 +11443,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 484 + "__id__": 482 }, "_children": [], "_active": true, "_components": [ { - "__id__": 494 + "__id__": 492 }, { - "__id__": 496 + "__id__": 494 } ], "_prefab": { - "__id__": 498 + "__id__": 496 }, "_lpos": { "__type__": "cc.Vec3", @@ -11521,11 +11493,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 493 + "__id__": 491 }, "_enabled": true, "__prefab": { - "__id__": 495 + "__id__": 493 }, "_contentSize": { "__type__": "cc.Size", @@ -11549,11 +11521,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 493 + "__id__": 491 }, "_enabled": true, "__prefab": { - "__id__": 497 + "__id__": 495 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11607,20 +11579,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 484 + "__id__": 482 }, "_children": [], "_active": true, "_components": [ { - "__id__": 500 + "__id__": 498 }, { - "__id__": 502 + "__id__": 500 } ], "_prefab": { - "__id__": 504 + "__id__": 502 }, "_lpos": { "__type__": "cc.Vec3", @@ -11657,11 +11629,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 499 + "__id__": 497 }, "_enabled": true, "__prefab": { - "__id__": 501 + "__id__": 499 }, "_contentSize": { "__type__": "cc.Size", @@ -11685,11 +11657,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 499 + "__id__": 497 }, "_enabled": true, "__prefab": { - "__id__": 503 + "__id__": 501 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11766,20 +11738,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 484 + "__id__": 482 }, "_children": [], "_active": true, "_components": [ { - "__id__": 506 + "__id__": 504 }, { - "__id__": 508 + "__id__": 506 } ], "_prefab": { - "__id__": 510 + "__id__": 508 }, "_lpos": { "__type__": "cc.Vec3", @@ -11816,11 +11788,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 505 + "__id__": 503 }, "_enabled": true, "__prefab": { - "__id__": 507 + "__id__": 505 }, "_contentSize": { "__type__": "cc.Size", @@ -11844,11 +11816,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 505 + "__id__": 503 }, "_enabled": true, "__prefab": { - "__id__": 509 + "__id__": 507 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11925,11 +11897,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 484 + "__id__": 482 }, "_enabled": true, "__prefab": { - "__id__": 512 + "__id__": 510 }, "_contentSize": { "__type__": "cc.Size", @@ -11953,11 +11925,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 484 + "__id__": 482 }, "_enabled": false, "__prefab": { - "__id__": 514 + "__id__": 512 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -11998,11 +11970,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 484 + "__id__": 482 }, "_enabled": false, "__prefab": { - "__id__": 516 + "__id__": 514 }, "_alignFlags": 44, "_target": null, @@ -12047,36 +12019,36 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 483 + "__id__": 481 }, "_children": [ { - "__id__": 519 + "__id__": 517 }, { - "__id__": 527 + "__id__": 525 }, { - "__id__": 533 + "__id__": 531 }, { - "__id__": 539 + "__id__": 537 } ], "_active": true, "_components": [ + { + "__id__": 543 + }, { "__id__": 545 }, { "__id__": 547 - }, - { - "__id__": 549 } ], "_prefab": { - "__id__": 551 + "__id__": 549 }, "_lpos": { "__type__": "cc.Vec3", @@ -12113,23 +12085,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 518 + "__id__": 516 }, "_children": [], "_active": true, "_components": [ + { + "__id__": 518 + }, { "__id__": 520 }, { "__id__": 522 - }, - { - "__id__": 524 } ], "_prefab": { - "__id__": 526 + "__id__": 524 }, "_lpos": { "__type__": "cc.Vec3", @@ -12166,11 +12138,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 519 + "__id__": 517 }, "_enabled": true, "__prefab": { - "__id__": 521 + "__id__": 519 }, "_contentSize": { "__type__": "cc.Size", @@ -12194,11 +12166,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 519 + "__id__": 517 }, "_enabled": true, "__prefab": { - "__id__": 523 + "__id__": 521 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12242,11 +12214,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 519 + "__id__": 517 }, "_enabled": true, "__prefab": { - "__id__": 525 + "__id__": 523 }, "_alignFlags": 45, "_target": null, @@ -12291,20 +12263,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 518 + "__id__": 516 }, "_children": [], "_active": true, "_components": [ { - "__id__": 528 + "__id__": 526 }, { - "__id__": 530 + "__id__": 528 } ], "_prefab": { - "__id__": 532 + "__id__": 530 }, "_lpos": { "__type__": "cc.Vec3", @@ -12341,11 +12313,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 527 + "__id__": 525 }, "_enabled": true, "__prefab": { - "__id__": 529 + "__id__": 527 }, "_contentSize": { "__type__": "cc.Size", @@ -12369,11 +12341,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 527 + "__id__": 525 }, "_enabled": true, "__prefab": { - "__id__": 531 + "__id__": 529 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12427,20 +12399,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 518 + "__id__": 516 }, "_children": [], "_active": true, "_components": [ { - "__id__": 534 + "__id__": 532 }, { - "__id__": 536 + "__id__": 534 } ], "_prefab": { - "__id__": 538 + "__id__": 536 }, "_lpos": { "__type__": "cc.Vec3", @@ -12477,11 +12449,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 533 + "__id__": 531 }, "_enabled": true, "__prefab": { - "__id__": 535 + "__id__": 533 }, "_contentSize": { "__type__": "cc.Size", @@ -12505,11 +12477,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 533 + "__id__": 531 }, "_enabled": true, "__prefab": { - "__id__": 537 + "__id__": 535 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12586,20 +12558,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 518 + "__id__": 516 }, "_children": [], "_active": true, "_components": [ { - "__id__": 540 + "__id__": 538 }, { - "__id__": 542 + "__id__": 540 } ], "_prefab": { - "__id__": 544 + "__id__": 542 }, "_lpos": { "__type__": "cc.Vec3", @@ -12636,11 +12608,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 539 + "__id__": 537 }, "_enabled": true, "__prefab": { - "__id__": 541 + "__id__": 539 }, "_contentSize": { "__type__": "cc.Size", @@ -12664,11 +12636,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 539 + "__id__": 537 }, "_enabled": true, "__prefab": { - "__id__": 543 + "__id__": 541 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12745,11 +12717,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 518 + "__id__": 516 }, "_enabled": true, "__prefab": { - "__id__": 546 + "__id__": 544 }, "_contentSize": { "__type__": "cc.Size", @@ -12773,11 +12745,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 518 + "__id__": 516 }, "_enabled": false, "__prefab": { - "__id__": 548 + "__id__": 546 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -12818,11 +12790,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 518 + "__id__": 516 }, "_enabled": false, "__prefab": { - "__id__": 550 + "__id__": 548 }, "_alignFlags": 44, "_target": null, @@ -12867,11 +12839,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 483 + "__id__": 481 }, "_enabled": true, "__prefab": { - "__id__": 553 + "__id__": 551 }, "_contentSize": { "__type__": "cc.Size", @@ -12895,11 +12867,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 483 + "__id__": 481 }, "_enabled": true, "__prefab": { - "__id__": 555 + "__id__": 553 }, "_alignFlags": 0, "_target": null, @@ -12931,11 +12903,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 483 + "__id__": 481 }, "_enabled": true, "__prefab": { - "__id__": 557 + "__id__": 555 }, "_resizeMode": 1, "_layoutType": 3, @@ -12986,26 +12958,26 @@ }, "_children": [ { - "__id__": 560 + "__id__": 558 }, { - "__id__": 568 + "__id__": 566 } ], "_active": true, "_components": [ + { + "__id__": 570 + }, { "__id__": 572 }, { "__id__": 574 - }, - { - "__id__": 576 } ], "_prefab": { - "__id__": 578 + "__id__": 576 }, "_lpos": { "__type__": "cc.Vec3", @@ -13042,23 +13014,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 559 + "__id__": 557 }, "_children": [], "_active": true, "_components": [ + { + "__id__": 559 + }, { "__id__": 561 }, { "__id__": 563 - }, - { - "__id__": 565 } ], "_prefab": { - "__id__": 567 + "__id__": 565 }, "_lpos": { "__type__": "cc.Vec3", @@ -13095,11 +13067,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 560 + "__id__": 558 }, "_enabled": true, "__prefab": { - "__id__": 562 + "__id__": 560 }, "_contentSize": { "__type__": "cc.Size", @@ -13123,11 +13095,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 560 + "__id__": 558 }, "_enabled": true, "__prefab": { - "__id__": 564 + "__id__": 562 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -13171,11 +13143,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 560 + "__id__": 558 }, "_enabled": true, "__prefab": { - "__id__": 566 + "__id__": 564 }, "_alignFlags": 45, "_target": null, @@ -13220,17 +13192,17 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 559 + "__id__": 557 }, "_children": [], "_active": true, "_components": [ { - "__id__": 569 + "__id__": 567 } ], "_prefab": { - "__id__": 571 + "__id__": 569 }, "_lpos": { "__type__": "cc.Vec3", @@ -13267,11 +13239,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 568 + "__id__": 566 }, "_enabled": true, "__prefab": { - "__id__": 570 + "__id__": 568 }, "_contentSize": { "__type__": "cc.Size", @@ -13308,11 +13280,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 559 + "__id__": 557 }, "_enabled": true, "__prefab": { - "__id__": 573 + "__id__": 571 }, "_contentSize": { "__type__": "cc.Size", @@ -13336,11 +13308,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 559 + "__id__": 557 }, "_enabled": true, "__prefab": { - "__id__": 575 + "__id__": 573 }, "_alignFlags": 0, "_target": null, @@ -13372,11 +13344,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 559 + "__id__": 557 }, "_enabled": false, "__prefab": { - "__id__": 577 + "__id__": 575 }, "_resizeMode": 1, "_layoutType": 3, @@ -13427,7 +13399,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 580 + "__id__": 578 }, "_contentSize": { "__type__": "cc.Size", @@ -13455,7 +13427,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 582 + "__id__": 580 }, "icon_node": { "__id__": 105 @@ -13463,10 +13435,23 @@ "sell_node": { "__id__": 449 }, - "NF_node": null, - "HF_node": null, + "close_node": { + "__id__": 465 + }, + "Name_node": { + "__id__": 302 + }, + "info_node": { + "__id__": 566 + }, "lv_node": { - "__id__": 411 + "__id__": 405 + }, + "ap_node": { + "__id__": 482 + }, + "hp_node": { + "__id__": 516 }, "_id": "" }, @@ -13484,7 +13469,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 584 + "__id__": 582 }, "_alignFlags": 44, "_target": null, diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index d4d2f869..b3f685fb 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -73,6 +73,19 @@ export enum MonStart { } + +/** +call 召唤后触发 降临 +dead 死亡后触发 遗志 +fstart 战斗开始 先手 +fend 战斗结束 终战 +field 驻场 光环 +atking 攻击后触发 追击 +atked 受击后触发 反击 +revive 复活触发 涅槃 + +**/ + /** * 英雄/怪物基础信息接口 */ diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 79c4ede1..e60d8659 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -127,6 +127,9 @@ export class Hero extends ecs.Entity { // 使用指数增长公式,等级2时为原来的3倍,等级3时为原来的9倍 (若需线性增长可改为 hero.ap * (1 + (model.lv - 1) * (FightSet.H_HERO_POW - 1))) let base_ap = hero.ap * Math.pow(FightSet.MERGE_NEED, model.lv - 1); let base_hp = hero.hp * Math.pow(FightSet.MERGE_NEED, model.lv - 1); + + model.base_ap = base_ap; + model.base_hp = base_hp; // 应用天赋加成 if (model.fac === FacSet.HERO) { diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index d1b48aab..93da309c 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -23,6 +23,8 @@ export class HeroAttrsComp extends ecs.Comp { type: number = 0; // 0近战 1远程 2辅助 fac: number = 0; // 0:hero 1:monster // ==================== 基础属性(有初始值) ==================== + base_ap: number = 0; // 原始基础攻击(无任何加成) + base_hp: number = 0; // 原始基础血量(无任何加成) ap: number = 0; // 基础攻击 hp: number = 100; // 基础血量 hp_max: number = 100; // 最大血量 @@ -309,6 +311,8 @@ export class HeroAttrsComp extends ecs.Comp { this.lv = 1; this.type = 0; this.fac = 0; + this.base_ap = 0; + this.base_hp = 0; this.ap = 0; this.hp = 100; this.hp_max = 100; diff --git a/assets/script/game/map/HInfoComp.ts b/assets/script/game/map/HInfoComp.ts index 017149a2..4e71aaac 100644 --- a/assets/script/game/map/HInfoComp.ts +++ b/assets/script/game/map/HInfoComp.ts @@ -51,27 +51,44 @@ export class HInfoComp extends CCComp { /** 英雄 idle 动画图标节点 */ @property(Node) icon_node=null! - /** 出售按钮节点(预留,当前交互已注释) */ + /** 出售按钮节点 */ @property(Node) sell_node=null! - /** 普通品质边框 */ + + /** 关闭窗口按钮节点 */ @property(Node) - NF_node=null! + close_node=null! + + /** 英雄名字节点 */ + @property(Node) + Name_node=null! /** 高品质边框 */ @property(Node) - HF_node=null! + info_node=null! @property(Node) lv_node=null! + @property(Node) + ap_node=null! + + @property(Node) + hp_node=null! + /** 绑定的英雄 ECS 实体 ID */ private eid: number = 0; /** 绑定的英雄属性数据模型引用 */ private model: HeroAttrsComp | null = null; + /** 英雄名字标签缓存引用 */ + private nameLabel: Label | null = null; /** AP 标签缓存引用 */ private apLabel: Label | null = null; + /** AP 加成标签缓存引用 */ + private apPlusLabel: Label | null = null; /** HP 标签缓存引用 */ private hpLabel: Label | null = null; + /** HP 加成标签缓存引用 */ + private hpPlusLabel: Label | null = null; /** 图标视觉令牌(异步加载竞态保护) */ private iconVisualToken: number = 0; /** 当前显示的英雄 UUID(避免相同 UUID 重复加载动画) */ @@ -161,12 +178,39 @@ export class HInfoComp extends CCComp { this.updateHeroAnimation(this.icon_node, heroUuid, this.iconVisualToken); } + // ---- 名字标签 ---- + if (this.nameLabel) { + this.nameLabel.string = this.model.hero_name ?? ""; + } + // ---- 数值标签 ---- if (this.apLabel) { - this.apLabel.string = `${Math.max(0, Math.floor(this.model.ap ?? 0))}`; + const currentAp = Math.max(0, Math.floor(this.model.ap ?? 0)); + const baseAp = Math.max(0, Math.floor(this.model.base_ap ?? 0)); + this.apLabel.string = `${currentAp}`; + if (this.apPlusLabel) { + const diff = currentAp - baseAp; + if (diff !== 0) { + this.apPlusLabel.string = diff > 0 ? `(+${diff})` : `(${diff})`; + this.apPlusLabel.node.active = true; + } else { + this.apPlusLabel.node.active = false; + } + } } if (this.hpLabel) { - this.hpLabel.string = `${Math.max(0, Math.floor(this.model.hp_max ?? 0))}`; + const currentHp = Math.max(0, Math.floor(this.model.hp_max ?? 0)); + const baseHp = Math.max(0, Math.floor(this.model.base_hp ?? 0)); + this.hpLabel.string = `${currentHp}`; + if (this.hpPlusLabel) { + const diff = currentHp - baseHp; + if (diff !== 0) { + this.hpPlusLabel.string = diff > 0 ? `(+${diff})` : `(${diff})`; + this.hpPlusLabel.node.active = true; + } else { + this.hpPlusLabel.node.active = false; + } + } } } @@ -182,11 +226,16 @@ export class HInfoComp extends CCComp { /** 缓存 AP / HP Label 引用,避免每次刷新都遍历节点树 */ private cacheLabels() { - if (!this.apLabel) { - this.apLabel = this.findLabelByPath(["ap", "val"]); + if (!this.nameLabel && this.Name_node) { + this.nameLabel = this.Name_node.getComponent(Label) || this.Name_node.getComponentInChildren(Label); } - if (!this.hpLabel) { - this.hpLabel = this.findLabelByPath(["hp", "val"]); + if (!this.apLabel && this.ap_node) { + this.apLabel = this.ap_node.getChildByName("val")?.getComponent(Label) || null; + this.apPlusLabel = this.ap_node.getChildByName("plus")?.getComponent(Label) || null; + } + if (!this.hpLabel && this.hp_node) { + this.hpLabel = this.hp_node.getChildByName("val")?.getComponent(Label) || null; + this.hpPlusLabel = this.hp_node.getChildByName("plus")?.getComponent(Label) || null; } } @@ -255,16 +304,29 @@ export class HInfoComp extends CCComp { private bindEvents() { this.sell_node?.on(Button.EventType.CLICK, this.onSellHero, this); - this.node.on(NodeEventType.TOUCH_END, this.onOpenIBox, this); + this.close_node?.on(Button.EventType.CLICK, this.onClosePanel, this); + // this.node.on(NodeEventType.TOUCH_END, this.onOpenIBox, this); } private unbindEvents() { if (this.sell_node && this.sell_node.isValid) { this.sell_node.off(Button.EventType.CLICK, this.onSellHero, this); } - if (this.node && this.node.isValid) { - this.node.off(NodeEventType.TOUCH_END, this.onOpenIBox, this); + if (this.close_node && this.close_node.isValid) { + this.close_node.off(Button.EventType.CLICK, this.onClosePanel, this); } + // if (this.node && this.node.isValid) { + // this.node.off(NodeEventType.TOUCH_END, this.onOpenIBox, this); + // } + } + + /** + * 点击关闭按钮时关闭英雄信息面板 + */ + private onClosePanel() { + if (this.isClosing) return; + this.isClosing = true; + oops.gui.remove(UIID.HInfo); } /**