- 修改 `ChangePet` 方法,记录初始攻击值并在切换时正确传递 - 简化多个 effect 的初始化方式,移除冗余的 `EffectNode` 字段 - 增强 Effect58 和 Effect67 的逻辑判断,增加空指针检查和类型判断 - 引入 decimal 包用于精确血量计算 - 统一 `Switch` 接口参数,增强状态类和节点类的兼容性 - 修正部分技能效果的触发条件和持续时间设置 - 调整回合结束逻辑,注释掉原有后手增益机制
34 lines
667 B
Go
34 lines
667 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{})
|
|
|
|
}
|
|
|
|
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
|
|
}
|