This commit is contained in:
shoopea 2019-06-06 14:52:34 +08:00
parent e219289285
commit 0bf1230036

4
obj.go
View File

@ -523,7 +523,7 @@ func silentGetObjItemID(c string, n string) int64 {
return i.ObjID64 return i.ObjID64
} }
if ok, _ := regexp.MatchString(`u[0-9]+`, c); ok { if ok, _ := regexp.MatchString(`u[0-9]+`, c); ok {
r := regexp.MustCompile(`^((?P<Modifier>⚡\+[0-9]+) ){0,1}(?P<BaseName>[a-zA-Z ]+?)( +(?P<Atk>[0-9]+)⚔ +(?P<Def>[0-9]+)🛡){0,1}$`) r := regexp.MustCompile(`^((?P<Modifier>⚡\+[0-9]+) ){0,1}(?P<BaseName>[a-zA-Z ]+?)( \+(?P<Atk>[0-9]+)⚔ \+(?P<Def>[0-9]+)🛡){0,1}$`)
fmt.Printf("silentGetObjItemID(unique) : Modifier : %s\n", r.ReplaceAllString(n, "${Modifier}")) fmt.Printf("silentGetObjItemID(unique) : Modifier : %s\n", r.ReplaceAllString(n, "${Modifier}"))
fmt.Printf("silentGetObjItemID(unique) : BaseName : %s\n", r.ReplaceAllString(n, "${BaseName}")) fmt.Printf("silentGetObjItemID(unique) : BaseName : %s\n", r.ReplaceAllString(n, "${BaseName}"))
fmt.Printf("silentGetObjItemID(unique) : Atk : %s\n", r.ReplaceAllString(n, "${Atk}")) fmt.Printf("silentGetObjItemID(unique) : Atk : %s\n", r.ReplaceAllString(n, "${Atk}"))
@ -535,7 +535,7 @@ func silentGetObjItemID(c string, n string) int64 {
} }
} }
if len(c) == 0 { if len(c) == 0 {
r := regexp.MustCompile(`^((?P<Modifier>⚡\+[0-9]+) ){0,1}(?P<BaseName>[a-zA-Z ]+?)( +(?P<Atk>[0-9]+)⚔ +(?P<Def>[0-9]+)🛡){0,1}$`) r := regexp.MustCompile(`^((?P<Modifier>⚡\+[0-9]+) ){0,1}(?P<BaseName>[a-zA-Z ]+?)( \+(?P<Atk>[0-9]+)⚔ \+(?P<Def>[0-9]+)🛡){0,1}$`)
fmt.Printf("silentGetObjItemID(null) : Modifier : %s\n", r.ReplaceAllString(n, "${Modifier}")) fmt.Printf("silentGetObjItemID(null) : Modifier : %s\n", r.ReplaceAllString(n, "${Modifier}"))
fmt.Printf("silentGetObjItemID(null) : BaseName : %s\n", r.ReplaceAllString(n, "${BaseName}")) fmt.Printf("silentGetObjItemID(null) : BaseName : %s\n", r.ReplaceAllString(n, "${BaseName}"))
fmt.Printf("silentGetObjItemID(null) : Atk : %s\n", r.ReplaceAllString(n, "${Atk}")) fmt.Printf("silentGetObjItemID(null) : Atk : %s\n", r.ReplaceAllString(n, "${Atk}"))