feat(currency_wars): complete systems, settlement Rank SS, damage report, camera and recovery fixes
This commit is contained in:
1 parent
c008243f11
commit
0995055296
78 files changed
+33840
-9525
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type CurrencyWarsNodeDrop struct {
|
||||
Rolls uint32 `json:"rolls"`
|
||||
Weights map[string]uint32 `json:"weights"`
|
||||
}
|
||||
|
||||
type CurrencyWarsNodeDropsCatalog struct {
|
||||
FormatVersion uint32 `json:"format_version"`
|
||||
TargetClientVersion string `json:"target_client_version"`
|
||||
TargetAssemblySHA256 string `json:"target_assembly_sha256"`
|
||||
NodeDrops map[string]CurrencyWarsNodeDrop `json:"node_drops"`
|
||||
}
|
||||
|
||||
func LoadCurrencyWarsNodeDrops(catalog *CurrencyWarsCatalog) (*CurrencyWarsNodeDropsCatalog, error) {
|
||||
raw, err := ReadResourceFile("resources/CurrencyWarsNodeDrops.json")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var out CurrencyWarsNodeDropsCatalog
|
||||
if err = json.Unmarshal(raw, &out); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if catalog != nil {
|
||||
if out.FormatVersion != 1 || out.TargetClientVersion != catalog.ClientVersion || out.TargetAssemblySHA256 != catalog.Provenance.GameAssemblySHA256 {
|
||||
return nil, fmt.Errorf("CW node drops revision differs from catalog")
|
||||
}
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
Reference in new issue
Block a user