涨能量需要再处理下, 怪物被攻击算命中 如何涨

This commit is contained in:
2025-07-24 00:05:11 +08:00
parent 690f0547cd
commit af89bb7707
8 changed files with 8602 additions and 7557 deletions

View File

@@ -11,6 +11,7 @@ import { FriendModelComp } from "./FriendModel";
import { MasterModelComp } from "./MasterModel";
import { GameEvent } from "../common/config/GameEvent";
import { BuffAttr } from "../common/config/SkillSet";
import { FightSet } from "../common/config/Mission";
/** 角色实体 */
@ecs.register(`Hero`)
@@ -51,6 +52,7 @@ export class Hero extends ecs.Entity {
hv.scale = 1;
hv.is_master=true;
hv.lv=1
console.log("hero load",hv.ATK_TO_POWER,hv.ATKED_TO_POWER,hv.CRIT_TO_POWER,hv.DODGE_TO_POWER)
this.add(hv);
this.addComponents<ecs.Comp>(MasterModelComp)
oops.message.dispatchEvent(GameEvent.MasterCalled,{uuid:uuid})
@@ -92,6 +94,10 @@ export class Hero extends ecs.Entity {
hv.hp= hv.hp_max = hv.hp_base=hero.hp+info.hp
hv.ap = hero.ap+info.ap;
hv.ap_base=hero.ap+info.ap;
hv.ATK_TO_POWER=FightSet.ATK_TO_POWER
hv.ATKED_TO_POWER=FightSet.ATKED_TO_POWER
hv.CRIT_TO_POWER=FightSet.CRIT_TO_POWER
hv.DODGE_TO_POWER=FightSet.DODGE_TO_POWER
hero.buff.forEach((buff:any)=>{
switch(buff.buff_type){
case BuffAttr.CRITICAL:
@@ -148,6 +154,18 @@ export class Hero extends ecs.Entity {
case BuffAttr.FROST_TIME:
hv.frost_time=buff.value
break
case BuffAttr.ATK_TO_POWER:
hv.ATK_TO_POWER+=buff.value
break
case BuffAttr.ATKED_TO_POWER:
hv.ATKED_TO_POWER+=buff.value
break
case BuffAttr.CRIT_TO_POWER:
hv.CRIT_TO_POWER+=buff.value
break
case BuffAttr.DODGE_TO_POWER:
hv.DODGE_TO_POWER+=buff.value
break
}
})
hv.atk_skill=hero.skills[0]