Files
bl/logic/service/fight/effect/effect_34.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

47 lines
869 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
/**
* 将所受的伤害n倍反馈给对手
*/
func init() {
input.InitEffect(input.EffectType.Skill, 34, &Effect34{})
}
// Effect 34: 将所受的伤害{0}倍反馈给对手
type Effect34 struct {
node.EffectNode
can bool
}
// 使用技能时不可被继承继承Miss和Hit就行
func (e *Effect34) OnSkill() bool {
e.can = true
return true
}
// 被攻击时候反弹
func (e *Effect34) DamageFloor(t *info.DamageZone) bool {
if !e.can {
return true
}
//不是技能
if e.Ctx().SkillEntity == nil {
return true
}
t.Damage = alpacadecimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Mul(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])))
return true
}