英雄去除 smchp

This commit is contained in:
panfudan
2025-08-11 22:33:22 +08:00
parent 5bcf5e737b
commit 919ff09351
5 changed files with 33 additions and 83 deletions

View File

@@ -19,6 +19,7 @@ const { ccclass, property } = _decorator;
export class SkillConComp extends CCComp {
HeroView:any=null;
HeroEntity:any=null;
skill_cd=0
private _timers: { [key: string]: number } = {};
private _damageQueue: Array<{ timer: number; callback: () => void }> = [];
@@ -48,26 +49,18 @@ export class SkillConComp extends CCComp {
update(dt: number) {
if(!smc.mission.play||smc.mission.pause) return
if(this.HeroView.DEBUFF_STUN <= 0&&this.HeroView.DEBUFF_FROST <= 0) {
this.HeroView.at += dt;
this.HeroView.vmHero.cd += dt
}
if(this.HeroView.vmHero.cd > this.HeroView.vmHero.cd_max){
let sc=SkillSet[this.HeroView.skills[1]]
if(!sc) return
if(sc.SType==SType.damage&&!this.HeroView.is_atking) return
this.castSkill(sc,false,0)
this.HeroView.vmHero.cd = 0
}
let cd = this.count_cd(this.HeroView.cd,this.HeroView)
if (this.HeroView.is_atking &&(this.HeroView.at > cd)) {
if(this.HeroView.is_dead) return
const config = SkillSet[this.HeroView.atk_skill];
if (!config) return;
this.castSkill(config,this.check_wfuny());
this.HeroView.count_atk_count()
this.HeroView.at = 0;
for(let i=0;i<this.HeroView.skills.length;i++){
this.HeroView.skills[i].cd += dt;
if(this.HeroView.skills[i].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
this.castSkill(sc,false,0)
this.HeroView.skills[i].cd = 0
}
}
}
if (this.aoe_queues.length > 0) {
//console.log("[FightConComp]:aoe_queues:",this.aoe_queues)
@@ -294,21 +287,7 @@ export class SkillConComp extends CCComp {
Object.values(this._timers).forEach(clearTimeout);
}
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)
}
get_count(count:number,view:HeroViewComp){
let re=count+view.wfuny
if(re<1) re=1