39 lines
753 B
Go
39 lines
753 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 408, &Effect408{})
|
|
input.InitEffect(input.EffectType.Skill, 463, &Effect408{})
|
|
}
|
|
|
|
type Effect408 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect408) DamageSubEx(t *info.DamageZone) bool {
|
|
|
|
if t.Type != info.DamageType.Red {
|
|
return true
|
|
}
|
|
|
|
if t.Damage.Cmp(e.Args()[1]) > 0 {
|
|
t.Damage = t.Damage.Sub(e.Args()[1])
|
|
} else {
|
|
t.Damage = alpacadecimal.Zero
|
|
}
|
|
return true
|
|
}
|
|
func (e *Effect408) SetArgs(t *input.Input, a ...int) {
|
|
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
|
|
|
|
}
|