- 在 `fight_boss.go` 中,调整了玩家挑战 Boss 的奖励事件注册逻辑, 并在战斗结束后正确取消事件监听。 - 修改了多个技能效果文件(`effect_13.go`、`effect_38.go`、`effect_49.go`), 增强状态持续时间计算和数据安全性。 - 更新 `player/done.go` 中的 `SPT` 方法签名以返回监听器实例。 - 调整数据库操作方法,将 `Update` 替换为 `Save` 以确保数据一致性。 - 修复菜单排序语法问题,统一使用字符串形式的排序表达式。
44 lines
862 B
Go
44 lines
862 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
// 可以抵挡n点伤害
|
|
// ---- Effect49 ----
|
|
type Effect49 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect49) Damage_SUB_ex(t *info.DamageZone) bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity == nil {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
//fmt.Println("Effect49_o", t.Damage)
|
|
if t.Type == info.DamageType.Red {
|
|
if decimal.NewFromInt(int64(e.Args()[0])).Cmp(t.Damage) == -1 {
|
|
t.Damage = t.Damage.Sub(decimal.NewFromInt(int64(e.Args()[0])))
|
|
}
|
|
|
|
}
|
|
|
|
//fmt.Println("Effect49_n", t.Damage)
|
|
return true
|
|
}
|
|
|
|
// ---- 注册所有效果 ----
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 49, &Effect49{})
|
|
}
|