From d5e03d7856807ae6ca79c0effb6f0e40ecb0a92e Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 12 Mar 2026 16:27:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor(skill):=20=E7=A7=BB=E9=99=A4=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E9=85=8D=E7=BD=AE=E4=B8=AD=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84cd=E5=92=8Ct=5Fnum=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 清理技能配置接口和实现代码,删除已不再使用的冷却时间(cd)和目标数量(t_num)字段。 在SCastSystem中,将目标数量计算简化为固定使用最小值1,因为t_num字段已废弃。 同时移除SkillView中已注释掉的旧逻辑代码。 --- assets/script/game/common/config/SkillSet.ts | 24 +++++++++----------- assets/script/game/hero/SCastSystem.ts | 2 +- assets/script/game/skill/SkillView.ts | 1 - 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 59c35930..39e64b1d 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -176,8 +176,6 @@ export interface SkillConfig { act:string, // 角色执行的动画 DTType:DTType, // 伤害类型(单体/范围) ap:number, // 攻击百分比(角色攻击力) - cd:number, // 冷却时间(秒) - t_num:number, // 目标数量 hit_num:number, // 范围攻击伤害敌人数量 hit:number, // 穿刺个数 hitcd:number, // 持续伤害的伤害间隔(秒) @@ -195,57 +193,57 @@ export interface SkillConfig { export const SkillSet: Record = { 5000:{uuid:5000,name:"反伤",sp_name:"thorns",icon:"1168",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single, - ap:0,cd:60,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:0,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],info:"反伤", }, // ========== 基础攻击 ========== 6001-6099 6001: { uuid:6001,name:"近战攻击",sp_name:"atk_s1",icon:"1026",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single, - ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:100,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],info:"对前方目标造成100%攻击的伤害", }, 6002: { uuid:6002,name:"远程攻击",sp_name:"b_arrow_blue",icon:"1135",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single, - ap:100,cd:1,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:100,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],info:"对前方单个目标造成100%攻击的伤害", }, 6003: { uuid:6003,name:"远程攻击",sp_name:"m_water_ball_1",icon:"1126",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single, - ap:100,cd:5,t_num:1,hit_num:1,hit:2,hitcd:0.3,speed:720,with:90, + ap:100,hit_num:1,hit:2,hitcd:0.3,speed:720,with:90, ready:8001,EAnm:0,DAnm:9001,RType:RType.linear,EType:EType.collision, buffs:[],info:"对前方单个目标造成100%攻击的伤害", }, 6004: { uuid:6004,name:"蓄力一击",sp_name:"atk_s4",icon:"1173",TGroup:TGroup.Enemy,SType:SType.damage,act:"atk",DTType:DTType.single, - ap:100,cd:3,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:100,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],info:"对前方目标造成150%攻击的伤害", }, // ========== 基础buff ========== 6100-6199 6100: { uuid:6100,name:"治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Self,SType:SType.heal,act:"atk",DTType:DTType.single, - ap:30,cd:5,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:30,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],info:"治疗自己,回复30%最大生命值", }, 6101:{ uuid:6101,name:"魔法盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,SType:SType.shield,act:"atk",DTType:DTType.single, - ap:30,cd:7,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:30,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[],info:"获得30%最大生命值的护盾,持续60秒", }, 6102:{ uuid:6102,name:"强壮",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Team,SType:SType.buff,act:"atk",DTType:DTType.single, - ap:30,cd:10,t_num:1,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:30,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[10001],info:"增加目标10%攻击力,持续30秒", }, 6103:{ uuid:6103,name:"群体强壮",sp_name:"buff_wind",icon:"3036",TGroup:TGroup.Team,SType:SType.buff,act:"atk",DTType:DTType.range, - ap:30,cd:10,t_num:3,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, + ap:30,hit_num:1,hit:1,hitcd:0.2,speed:720,with:0, ready:0,EAnm:0,DAnm:9001,RType:RType.fixed,EType:EType.animationEnd, buffs:[10011],info:"增加目标10%攻击力,持续30秒", }, @@ -253,14 +251,14 @@ export const SkillSet: Record = { 6201: { uuid:6201, name:"怪物近战", sp_name:"atk_s1", icon:"3036", TGroup:TGroup.Enemy, SType:SType.damage, act:"atk", DTType:DTType.single, - ap:100, cd:1, t_num:1, hit_num:1, hit:1, hitcd:0.2, speed:0, with:0, // 怪物近战特殊距离 + ap:100, hit_num:1, hit:1, hitcd:0.2, speed:0, with:0, // 怪物近战特殊距离 ready:0, EAnm:0, DAnm:9001, RType:RType.fixed, EType:EType.animationEnd, buffs:[], info:"怪物基础近战攻击", }, 6203: { uuid:6203, name:"怪物射击", sp_name:"arrow_1", icon:"3039", TGroup:TGroup.Enemy, SType:SType.damage, act:"atk", DTType:DTType.single, - ap:80, cd:2, t_num:1, hit_num:1, hit:1, hitcd:0.2, speed:800, with:0, // 怪物远程特殊距离 + ap:80, hit_num:1, hit:1, hitcd:0.2, speed:800, with:0, // 怪物远程特殊距离 ready:0, EAnm:0, DAnm:9001, RType:RType.linear, EType:EType.collision, buffs:[], info:"怪物基础远程攻击", }, diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 1cb1ff13..ee324d0d 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -151,7 +151,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate if (a.lane !== b.lane) return a.lane - b.lane; return a.dis - b.dis; }); - const maxTargets = Math.max(GameConst.Skill.MIN_TARGET_COUNT, config.t_num || 1); + const maxTargets = Math.max(GameConst.Skill.MIN_TARGET_COUNT, 1); return list.slice(0, maxTargets).map(item => item.view); } } diff --git a/assets/script/game/skill/SkillView.ts b/assets/script/game/skill/SkillView.ts index a7f1e169..f188f714 100644 --- a/assets/script/game/skill/SkillView.ts +++ b/assets/script/game/skill/SkillView.ts @@ -130,7 +130,6 @@ export class SkillView extends CCComp { const targetName = target.ent.get(HeroAttrsComp)?.hero_name ?? "未知目标"; mLogger.log(this.debugMode, 'SkillView', `[skillView] 伤害 [${this.group}][${casterName}][${this.sData.casterEid}]的 [${this.SConf.name}]对 [${target.box_group}][ ${targetName}][${target.ent.eid}]`); - // if(this.sData.hit_count > this.SConf.hit_num) return 不能超出 最大伤害数量 // 使用伤害队列系统处理伤害 DamageQueueHelper.addDamageToEntity( target.ent,