-
Notifications
You must be signed in to change notification settings - Fork 88
/
main.go
51 lines (42 loc) · 1.34 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"encoding/json"
"fmt"
"os"
"strings"
"github.com/genshinsim/gcsim/pkg/core/attributes"
"github.com/genshinsim/gcsim/pkg/core/curves"
"github.com/genshinsim/gcsim/pkg/core/keys"
"github.com/genshinsim/gcsim/pkg/core/player/character/profile"
"github.com/genshinsim/gcsim/pkg/core/player/weapon"
)
//Provides mapping in JSON between gcsim keys and character data such as element, weapon type, etc...
func main() {
//we pull the information from the curves pkg
//but in reality this should all just be piped from dimbreath's repo instead
res := make(map[string]curves.CharBase)
//we start at TravelerDelim because traveler has to be handled as special case
for i := keys.TravelerDelim + 1; i < keys.EndCharKeys; i++ {
res[i.String()] = curves.CharBaseMap[i]
}
//handle traveler
for i := keys.NoChar + 1; i < keys.TravelerDelim-2; i++ {
key := i.String()
//odd is aether, even is lumine
name := "aether"
if !strings.HasPrefix(key, name) {
name = "lumine"
}
element := attributes.StringToEle(strings.TrimPrefix(key, name))
res[key] = curves.CharBase{
Rarity: 5,
Body: profile.BodyBoy,
Element: element,
WeaponType: weapon.WeaponClassSword,
}
fmt.Println(res[key])
}
//write to file
out, _ := json.MarshalIndent(res, "", " ")
os.WriteFile("./character_data.json", out, 0644)
}