Update GaCy-GO
This commit is contained in:
1 parent
da8a32f60d
commit
0cbe460e49
345 files changed
+98202
-77559
No files matched your search
@@ -29,6 +29,25 @@ type cwEnemyPlan struct {
|
||||
} `json:"waves"`
|
||||
}
|
||||
|
||||
// cwSelectedEnemyBranch resolves the one-based selection stored by the CW
|
||||
// layer. Encounter layers can offer several enemy plans; choosing the first
|
||||
// entry implicitly would fight a different branch from the one shown to the
|
||||
// player.
|
||||
func cwSelectedEnemyBranch(layer *pb.MDJBBILMHLC) (*pb.KKBGIPCAGGH, error) {
|
||||
if layer == nil || len(layer.BPDABHGFBFO) == 0 {
|
||||
return nil, fmt.Errorf("CW saved enemy layer has no offered plans")
|
||||
}
|
||||
selection := layer.MOADBALHMFD
|
||||
if selection == 0 || uint64(selection) > uint64(len(layer.BPDABHGFBFO)) {
|
||||
return nil, fmt.Errorf("CW selected enemy branch %d is outside %d offered plans", selection, len(layer.BPDABHGFBFO))
|
||||
}
|
||||
plan := layer.BPDABHGFBFO[selection-1]
|
||||
if plan == nil {
|
||||
return nil, fmt.Errorf("CW selected enemy branch %d is empty", selection)
|
||||
}
|
||||
return plan, nil
|
||||
}
|
||||
|
||||
// Only wave parameters are captured. Monster IDs and stars must agree with
|
||||
// the current run's saved layer, so a reference encounter never replaces it.
|
||||
func cwBuildNodeEnemy(catalog *common.CurrencyWarsCatalog, run *pb.MPIMAEMCEFH, stage *pb.BEEFLEJAOCN, node *pb.OHMDHKGAEMM, info *pb.SceneBattleInfo) error {
|
||||
@@ -56,26 +75,27 @@ func cwBuildNodeEnemy(catalog *common.CurrencyWarsCatalog, run *pb.MPIMAEMCEFH,
|
||||
return fmt.Errorf("CW enemy plan provenance missing")
|
||||
}
|
||||
}
|
||||
layer := stage.IMPNAHBCADN.GetMPOBBIPMNNJ()
|
||||
plan, err := cwSelectedEnemyBranch(layer)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var recipe *cwEnemyPlan
|
||||
for i := range resource.Entries {
|
||||
r := &resource.Entries[i]
|
||||
if r.Route == stage.EMOHLJHPOPC && r.Chapter == stage.DCAHJELNJNP && r.Section == stage.SectionId && r.Division == run.DivisionId && r.Overclock == run.IsOverlock && r.Stage == node.StageId && r.Penalty == node.IFIIOIIKJHO {
|
||||
if r.Route == stage.EMOHLJHPOPC && r.Chapter == stage.DCAHJELNJNP && r.Section == stage.SectionId && r.Division == run.DivisionId && r.Overclock == run.IsOverlock && r.Stage == node.StageId && r.Penalty == plan.IFIIOIIKJHO {
|
||||
if recipe != nil {
|
||||
return fmt.Errorf("CW enemy plan duplicated")
|
||||
}
|
||||
recipe = r
|
||||
}
|
||||
}
|
||||
if recipe == nil || recipe.Level == 0 || recipe.HardLevelGroup == 0 || recipe.EliteGroup == 0 || len(recipe.Waves) == 0 {
|
||||
return fmt.Errorf("CW enemy plan not captured for this node/mode")
|
||||
if recipe == nil {
|
||||
return cwBuildReferenceBossEnemy(catalog, run, stage, node, info)
|
||||
}
|
||||
layer := stage.IMPNAHBCADN.GetMPOBBIPMNNJ()
|
||||
// This capture is an ordinary combat node with a single selected plan.
|
||||
// Elite branch selection needs a separately mapped identity, not index 0.
|
||||
if layer == nil || len(layer.BPDABHGFBFO) != 1 || layer.MOADBALHMFD != 1 {
|
||||
return fmt.Errorf("CW current enemy layer is not a single selected plan")
|
||||
if recipe.Level == 0 || recipe.HardLevelGroup == 0 || recipe.EliteGroup == 0 || len(recipe.Waves) == 0 {
|
||||
return fmt.Errorf("CW enemy plan not captured for route=%d chapter=%d section=%d division=%d overclock=%t stage=%d branch=%d/%d penalty=%d", stage.EMOHLJHPOPC, stage.DCAHJELNJNP, stage.SectionId, run.DivisionId, run.IsOverlock, node.StageId, layer.MOADBALHMFD, len(layer.BPDABHGFBFO), plan.IFIIOIIKJHO)
|
||||
}
|
||||
plan := layer.BPDABHGFBFO[0]
|
||||
if plan.IFIIOIIKJHO != recipe.Penalty || plan.EPPHOFDAEMI != recipe.ExtraDifficulty || len(plan.MonsterWaveList) != len(recipe.Waves) {
|
||||
return fmt.Errorf("CW saved enemy plan differs from captured wave schema")
|
||||
}
|
||||
@@ -118,7 +138,7 @@ func cwBuildNodeEnemy(catalog *common.CurrencyWarsCatalog, run *pb.MPIMAEMCEFH,
|
||||
info.MonsterWaveList = waves
|
||||
grid := info.EIGMKOJOEEI
|
||||
grid.IOCKDJCDMAH = &pb.MIPDJDJLGPL{EMOHLJHPOPC: stage.EMOHLJHPOPC, DCAHJELNJNP: stage.DCAHJELNJNP, SectionId: stage.SectionId, CJCCMAACJDB: node.CJCCMAACJDB}
|
||||
grid.IFIIOIIKJHO = node.IFIIOIIKJHO
|
||||
grid.IFIIOIIKJHO = recipe.Penalty
|
||||
grid.LODNFLMBIEH = division.EnemyHardLevel
|
||||
grid.BattleWaveId = recipe.Waves[0].ID
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user