Files
bl/logic/service/fight/effect/137.go
xinian a8cbe99873
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构技能效果实现
2026-03-08 14:55:53 +08:00

36 lines
814 B
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"
)
// 137 - 损失一半当前体力值攻击和速度提升2个等级
type Effect137 struct {
node.EffectNode
}
func (e *Effect137) OnSkill() bool {
// 损失一半当前体力值
currentHp := e.Ctx().Our.CurrentPet.GetHP()
halfHp := currentHp.Div(alpacadecimal.NewFromInt(2))
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: halfHp,
}
e.Ctx().Our.Damage(e.Ctx().Our, damageZone)
e.Ctx().Our.SetProp(e.Ctx().Our, 4, 2, info.AbilityOpType.ADD)
e.Ctx().Our.SetProp(e.Ctx().Our, 0, 2, info.AbilityOpType.ADD)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 137, &Effect137{})
}