refactor(fight/effect): 重构SetArgs方法为可变参数形式,优化Effect62参数设置逻辑并同步更新Effect接口定义
This commit is contained in:
@@ -27,7 +27,7 @@ type Effect interface {
|
||||
SetInput(input *Input)
|
||||
AfterAttr() //在获取属性前,比如重写对方属性AfterAttr
|
||||
BeferAttr() //在获取属性后,比如视为对方属性
|
||||
SetArgs(param []int)
|
||||
SetArgs(param ...int)
|
||||
IsCrit(opp *Input, skill *info.SkillEntity) //是否暴击
|
||||
CalculateDamage(opp *Input, skill *info.SkillEntity) //击判定成功且伤害计算前触发
|
||||
OnBeforeCalculateDamage(opp *Input, skill *info.SkillEntity) // 最终伤害计算前触发
|
||||
@@ -193,6 +193,7 @@ func getTypeName(v interface{}) string {
|
||||
|
||||
func (c *Input) AddEffect(e Effect) {
|
||||
//todo 免疫
|
||||
//TODO 先激活
|
||||
e.SetInput(c)
|
||||
// 如果已有同 ID 的效果,尝试叠加
|
||||
for _, eff := range c.Effects {
|
||||
|
||||
Reference in New Issue
Block a user