refactor: 重构战斗系统为统一动作包结构
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-04-06 00:58:23 +08:00
committed by cnb
parent 141ba67014
commit f433a26a6d
12 changed files with 683 additions and 158 deletions

View File

@@ -1,26 +1,25 @@
package effect
import (
"blazing/logic/service/fight/input"
)
import "blazing/logic/service/fight/input"
// 501. g1. 最后一个死 (只要有队友没死, 则自己又恢复hp和pp)
// TODO: 需要了解如何判断队友状态并恢复HP和PP
type NewSel501 struct {
NewSel0
}
// SwitchOut 在拥有者死亡离场时触发;若仍有存活队友,则把自己回满留作后续再上场。
func (e *NewSel501) SwitchOut(in *input.Input) bool {
//魂印特性有不在场的情况,绑定时候将精灵和特性绑定
if e.ID().GetCatchTime() != e.Ctx().Our.CurPet[0].Info.CatchTime {
owner := e.SourceInput()
if owner == nil || in != owner || !e.IsOwner() {
return true
}
currentPet := owner.CurrentPet()
if currentPet == nil || currentPet.Info.Hp > 0 || !owner.HasLivingTeammate() {
return true
}
// TODO: 检查是否有队友还活着
// 如果有队友活着恢复自身HP和PP
// e.Ctx().Our.Heal(e.Ctx().Our, nil, e.Ctx().Our.CurPet[0].GetMaxHP())
// TODO: 恢复PP值的方法
currentPet.Info.Hp = currentPet.Info.MaxHp
owner.HealPP(-1)
return true
}