Files
bl/logic/service/fight/effect/504.go
xinian 1e37d71878
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
fix: 修复属性设置逻辑
2026-03-17 10:57:11 +08:00

39 lines
897 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 504 - m%令对手害怕,若没有触发害怕效果,则对手攻击,防御,特攻,特防,速度,命中等级下降
type Effect504 struct {
node.EffectNode
}
func (e *Effect504) OnSkill() bool {
chance := e.Args()[0].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
// 令对手害怕
fearEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Fear))
if fearEffect != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, fearEffect)
}
} else {
for i, effectId := range e.SideEffectArgs[1:] {
if effectId!=0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(effectId))
}
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 504, &Effect504{})
}