去掉skillcom处理 buff skill只负责动画运行和碰撞伤害

This commit is contained in:
2025-08-12 10:31:01 +08:00
parent ca8bbd397b
commit 1273ec6e99
13 changed files with 166 additions and 443 deletions

View File

@@ -1,6 +1,6 @@
import { _decorator, Component, Node, v3, Vec3 } from 'cc';
import { HeroViewComp } from './HeroViewComp';
import { DTType, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet';
import { BuffAttr, DTType, SkillSet, SType, TGroup, TType } from '../common/config/SkillSet';
import { Skill } from '../skills/Skill';
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
import { oops } from 'db://oops-framework/core/Oops';
@@ -50,7 +50,7 @@ export class SkillConComp extends CCComp {
if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) {
for(let i=0;i<this.HeroView.skills.length;i++){
this.HeroView.skills[i].cd += dt;
if(this.HeroView.skills[i].cd > (i==0?this.count_cd(this.HeroView.skills[i].cd_max,this.HeroView):this.HeroView.skills[i].cd_max)){
if(this.HeroView.skills[i].cd > (i==0?this.HeroView.Attrs[BuffAttr.ATK_CD]:this.HeroView.skills[i].cd_max)){
let sc=SkillSet[this.HeroView.skills[i].uuid]
if(!sc) return
if(sc.SType==SType.damage&&!this.HeroView.is_atking) return
@@ -90,21 +90,7 @@ export class SkillConComp extends CCComp {
}
}
count_cd(cd:number,view:HeroViewComp){
// 汇总DEBUFF_DECD不再按次数减少改为按时间减少
let decd = 0;
for (let i = view.DEBUFF_DECDS.length - 1; i >= 0; i--) {
decd += view.DEBUFF_DECDS[i].value;
// 不再在这里减少duration改为在update中按时间减少
}
let bcd=0
for (let i = view.BUFF_CDS.length - 1; i >= 0; i--) {
bcd += view.BUFF_CDS[i].value;
// 不再在这里减少duration改为在update中按时间减少
}
return cd/((bcd+decd)/100+1)
}
/** 施放技能 */
castSkill(config: typeof SkillSet[keyof typeof SkillSet]) {
// //console.log(view.uuid+"=>"+view.hero_name+"施放技能:"+config.uuid);
@@ -171,7 +157,7 @@ export class SkillConComp extends CCComp {
check_wfuny(){
let random = Math.random()*100
if(random < this.HeroView.wfuny){
if(random < this.HeroView.Attrs[BuffAttr.WFUNY]){
return true
}
return false