战斗系统 重构继续

This commit is contained in:
2025-10-30 10:39:46 +08:00
parent a79cb9f35d
commit 2d358e450d
23 changed files with 515 additions and 911 deletions

View File

@@ -6,8 +6,8 @@ import { GameEvent } from '../common/config/GameEvent';
import { FacSet } from '../common/config/BoxSet';
import { smc } from '../common/SingletonModuleComp';
import { CCComp } from 'db://oops-framework/module/common/CCComp';
import { MonModelComp } from './MonModelComp';
import { HeroModelComp } from './HeroModelComp';
import { MonAttrsComp } from './MonAttrsComp';
import { HeroAttrsComp } from './HeroAttrsComp';
import { SkillEnt } from '../skill/SkillEnt';
import { Attrs } from '../common/config/HeroAttrs';
import { TalComp } from './TalComp';
@@ -18,7 +18,6 @@ const { ccclass, property } = _decorator;
export class SkillConComp extends CCComp {
HeroView:any=null;
HeroEntity:any=null;
TALCOMP:any=null;
skill_cd=0
private _timers: { [key: string]: any } = {};
init(): void {
@@ -26,7 +25,6 @@ export class SkillConComp extends CCComp {
}
onLoad(){
this.HeroView=this.node.getComponent(HeroViewComp)
this.TALCOMP=this.node.getComponent(TalComp)
}
start() {
this.HeroEntity=this.HeroView.ent
@@ -109,9 +107,9 @@ export class SkillConComp extends CCComp {
check_target(){
if(this.HeroView.fac==FacSet.HERO){
return ecs.query(ecs.allOf(MonModelComp))
return ecs.query(ecs.allOf(MonAttrsComp))
}else{
return ecs.query(ecs.allOf(HeroModelComp))
return ecs.query(ecs.allOf(HeroAttrsComp))
}
}
get_front(entities:any){