From c75c58d13cbfc7f3ab84715ae53a420cf7b6b41f Mon Sep 17 00:00:00 2001 From: walkpan Date: Sun, 22 Mar 2026 19:38:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8A=80=E8=83=BD):=20=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E5=8D=87=E7=BA=A7=E9=85=8D=E7=BD=AE=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 SkillUpList 配置表,支持技能升级时属性成长 - 修改 Skill.ts 中的伤害计算逻辑,将基础属性与升级加成结合 - 移除 SkillSet.ts 中冗余的注释行,保持代码整洁 --- assets/script/game/common/config/SkillSet.ts | 64 ++++++++++---------- assets/script/game/hero/SCastSystem.ts | 3 +- assets/script/game/skill/Skill.ts | 21 ++++--- 3 files changed, 46 insertions(+), 42 deletions(-) diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 8e2239a4..0cafe6c1 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -147,9 +147,12 @@ export interface SkillConfig { buffs:BuffConf[], // 对目标应用的 buff 配置列表 call_hero?:number, // 召唤技能召唤英雄id(可选) info:string, // 技能描述 + num:number, //技能释放次数 } - +export const SkillUpList = { + 6001:{ap:0,hit_count:0,buff_ap:0,buff_max:0,bck:0,frz:0,crt:0,num:0} +} /****** * @@ -157,159 +160,156 @@ export interface SkillConfig { * 火法技能 带击退属性 * 冰法技能 带冰冻属性 * - * - * - * */ export const SkillSet: Record = { // ========== 近战技能 ========== 6001: { uuid:6001,name:"近战攻击",sp_name:"atk",icon:"1026",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个造成100%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个造成100%攻击的伤害", }, 6002: { uuid:6002,name:"闪光攻击",sp_name:"atk_s2",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"max", DTType:DTType.single,ap:150,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"对多个目标造成150%攻击的伤害", }, 6003: { uuid:6003,name:"火焰攻击",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max", DTType:DTType.single,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害,击退率20%", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"对多个目标造成150%攻击的伤害,击退率20%", }, 6004: { uuid:6004,name:"闪电攻击",sp_name:"atk_s4",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"blues",endAnm:"",act:"max", DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"对多个目标造成150%攻击的伤害,暴击率20%", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"对多个目标造成150%攻击的伤害,暴击率20%", }, 6005: { uuid:6005,name:"半月攻击",sp_name:"atk_light",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:100,hit_count:3,hitcd:0.3,speed:720,with:90,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"穿透多个目标造成100%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"穿透多个目标造成100%攻击的伤害", }, //===============射手技能================== 6101: { uuid:6101,name:"普通射击",sp_name:"arrow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个目标造成100%攻击的伤害", }, 6102: { uuid:6102,name:"冰冻射击",sp_name:"arrow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个目标造成100%攻击的伤害", }, 6103: { uuid:6103,name:"暴击射击",sp_name:"arrow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:100,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个目标造成100%攻击的伤害", }, 6104: { uuid:6104,name:"闪光设计",sp_name:"arrow_big_yellow",icon:"1135",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max", DTType:DTType.single,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对多个目标造成100%攻击的伤害,暴击", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对多个目标造成100%攻击的伤害,暴击", }, //===========魔法技能=========== 6201: { uuid:6201,name:"冰击",sp_name:"ball_forst",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,frz:20,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害,冰冻率20%", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个目标造成100%攻击的伤害,冰冻率20%", }, 6202: { uuid:6202,name:"冰球",sp_name:"ball_ice",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个目标造成100%攻击的伤害", }, 6203: { uuid:6203,name:"火击",sp_name:"ball_fire",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个目标造成100%攻击的伤害", }, 6204: { uuid:6204,name:"火球",sp_name:"ball_fire",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,bck:20,ap:100,hit_count:1,hitcd:0.3,speed:720,with:90,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对单个目标造成100%攻击的伤害,击退率20%", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对单个目标造成100%攻击的伤害,击退率20%", }, 6205: { uuid:6205,name:"月波",sp_name:"ball_gquan",icon:"1126",TGroup:TGroup.Enemy,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,ap:200,hit_count:6,hitcd:0.3,speed:300,with:90,ready:0,EAnm:0,DAnm:"", - RType:RType.linear,EType:EType.collision,buffs:[],info:"对多个目标造成200%攻击的伤害", + RType:RType.linear,EType:EType.collision,buffs:[],num:1,info:"对多个目标造成200%攻击的伤害", }, 6206: { uuid:6206,name:"陨石术",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max", DTType:DTType.range,crt:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,暴击率20%", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"多次对多个目标造成150%攻击的伤害,暴击率20%", }, 6207: { uuid:6207,name:"冰刺",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max", DTType:DTType.range,frz:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,冰冻率20%", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"多次对多个目标造成150%攻击的伤害,冰冻率20%", }, 6208: { uuid:6208,name:"火墙",sp_name:"atk_fire",icon:"1173",TGroup:TGroup.Enemy,readyAnm:"reds",endAnm:"",act:"max", DTType:DTType.range,bck:20,ap:100,hit_count:6,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"多次对多个目标造成150%攻击的伤害,击退率20%", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"多次对多个目标造成150%攻击的伤害,击退率20%", }, //============================= ====== 辅助技能 ====== ========================== 6301:{ uuid:6301,name:"魔法盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Shield,ap:30,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"获得30%最大生命值的护盾", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"获得30%最大生命值的护盾", }, 6302: { uuid:6302,name:"治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Heal,ap:30,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"治疗1个友方30%最大生命值", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"治疗1个友方30%最大生命值", }, 6303:{ uuid:6303,name:"护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Self,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Shield,ap:30,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机1个友方获得30%最大生命值的护盾", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"随机1个友方获得30%最大生命值的护盾", }, 6304: { uuid:6304,name:"群体治疗",sp_name:"buff_wind",icon:"1292",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Heal,ap:20,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机3个友方,回复20%最大生命值", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"随机3个友方,回复20%最大生命值", }, 6305:{ uuid:6305,name:"群体护盾",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Shield,ap:20,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[],info:"随机3个友方获得20%最大生命值的护盾", + RType:RType.fixed,EType:EType.animationEnd,buffs:[],num:1,info:"随机3个友方获得20%最大生命值的护盾", }, //==========================buff 技能===================== 6401:{ uuid:6401,name:"单体攻击",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5}],info:"随机1个友方+5攻击", + RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5}],num:1,info:"随机1个友方+5攻击", }, 6402:{ uuid:6402,name:"单体生命",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:20}],info:"随机1个友方+20最大生命值", + RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:20}],num:1,info:"随机1个友方+20最大生命值", }, 6403:{ uuid:6403,name:"单体全能",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:1,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5},{buff:Attrs.hp_max,value:20}],info:"随机1个友方+2攻击,+10最大生命值", + RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:5},{buff:Attrs.hp_max,value:20}],num:1,info:"随机1个友方+2攻击,+10最大生命值", }, 6404:{ uuid:6404,name:"群体攻击",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2}],info:"随机3个友方+2攻击", + RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2}],num:1,info:"随机3个友方+2攻击", }, 6405:{ uuid:6405,name:"群体生命",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:10}],info:"随机3个友方+10最大生命值", + RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.hp_max,value:10}],num:1,info:"随机3个友方+10最大生命值", }, 6406:{ uuid:6406,name:"群体全能",sp_name:"buff_wind",icon:"1255",TGroup:TGroup.Team,readyAnm:"",endAnm:"",act:"atk", DTType:DTType.single,kind:SkillKind.Support,ap:0,hit_count:3,hitcd:0.2,speed:720,with:0,ready:0,EAnm:0,DAnm:"", - RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],info:"随机3个友方+2攻击,+10最大生命值", + RType:RType.fixed,EType:EType.animationEnd,buffs:[{buff:Attrs.ap,value:2},{buff:Attrs.hp_max,value:10}],num:1,info:"随机3个友方+2攻击,+10最大生命值", }, }; diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 0fe3d549..73294052 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -2,7 +2,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec import { Vec3 } from "cc"; import { HeroAttrsComp } from "./HeroAttrsComp"; import { HeroViewComp } from "./HeroViewComp"; -import { DTType, SkillConfig, SkillKind, SkillSet, TGroup } from "../common/config/SkillSet"; +import { DTType, SkillConfig, SkillKind, SkillSet, SkillUpList, TGroup } from "../common/config/SkillSet"; import { Skill } from "../skill/Skill"; import { smc } from "../common/SingletonModuleComp"; import { GameConst } from "../common/config/GameConst"; @@ -122,6 +122,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const parent = caster.node.parent; if (!parent) return; const skill = ecs.getEntity(Skill); + const sNum= Math.floor(SkillUpList[s_uuid].num*skillLv) skill.load(caster.node.position.clone(), parent, s_uuid, targetPos.clone(), caster, cAttrsComp, skillLv, 0); } diff --git a/assets/script/game/skill/Skill.ts b/assets/script/game/skill/Skill.ts index 1adc531a..8a399188 100644 --- a/assets/script/game/skill/Skill.ts +++ b/assets/script/game/skill/Skill.ts @@ -1,6 +1,6 @@ import { BoxCollider2D, instantiate, Node, Prefab, v3, Vec3, NodePool } from "cc"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; -import { EType, SkillSet } from "../common/config/SkillSet"; +import { EType, SkillSet, SkillUpList } from "../common/config/SkillSet"; import { oops } from "db://oops-framework/core/Oops"; import { HeroAttrsComp } from "../hero/HeroAttrsComp"; import { Attrs } from "../common/config/HeroAttrs"; @@ -204,19 +204,22 @@ export class Skill extends ecs.Entity { sDataCom.group=caster.box_group sDataCom.casterEid=caster.ent.eid sDataCom.Attrs = {}; - const addCrt = config.crt ?? 0; - const addFrz = config.frz ?? 0; - const addBck = config.bck ?? 0; - sDataCom.Attrs[Attrs.ap] = cAttrsComp.ap*config.ap; - sDataCom.Attrs[Attrs.critical] = cAttrsComp.critical + addCrt; - sDataCom.Attrs[Attrs.freeze_chance] = cAttrsComp.freeze_chance + addFrz; - sDataCom.Attrs[Attrs.back_chance] = cAttrsComp.back_chance + addBck; + const SUp=SkillUpList[s_uuid] + const sCrt = (config.crt ?? 0)+(SUp.crt??0)*skill_lv; + const sFrz = (config.frz ?? 0)+(SUp.frz??0)*skill_lv; + const sBck = (config.bck ?? 0)+(SUp.bck??0)*skill_lv; + const sAp =config.ap+SUp.ap*skill_lv; + const sHit=config.hit_count+SUp.hit_count*skill_lv + cAttrsComp.puncture + sDataCom.Attrs[Attrs.ap] = cAttrsComp.ap*sAp; + sDataCom.Attrs[Attrs.critical] = cAttrsComp.critical + sCrt; + sDataCom.Attrs[Attrs.freeze_chance] = cAttrsComp.freeze_chance + sFrz; + sDataCom.Attrs[Attrs.back_chance] = cAttrsComp.back_chance + sBck; sDataCom.s_uuid=s_uuid sDataCom.skill_lv = Math.max(1, skill_lv); sDataCom.fac=cAttrsComp.fac sDataCom.ext_dmg=ext_dmg sDataCom.hit_count = 0 - sDataCom.max_hit_count = Math.max(1, config.hit_count + cAttrsComp.puncture) + sDataCom.max_hit_count = Math.max(1,sHit) SView.init(); }