Files
bl/logic/service/fight/effect/effect_7.go
2025-11-11 05:54:24 +00:00

44 lines
842 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
* 对方体力高于自己时才能命中,将对方体力减到和自己相同
*/
func init() {
input.InitEffect(input.EffectType.Skill, 7, &Effect7{
EffectNode: node.EffectNode{},
})
}
type Effect7 struct {
node.EffectNode
}
func (e *Effect7) Skill_Hit_Pre() bool {
if e.Ctx().Our.CurrentPet.Info.Hp <= e.Input.CurrentPet.Info.Hp {
e.Ctx().SkillEntity.Accuracy = 0
}
return true
}
func (e *Effect7) Damage_Floor() bool {
if !e.Hit() {
return true
}
if e.Ctx().DamageZone.Type == info.DamageType.Red {
e.Ctx().DamageZone.Damage = decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.Hp - e.Ctx().Opp.CurrentPet.Info.Hp))
}
return true
}