feat(fight): 调整技能与状态效果逻辑,优化战斗流程 - 注释掉状态 ID 13 的注册,暂不启用 DrainedHP 状态 - 为 Effect10 增加输入参数设置,标记目标单位 - 重构 Effect62 实现逻辑,新增子效果 Effect62_1 支持回合触发秒杀机制 - 引入 decimal 包以支持精确伤害计算 - 修改命中判断流程,修复部分技能命中异常问题 - 增加睡眠状态对空技能的防御处理 - 优化战斗死亡判定逻辑,支持同归于尽判定及战斗结束控制
43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// -----------------------------------------------------------
|
|
// 通用状态效果(例如 麻痹 / 中毒 / 疲惫 / 混乱 等)
|
|
// -----------------------------------------------------------
|
|
type Effect13 struct {
|
|
node.EffectNode
|
|
Status info.EnumBattleStatus // 要施加的状态类型
|
|
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 13, &Effect13{})
|
|
}
|
|
|
|
// -----------------------------------------------------------
|
|
// 技能触发时调用
|
|
// -----------------------------------------------------------
|
|
func (e *Effect13) OnSkill(ctx input.Ctx) bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
|
|
duration := e.EffectNode.SideEffectArgs[0]
|
|
//duration++
|
|
// 获取状态效果
|
|
eff := input.Geteffect(input.EffectType.Status, int(info.PetStatus.DrainedHP))
|
|
if eff == nil {
|
|
return true
|
|
}
|
|
|
|
eff.Duration(duration)
|
|
eff.SetArgs(ctx.Input)
|
|
ctx.AddEffect(eff)
|
|
return true
|
|
}
|