- 修改 `ChangePet` 方法,记录初始攻击值并在切换时正确传递 - 简化多个 effect 的初始化方式,移除冗余的 `EffectNode` 字段 - 增强 Effect58 和 Effect67 的逻辑判断,增加空指针检查和类型判断 - 引入 decimal 包用于精确血量计算 - 统一 `Switch` 接口参数,增强状态类和节点类的兼容性 - 修正部分技能效果的触发条件和持续时间设置 - 调整回合结束逻辑,注释掉原有后手增益机制
31 lines
612 B
Go
31 lines
612 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
// 自身体力小于1/n时威力为m倍
|
|
type Effect37 struct {
|
|
node.EffectNode
|
|
can bool
|
|
}
|
|
|
|
func (e *Effect37) Skill_Hit() bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
cmphp := e.GetInput().CurrentPet.GetMaxHP().Div(decimal.NewFromInt(int64(e.Args()[0])))
|
|
if e.GetInput().CurrentPet.GetHP().Cmp(cmphp) == -1 {
|
|
e.Ctx().SkillEntity.Power *= e.Args()[0]
|
|
}
|
|
return true
|
|
}
|
|
|
|
// ---- 注册所有效果 ----
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 37, &Effect37{})
|
|
}
|