32 lines
755 B
Go
32 lines
755 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 459: 附加对手防御值{0}%的百分比伤害
|
|
type Effect459 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect459) OnSkill() bool {
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
|
|
opponentDef := alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurPet[0].Info.Prop[1]))
|
|
percent := e.Args()[0].Div(alpacadecimal.NewFromInt(100))
|
|
additionalDamage := opponentDef.Mul(percent)
|
|
|
|
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: additionalDamage})
|
|
|
|
return true
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 459, &Effect459{})
|
|
}
|