40 lines
785 B
Go
40 lines
785 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 46: 抵挡下{0}次对手的攻击
|
|
type Effect46 struct {
|
|
FixedDurationNeg1Arg0CountBase
|
|
}
|
|
|
|
func (e *Effect46) Damage_Shield(t *info.DamageZone) bool {
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
//fmt.Println("Effect46_o", t.Damage)
|
|
if t.Type == info.DamageType.Red && e.remaining > 0 {
|
|
e.remaining--
|
|
t.Damage = alpacadecimal.Zero
|
|
if e.remaining <= 0 {
|
|
e.Alive(false)
|
|
}
|
|
}
|
|
//fmt.Println("Effect46_n", t.Damage)
|
|
return true
|
|
}
|
|
|
|
// ---- 注册所有效果 ----
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 46, &Effect46{})
|
|
}
|