refactor(fight): 重构战斗逻辑中技能实体传递方式 将战斗逻辑中使用的 action.SelectSkillAction 替换为 info.SkillEntity, 以统一技能数据结构。同时更新相关函数签名和字段引用。 此外,移除了未使用的 Attack 字段,并调整了部分逻辑实现以提高代码清晰度。 还修复了 effect_power_doblue.go 中对输入参数的错误引用问题。 最后,修改了通道命名规范(ActionChan -> actionChan, GetActionChan -> GetOverChan), 并引入 overchan 用于战斗结束通知,提升并发安全性与语义明确性。 ```
23 lines
586 B
Go
23 lines
586 B
Go
package common
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"math/rand"
|
|
)
|
|
|
|
type FightI interface {
|
|
Over(c PlayerI, id info.EnumBattleOverReason) //逃跑
|
|
UseSkill(c PlayerI, id int32) //使用技能
|
|
GetCurrPET(c PlayerI) *info.BattlePetEntity //当前精灵
|
|
Ownerid() uint32
|
|
ReadyFight(c PlayerI) //是否准备战斗
|
|
ChangePet(c PlayerI, id uint32)
|
|
Capture(c PlayerI, id uint32)
|
|
GetRand() *rand.Rand
|
|
LoadPercent(c PlayerI, percent int32)
|
|
UseItem(c PlayerI, cacthid, itemid uint32)
|
|
CanEscape() bool
|
|
IsFirst(c PlayerI) bool
|
|
GetOverChan() chan struct{}
|
|
}
|