feat(fight): 调整战斗逻辑与伤害计算流程 - 移除 `Over` 方法中的冗余回调参数 `fn` - 修复部分技能效果中错误的伤害目标对象(Our/Opp) - 优化战斗循环逻辑,使用 `over` channel 替代 `quit` 作为战斗结束信号 - 增加回合效果执行前的存活状态判断 - 修正伤害计算过程中对血量扣减的逻辑错误 -
24 lines
587 B
Go
24 lines
587 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{}
|
|
}
|