Update GaCy-GO

This commit is contained in:
CAtlas0784 committed 2026-10-28 18:54:43 +07:00
1 parent da8a32f60d
commit 0cbe460e49
345 files changed
+98202 -77559

No files matched your search

+13 -17
View File
@@ -3,7 +3,6 @@ package gameserver
import (
"encoding/json"
"fmt"
"os"
"sync"
"gac-hkrpg-go/internal/common"
@@ -553,8 +552,8 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32, sources ...*commo
rules.addGlobalPassives(battleInfo, player)
// Invasion support belongs to an active challenge, not a custom battle
// merely reusing the same stage. The scene loader records that state.
// Official challenges add their resource-defined corruption. Custom battles
// retain only the corruption actually supplied in their buff list.
if s.ChallengeStageID != 0 {
if invasionID := getStageInvasionID(s.ChallengeStageID); invasionID != 0 {
buffID, ok := rules.InvasionBuffs[invasionID]
@@ -562,11 +561,11 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32, sources ...*commo
return nil, fmt.Errorf("battle: invasion %d has no buff resource", invasionID)
}
battleInfo.BuffList = append(battleInfo.BuffList, battleBuff(buffID, firstAvatarIdx, map[string]float32{"SkillIndex": 1}))
if player.BattleConfig.EnableInvasionSupport {
battleInfo.BuffList = append(battleInfo.BuffList, battleBuff(rules.InvasionSupportBuff, firstAvatarIdx, map[string]float32{"SkillIndex": 1}))
}
}
}
if err := rules.applyAhaHelp(battleInfo, player.BattleConfig.EnableInvasionSupport, firstAvatarIdx); err != nil {
return nil, err
}
if len(battleInfo.MonsterWaveList) == 0 {
return nil, fmt.Errorf("battle: stage %d has no configured waves", battleInfo.StageId)
}
@@ -594,17 +593,14 @@ var (
func getStageInvasionID(stageID uint32) uint32 {
stageInvasionOnce.Do(func() {
for _, path := range []string{"resources/StageInvasionConfig.json", "StageInvasionConfig.json"} {
raw, err := os.ReadFile(path)
if err != nil {
continue
}
var cfg stageInvasionConfigData
if err := json.Unmarshal(raw, &cfg); err == nil {
for _, entry := range cfg.StageInvasionConfig {
stageInvasionMap[entry.StageID] = entry.InvasionID
}
break
raw, err := common.ReadResourceFile("resources/StageInvasionConfig.json", "StageInvasionConfig.json")
if err != nil {
return
}
var cfg stageInvasionConfigData
if err := json.Unmarshal(raw, &cfg); err == nil {
for _, entry := range cfg.StageInvasionConfig {
stageInvasionMap[entry.StageID] = entry.InvasionID
}
}
})