refactor(fight): 重构战斗系统

- 重构了 BattleSkillEntity 结构,改名为 SkillEntity
- 优化了 Input 结构,移除了冗余的 Effect 容器
- 调整了 Effect 接口,增加了 SetInput 和 Alive 方法
- 重构了战斗逻辑中的技能使用和效果处理流程
- 优化了代码结构,提高了可读性和可维护性
This commit is contained in:
2025-09-15 00:40:19 +08:00
parent 906bad9e21
commit d9f09aa96a
10 changed files with 108 additions and 94 deletions

View File

@@ -18,7 +18,7 @@ type Input struct {
*info.AttackValue
FightC common.FightI
// info.BattleActionI
Effect NodeManager //effects容器 技能的
Effects []Effect //effects 实际上全局就是effect无限回合 //effects容器 技能的
// Prop NodeManager //属性容器
// Status NodeManager //状态容器
//NewSeIdx NodeManager //全局容器
@@ -29,8 +29,8 @@ type Input struct {
func NewInput(c common.FightI, p common.PlayerI) *Input {
ret := &Input{FightC: c, Player: p}
t := NodeM[1000000]
ret.Effect.AddEffect(deepcopy.Copy(t).(Effect)) //添加默认基类,实现继承
p.SetFightC(c) //给玩家设置战斗容器
ret.AddEffect(deepcopy.Copy(t).(Effect)) //添加默认基类,实现继承
p.SetFightC(c) //给玩家设置战斗容器
return ret
}