From 8ab0cc39714dbbf696aa818a19ff71ae011116be Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 23 Apr 2026 09:09:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(hero):=20=E4=B8=BA=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B7=BB=E5=8A=A0=E5=A4=8D=E6=B4=BB=E6=9C=BA?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 HeroAttrsComp 中增加 `is_revived` 字段以追踪已复活次数 - 修改 HeroViewComp 的 `scheduleRevive` 方法,使其能播放复活技能的准备动画并立即触发复活 - 在 heroInfo 接口中新增 `revive` 配置项,用于定义英雄的复活技能 - 在 SkillSet 中添加新的复活技能配置(uuid: 6501) - 新增 hero-roster.md 的元数据配置文件 --- assets/script/game/common/config/SkillSet.ts | 5 +++++ assets/script/game/common/config/hero-roster.md.meta | 11 +++++++++++ assets/script/game/common/config/heroSet.ts | 1 + assets/script/game/hero/HeroAttrsComp.ts | 3 ++- assets/script/game/hero/HeroViewComp.ts | 9 +++++---- 5 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 assets/script/game/common/config/hero-roster.md.meta diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 41763aa4..34709a8c 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -296,6 +296,11 @@ export const SkillSet: Record = { DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support, RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],info:"随机3个友方+2攻击,+10最大生命值", }, + 6501:{ + uuid:6501,name:"复活",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"ap_up",endAnm:"",act:"atk", + DTType:DTType.single,kind:SkillKind.Support,ap:50,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0.2,EAnm:0,DAnm:"",IType:IType.support, + RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"立即复活,获得50%生命", + } }; diff --git a/assets/script/game/common/config/hero-roster.md.meta b/assets/script/game/common/config/hero-roster.md.meta new file mode 100644 index 00000000..53fe428e --- /dev/null +++ b/assets/script/game/common/config/hero-roster.md.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.0.1", + "importer": "text", + "imported": true, + "uuid": "c86bee35-69d7-43a9-ab1a-967c1e4f08a8", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 08d8df2d..f4f28dee 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -70,6 +70,7 @@ export interface heroInfo { field?:number[]; // 驻场技能uuid列表,英雄在场时对全局生效 atking?:{s_uuid:number, t_num:number}[]; // 普通攻击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的普攻次数 atked?:{s_uuid:number, t_num:number}[]; // 受击后触发的技能配置,s_uuid: 技能id, t_num: 触发所需的受击次数 + revive?:{s_uuid:number,r_num:number,upr:number}[] // dis: number; // 攻击距离(像素) speed: number; // 移动速度(像素/秒) skills: Record ; // 携带技能ID列表 diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index c8b15d59..e838e144 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -41,7 +41,8 @@ export class HeroAttrsComp extends ecs.Comp { puncture: number = 0; // 穿刺次数 wfuny: number = 0; // 风怒 - revive_count: number = 0; // 复活次数 + revive_count: number = 0; // 总复活次数 + is_revived:number = 0; // 已复活次数 revive_time: number = 0; // 复活时间 invincible_time: number = 0;// 无敌时间 diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index a3e621e5..b467d46c 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -405,10 +405,11 @@ export class HeroViewComp extends CCComp { * 调度复活逻辑 * @param delay 延迟时间(秒) */ - scheduleRevive(delay: number) { - this.scheduleOnce(() => { - this.alive(); - }, delay); + scheduleRevive(s_uuid:number) { + const sConf=SkillSet[s_uuid] + this.playReady(sConf.readyAnm) + this.skill_name('',s_uuid) + this.alive(); } /**