refactor: 重构技能效果实现
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
41
logic/service/fight/effect/428.go
Normal file
41
logic/service/fight/effect/428.go
Normal 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{})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user