Files
bl/logic/service/fight/effect/effect_130.go
xinian 9c6f3988de
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构 CurrentPet 为 CurPet
2026-04-04 04:34:43 +08:00

38 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// Effect 130: 对方为{0}则附加{1}点伤害
type Effect130 struct {
node.EffectNode // 仅继承基础效果节点,不嵌入条件函数
}
// -----------------------------------------------------------
// 核心共性逻辑:命中且满足条件时,附加固定伤害
// -----------------------------------------------------------
func (e *Effect130) Skill_Use() bool {
// 1. 命中判定失败,不触发
if e.Ctx().Opp.CurPet[0].Info.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{})
}