Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
fix(fight): 完善boss技能37注释并修复技能48伤害计算逻辑 - 移除NewSeIdx_37.go中TODO注释,完善技能描述 - 修复NewSeIdx_48.go中技能48的伤害减免逻辑,统一使用Ctx().Category() - 优化modules/config/service/base.go中的缓存配置逻辑 ```
50 lines
1.1 KiB
Go
50 lines
1.1 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
|
||
}
|
||
if t.Type != info.DamageType.Red {
|
||
return true
|
||
}
|
||
|
||
// 检查攻击类型是否匹配(攻击类型:1=物理攻击,2=特殊攻击)
|
||
attackCategory := int(e.Args()[0].IntPart())
|
||
switch attackCategory {
|
||
case 1:
|
||
if e.Ctx().Category() == info.Category.PHYSICAL {
|
||
// 物理攻击无效
|
||
t.Damage = alpacadecimal.Zero
|
||
}
|
||
case 2:
|
||
if e.Ctx().Category() == info.Category.SPECIAL {
|
||
// 特殊攻击无效
|
||
t.Damage = alpacadecimal.Zero
|
||
}
|
||
}
|
||
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.NewSel, 48, &NewSel48{})
|
||
}
|