feat: add enable_aha_global passive support to Persistent and battle handlers

This commit is contained in:
CAtlas0784 committed 2026-10-17 00:49:09 +07:00
1 parent 74f3c4411b
commit 332171cafb
3 files changed
+26 -15

No files matched your search

+6
View File
@@ -305,6 +305,7 @@ type Persistent struct {
MarchType MultiPathAvatar `json:"march_type"` MarchType MultiPathAvatar `json:"march_type"`
EnableSWGlobal *bool `json:"enable_sw_global"` EnableSWGlobal *bool `json:"enable_sw_global"`
EnableCastoriceGlobal *bool `json:"enable_castorice_global"` EnableCastoriceGlobal *bool `json:"enable_castorice_global"`
EnableAhaGlobal *bool `json:"enable_aha_global"`
DressedSkins map[uint32]uint32 `json:"dressed_skins"` DressedSkins map[uint32]uint32 `json:"dressed_skins"`
ExRanksUnlocked map[uint32]bool `json:"ex_ranks_unlocked"` ExRanksUnlocked map[uint32]bool `json:"ex_ranks_unlocked"`
} }
@@ -313,6 +314,7 @@ type Persistent struct {
func DefaultPersistent() Persistent { func DefaultPersistent() Persistent {
sw := true sw := true
cg := true cg := true
aha := true
return Persistent{ return Persistent{
Lineups: map[uint32]uint32{0: 1313, 1: 1006, 2: 8001, 3: 1405}, Lineups: map[uint32]uint32{0: 1313, 1: 1006, 2: 8001, 3: 1405},
Position: DefaultPosition(), Position: DefaultPosition(),
@@ -321,6 +323,7 @@ func DefaultPersistent() Persistent {
MarchType: MultiPathMarchHunt, MarchType: MultiPathMarchHunt,
EnableSWGlobal: &sw, EnableSWGlobal: &sw,
EnableCastoriceGlobal: &cg, EnableCastoriceGlobal: &cg,
EnableAhaGlobal: &aha,
DressedSkins: map[uint32]uint32{}, DressedSkins: map[uint32]uint32{},
ExRanksUnlocked: map[uint32]bool{}, ExRanksUnlocked: map[uint32]bool{},
} }
@@ -344,6 +347,7 @@ type FreesrData struct {
MarchType MultiPathAvatar `json:"-"` MarchType MultiPathAvatar `json:"-"`
EnableSWGlobal *bool `json:"-"` EnableSWGlobal *bool `json:"-"`
EnableCastoriceGlobal *bool `json:"-"` EnableCastoriceGlobal *bool `json:"-"`
EnableAhaGlobal *bool `json:"-"`
DressedSkins map[uint32]uint32 `json:"-"` DressedSkins map[uint32]uint32 `json:"-"`
} }
@@ -379,6 +383,7 @@ func LoadFreesrData() (*FreesrData, error) {
data.MarchType = p.MarchType data.MarchType = p.MarchType
data.EnableSWGlobal = p.EnableSWGlobal data.EnableSWGlobal = p.EnableSWGlobal
data.EnableCastoriceGlobal = p.EnableCastoriceGlobal data.EnableCastoriceGlobal = p.EnableCastoriceGlobal
data.EnableAhaGlobal = p.EnableAhaGlobal
data.DressedSkins = p.DressedSkins data.DressedSkins = p.DressedSkins
for aid, unlocked := range p.ExRanksUnlocked { for aid, unlocked := range p.ExRanksUnlocked {
if av, ok := data.Avatars[aid]; ok { if av, ok := data.Avatars[aid]; ok {
@@ -460,6 +465,7 @@ func (f *FreesrData) SavePersistent() {
MarchType: f.MarchType, MarchType: f.MarchType,
EnableSWGlobal: f.EnableSWGlobal, EnableSWGlobal: f.EnableSWGlobal,
EnableCastoriceGlobal: f.EnableCastoriceGlobal, EnableCastoriceGlobal: f.EnableCastoriceGlobal,
EnableAhaGlobal: f.EnableAhaGlobal,
DressedSkins: f.DressedSkins, DressedSkins: f.DressedSkins,
ExRanksUnlocked: exUnlocked, ExRanksUnlocked: exUnlocked,
} }
+9 -5
View File
@@ -405,6 +405,7 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat
// global buffs // global buffs
hasCastorice, hasSilverWolf := false, false hasCastorice, hasSilverWolf := false, false
hasAha := false
for _, buff := range battleInfo.BuffList { for _, buff := range battleInfo.BuffList {
if buff.Id == 140703 { if buff.Id == 140703 {
hasCastorice = true hasCastorice = true
@@ -412,6 +413,9 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat
if buff.Id == 150602 { if buff.Id == 150602 {
hasSilverWolf = true hasSilverWolf = true
} }
if buff.Id == 151104 {
hasAha = true
}
} }
if !hasCastorice && (player.EnableCastoriceGlobal == nil || *player.EnableCastoriceGlobal) { if !hasCastorice && (player.EnableCastoriceGlobal == nil || *player.EnableCastoriceGlobal) {
battleInfo.BuffList = append(battleInfo.BuffList, &goproto.BattleBuff{ battleInfo.BuffList = append(battleInfo.BuffList, &goproto.BattleBuff{
@@ -423,6 +427,11 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat
Id: 150602, Level: 1, OwnerId: 0xffffffff, WaveFlag: 0xffffffff, Id: 150602, Level: 1, OwnerId: 0xffffffff, WaveFlag: 0xffffffff,
}) })
} }
if !hasAha && (player.EnableAhaGlobal == nil || *player.EnableAhaGlobal) {
battleInfo.BuffList = append(battleInfo.BuffList, &goproto.BattleBuff{
Id: 151104, Level: 1, OwnerId: 0xffffffff, WaveFlag: 0xffffffff,
})
}
// Stage invasion buff (pearl-sr 4.6.53: e.g. Peak 11 stage 4 30511021/30511022 -> buff 3034004) // Stage invasion buff (pearl-sr 4.6.53: e.g. Peak 11 stage 4 30511021/30511022 -> buff 3034004)
if invasionID := getStageInvasionID(battleInfo.StageId); invasionID != 0 { if invasionID := getStageInvasionID(battleInfo.StageId); invasionID != 0 {
@@ -445,11 +454,6 @@ func createBattleInfo(s *Session, casterID, skillIndex uint32) *goproto.SceneBat
}) })
} }
// Aha Global Passive (151104) — always on, same as the Rust build
battleInfo.BuffList = append(battleInfo.BuffList, &goproto.BattleBuff{
Id: 151104, Level: 1, OwnerId: 0xffffffff, WaveFlag: 0xffffffff,
})
return battleInfo return battleInfo
} }
+11 -10
View File
@@ -1,25 +1,26 @@
{ {
"lineups": { "lineups": {
"0": 1204, "0": 1511,
"1": 1213, "1": 1506,
"2": 1308, "2": 1502,
"3": 1409 "3": 1503
}, },
"position": { "position": {
"x": -92, "x": 0,
"y": 4278, "y": 0,
"z": 68083, "z": 0,
"rot_y": 155566 "rot_y": 155566
}, },
"scene": { "scene": {
"plane_id": 10202, "plane_id": 20001,
"floor_id": 10202001, "floor_id": 20001001,
"entry_id": 102020107 "entry_id": 2000101
}, },
"main_character": "FemaleHarmony", "main_character": "FemaleHarmony",
"march_type": "MarchHunt", "march_type": "MarchHunt",
"enable_sw_global": true, "enable_sw_global": true,
"enable_castorice_global": true, "enable_castorice_global": true,
"enable_aha_global": true,
"dressed_skins": {}, "dressed_skins": {},
"ex_ranks_unlocked": { "ex_ranks_unlocked": {
"1204": true, "1204": true,