This commit is contained in:
2025-10-16 16:53:34 +08:00
parent d0cd9c1326
commit d486d87676

View File

@@ -8,6 +8,7 @@ import { BoxSet, FacSet } from "../common/config/BoxSet";
import { HeroInfo, HeroPos, HType } from "../common/config/heroSet";
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
import { GameEvent } from "../common/config/GameEvent";
import { BuffAttr, getBuffNum, SkillSet, SType } from "../common/config/SkillSet";
/** 角色实体 */
@ecs.register(`Hero`)
@@ -72,30 +73,30 @@ export class Hero extends ecs.Entity {
hv.hero_name= hero.name;
hv.hp=hv.hp_max=hv.hp_base=HeroInfo[uuid].hp;
hv.mp=hv.mp_max=hv.mp_base=HeroInfo[uuid].mp;
// hv.Attrs=getBuffNum()
// hv.Attrs[BuffAttr.SPEED]=hv.speed = hero.speed;
// hv.Attrs[BuffAttr.DIS]=hv.dis=hero.dis;
// hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd
// hv.Attrs[BuffAttr.AP]=hv.ap=HeroInfo[uuid].ap;
// hv.Attrs[BuffAttr.DEF]=HeroInfo[uuid].def;
// hero.buff.forEach((buff:any)=>{
// hv.apply_buff(buff.type,buff.value)
// })
// for(let i=0;i<hero.skills.length;i++){
// if(SkillSet[hero.skills[i]].SType==SType.buff){
// let buffs=SkillSet[hero.skills[i]].buffs
// buffs.forEach((buff:any)=>{
// hv.apply_buff(buff.buff, buff.buV)
// })
// continue
// }else{
// hv.skills.push({
// cd:0,
// uuid:hero.skills[i],
// cd_max:i==0?hero.cd:SkillSet[hero.skills[i]].cd
// })
// }
// }
hv.Attrs=getBuffNum()
hv.Attrs[BuffAttr.SPEED]=hv.speed = hero.speed;
hv.Attrs[BuffAttr.DIS]=hv.dis=hero.dis;
hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd
hv.Attrs[BuffAttr.AP]=hv.ap=HeroInfo[uuid].ap;
hv.Attrs[BuffAttr.DEF]=HeroInfo[uuid].def;
hero.buff.forEach((buff:any)=>{
hv.apply_buff(buff.type,buff.value)
})
for(let i=0;i<hero.skills.length;i++){
if(SkillSet[hero.skills[i]].SType==SType.buff){
let buffs=SkillSet[hero.skills[i]].buffs
buffs.forEach((buff:any)=>{
hv.apply_buff(buff.buff, buff.buV)
})
continue
}else{
hv.skills.push({
cd:0,
uuid:hero.skills[i],
cd_max:i==0?hero.cd:SkillSet[hero.skills[i]].cd
})
}
}
return hv
}
}