refactor(fight): 重构战斗逻辑中技能实体传递方式

将战斗逻辑中使用的 action.SelectSkillAction 替换为 info.SkillEntity,
以统一技能数据结构。同时更新相关函数签名和字段引用。

此外,移除了未使用的 Attack 字段,并调整了部分逻辑实现以提高代码清晰度。
还修复了 effect_power_doblue.go 中对输入参数的错误引用问题。

最后,修改了通道命名规范(ActionChan -> actionChan, GetActionChan -> GetOverChan),
并引入 overchan 用于战斗结束通知,提升并发安全性与语义明确性。
```
This commit is contained in:
2025-11-10 02:29:00 +08:00
parent a4041aaa66
commit 4b34445dfc
12 changed files with 64 additions and 71 deletions

View File

@@ -1,13 +1,12 @@
package input
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
)
type Ctx struct {
*Input //施加方
*action.SelectSkillAction //action本身
*Input //施加方
*info.SkillEntity //action本身
*info.DamageZone //伤害
}

View File

@@ -14,7 +14,7 @@ import (
)
// 计算暴击
func (u *Input) CalculateCrit(opp *Input, skill *action.SelectSkillAction) {
func (u *Input) CalculateCrit(opp *Input, skill *info.SkillEntity) {
skill.Crit = 0
if skill.Category() == info.Category.STATUS { //属性技能不用算暴击

View File

@@ -84,14 +84,8 @@ func (c *Input) GetEffect(etype EnumEffectType, id int) Effect {
return nil
}
func (c *Input) StatEffect_Exist(id int) bool {
for _, v := range c.Effects {
if v.ID()+int(EffectType.Status) == id && v.Alive() {
return true
}
}
return false
return c.GetEffect(EffectType.Status, id-int(EffectType.Status)) != nil
}
func (c *Input) StatEffect_Exist_all() bool {
for _, v := range c.Effects {