装备特殊加成 继续完善

This commit is contained in:
2025-06-17 16:19:02 +08:00
parent 0a1e2b7813
commit d7b6dd375a
11 changed files with 171 additions and 113 deletions

View File

@@ -8,6 +8,8 @@ import { BoxSet, FacSet } from "../common/config/BoxSet";
import { HeroInfo, HeroPos } from "../common/config/heroSet";
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
import { SkillConComp } from "./SkillConComp";
import { FriendModelComp } from "./FriendModel";
import { MasterModelComp } from "./MasterModel";
/** 角色实体 */
@ecs.register(`Hero`)
@@ -26,6 +28,12 @@ export class Hero extends ecs.Entity {
destroy(): void {
this.remove(HeroViewComp);
this.remove(HeroModelComp);
if(this.get(FriendModelComp)){
this.remove(FriendModelComp);
}
if(this.get(MasterModelComp)){
this.remove(MasterModelComp);
}
super.destroy();
}
hart_load(uuid:number=5004) {
@@ -57,6 +65,7 @@ export class Hero extends ecs.Entity {
hv.atk_skill=hero.skills[0]
console.log(hv.hero_name+"dis=>"+hv.dis)
this.add(hv);
this.addComponents<ecs.Comp>(MasterModelComp)
}
/** 加载角色 */
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,info:any={ap:0,hp:0},fight_pos:number=1) {
@@ -88,6 +97,7 @@ export class Hero extends ecs.Entity {
hv.hp_up=hero.hp_up
hv.atk_skill=hero.skills[0]
this.add(hv);
this.addComponents<ecs.Comp>(FriendModelComp);
const move = this.get(BattleMoveComp);
move.direction = 1; // 向右移动
move.targetX = 800; // 右边界'