将 StatEffect_Exist 方法的参数类型从 int 改为 info.EnumPetStatus, 并在调用 GetEffect 时进行显式类型转换,以提高代码可读性和类型安全性。 同时清理了部分冗余的类型转换调用。
43 lines
766 B
Go
43 lines
766 B
Go
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
|
||
}
|