feat(fight): 实现技能PP消耗Hook机制并优化效果处理 - 在Effect475中添加子效果时通过Ctx().Our.AddEffect正确添加效果 - 删除已废弃的Effect407、Effect440和Effect412效果类型 - 在fightc.go中实现技能使用后的PP消耗Hook机制,支持效果修改PP消耗数量 - 添加HookPP接口方法用于处理技能使用的PP消耗逻辑 - 在SkillInfo中添加Use方法用于实际消耗PP值 ```
This commit is contained in:
27
logic/service/fight/effect/412.go
Normal file
27
logic/service/fight/effect/412.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package effect
|
||||
|
||||
import (
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
)
|
||||
|
||||
// 412 - 若自身体力小于1/n,则每次攻击不消耗PP值
|
||||
type Effect412 struct {
|
||||
node.EffectNode
|
||||
}
|
||||
|
||||
func (e *Effect412) HookPP(count *int) bool {
|
||||
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
|
||||
currentHp := e.Ctx().Our.CurrentPet.GetHP()
|
||||
threshold := maxHp.Div(e.Args()[0]) // 1/n
|
||||
|
||||
if currentHp.Cmp(threshold) < 0 {
|
||||
*count = 0
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.Skill, 412, &Effect412{})
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user