buff需要重置

This commit is contained in:
2025-10-16 16:52:27 +08:00
parent 31eedceeb3
commit d0cd9c1326
21 changed files with 153 additions and 958 deletions

View File

@@ -8,9 +8,6 @@ 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";
import { FightSet } from "../common/config/Mission";
import { Skill } from "../skills/Skill";
/** 角色实体 */
@ecs.register(`Hero`)
@@ -73,31 +70,32 @@ export class Hero extends ecs.Entity {
hv.box_group = BoxSet.HERO;
hv.hero_uuid= uuid;
hv.hero_name= hero.name;
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.HP_MAX]=hv.hp=hv.hp_max=HeroInfo[uuid].hp;
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.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
// })
// }
// }
return hv
}
}