```
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

@@ -77,15 +77,27 @@ func (our *Input) Heal(in *Input, ac action.BattleActionI, value alpacadecimal.D
if healValue >= 0 {
currentPet.Info.ModelHP(int64(healValue))
if our.AttackValue != nil {
our.AttackValue.RemainHp = int32(currentPet.Info.Hp)
our.AttackValue.MaxHp = currentPet.Info.MaxHp
}
return
}
damage := uint32(-healValue)
if damage >= currentPet.Info.Hp {
currentPet.Info.Hp = 0
if our.AttackValue != nil {
our.AttackValue.RemainHp = 0
our.AttackValue.MaxHp = currentPet.Info.MaxHp
}
return
}
currentPet.Info.Hp -= damage
if our.AttackValue != nil {
our.AttackValue.RemainHp = int32(currentPet.Info.Hp)
our.AttackValue.MaxHp = currentPet.Info.MaxHp
}
}
func (our *Input) HealPP(value int) {
@@ -227,6 +239,10 @@ func (our *Input) Damage(in *Input, sub *info.DamageZone) {
} else {
currentPet.Info.Hp = currentPet.Info.Hp - uint32(sub.Damage.IntPart())
}
if our.AttackValue != nil {
our.AttackValue.RemainHp = int32(currentPet.Info.Hp)
our.AttackValue.MaxHp = currentPet.Info.MaxHp
}
//todo 待实现死亡effet