fix(login): 修正用户登录时间字段命名及逻辑 将 `Onlinetime` 字段更名为 `Logintime`,以更准确反映其含义,并确保在登录时正确记录时间戳。 refactor(player): 移除冗余的 Save 方法及相关逻辑 删除 Player 结构体中的 Save、CanGetExp、CompleteLogin 和 IsNewPlayer 方法, 相关功能已迁移或不再使用。 feat(pprof): 更新 pprof 监听地址 修改 README 中的 pprof 示例命令,将监听地址从远程 IP 改为本地回环地址 `127.0.0.1
41 lines
836 B
Go
41 lines
836 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
/**
|
|
* n回合内每回合使用技能恢复自身最大体力的1/m
|
|
*/
|
|
|
|
func init() {
|
|
|
|
// t.Duration(-1) //设置成无限回合,到回合数就停止
|
|
input.InitEffect(input.EffectType.Skill, 57, &Effect57{})
|
|
|
|
}
|
|
|
|
type Effect57 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
// 默认添加回合
|
|
func (e *Effect57) SetArgs(t *input.Input, a ...int) {
|
|
|
|
e.EffectNode.SetArgs(t, a...)
|
|
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
|
|
|
|
}
|
|
func (e *Effect57) OnSkill() bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(decimal.NewFromInt(int64(e.Args()[1])))
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
|
return true
|
|
}
|