Files
bl/logic/service/fight/boss/NewSeIdx_33.go
xinian ca7eb04f6e
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重命名 ActionEndEx 为 Action_end_ex
2026-03-08 19:14:42 +08:00

33 lines
871 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/input"
)
// 33. 精灵体力降低到 1/n 时有 m% 几率体力回满;a1: n, a2: m 百分比)
// TODO: 实现精灵体力降低到 1/n 时有 m% 几率体力回满;a1: n, a2: m 百分比)的核心逻辑
type NewSel33 struct {
NewSel0
}
func (e *NewSel33) Action_end_ex() bool {
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
return true
}
// 3. 概率判定Args()[1]为触发概率)
cmp := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])
if e.Ctx().Our.CurrentPet.GetHP().Cmp(cmp) == -1 {
success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if !success {
return true
}
e.Ctx().Our.Heal(e.Ctx().Our, nil, e.Ctx().Our.GetPetInfo().GetMaxHP())
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 33, &NewSel33{})
}