Files
bl/logic/service/fight/effect/403.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

35 lines
850 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"
)
// 403 - 技能使用成功时n%令自身特攻和速度等级+m。若和对手属性相同则技能效果翻倍
type Effect403 struct {
node.EffectNode
}
func (e *Effect403) OnSkill() bool {
chance := e.Args()[0].IntPart()
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
boostValue := int8(e.Args()[1].IntPart())
// 检查属性是否相同
if e.Ctx().Our.CurrentPet.Type == e.Ctx().Opp.CurrentPet.Type {
boostValue *= 2
}
e.Ctx().Our.SetProp(e.Ctx().Our, 4, boostValue, info.AbilityOpType.ADD)
e.Ctx().Our.SetProp(e.Ctx().Our, 2, boostValue, info.AbilityOpType.ADD)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 403, &Effect403{})
}