pre cw with probe and a bunch script to read game behavior

This commit is contained in:
CAtlas0784 committed 2026-10-21 20:40:13 +07:00
1 parent 5120219ae2
commit da8a32f60d
310 files changed
+219693 -872

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
package gameserver
import (
"testing"
)
func TestSrtoolCustomBattleIsLimitedToClientCalyxRows(t *testing.T) {
chdirRepositoryRoot(t)
resources, err := loadWorldBattleResources()
if err != nil {
t.Fatal(err)
}
seenCalyx, seenStagnantShadow, seenCavern := false, false, false
for _, row := range resources.Cocoons {
if row.CocoonType == 0 {
t.Fatalf("Client Cocoon row %d at world level %d has no CocoonType", row.ID, row.WorldLevel)
}
allowed := canUseSrtoolCustomCocoon(row)
switch row.CocoonType {
case clientCocoonTypeCalyx:
seenCalyx = true
if !allowed {
t.Errorf("Calyx row %d at world level %d must allow FreeSR custom battles", row.ID, row.WorldLevel)
}
case clientCocoonTypeStagnantShadow:
seenStagnantShadow = true
if allowed {
t.Errorf("Stagnant Shadow row %d at world level %d must use its Client stage", row.ID, row.WorldLevel)
}
case clientCocoonTypeCavernCorrosion:
seenCavern = true
if allowed {
t.Errorf("Cavern row %d at world level %d must use its Client stage", row.ID, row.WorldLevel)
}
default:
if allowed {
t.Errorf("unknown Client CocoonType %d must not allow FreeSR custom battles", row.CocoonType)
}
}
}
if !seenCalyx || !seenStagnantShadow || !seenCavern {
t.Fatalf("Client Cocoon resource must cover Calyx, Stagnant Shadow, and Cavern; got calyx=%t stagnant=%t cavern=%t", seenCalyx, seenStagnantShadow, seenCavern)
}
}