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

+14 -4
View File
@@ -84,16 +84,19 @@ func eidolonMaterials(player *common.FreesrData) ([]*goproto.Material, error) {
}
counts := map[uint32]uint32{}
for id, rules := range resources.Avatars {
avatar := player.Avatars[id]
if avatar == nil {
continue
// Rank-up materials belong to the catalog, not to the currently owned
// avatar list. Include every configured avatar so the player can obtain
// its Eidolon materials before unlocking that character.
var currentRank uint32
if avatar := player.Avatars[id]; avatar != nil {
currentRank = avatar.Data.Rank
}
for _, rank := range rules.Ranks {
for _, cost := range rank.Cost {
if _, present := counts[cost.ItemID]; !present {
counts[cost.ItemID] = 0
}
if rank.Rank > avatar.Data.Rank {
if rank.Rank > currentRank {
counts[cost.ItemID] += cost.ItemNum
}
}
@@ -109,6 +112,13 @@ func eidolonMaterials(player *common.FreesrData) ([]*goproto.Material, error) {
counts[grant.ItemID] = grant.Count
}
}
// Explicit inventory quantities are separate from progression. Preserve
// retained stones (and explicit zero) through rank/EX notifications too.
for id, count := range player.Materials {
if _, known := counts[id]; known {
counts[id] = count
}
}
ids := make([]uint32, 0, len(counts))
for id := range counts {
ids = append(ids, id)