```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

feat(fight): 添加旧组队协议支持并优化战斗系统

- 实现了旧组队协议相关功能,包括GroupReadyFightFinish、GroupUseSkill、
  GroupUseItem、GroupChangePet和GroupEscape方法
- 新增组队战斗相关的入站信息结构体定义
- 实现了组队BOSS战斗逻辑,添加groupBossSlotLimit常量
- 重构宠物技能设置逻辑,调整金币消耗时机
- 优化战斗循环逻辑,添加对无行动槽位的处理
- 改进AI行动逻辑,增加多位置目标选择
This commit is contained in:
昔念
2026-04-08 01:28:55 +08:00
parent 918cdeac0e
commit 0051ac0be8
21 changed files with 993 additions and 67 deletions

View File

@@ -416,6 +416,10 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
}
if f.LegacyGroupProtocol {
f.sendLegacyRoundBroadcast(firstAttack, secondAttack)
}
attackValueResult := f.buildNoteUseSkillOutboundInfo()
//因为切完才能广播,所以必须和回合结束分开结算
f.Broadcast(func(fighter *input.Input) {
@@ -446,6 +450,17 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
}
func (f *FightC) TURNOVER(cur *input.Input) {
var _hasBackup bool
if cur == nil {
return
}
for _, pet := range cur.BenchPets() {
if pet != nil && pet.Info.Hp > 0 {
_hasBackup = true
break
}
}
f.sendLegacySpriteDie(cur, _hasBackup)
f.Broadcast(func(ff *input.Input) {
@@ -459,6 +474,9 @@ func (f *FightC) TURNOVER(cur *input.Input) {
if f.IsWin(f.GetInputByPlayer(cur.Player, true)) { //然后检查是否战斗结束
f.FightOverInfo.WinnerId = f.GetInputByPlayer(cur.Player, true).UserID
f.FightOverInfo.Reason = model.BattleOverReason.DefaultEnd
f.WinnerId = f.FightOverInfo.WinnerId
f.Reason = model.BattleOverReason.DefaultEnd
f.closefight = true
// break