Files
bl/logic/service/fight/effect/effect_100.go
昔念 f224bef17a feat(fight): 移除无用代码并优化技能效果逻辑
- 删除了多个未使用的技能效果文件(effect_10-16_94_99_14.go、effect_61_70_118.go、
  effect_66.go、effect_67.go、effect_78_86_106.go、effect_84_92.go、prop.go)
- 修正了部分技能效果中的错误逻辑判断和数值计算方式
- 调整了伤害计算与治疗效果的参数使用顺序,使其符合预期行为
- 注释掉调试打印语句及测试调用,减少冗余输出
- 修复了部分效果中对技能分类的错误比较条件

此次修改提升了战斗系统代码的整洁性和准确性。
2025-11-14 02:04:19 +08:00

45 lines
948 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/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
// 自身体力越少则威力越大
type Effect100 struct {
node.EffectNode
can bool
}
func (e *Effect100) 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
}
//技能威力=【165-65*【当前体力百分比】】,任意体力百分比对应的威力浮动范围∈[-10+10]
odp := e.GetInput().CurrentPet.GetHP().Div(e.GetInput().CurrentPet.GetMaxHP()).Mul(decimal.NewFromInt(65))
if odp.Cmp(decimal.NewFromInt(165)) == -1 {
e.Ctx().SkillEntity.Power = int(decimal.NewFromInt(165).Sub(odp).IntPart())
}
return true
}
// ---- 注册所有效果 ----
func init() {
input.InitEffect(input.EffectType.Skill, 100, &Effect100{})
}