Files
bl/logic/service/fight/effect/effect_95.go
昔念 3c067751f1 fix(logic/service/fight): 修正状态效果判断逻辑中的类型转换问题
将 StatEffect_Exist 方法的参数类型从 int 改为 info.EnumPetStatus,
并在调用 GetEffect 时进行显式类型转换,以提高代码可读性和类型安全性。
同时清理了部分冗余的类型转换调用。
2025-11-14 00:47:49 +08:00

43 lines
766 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/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* 对手处于睡眠状态时致命一击率提升n/16
*/
func init() {
input.InitEffect(input.EffectType.Skill, 95, &Effect95{})
}
type Effect95 struct {
node.EffectNode
}
func (e *Effect95) Skill_Hit_Pre(a, b *action.SelectSkillAction) bool {
if !e.Hit() {
return true
}
//fmt.Println(e.Ctx().SkillEntity)
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if !e.Ctx().Opp.StatEffect_Exist(input.StatusSleep) {
return true
}
e.Ctx().SkillEntity.CritRate += e.Args()[0]
return true
}