Files
bl/logic/service/fight/effect/effect_68.go
昔念 6afae2c704 fix(fight): 调整技能命中逻辑与效果触发时机
移除冗余的 Calculate_Pre 调用注释,优化技能命中判断流程。
将 SkillID 赋值操作移动至命中条件判断内部,确保仅在技能命中时记录。
注释掉部分不再使用的接口方法定义,保持代码整洁。
2025-11-14 04:23:50 +08:00

47 lines
955 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"
)
// 1回合内受到致死攻击时则余下1点体力
// ---- Effect68 ----
type Effect68 struct {
node.EffectNode
StatusID int
}
func (e *Effect68) Skill_Use_ex() bool {
if !e.Hit() {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
//fmt.Println("Effect68_o", t.Damage)
//伤害溢出
if e.Ctx().Opp.DamageZone.Damage.Cmp(e.Ctx().Our.CurrentPet.GetHP()) == 1 {
e.Ctx().Our.CurrentPet.Info.Hp = 1
}
//fmt.Println("Effect68_n", t.Damage)
return true
}
func (e *Effect68) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[1])
}
// ---- 注册所有效果 ----
func init() {
input.InitEffect(input.EffectType.Skill, 68, &Effect68{})
}