refactor: 重、、、、
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user