refactor: 重、、、、

This commit is contained in:
xinian
2026-04-04 06:11:01 +08:00
committed by cnb
parent 28d92c1e18
commit 3a9932e307
18 changed files with 665 additions and 680 deletions

View File

@@ -2,11 +2,49 @@ package input
import "blazing/logic/service/fight/info"
type LegacySides struct {
Our *Input // 兼容旧 effect当前执行侧
Opp *Input // 兼容旧 effect当前执行侧的对位
}
type EffectBinding struct {
Source *Input // effect 绑定的输入源,等价于 e.GetInput()
Carrier *Input // 当前持有该 effect 的输入源
Target *Input // 当前 effect 实际作用/挂载的输入源
}
type Ctx struct {
Our *Input //施加方
Opp *Input //被施加方
LegacySides
EffectBinding
*info.SkillEntity //action本身
// *info.DamageZone //伤害
}
func (c *Ctx) Self() *Input {
if c == nil {
return nil
}
if c.Source != nil {
return c.Source
}
return c.Our
}
func (c *Ctx) Receiver() *Input {
if c == nil {
return nil
}
if c.Target != nil {
return c.Target
}
if c.Carrier != nil {
return c.Carrier
}
return c.Our
}