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值 ```
80 lines
1.6 KiB
Go
80 lines
1.6 KiB
Go
package node
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
)
|
|
|
|
func (e *EffectNode) Skill_Pre() bool {
|
|
return true
|
|
}
|
|
|
|
// func (e *EffectNode) Calculate_Pre() bool {
|
|
// return true
|
|
// }
|
|
|
|
func (e *EffectNode) SkillHit() bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) SkillHit_ex() bool {
|
|
return true
|
|
}
|
|
|
|
func (e *EffectNode) CalculatePre() bool {
|
|
return true
|
|
}
|
|
|
|
func (e *EffectNode) HookPP(count *int) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) OnSkill() bool {
|
|
// if e.Effect != nil {
|
|
// if e.Hit() { //没命中
|
|
// e.Effect.OnHit(ctx.Input, ctx.SkillEntity)
|
|
// } else {
|
|
// e.Effect.OnMiss(ctx.Input, ctx.SkillEntity)
|
|
// }
|
|
// }
|
|
return true
|
|
}
|
|
|
|
func (e *EffectNode) Skill_Can() bool {
|
|
|
|
return e.Input.CurrentPet.HP != 0
|
|
}
|
|
|
|
func (e *EffectNode) GenSub(t input.Effect, Duration int) input.Effect {
|
|
|
|
tt := e.ID()
|
|
tt.SetEffectType(input.EffectType.Sub)
|
|
|
|
t.ID(tt)
|
|
t.SetArgs(e.Input, e.SideEffectArgs...)
|
|
return t
|
|
|
|
}
|
|
|
|
// func (e *EffectNode) Skill_Use_ex() bool {
|
|
// return true
|
|
// }
|
|
|
|
// func (e *EffectNode) Skill_Use() bool {
|
|
// // if e.Effect != nil {
|
|
// // if e.Input.CurrentPet.Info.Hp == 0 {
|
|
// // e.OnDefeat(ctx.Input, ctx.SkillEntity) //死亡
|
|
|
|
// // } else {
|
|
// // e.OnAlive(ctx.Input, ctx.SkillEntity) //存活
|
|
// // }
|
|
|
|
// // }
|
|
// // return true
|
|
// return true
|
|
// }
|
|
|
|
// type Effect interface {
|
|
// OnMiss(opp *input.Input, skill *info.SkillEntity)
|
|
// OnHit(opp *input.Input, skill *info.SkillEntity)
|
|
// OnDefeat(opp *input.Input, skill *info.SkillEntity) bool //如果需要死亡
|
|
// OnAlive(opp *input.Input, skill *info.SkillEntity) bool //如果需要存活
|
|
// }
|