This commit is contained in:
44
logic/service/fight/effect/effect_484.go
Normal file
44
logic/service/fight/effect/effect_484.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/common/utils"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
// 484 - 连击n次,每次命中后连击数+m,最高连击p次
|
||||
type Effect484 struct {
|
||||
node.EffectNode
|
||||
count int64
|
||||
}
|
||||
|
||||
func (e *Effect484) Damage_Mul(t *info.DamageZone) bool {
|
||||
|
||||
if t.Type == info.DamageType.Red {
|
||||
n := utils.Min(e.Args()[0].IntPart()+e.count, e.Args()[1].IntPart())
|
||||
t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(n)))
|
||||
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
func (e *Effect484) SkillHit() bool {
|
||||
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Ctx().SkillEntity.AttackTime != 0 {
|
||||
e.count = 0
|
||||
return true
|
||||
}
|
||||
e.count += e.Args()[1].IntPart()
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 484, &Effect484{})
|
||||
}
|
||||
Reference in New Issue
Block a user