refactor(game): 重构天赋系统,移除MP效果并添加属性永久加成
- 删除HeroAttrEvent.ts文件及相关MP效果处理 - 将TalEffet.STATS重命名为TalEffet.ATTR以更准确描述功能 - 调整部分天赋配置数值和触发条件 - 新增风怒属性永久加成功能
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { Attrs } from "../common/config/HeroAttrs";
|
||||
|
||||
export interface AttrEvent {
|
||||
Attr: Attrs;
|
||||
Value:number;
|
||||
}
|
||||
|
||||
@ecs.register('HeroAttrEvent')
|
||||
export class HeroAttrEvent extends ecs.Comp {
|
||||
|
||||
|
||||
AttrEvents:AttrEvent[] = [];
|
||||
addAttrEvent(event:AttrEvent){
|
||||
this.AttrEvents.push(event);
|
||||
}
|
||||
reset() {
|
||||
this.AttrEvents = [];
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { Attrs } from "../common/config/HeroAttrs";
|
||||
import { HeroUpSet } from "../common/config/heroSet";
|
||||
import { HeroSkillsComp } from "./HeroSkills";
|
||||
import { HeroAttrsComp } from "./HeroAttrsComp";
|
||||
import { HeroAttrEvent } from "./HeroAttrEvent";
|
||||
/**
|
||||
* ==================== 英雄属性更新系统 ====================
|
||||
*
|
||||
* 按照 ECS 设计理念:
|
||||
* - System(HeroAttrEventSystem):处理属性更新事件
|
||||
*
|
||||
* 系统职责:
|
||||
* 1. 处理当角色收到attr变更事件时,更新角色属性,并处理动画展示
|
||||
*/
|
||||
@ecs.register('HeroAttrEventSystem')
|
||||
export class HeroAttrEventSystem extends ecs.ComblockSystem
|
||||
implements ecs.ISystemUpdate, ecs.IEntityEnterSystem {
|
||||
|
||||
filter(): ecs.IMatcher {
|
||||
return ecs.allOf(HeroAttrsComp,HeroAttrEvent);
|
||||
}
|
||||
entityEnter(e: ecs.Entity): void {
|
||||
|
||||
}
|
||||
|
||||
update(e: ecs.Entity): void {
|
||||
if(!smc.mission.play ) return;
|
||||
if(smc.mission.pause) return
|
||||
const model = e.get(HeroAttrsComp);
|
||||
if (!model || model.is_dead) return;
|
||||
const event = e.get(HeroAttrEvent);
|
||||
if (!event) return;
|
||||
// 移除事件组件(事件处理完成)
|
||||
|
||||
}
|
||||
/**
|
||||
* 启用调试模式(调试时使用)
|
||||
*/
|
||||
enableDebug() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用调试模式(正式运行)
|
||||
*/
|
||||
disableDebug() {
|
||||
}
|
||||
}
|
||||
@@ -214,9 +214,6 @@ export class TalComp extends ecs.Comp {
|
||||
case TalEffet.HP:
|
||||
heroAttrs.add_hp(talent.value + talent.value_add,talent.vType == BType.VALUE);
|
||||
break;
|
||||
case TalEffet.MP:
|
||||
heroAttrs.add_mp(talent.value + talent.value_add,talent.vType == BType.VALUE);
|
||||
break;
|
||||
case TalEffet.WFUNY:
|
||||
heroAttrs.addCountTal(TalEffet.WFUNY, talent.value + talent.value_add);
|
||||
break;
|
||||
@@ -235,6 +232,9 @@ export class TalComp extends ecs.Comp {
|
||||
case TalEffet.BUFF:
|
||||
heroAttrs.addValueTal(talent.uuid, talent.attrs, talent.vType, talent.value + talent.value_add);
|
||||
break;
|
||||
case TalEffet.ATTR:
|
||||
heroAttrs.addValueTal(talent.uuid, talent.attrs, talent.vType, talent.value + talent.value_add);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user