31 lines
724 B
Go
31 lines
724 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// 552 - 若对手处于异常状态,则{0}%概率附加{1}点伤害
|
|
type Effect552 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect552) DamageModify(t *info.DamageZone) bool {
|
|
if t.Type == info.DamageType.Red && e.Ctx().Opp.StatEffect_Exist_all() {
|
|
chance := e.Args()[0].IntPart()
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|
if success {
|
|
extra := alpacadecimal.NewFromInt(e.Args()[1].IntPart())
|
|
t.Damage = t.Damage.Add(extra)
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 552, &Effect552{})
|
|
}
|