- 将 InitEffect 重命名为 InitSkillEffect,用于初始化技能效果 - 修改技能效果的 ID,避免和普通效果 ID 冲突 - 优化战斗循环逻辑,增加战斗结束的判断条件 - 调整输入结构,移除未使用的属性和状态容器 - 重构技能解析和攻击处理逻辑,提高代码可读性和维护性
28 lines
579 B
Go
28 lines
579 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
/**
|
|
* 给予对象损伤一半,会回复自己的体力
|
|
*/
|
|
type Effect1 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func init() {
|
|
input.InitSkillEffect(1, &Effect1{})
|
|
|
|
}
|
|
|
|
// 重写POST_DAMAGE ,伤害结束后触发回血
|
|
func (this *Effect1) PostDamage() bool {
|
|
|
|
// off := this.GetSkill().DamageValue.Div(decimal.NewFromInt(2)) //伤害的一半
|
|
//this.GetOwnerPet().HP += int(off.IntPart()) //这里是effect在对方挂载,故回血给自己回血
|
|
//待重写实现
|
|
return true
|
|
}
|