feat(技能): 引入技能升级配置并调整伤害计算
- 新增 SkillUpList 配置表,支持技能升级时属性成长 - 修改 Skill.ts 中的伤害计算逻辑,将基础属性与升级加成结合 - 移除 SkillSet.ts 中冗余的注释行,保持代码整洁
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user