This commit is contained in:
28
logic/service/fight/effect/effect_415.go
Normal file
28
logic/service/fight/effect/effect_415.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/action"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 415 - 若造成的伤害大于m点,则自身恢复n点体力
|
||||
type Effect415 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect415) SkillUseed() bool {
|
||||
damageThreshold := int(e.Args()[0].IntPart())
|
||||
healAmount := e.Args()[1].IntPart()
|
||||
|
||||
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(int64(damageThreshold))) > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(healAmount)))
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 415, &Effect415{})
|
||||
}
|
||||
Reference in New Issue
Block a user