feat: 新增多个战斗效果并修复逻辑问题
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:
50
logic/service/fight/effect/effect_508.go
Normal file
50
logic/service/fight/effect/effect_508.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
|
||||
"github.com/alpacahq/alpacadecimal"
|
||||
)
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 508, &Effect508{})
|
||||
|
||||
}
|
||||
|
||||
type Effect508 struct {
|
||||
node.EffectNode
|
||||
Can bool
|
||||
}
|
||||
|
||||
func (e *Effect508) OnSkill() bool {
|
||||
|
||||
e.Can = true
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *Effect508) DamageSubEx(t *info.DamageZone) bool {
|
||||
|
||||
if !e.Can {
|
||||
return true
|
||||
}
|
||||
|
||||
if t.Type != info.DamageType.Red {
|
||||
return true
|
||||
}
|
||||
|
||||
if t.Damage.Cmp(e.Args()[1]) > 0 {
|
||||
t.Damage = t.Damage.Sub(e.Args()[1])
|
||||
} else {
|
||||
t.Damage = alpacadecimal.Zero
|
||||
}
|
||||
return true
|
||||
}
|
||||
func (e *Effect508) SetArgs(t *input.Input, a ...int) {
|
||||
|
||||
e.EffectNode.SetArgs(t, a...)
|
||||
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user