移除冗余的 Calculate_Pre 调用注释,优化技能命中判断流程。 将 SkillID 赋值操作移动至命中条件判断内部,确保仅在技能命中时记录。 注释掉部分不再使用的接口方法定义,保持代码整洁。
47 lines
955 B
Go
47 lines
955 B
Go
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{})
|
||
}
|