Files
bl/logic/service/fight/effect/460.go
xinian 78a68148ce
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
chore: update fight logic and effect implementations
2026-04-05 02:25:44 +08:00

36 lines
824 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 460: {0}%概率令对手害怕,若对手处于能力提升状态则额外附加{1}%概率
type Effect460 struct {
node.EffectNode
}
func (e *Effect460) OnSkill() bool {
baseChance := e.Args()[0].IntPart() // m%
totalChance := baseChance
if e.TargetInput().HasPropADD() {
totalChance += e.Args()[1].IntPart()
}
success, _, _ := e.Input.Player.Roll(int(totalChance), 100)
if success {
fearEffect := e.CarrierInput().InitEffect(input.EffectType.Status, int(info.PetStatus.Fear))
if fearEffect != nil {
e.TargetInput().AddEffect(e.CarrierInput(), fearEffect)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 460, &Effect460{})
}