Files
heros/assets/script/game/hero/TalComp.ts
panw 7b067213c0 feat(天赋系统): 重构天赋系统并添加新天赋效果
- 重构天赋类型和效果枚举,简化触发条件分类
- 添加天赋buff数组支持叠加效果计算
- 实现多种新天赋效果包括风怒、溅射、护盾等
- 修改熟练天赋触发条件从3次改为10次攻击
2025-11-18 16:46:13 +08:00

39 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { BuffConf, SkillSet } from "../common/config/SkillSet";
import { TalAttrs, TalEffet, TalTarget, TriType } from "../common/config/TalSet";
import { HeroInfo } from "../common/config/heroSet";
import { HeroViewComp } from "./HeroViewComp";
export interface TalSlot {
uuid: number; // 天赋ID
name: string; // 天赋名称
value: number; // 触发的效果价值
Trigger:boolean //触发值减值
C_Trigger:number //当前值
}
/**
* 天赋系统组件类
* 继承自 CCComp作为 ECS 架构中的组件存在
* 负责管理英雄的天赋系统,包括天赋获取、触发、效果应用等
*/
@ecs.register('TalComp', false)
export class TalComp extends ecs.Comp {
/** 英雄视图组件引用,运行时获取避免循环引用 */
private heroView: any = null;
private skillCon:any=null;
/** 英雄唯一标识符,用于从配置中获取英雄信息 */
private heroUuid: number = 0;
/** 天赋数组 */
Tals: Record<number, TalSlot> = {};
/** 天赋槽位数组,默认开启2个最多4个 */
TalSlots:number[]=[1,1,0,0]
reset() {
}
}