Files
bl/logic/service/fight/effect/effect_34.go
2025-11-21 05:47:51 +00:00

48 lines
831 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/shopspring/decimal"
)
/**
* 将所受的伤害n倍反馈给对手
*/
func init() {
input.InitEffect(input.EffectType.Skill, 34, &Effect34{})
}
type Effect34 struct {
node.EffectNode
can bool
}
// 使用技能时不可被继承继承Miss和Hit就行
func (e *Effect34) OnSkill() bool {
if !e.Hit() {
return true
}
e.can = true
return true
}
// 被攻击时候反弹
func (e *Effect34) Damage_Floor(t *info.DamageZone) bool {
if !e.can {
return true
}
//不是技能
if e.Ctx().SkillEntity == nil {
return true
}
t.Damage = decimal.NewFromInt(int64(e.Ctx().Opp.SumDamage.IntPart())).Mul(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
return true
}