refactor: 重构技能效果实现
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-08 14:55:53 +08:00
committed by cnb
parent 986c7f7b83
commit a8cbe99873
13 changed files with 475 additions and 345 deletions

View File

@@ -0,0 +1,41 @@
package effect
import (
element "blazing/common/data/Element"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 428 - 遇到天敌时附加m点固定伤害
type Effect428 struct {
node.EffectNode
}
func (e *Effect428) SkillHit_ex() bool {
t, _ := element.Calculator.GetOffensiveMultiplier(e.Ctx().Opp.CurrentPet.Type, e.Ctx().Our.CurrentPet.Type)
// evs := gconv.Uint32s(strings.Split(xmlres.PetMAP[int(e.Ctx().Our.CurrentPet.ID)].NaturalEnemy, " "))
// _, ok := lo.Find(evs, func(t uint32) bool {
// return t == uint32(e.Ctx().Opp.CurrentPet.ID)
// })
if t <= 1 {
return true
}
// 附加m点固定伤害
additionalDamage := alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart()))
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: additionalDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 428, &Effect428{})
}