Files
bl/logic/service/fight/effect/effect_35.go
昔念 6ba9c3549c feat(fight): 优化精灵切换逻辑与技能效果处理
- 修改 `ChangePet` 方法,记录初始攻击值并在切换时正确传递
- 简化多个 effect 的初始化方式,移除冗余的 `EffectNode` 字段
- 增强 Effect58 和 Effect67 的逻辑判断,增加空指针检查和类型判断
- 引入 decimal 包用于精确血量计算
- 统一 `Switch` 接口参数,增强状态类和节点类的兼容性
- 修正部分技能效果的触发条件和持续时间设置
- 调整回合结束逻辑,注释掉原有后手增益机制
2025-11-13 23:06:55 +08:00

46 lines
942 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 惩罚,对方能力等级越高,此技能威力越大
type Effect35 struct {
node.EffectNode
can bool
}
func (e *Effect35) Skill_Hit() bool {
if !e.Hit() {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.PHYSICAL {
return true
}
switch e.Ctx().SkillEntity.Category() {
case info.Category.PHYSICAL:
e.Ctx().SkillEntity.Power += e.Ctx().Opp.GetProp(0, true) + e.Ctx().Opp.GetProp(1, true)
case info.Category.SPECIAL:
e.Ctx().SkillEntity.Power += e.Ctx().Opp.GetProp(2, true) + e.Ctx().Opp.GetProp(3, true)
}
return true
}
// ---- 注册所有效果 ----
func init() {
input.InitEffect(input.EffectType.Skill, 35, &Effect35{})
}