package effect import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" "github.com/alpacahq/alpacadecimal" ) type Effect130 struct { node.EffectNode // 仅继承基础效果节点,不嵌入条件函数 } // ----------------------------------------------------------- // 核心共性逻辑:命中且满足条件时,附加固定伤害 // ----------------------------------------------------------- func (e *Effect130) OnSkill() bool { // 1. 命中判定失败,不触发 if !e.Hit() { return true } if e.Ctx().Opp.CurrentPet.PetInfo.Gender != int(e.Args()[0].IntPart()) { return true } // 4. 附加固定伤害(从SideEffectArgs[0]获取伤害值) damageValue := alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1])) e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ Type: info.DamageType.Fixed, Damage: damageValue, }) return true } func init() { input.InitEffect(input.EffectType.Skill, 130, &Effect130{}) }