```
refactor(effect): 更新状态枚举类型为 EnumPetStatus 将多个技能效果文件中的 EnumBattleStatus 类型统一更新为 EnumPetStatus, 以更准确地反映其用途。同时修改了相关函数签名和变量声明。 此外,清理了部分注释格式,并补充了关于被动效果不能被免疫的说明。 ```
This commit is contained in:
40
logic/service/fight/effect/effect_57.go
Normal file
40
logic/service/fight/effect/effect_57.go
Normal file
@@ -0,0 +1,40 @@
|
||||
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().Opp.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user