Files
bl/logic/service/fight/effect/effect_58.go
昔念 7f443736bc feat(fight): 重构战斗效果触发机制与ID管理
- 统一将 Skill_Hit_Pre 和 Skill_Hit_Pre_ex 方法重命名为 Action_start 和 Action_start_ex
- 新增 Action_end 和 Action_end_ex 接口方法,完善行动周期控制
- 修改效果ID生成逻辑,使用 EffectIDCombiner 替代简单整数运算,提升扩展性
- 调整状态类效果判断方式,通过前缀匹配识别状态类型
- 增加随机持续时间和参数设置功能,增强部分效果的表现力
- 优化战斗流程中效果执行时机,确保行为前后逻辑完整闭环
2025-11-22 00:44:42 +08:00

57 lines
962 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回合自身攻击技能必定打出致命一击
*/
func init() {
input.InitEffect(input.EffectType.Skill, 58, &Effect58{})
}
type Effect58 struct {
node.EffectNode
Can bool
}
func (e *Effect58) OnSkill() bool {
if !e.Hit() {
return true
}
e.Can = true
return true
}
func (e *Effect58) Action_start(a, b *action.SelectSkillAction) bool {
if !e.Hit() {
return true
}
if !e.Can {
return true
}
//fmt.Println(e.Ctx().SkillEntity)
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.CritRate = 16
return true
}
func (e *Effect58) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}