42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
|
||
"github.com/alpacahq/alpacadecimal"
|
||
)
|
||
|
||
// 48. 对方某种攻击类型无效(a1: 攻击类型)
|
||
type NewSel48 struct {
|
||
NewSel0
|
||
}
|
||
|
||
func (e *NewSel48) DamageDivEx(t *info.DamageZone) bool {
|
||
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
|
||
if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime {
|
||
return true
|
||
}
|
||
|
||
// 检查对手是否使用了指定攻击类型
|
||
if e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
|
||
// 检查攻击类型是否匹配(攻击类型:1=物理攻击,3=特殊攻击)
|
||
attackCategory := int(e.Args()[0].IntPart())
|
||
if e.Ctx().SkillEntity.Category() == info.Category.PHYSICAL && attackCategory == 1 {
|
||
// 物理攻击无效
|
||
t.Damage = alpacadecimal.Zero
|
||
} else if e.Ctx().SkillEntity.Category() == info.Category.SPECIAL && attackCategory == 3 {
|
||
// 特殊攻击无效
|
||
t.Damage = alpacadecimal.Zero
|
||
}
|
||
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.NewSel, 48, &NewSel48{})
|
||
}
|