39 lines
759 B
Go
39 lines
759 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 570: 免疫下{0}次受到的攻击
|
|
type Effect570 struct {
|
|
node.EffectNode
|
|
remaining int
|
|
}
|
|
|
|
func (e *Effect570) SetArgs(t *input.Input, a ...int) {
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.EffectNode.Duration(-1)
|
|
if len(a) > 0 {
|
|
e.remaining = a[0]
|
|
}
|
|
}
|
|
|
|
func (e *Effect570) DamageLockEx(t *info.DamageZone) bool {
|
|
if e.remaining > 0 && t.Type == info.DamageType.Red {
|
|
t.Damage = alpacadecimal.Zero
|
|
e.remaining--
|
|
if e.remaining <= 0 {
|
|
e.Alive(false) // 效果结束
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 570, &Effect570{})
|
|
}
|