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

+41 -26
View File
@@ -168,6 +168,7 @@ func (s *SubAffix) UnmarshalJSON(data []byte) error {
type Relic struct {
Level uint32 `json:"level"`
RelicID uint32 `json:"relic_id"`
RelicSetID uint32 `json:"relic_set_id"`
MainAffixID uint32 `json:"main_affix_id"`
SubAffixes []SubAffix `json:"sub_affixes"`
InternalUID uint32 `json:"internal_uid"`
@@ -286,6 +287,7 @@ type RogueMagicScepter struct {
}
type BattleConfig struct {
WorldLevel *uint32 `json:"world_level,omitempty"`
EnableInvasionSupport bool `json:"enable_invasion_support"`
BattleType BattleType `json:"battle_type"`
Monsters [][]Monster `json:"monsters"`
@@ -351,21 +353,24 @@ type TeamPreset struct {
}
type Persistent struct {
TeamPresets map[uint32]*TeamPreset `json:"team_presets"`
ActiveTeamPreset uint32 `json:"active_team_preset"`
TierceProgress map[uint32]*TierceProgress `json:"tierce_progress"`
TechniqueFoodStock map[uint32]uint32 `json:"technique_food_stock"`
AutoTechniqueFood *bool `json:"auto_technique_food"`
Lineups map[uint32]uint32 `json:"lineups"`
Position Position `json:"position"`
Scene Scene `json:"scene"`
MainCharacter MultiPathAvatar `json:"main_character"`
MarchType MultiPathAvatar `json:"march_type"`
EnableSWGlobal *bool `json:"enable_sw_global"`
EnableCastoriceGlobal *bool `json:"enable_castorice_global"`
EnableAhaGlobal *bool `json:"enable_aha_global"`
DressedSkins map[uint32]uint32 `json:"dressed_skins"`
ExRanksUnlocked map[uint32]bool `json:"ex_ranks_unlocked"`
Profile ProfileSettings `json:"profile"`
TeamPresets map[uint32]*TeamPreset `json:"team_presets"`
ActiveTeamPreset uint32 `json:"active_team_preset"`
TierceProgress map[uint32]*TierceProgress `json:"tierce_progress"`
TechniqueFoodStock map[uint32]uint32 `json:"technique_food_stock"`
AutoTechniqueFood *bool `json:"auto_technique_food"`
Lineups map[uint32]uint32 `json:"lineups"`
Position Position `json:"position"`
Scene Scene `json:"scene"`
MainCharacter MultiPathAvatar `json:"main_character"`
MarchType MultiPathAvatar `json:"march_type"`
EnableSWGlobal *bool `json:"enable_sw_global"`
EnableCastoriceGlobal *bool `json:"enable_castorice_global"`
EnableAhaGlobal *bool `json:"enable_aha_global"`
DressedSkins map[uint32]uint32 `json:"dressed_skins"`
PlayerOutfits []uint32 `json:"player_outfits"`
SceneGroupProperties map[uint32]map[uint32]map[string]int32 `json:"scene_group_properties"`
ExRanksUnlocked map[uint32]bool `json:"ex_ranks_unlocked"`
}
// DefaultPersistent mirrors the Rust Default impl.
@@ -392,6 +397,7 @@ func DefaultPersistent() Persistent {
// ---------------------------------------------------------------------------
type FreesrData struct {
Profile ProfileSettings `json:"-"`
TeamPresets map[uint32]*TeamPreset `json:"-"`
ActiveTeamPreset uint32 `json:"-"`
TierceProgress map[uint32]*TierceProgress `json:"-"`
@@ -401,19 +407,22 @@ type FreesrData struct {
Lightcones []Lightcone `json:"lightcones"`
Relics []Relic `json:"relics"`
Materials map[uint32]uint32 `json:"materials,omitempty"`
Avatars map[uint32]*AvatarJson `json:"avatars"`
BattleConfig BattleConfig `json:"battle_config"`
// Fields stored in "persistent", merged on load (not serialized here).
Lineups map[uint32]uint32 `json:"-"`
Position Position `json:"-"`
Scene Scene `json:"-"`
MainCharacter MultiPathAvatar `json:"-"`
MarchType MultiPathAvatar `json:"-"`
EnableSWGlobal *bool `json:"-"`
EnableCastoriceGlobal *bool `json:"-"`
EnableAhaGlobal *bool `json:"-"`
DressedSkins map[uint32]uint32 `json:"-"`
Lineups map[uint32]uint32 `json:"-"`
Position Position `json:"-"`
Scene Scene `json:"-"`
MainCharacter MultiPathAvatar `json:"-"`
MarchType MultiPathAvatar `json:"-"`
EnableSWGlobal *bool `json:"-"`
EnableCastoriceGlobal *bool `json:"-"`
EnableAhaGlobal *bool `json:"-"`
DressedSkins map[uint32]uint32 `json:"-"`
PlayerOutfits []uint32 `json:"-"`
SceneGroupProperties map[uint32]map[uint32]map[string]int32 `json:"-"`
}
// LoadFreesrData reads freesr-data.json + persistent and merges them,
@@ -429,8 +438,8 @@ func LoadFreesrData() (*FreesrData, error) {
return nil, fmt.Errorf("freesr-data.json is broken: %w, pls redownload", err)
}
if data.Avatars == nil {
data.Avatars = map[uint32]*AvatarJson{}
if err := ValidateAvatarRoster(data.Avatars); err != nil {
return nil, fmt.Errorf("invalid freesr-data.json: %w", err)
}
if data.BattleConfig.Monsters == nil && data.BattleConfig.StageID == 0 {
data.BattleConfig = DefaultBattleConfig()
@@ -441,6 +450,7 @@ func LoadFreesrData() (*FreesrData, error) {
if err == nil {
var p Persistent
if err := json.Unmarshal(pers, &p); err == nil {
data.Profile = p.Profile
data.Lineups = p.Lineups
data.TeamPresets = p.TeamPresets
data.ActiveTeamPreset = p.ActiveTeamPreset
@@ -455,6 +465,8 @@ func LoadFreesrData() (*FreesrData, error) {
data.EnableCastoriceGlobal = p.EnableCastoriceGlobal
data.EnableAhaGlobal = p.EnableAhaGlobal
data.DressedSkins = p.DressedSkins
data.PlayerOutfits = p.PlayerOutfits
data.SceneGroupProperties = p.SceneGroupProperties
for aid, unlocked := range p.ExRanksUnlocked {
if av, ok := data.Avatars[aid]; ok {
av.ExRankUnlocked = unlocked
@@ -487,6 +499,9 @@ func LoadFreesrData() (*FreesrData, error) {
}
data.VerifyLineup()
if err := ValidateAdventureLineup(data.Avatars, data.Lineups); err != nil {
return nil, fmt.Errorf("invalid active lineup: %w", err)
}
if data.MarchType.ID() > 8000 {
data.MarchType = MultiPathMarchHunt