Save endgame progress, team presets, technique support and camera controls
This commit is contained in:
1 parent
a681affdb3
commit
639cef7d19
52 files changed
+11940
-766
No files matched your search
@@ -162,34 +162,24 @@ func (a *AvatarJson) ToAvatarPathDataProto(lightcone *Lightcone, relics []*Relic
|
||||
out.EquipRelicList = append(out.EquipRelicList, r.ToEquipRelic())
|
||||
}
|
||||
|
||||
if len(a.Data.Skills) > 0 {
|
||||
for pointID, level := range a.Data.Skills {
|
||||
out.AvatarPathSkillTree = append(out.AvatarPathSkillTree, &goproto.AvatarPathSkillTree{
|
||||
PointId: pointID,
|
||||
Level: level,
|
||||
})
|
||||
}
|
||||
} else if len(a.Data.SkillsByAnchorType) > 0 {
|
||||
res, _ := GameRes()
|
||||
for anchorType, level := range a.Data.SkillsByAnchorType {
|
||||
pointID := anchorType
|
||||
if res != nil && res.AvatarSkillTreePoints != nil && res.AvatarSkillTreePoints[a.AvatarID] != nil {
|
||||
if pid, ok := res.AvatarSkillTreePoints[a.AvatarID][anchorType]; ok && pid != 0 {
|
||||
pointID = pid
|
||||
}
|
||||
// AvatarPathData uses AnchorType numbers, whereas BattleAvatar uses full
|
||||
// PointIDs. PearlSR avatar_mgr.createSkillTree and battle_mgr intentionally
|
||||
// serialize different IDs for these two protocol messages.
|
||||
if res, err := GameRes(); err == nil {
|
||||
points := res.AvatarSkillTreePoints[a.AvatarID]
|
||||
for anchor, pointID := range points {
|
||||
var level uint32
|
||||
if len(a.Data.Skills) > 0 {
|
||||
level = a.Data.Skills[pointID]
|
||||
} else if len(a.Data.SkillsByAnchorType) > 0 {
|
||||
level = a.Data.SkillsByAnchorType[anchor]
|
||||
} else {
|
||||
// Keep the existing no-import level behavior, using valid anchors.
|
||||
level = 1
|
||||
}
|
||||
out.AvatarPathSkillTree = append(out.AvatarPathSkillTree, &goproto.AvatarPathSkillTree{
|
||||
PointId: pointID,
|
||||
Level: level,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if res, err := GameRes(); err == nil && res.AvatarSkillTreePoints != nil && res.AvatarSkillTreePoints[a.AvatarID] != nil {
|
||||
for _, pid := range res.AvatarSkillTreePoints[a.AvatarID] {
|
||||
out.AvatarPathSkillTree = append(out.AvatarPathSkillTree, &goproto.AvatarPathSkillTree{
|
||||
PointId: pid,
|
||||
Level: 1,
|
||||
})
|
||||
if level > 0 {
|
||||
out.AvatarPathSkillTree = append(out.AvatarPathSkillTree,
|
||||
&goproto.AvatarPathSkillTree{PointId: anchor, Level: level})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -314,15 +304,16 @@ func ToLineupAvatars(f *FreesrData) []*goproto.LineupAvatar {
|
||||
|
||||
// ToLineupInfo builds LineupInfo from a lineup map (order: ascending slot).
|
||||
func ToLineupInfo(lineups map[uint32]uint32) *goproto.LineupInfo {
|
||||
maxMp := uint32(5)
|
||||
if _, ok := lineups[1408]; ok {
|
||||
maxMp = 8
|
||||
var maxMp, currentMP uint32
|
||||
if rules, err := LoadTechniqueRules(); err == nil {
|
||||
maxMp = rules.MaxMP(lineups)
|
||||
currentMP = rules.InitialMP
|
||||
}
|
||||
|
||||
lineup := &goproto.LineupInfo{
|
||||
ExtraLineupType: goproto.ExtraLineupType_ExtraLineupType_LineupNone,
|
||||
Name: "Squad 1",
|
||||
Mp: maxMp,
|
||||
Mp: currentMP,
|
||||
MaxMp: maxMp,
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user