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

34 lines
803 B
Go

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 403: 技能使用成功时,{0}%令自身特攻和速度等级+{1}。若和对手属性相同,则技能效果翻倍
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.CarrierInput().CurPet[0].Type == e.TargetInput().CurPet[0].Type {
boostValue *= 2
}
e.CarrierInput().SetProp(e.CarrierInput(), 4, boostValue)
e.CarrierInput().SetProp(e.CarrierInput(), 2, boostValue)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 403, &Effect403{})
}