feat(fight): 调整战斗逻辑与精灵切换机制 - 优化精灵切换时的效果处理,增加切换事件支持 - 修复战斗中超时逻辑和技能CD计算问题 - 增强状态效果在精灵上下场时的清理机制 - 修改伤害计算逻辑以提高准确性 - 更新战斗池初始化参数提升并发性能 此外,同步更新了宠物放生字段命名及逻辑处理方式,并调整网络通信中的限流策略。 ```
36 lines
702 B
Go
36 lines
702 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
/**
|
|
* 恢复自身最大体力的1/n
|
|
*/
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 43, &Effect43{
|
|
EffectNode: node.EffectNode{},
|
|
})
|
|
|
|
}
|
|
|
|
type Effect43 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect43) OnSkill() bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
tt := decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0])))
|
|
//fmt.Println("恢复自身最大体量的1/n", tt.IntPart())
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, tt)
|
|
|
|
return true
|
|
}
|