Files
bl/logic/service/fight/effect/495.go
xinian 937ddd0a97
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
fix: 修复宠物存活状态判定逻辑
移除 `NotAlive` 字段,改用 `Alive()` 方法通过 HP 判断存活状态,修正相关效果触发逻辑。
2026-03-17 13:34:50 +08:00

32 lines
639 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"
)
// 495 - 若对手处于XX状态则30%几率秒杀对手
type Effect495 struct {
node.EffectNode
}
func (e *Effect495) OnSkill() bool {
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { // 对手处于异常状态
chance := 30 // 固定30%
success, _, _ := e.Input.Player.Roll(chance, 100)
if success {
// 秒杀对手
e.Ctx().Opp.CurrentPet.Info.Hp = 0
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 495, &Effect495{})
}