Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
fix(fight): 修复技能效果参数错误和伤害统计问题 - 修复effect_508中参数索引错误,将Args()[1]改为Args()[0] - 修复effect_508中持续时间设置错误,统一设置为1 - 修复战斗伤害统计错误,将我方受伤统计改为对方受伤统计 ```
51 lines
774 B
Go
51 lines
774 B
Go
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()[0]) > 0 {
|
|
t.Damage = t.Damage.Sub(e.Args()[0])
|
|
} else {
|
|
t.Damage = alpacadecimal.Zero
|
|
}
|
|
return true
|
|
}
|
|
func (e *Effect508) SetArgs(t *input.Input, a ...int) {
|
|
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.EffectNode.Duration(1)
|
|
|
|
}
|