fix(scene): unlock all teleports across maps, merge resource configs, fix scenary not load error, and add quick farm battle handlers

This commit is contained in:
CAtlas0784 committed 2026-10-16 20:08:13 +07:00
1 parent 9aab62414f
commit 163d4433e6
47 files changed
+2025067 -6082

No files matched your search

+34 -8
View File
@@ -174,14 +174,15 @@ type AvatarData struct {
}
type AvatarJson struct {
AvatarID uint32 `json:"avatar_id"`
Data AvatarData `json:"data"`
Level uint32 `json:"level"`
Promotion uint32 `json:"promotion"`
Techniques []uint32 `json:"techniques"`
SPValue *uint32 `json:"sp_value"`
SPMax *uint32 `json:"sp_max"`
EnhancedID *uint32 `json:"enhanced_id"`
AvatarID uint32 `json:"avatar_id"`
Data AvatarData `json:"data"`
Level uint32 `json:"level"`
Promotion uint32 `json:"promotion"`
Techniques []uint32 `json:"techniques"`
SPValue *uint32 `json:"sp_value"`
SPMax *uint32 `json:"sp_max"`
EnhancedID *uint32 `json:"enhanced_id"`
ExRankUnlocked bool `json:"ex_rank_unlocked,omitempty"`
}
func (a *AvatarJson) SPCur() uint32 {
@@ -305,6 +306,7 @@ type Persistent struct {
EnableSWGlobal *bool `json:"enable_sw_global"`
EnableCastoriceGlobal *bool `json:"enable_castorice_global"`
DressedSkins map[uint32]uint32 `json:"dressed_skins"`
ExRanksUnlocked map[uint32]bool `json:"ex_ranks_unlocked"`
}
// DefaultPersistent mirrors the Rust Default impl.
@@ -320,6 +322,7 @@ func DefaultPersistent() Persistent {
EnableSWGlobal: &sw,
EnableCastoriceGlobal: &cg,
DressedSkins: map[uint32]uint32{},
ExRanksUnlocked: map[uint32]bool{},
}
}
@@ -377,6 +380,11 @@ func LoadFreesrData() (*FreesrData, error) {
data.EnableSWGlobal = p.EnableSWGlobal
data.EnableCastoriceGlobal = p.EnableCastoriceGlobal
data.DressedSkins = p.DressedSkins
for aid, unlocked := range p.ExRanksUnlocked {
if av, ok := data.Avatars[aid]; ok {
av.ExRankUnlocked = unlocked
}
}
}
}
if data.DressedSkins == nil {
@@ -438,6 +446,12 @@ func (f *FreesrData) VerifyLineup() {
// SavePersistent writes the persistent subset back to the "persistent" file.
func (f *FreesrData) SavePersistent() {
exUnlocked := make(map[uint32]bool)
for aid, av := range f.Avatars {
if av.ExRankUnlocked {
exUnlocked[aid] = true
}
}
p := Persistent{
Lineups: f.Lineups,
Position: f.Position,
@@ -447,6 +461,7 @@ func (f *FreesrData) SavePersistent() {
EnableSWGlobal: f.EnableSWGlobal,
EnableCastoriceGlobal: f.EnableCastoriceGlobal,
DressedSkins: f.DressedSkins,
ExRanksUnlocked: exUnlocked,
}
out, err := json.MarshalIndent(p, "", " ")
if err != nil {
@@ -477,3 +492,14 @@ func (f *FreesrData) FindRelicsFor(avatarID uint32) []*Relic {
}
return out
}
// BaseAvatarIDs contains all playable base avatar IDs
var BaseAvatarIDs = []uint32{
8001, 1001,
1002, 1003, 1004, 1005, 1006, 1008, 1009, 1013, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,
1109, 1110, 1111, 1112, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212,
1213, 1214, 1215, 1217, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1312, 1315, 1310,
1314, 1218, 1221, 1220, 1222, 1223, 1317, 1313, 1225, 1402, 1401, 1404, 1403, 1405, 1407, 1406,
1409, 1014, 1015, 1408, 1410, 1412, 1413, 1414, 1415, 1321, 1501, 1502, 1503, 1504, 1505, 1506,
1507, 1508, 1509, 1510, 1511, 1512, 1513,
}