Files
bl/logic/service/fight/effect/475.go
昔念 1fa1ae848d
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
feat(fight): 实现技能PP消耗Hook机制并优化效果处理

- 在Effect475中添加子效果时通过Ctx().Our.AddEffect正确添加效果
- 删除已废弃的Effect407、Effect440和Effect412效果类型
- 在fightc.go中实现技能使用后的PP消耗Hook机制,支持效果修改PP消耗数量
- 添加HookPP接口方法用于处理技能使用的PP消耗逻辑
- 在SkillInfo中添加Use方法用于实际消耗PP值
```
2026-03-09 23:44:09 +08:00

52 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 475 - 若造成的伤害不足m则下n回合的攻击必定致命一击
type Effect475 struct {
node.EffectNode
damageThreshold int
critDuration int
}
func (e *Effect475) Skill_Use() bool {
damageThreshold := int(e.Args()[0].IntPart())
damageDone := e.Ctx().Our.SumDamage
if damageDone.IntPart() < int64(damageThreshold) {
critDuration := int(e.Args()[1].IntPart())
e.Ctx().Our.AddEffect(e.Ctx().Our, e.GenSub(&Effect475_sub{}, critDuration))
}
return true
}
type Effect475_sub struct {
node.EffectNode
}
func (e *Effect475_sub) ActionStart(a, b *action.SelectSkillAction) bool {
//fmt.Println(e.Ctx().SkillEntity)
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
e.Ctx().SkillEntity.XML.CritRate = 16
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 475, &Effect475{})
}