Compare commits

..

No commits in common. "main" and "v0.4.1" have entirely different histories.
main ... v0.4.1

42 changed files with 1175 additions and 2332 deletions

1
.gitignore vendored
View file

@ -23,4 +23,3 @@ product/
releases releases
id_keys.json id_keys.json
shiny_stats.json shiny_stats.json
data

387
Cargo.lock generated
View file

@ -19,9 +19,9 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]] [[package]]
name = "anstream" name = "anstream"
version = "0.6.18" version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"anstyle-parse", "anstyle-parse",
@ -34,37 +34,36 @@ dependencies = [
[[package]] [[package]]
name = "anstyle" name = "anstyle"
version = "1.0.10" version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
[[package]] [[package]]
name = "anstyle-parse" name = "anstyle-parse"
version = "0.2.6" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb"
dependencies = [ dependencies = [
"utf8parse", "utf8parse",
] ]
[[package]] [[package]]
name = "anstyle-query" name = "anstyle-query"
version = "1.1.2" version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a"
dependencies = [ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
name = "anstyle-wincon" name = "anstyle-wincon"
version = "3.0.7" version = "3.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8"
dependencies = [ dependencies = [
"anstyle", "anstyle",
"once_cell", "windows-sys 0.52.0",
"windows-sys 0.59.0",
] ]
[[package]] [[package]]
@ -102,18 +101,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "2.8.0" version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
"generic-array",
]
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
@ -129,9 +119,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.10" version = "1.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e"
dependencies = [ dependencies = [
"shlex", "shlex",
] ]
@ -144,9 +134,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.26" version = "4.5.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@ -154,9 +144,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.26" version = "4.5.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@ -166,27 +156,27 @@ dependencies = [
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.5.24" version = "4.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.7.4" version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
[[package]] [[package]]
name = "colorchoice" name = "colorchoice"
version = "1.0.3" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
[[package]] [[package]]
name = "core-foundation" name = "core-foundation"
@ -205,32 +195,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "cpufeatures" name = "derive-deref-rs"
version = "0.2.16" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" checksum = "fb44ba65b4c7afe45d03d8e33ecb53a21c57d0ffff196f04aefa15c43671f8a6"
dependencies = [ dependencies = [
"libc", "proc-macro2",
] "quote",
"syn 1.0.109",
[[package]]
name = "crypto-common"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
"typenum",
]
[[package]]
name = "digest"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer",
"crypto-common",
] ]
[[package]] [[package]]
@ -241,7 +213,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]
[[package]] [[package]]
@ -355,16 +327,6 @@ dependencies = [
"slab", "slab",
] ]
[[package]]
name = "generic-array"
version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.2.15" version = "0.2.15"
@ -640,29 +602,30 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]
[[package]] [[package]]
name = "idmangler-cli" name = "idmangler-cli"
version = "0.5.0" version = "0.4.1"
dependencies = [ dependencies = [
"base64",
"clap", "clap",
"derive-deref-rs",
"idmangler-lib", "idmangler-lib",
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",
"serde_json5",
"thiserror", "thiserror",
"tribool",
] ]
[[package]] [[package]]
name = "idmangler-lib" name = "idmangler-lib"
version = "0.5.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3289c6bd14bc60ec34cebb05292f1bbf369eace2674e6def4dc0f031b34e344" checksum = "0395df40b27e5b44d89befbf479c06df7554c0af28674fa663aebd8e0d8f400c"
dependencies = [ dependencies = [
"serde",
"thiserror", "thiserror",
] ]
@ -711,15 +674,15 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "1.0.14" version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.77" version = "0.3.76"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"wasm-bindgen", "wasm-bindgen",
@ -733,9 +696,9 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.4.15" version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
[[package]] [[package]]
name = "litemap" name = "litemap"
@ -745,9 +708,9 @@ checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"
[[package]] [[package]]
name = "log" name = "log"
version = "0.4.25" version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]] [[package]]
name = "memchr" name = "memchr"
@ -763,9 +726,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.8.3" version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394"
dependencies = [ dependencies = [
"adler2", "adler2",
] ]
@ -836,7 +799,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]
[[package]] [[package]]
@ -863,56 +826,11 @@ version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pest"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc"
dependencies = [
"memchr",
"thiserror",
"ucd-trie",
]
[[package]]
name = "pest_derive"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e"
dependencies = [
"pest",
"pest_generator",
]
[[package]]
name = "pest_generator"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "pest_meta"
version = "2.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea"
dependencies = [
"once_cell",
"pest",
"sha2",
]
[[package]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
version = "0.2.16" version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"
[[package]] [[package]]
name = "pin-utils" name = "pin-utils"
@ -928,27 +846,27 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.93" version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.38" version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.12.12" version = "0.12.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f"
dependencies = [ dependencies = [
"base64", "base64",
"bytes", "bytes",
@ -980,7 +898,6 @@ dependencies = [
"system-configuration", "system-configuration",
"tokio", "tokio",
"tokio-native-tls", "tokio-native-tls",
"tower",
"tower-service", "tower-service",
"url", "url",
"wasm-bindgen", "wasm-bindgen",
@ -1012,9 +929,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.43" version = "0.38.42"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"errno", "errno",
@ -1025,9 +942,9 @@ dependencies = [
[[package]] [[package]]
name = "rustls" name = "rustls"
version = "0.23.21" version = "0.23.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"rustls-pki-types", "rustls-pki-types",
@ -1062,12 +979,6 @@ dependencies = [
"untrusted", "untrusted",
] ]
[[package]]
name = "rustversion"
version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.18" version = "1.0.18"
@ -1098,9 +1009,9 @@ dependencies = [
[[package]] [[package]]
name = "security-framework-sys" name = "security-framework-sys"
version = "2.14.0" version = "2.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5"
dependencies = [ dependencies = [
"core-foundation-sys", "core-foundation-sys",
"libc", "libc",
@ -1108,29 +1019,29 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.217" version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.217" version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.135" version = "1.0.128"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@ -1138,17 +1049,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "serde_json5"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a6b754515e1a7bd79fc2edeaecee526fc80cb3a918607e5ca149225a3a9586"
dependencies = [
"pest",
"pest_derive",
"serde",
]
[[package]] [[package]]
name = "serde_urlencoded" name = "serde_urlencoded"
version = "0.7.1" version = "0.7.1"
@ -1161,17 +1061,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "sha2"
version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
dependencies = [
"cfg-if",
"cpufeatures",
"digest",
]
[[package]] [[package]]
name = "shlex" name = "shlex"
version = "1.3.0" version = "1.3.0"
@ -1229,9 +1118,20 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.96" version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1255,7 +1155,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]
[[package]] [[package]]
@ -1281,13 +1181,12 @@ dependencies = [
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.15.0" version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"fastrand", "fastrand",
"getrandom",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.59.0", "windows-sys 0.59.0",
@ -1295,22 +1194,22 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "2.0.11" version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "2.0.11" version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]
[[package]] [[package]]
@ -1325,9 +1224,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.43.0" version = "1.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
@ -1371,27 +1270,6 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "tower"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
dependencies = [
"futures-core",
"futures-util",
"pin-project-lite",
"sync_wrapper",
"tokio",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-layer"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]] [[package]]
name = "tower-service" name = "tower-service"
version = "0.3.3" version = "0.3.3"
@ -1417,29 +1295,26 @@ dependencies = [
"once_cell", "once_cell",
] ]
[[package]]
name = "tribool"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e8660361502033a51e119386b47fbb811e5706722f2e91ccf867aa6b2b09f90"
dependencies = [
"serde",
]
[[package]] [[package]]
name = "try-lock" name = "try-lock"
version = "0.2.5" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "typenum"
version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
[[package]]
name = "ucd-trie"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.14" version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]] [[package]]
name = "untrusted" name = "untrusted"
@ -1482,12 +1357,6 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "version_check"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]] [[package]]
name = "want" name = "want"
version = "0.3.1" version = "0.3.1"
@ -1505,35 +1374,34 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.100" version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
"rustversion",
"wasm-bindgen-macro", "wasm-bindgen-macro",
] ]
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.100" version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.50" version = "0.4.49"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"js-sys", "js-sys",
@ -1544,9 +1412,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.100" version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@ -1554,31 +1422,28 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.100" version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.100" version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6"
dependencies = [
"unicode-ident",
]
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.77" version = "0.3.76"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@ -1728,7 +1593,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
"synstructure", "synstructure",
] ]
@ -1749,7 +1614,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
"synstructure", "synstructure",
] ]
@ -1778,5 +1643,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn 2.0.87",
] ]

View file

@ -1,17 +1,19 @@
[package] [package]
name = "idmangler-cli" name = "idmangler-cli"
authors = ["endernon"] authors = ["endernon"]
version = "0.5.0" version = "0.4.1"
edition = "2021" edition = "2021"
readme = "README.md" readme = "README.md"
license = "MIT" license = "MIT"
description = "A cli tool to generate fake wynntils items" description = "A cli tool to generate fake wynntils items"
[dependencies] [dependencies]
clap = { version = "4.5.26", features = ["derive"] } base64 = "0.22.1"
idmangler-lib = { version = "0.5.0", features = ["serde"] } clap = { version = "4.5.20", features = ["derive"] }
derive-deref-rs = "0.1.1"
idmangler-lib = "0.4.0"
reqwest = { version = "0.12.9", features = ["blocking", "json"] } reqwest = { version = "0.12.9", features = ["blocking", "json"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.135" serde_json = "1.0"
serde_json5 = "0.1.0" thiserror = "1.0.68"
thiserror = "2.0.11" tribool = { version = "0.3.0", features = ["serde"] }

View file

@ -1,7 +1,7 @@
# idmangler-cli # idmangler-cli
Basically this generates fake items by loading from a json. Effectively a wrapper for [zatzou's idmangler-lib](https://github.com/Zatzou/idmangler-lib). Basically this generates fake items by loading from a json. Effectively a wrapper for [zatzou's idmangler-lib](https://github.com/Zatzou/idmangler-lib).
A video guide for Windows users can be found [HERE](https://www.youtube.com/watch?v=AvEUhs_6rEc). Any bugs? DM endernon on discord.
## How to get the program ## How to get the program
@ -36,8 +36,8 @@ run `cargo install idmangler-cli`.
- Move the program to some folder along with config.json . Download these three files and place them next to the program: - Move the program to some folder along with config.json . Download these three files and place them next to the program:
- https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/id_keys.json - https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/id_keys.json
- https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Data-Storage/shiny_stats.json - https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Data-Storage/shiny_stats.json
### 3) Actually generating an item - ### 3) Actually generating an item
- Read through the provided `config.md` document. You can get the web version [HERE](docs/config.md). - Read through the provided `config.md` document. You can get the web version [HERE](https://git.frfrnocap.men/endernon/idmangler-cli/src/branch/main/config.md).
- Once you have read through it, use one of the provided json files to create your own json. - Once you have read through it, use one of the provided json files to create your own json.
- Run the program with it. - Run the program with it.
- Windows: run `idmangler-cli.exe --config CONFIG_FILE_PATH` - Windows: run `idmangler-cli.exe --config CONFIG_FILE_PATH`

View file

@ -5,7 +5,7 @@ mkdir -p product
cp ./target/x86_64-pc-windows-gnu/release/idmangler-cli.exe ./product/idmangler-cli.exe cp ./target/x86_64-pc-windows-gnu/release/idmangler-cli.exe ./product/idmangler-cli.exe
cp ./target/x86_64-unknown-linux-gnu/release/idmangler-cli ./product/idmangler-cli cp ./target/x86_64-unknown-linux-gnu/release/idmangler-cli ./product/idmangler-cli
cp -r ./example_configs ./product/ cp -u -p ./{config.json,config_hanafupookie.json,config_singu.json,config.md} ./product/
pkgversion=$(cargo metadata --format-version=1 --no-deps | jq '.packages[] | select(.name == "idmangler-cli") | .version') pkgversion=$(cargo metadata --format-version=1 --no-deps | jq '.packages[] | select(.name == "idmangler-cli") | .version')
echo "package version is:" echo "package version is:"
@ -16,5 +16,5 @@ echo "$balls2"
cd product cd product
zip "idmangler-windows-x64-${balls2}.zip" ./example_configs/ idmangler-cli.exe zip "idmangler-windows-x64-${balls2}.zip" config.json config_hanafupookie.json config_singu.json config.md idmangler-cli.exe
zip "idmangler-linux-x64-${balls2}.zip" ./example_configs/ idmangler-cli zip "idmangler-linux-x64-${balls2}.zip" config.json config_hanafupookie.json config_singu.json config.md idmangler-cli

282
config.json Normal file
View file

@ -0,0 +1,282 @@
{
"READMEFIRST": [
"Refer to config.md to understand how to apply the data shown here.",
"There are also some values you cannot increase beyond a limit."
],
"name":"Singularity",
"item_type": "Gear",
"shiny": {
"key": "playersKilled",
"value": 9223372036854775807
},
"ids": [
{"id": "mainAttackDamage","base": 320,"roll": 69},
{"id": "healthRegenRaw", "base":250 , "roll":130 },
{"id": "rawDexterity", "base":35 },
{"id": "walkSpeed", "base":-40 , "roll":69},
{"id": "mainAttackDamage", "base":15, "roll":130 },
{"id": "rawMainAttackDamage", "base":444 , "roll":130 },
{"id": "rawSpellDamage", "base":222 , "roll":130 },
{"id": "spellDamage", "base":10 , "roll":130 }
],
"powder_limit": 255,
"powders": [
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6}
],
"rerolls": 255
}

68
config.md Normal file
View file

@ -0,0 +1,68 @@
# Values Guide
## Name
**Name** is stored as a String. It must be a valid Wynncraft item for it to display as intended.
## Shiny ID
Inside the Shiny{} list, there will be two elements: "key" and "value".
The potential keys for any shiny value are listed here: https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Data-Storage/shiny_stats.json
The value is the shown amount.
## Item type
WIP. This will support crafteds in the future, but for now you must have this:
```
"item_type": "Gear"
```
## Powders
### Powder Limit
Powder limit cannot be increased beyond 255. This is because the powder count is stored as a byte.
Potential value range: 0<->255.
### Format
Inside the "powders":[ ] array, set it up in the following structure.
**{ "type":"$TYPE", "tier":$TIER, "amount": $AMOUNT }**
**TYPE** is stored as a single character.
Potential Values: "E" "T" "W" "F" "A" . These represent Earth, Thunder, Wind, Fire, Air.
**TIER** is stored as a single digit integer.
Potential value range: 1<->6.
**AMOUNT** is stored as an integer. It is optional. If not provided it falls back to 1.
Potential value range: 1<->255.
#### Other things about powder format:
Each value in the array must have a comma at the end except the last.
The use of spaces is optional, as well as letter case for the $TYPE value.
The keys ("type" "tier" "amount") must All be lowercase.
If type is invalid, it will default back to being Thunder powder.
#### Powders Example (yes, this looks wacky to show that this is allowed)
```json
"powders": [
{ "type":"T", "tier":6, "amount":5 },
{"type" :"e","tier":1,"amount":5},
{"type": "F", "tier": 3,"amount":1},
{ "type" : "w" , "tier":6 }
]
```
Note that the last powder block in array has no comma at the end.
### Which items can have powders?
Powders can only be encoded on an item that originally supported powders in the first place.
Unfortunately you can't add powders to an item that didn't originally have them.
e.g. can't put powder on depressing shears, as depressing weapons don't have powder slot.
## Identifications
### Format
Inside the "ids":[] array, set it up in the following structure.
**{"id": "$ID","base": $BASE,"roll": $ROLL}**
**ID** is stored as a string corresponding to the Wynntils internal ID string of any roll. See here for a list: https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/id_keys.json .
**BASE** is the base roll. The default base data is defined in (WARNING: EXTREMELY MASSIVE TEXT FILE) https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/gear.json .
Beautify it then look for `ITEMNAME > identifications > IDENTIFICATIONNAME > raw` for default value. This base value defines the listed ID ranges.
**ROLL** defines the actual rolled value for the Identification. The formula is `BASE * ROLL / 100`. Most values are in the range 30-130 due to how Wynncraft handles many Identifications as 30-130 percent of a base stat. Thus, if you are trying to find the ROLL value, try your desired roll **(NOT the roll percentage 1-100)** divided by the BASE then round it to the nearest integer. This value is optional, and you should only exclude it when it is a fixed value e.g. Skill Points.
## Rerolls
Optional single value, i8. Stores number of rerolls. If missing or is 0, rerolls are not encoded.
Potential range: 0<->255.
### Other things about this
The format obeys the same json rules as the powders.
If you are trying to get the 100% or 0% roll and the value you calculated is close to 130 or 30, change it to 130 or 30 because that is the real value.
However, if the value is negative it will be between 70%-130%.
# Current issues
Crafteds are not implemented

View file

@ -4,7 +4,10 @@
"There are also some values you cannot increase beyond a limit." "There are also some values you cannot increase beyond a limit."
], ],
"name":"Hanafubuki", "name":"Hanafubuki",
"item_type": "Gear", "shiny": {
"key": "playersKilled",
"value": 9223372036854775807
},
"ids": [ "ids": [
{"id": "3rdSpellCost","base": -25,"roll": 70}, {"id": "3rdSpellCost","base": -25,"roll": 70},
{"id": "4thSpellCost", "base":-15 , "roll":70 }, {"id": "4thSpellCost", "base":-15 , "roll":70 },
@ -12,6 +15,11 @@
{"id": "elementalDamage", "base":256 , "roll":130}, {"id": "elementalDamage", "base":256 , "roll":130},
{"id": "jumpHeight", "base":3, "roll":130 }, {"id": "jumpHeight", "base":3, "roll":130 },
{"id": "rawStrength", "base":15} {"id": "rawStrength", "base":15}
],
"powder_limit": 255,
"powders": [
], ],
"rerolls": 255 "rerolls": 255
} }

View file

@ -11,6 +11,7 @@
}, },
"ids": [ "ids": [
], ],
"powder_limit": 255,
"powders": [ "powders": [
], ],
"rerolls": 255 "rerolls": 255

282
config_singu.json Normal file
View file

@ -0,0 +1,282 @@
{
"READMEFIRST": [
"Refer to config.md to understand how to apply the data shown here.",
"There are also some values you cannot increase beyond a limit."
],
"name":"Singularity",
"item_type": "Gear",
"shiny": {
"key": "playersKilled",
"value": 9223372036854775807
},
"ids": [
{"id": "mainAttackDamage","base": 320,"roll": 69},
{"id": "healthRegenRaw", "base":250 , "roll":130 },
{"id": "rawDexterity", "base":35 },
{"id": "walkSpeed", "base":-40 , "roll":69},
{"id": "mainAttackDamage", "base":15, "roll":130 },
{"id": "rawMainAttackDamage", "base":444 , "roll":130 },
{"id": "rawSpellDamage", "base":222 , "roll":130 },
{"id": "spellDamage", "base":10 , "roll":130 }
],
"powder_limit": 255,
"powders": [
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6},
{"type":"E", "tier":6},
{"type":"T", "tier":6},
{"type":"W", "tier":6},
{"type":"F", "tier":6},
{"type":"A", "tier":6}
],
"rerolls": 255
}

View file

View file

View file

View file

@ -1,44 +0,0 @@
# Identifications
- This data block encodes for identifications on Gear-type items.
- Not to be confused with [Custom Identifications](identificationscustom.md).
- Field name: `ids`
- Field type: `Array[id, base, roll]`
- Example: `"id":"1stSpellCost","base":69,"roll":30`
- # Id
- This is the ID that is used. It corresponds to the Wynntils internal name for an identification.
- See [HERE](https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/id_keys.json) for a list.
- Field name: `id`
- Field type: `String`
- Example: `"id":"1stSpellCost"`
- # Base
- This is the base value. This value defines the range for 0% to 100% of any stat on any item.
- It is defined for any item in [THIS](https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/gear.json) data file. Use a json beautifier, then look for `ITEMNAME > identifications > IDENTIFICATION_NAME > raw` for the base value.
- Field name: `base`
- Field type: `Signed 32-bit Integer`
- Field range: `2147483648` to `2147483647`
- Example: `"base":69`
- # Roll (OPTIONAL)
- This is the roll value. It defines the actual roll percent for the identification.
- The formula for the final shown percentage on the final item is `BASE * ROLL / 100`.
- Positive values are in the range 30-130 due to how Wynncraft handles many Identifications as `(0.3 <-> 1.3) x baseStat`.
- If you are trying to find the ROLL value, try your desired roll VALUE **(NOT the roll percentage)** divided by the BASE STAT then round it to the nearest integer.
- This value is optional, BUT you should only exclude it when it is a fixed value and not a range, e.g. Skill Points are always fixed.
- Field name: `roll`
- Field type: `Unsigned 8-bit Integer`
- Field range: `0` to `255`
- ...But for it to be a valid item, `30` to `130` (positive base stat) and `70` to `130` (negative base stat).
- Example: `"roll":30`
## Example Identifications for a perfect Singularity:
```json
"ids": [
{"id": "mainAttackDamage","base": 320,"roll": 69},
{"id": "healthRegenRaw", "base":250 , "roll":130 },
{"id": "rawDexterity", "base":35 },
{"id": "walkSpeed", "base":-40 , "roll":69},
{"id": "mainAttackDamage", "base":15, "roll":130 },
{"id": "rawMainAttackDamage", "base":444 , "roll":130 },
{"id": "rawSpellDamage", "base":222 , "roll":130 },
{"id": "spellDamage", "base":10 , "roll":130 }
],
```

View file

@ -1,8 +0,0 @@
# Name
This data block encodes for the name of an item.
- Field name: `name`
- Field type: `String`
- Example: `"name":"Singularity"`
- **NOTES FOR GEAR TYPE ITEMS**:
- It must be a valid Wynncraft item name for it to display as intended.
- in game, the name has a limit of 48 characters. That means that the final tier Legendary Island item, "Outlandish Replica Face Mask of Legendary Victory", only encodes up to "Victor". Thus, it does not work in game. ![frfr.png](../images/outlandish_mask.png)

View file

@ -1,41 +0,0 @@
# Powders
- This data block encodes for powders present on the item.
- Field name: `powders`
- Field type: `Array[type, tier, amount]`
- Field range: `0` to `255` powders total.
- ## Type
- This is the type of powder that is present.
- These values represent Earth, Thunder, Water, Fire, and Air.
- Field name: `type`
- Field type: `Char`
- Field potential values: `E`,`T`,`W`,`F`,`A`
- Field fallback value (if invalid): `T`
- Example: `"type":"E"`
- ## Tier
- This is the powder tier, although it really doesn't do anything as by default Wynntils only encodes to and accepts Tier 6.
- Field name: `tier`
- Field type: `Unsigned 8-bit Integer`
- Field range: `1` to `6`
- Example: `"tier":6`
- ## Amount (OPTIONAL)
- For each entry in the `powders` array, this is the amount of powders encoded.
- It is optional, as it's just used to make encoding lots of the same powder easier.
- For example, you could repeat `{"type":"E", "tier":6}` six times, or just do `{"type":"E", "tier":6, "amount":6}` and both would be the same.
- Field name: `amount`
- Field type: `Unsigned 8-bit Integer`
- Field range: `1` to `255`
- Field fallback value (if not provided): `1`
- Example: `"amount":6`
## EXAMPLE of the Powders array
```
"powders": [
{"type":"T", "tier":6, "amount":5},
{"type":"e", "tier":1, "amount":5},
{"type":"F", "tier":3, "amount":1},
{"type":"w", "tier":6}
]
```
## Which items can have powders?
Powders can only be encoded on an item that originally supported powders in the first place.
Unfortunately you can't add powders to an item that didn't originally have them.
e.g. can't put powder on depressing shears, as depressing weapons don't have powder slot.

View file

@ -1,6 +0,0 @@
## Rerolls (OPTIONAL)
- This data block encodes the number of rerolls.
- Field name: `rerolls`
- Field type: `Unsigned 8-bit Integer`
- Field range: `0` to `255`
- Example: `"rerolls":"125"`

View file

@ -1,17 +0,0 @@
# Shiny
This data block encodes for Shiny data present on gear items.
- Field name: `shiny`
- Field type: `{key, value}`
- Example: `"shiny": {"key": "playersKilled","value": 20}`
- ## Key
- This is the type of the shiny stat present.
- The potential keys for any shiny value are listed [HERE](https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Data-Storage/shiny_stats.json).
- Field name: `key`
- Field type: `String`
- Example: `"key": "playersKilled"`
- ## Value
- This is the value of the shiny stat present.
- Field name: `value`
- Field type: `Signed 64-bit Integer`
- Field range: `-9,223,372,036,854,775,808` to `9,223,372,036,854,775,807`
- Example: `"value":"20"`

View file

@ -1,8 +0,0 @@
# Item type
- This data block encodes for the type of the item that's being encoded.
- This will support crafteds in the future, but for now it only supports non crafted types.
- If you input a crafted value, literally nothing will happen, I think.
- Field name: `item_type`
- Field type: `String`
- Field potential values: `"Gear"`, `"Tome"`, `"Charm"`
- Example: `"item_type": "Gear"`

View file

@ -1,43 +0,0 @@
# Config Guide
## The required blocks
According to the [Wynntils Artemis encoding proposal Github Issue](https://github.com/Wynntils/Wynntils/issues/2246),
the allowed blocks should look like this:
![An image of the original encoding proposal table, present on GitHub](images/encodingproposaltable.png)
However, it's inaccurate. This is what it SHOULD look like:
##### Key to Type Mapping Table
| Key | Type | Required blocks | Optional blocks |
|-----|--------------------------|--------------------------------------------|-------------------------------------------------------------|
| `0` | Gear Item | Name | Identifications, Powders, Shiny, Reroll |
| `1` | Tome Item | Name | Identifications, Reroll |
| `2` | Charm Item | Name | Identifications, Reroll |
| `3` | Crafted Gear Item | Custom Gear Type, Durability, Requirements | NameAfter, Damage, Defense, Custom Identifications, Powders |
| `4` | Crafted Consumable Item | Custom Consumable Type, Uses, Requirements | Effects, NameAfter, Custom Identifications |
| `5` | Crafted Item from Recipe | TODO | TODO |
## Documentation for each block:
- [Item type](blocks/type.md)
- [Custom Gear Type (NOT IMPLEMENTED YET)](blocks/customgeartype.md)
- [Custom Consumable Type (NOT IMPLEMENTED YET)](blocks/customconsumtype.md)
- [Durability (NOT IMPLEMENTED YET)](blocks/durability.md)
- [Requirements (NOT IMPLEMENTED YET)](blocks/requirements.md)
- [Name](blocks/name.md)
- [NameAfter (NOT IMPLEMENTED YET)](blocks/nameafter.md)
- [Shiny](blocks/shiny.md)
- [Identifications](blocks/identifications.md)
- [Damage (NOT IMPLEMENTED YET)](blocks/damage.md)
- [Defense (NOT IMPLEMENTED YET)](blocks/defense.md)
- [Effects (NOT IMPLEMENTED YET)](blocks/effects.md)
- [Powders](blocks/powders.md)
- [Custom Identifications (NOT IMPLEMENTED YET)](blocks/identifications.md)
- [Reroll](blocks/reroll.md)
# Current issues
Crafteds are not implemented

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View file

@ -1,281 +0,0 @@
{
"READMEFIRST": [
"Refer to config.md to understand how to apply the data shown here.",
"There are also some values you cannot increase beyond a limit."
],
"name":"Singularity",
"item_type": "Gear",
"shiny": {
"key": "playersKilled",
"value": 9223372036854775807
},
"ids": [
{"id": "mainAttackDamage","base": 320,"roll": 69},
{"id": "healthRegenRaw", "base":250 , "roll":130 },
{"id": "rawDexterity", "base":35 },
{"id": "walkSpeed", "base":-40 , "roll":69},
{"id": "mainAttackDamage", "base":15, "roll":130 },
{"id": "rawMainAttackDamage", "base":444 , "roll":130 },
{"id": "rawSpellDamage", "base":222 , "roll":130 },
{"id": "spellDamage", "base":10 , "roll":130 }
],
"powders": [
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"}
],
"rerolls": 255
}

View file

@ -1,277 +0,0 @@
{
"READMEFIRST": [
"Refer to config.md to understand how to apply the data shown here.",
"There are also some values you cannot increase beyond a limit."
],
"name":"Singularity",
"item_type": "craftedgear",
"crafted_type": "spear",
"requirements": {
"level": 69,
"class": "Mage"
},
"durability": {
"effect_strength": 100,
"dura_cur": 50,
"dura_max": 100
},
"powders": [
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"}
],
"rerolls": 255
}

View file

@ -1,281 +0,0 @@
{
"READMEFIRST": [
"Refer to config.md to understand how to apply the data shown here.",
"There are also some values you cannot increase beyond a limit."
],
"name":"Singularity",
"item_type": "Gear",
"shiny": {
"key": "playersKilled",
"value": 9223372036854775807
},
"ids": [
{"id": "mainAttackDamage","base": 320,"roll": 69},
{"id": "healthRegenRaw", "base":250 , "roll":130 },
{"id": "rawDexterity", "base":35 },
{"id": "walkSpeed", "base":-40 , "roll":69},
{"id": "mainAttackDamage", "base":15, "roll":130 },
{"id": "rawMainAttackDamage", "base":444 , "roll":130 },
{"id": "rawSpellDamage", "base":222 , "roll":130 },
{"id": "spellDamage", "base":10 , "roll":130 }
],
"powders": [
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"},
{"type":"E"},
{"type":"T"},
{"type":"W"},
{"type":"F"},
{"type":"A"}
],
"rerolls": 255
}

View file

@ -1,9 +0,0 @@
{
"READMEFIRST": [
"Refer to config.md to understand how to apply the data shown here.",
"There are also some values you cannot increase beyond a limit."
],
"name":"Assimilator's Tome of Allegiance",
"item_type": "tome",
"rerolls": 255
}

View file

@ -1,3 +0,0 @@
fn_params_layout = "Compressed"
attr_fn_like_width = 210
max_width = 220

50
shiny_stats.json Normal file
View file

@ -0,0 +1,50 @@
[
{
"id": 1,
"key": "mobsKilled",
"displayName": "Mobs Killed",
"statUnit": "raw"
},
{
"id": 2,
"key": "raidsWon",
"displayName": "Raids Won",
"statUnit": "raw"
},
{
"id": 3,
"key": "chestsOpened",
"displayName": "Chests Opened",
"statUnit": "raw"
},
{
"id": 4,
"key": "warsWon",
"displayName": "Wars Won",
"statUnit": "raw"
},
{
"id": 5,
"key": "playersKilled",
"displayName": "Players Killed",
"statUnit": "raw"
},
{
"id": 6,
"key": "dungeonsWon",
"displayName": "Dungeons Won",
"statUnit": "raw"
},
{
"id": 7,
"key": "deaths",
"displayName": "Deaths",
"statUnit": "raw"
},
{
"id": 8,
"key": "lootrunsCompleted",
"displayName": "Lootruns Completed",
"statUnit": "raw"
}
]

View file

@ -1,276 +0,0 @@
use crate::errorfr::Errorfr;
use crate::jsonstruct::{CraftedTypesFr, Durability, Identificationer, ItemTypeDeser, PowderFr, RequirementsDeser, Shinyjson, Shinystruct};
use idmangler_lib::encoding::DataEncoder;
use idmangler_lib::{
block::{CraftedConsumableTypeData, CraftedGearTypeData, DurabilityData, EndData, IdentificationData, NameData, PowderData, RequirementsData, RerollData, ShinyData, StartData, TypeData},
types::{ClassType, Element, ItemType, Powder, RollType, SkillType, Stat},
};
use std::collections::HashMap;
use idmangler_lib::types::EncodingVersion;
/// FuncParams struct, used for the three most important parameters for encoding.
/// Also, all the encode functions are stored here, seeing as I require these three params most of the time when encoding.
#[derive(PartialEq, Eq, Hash, Debug)]
pub struct FuncParams<'a> {
pub fr_out: &'a mut Vec<u8>,
pub fr_debug_mode: &'a bool,
pub fr_ver: EncodingVersion,
}
impl FuncParams<'_> {
/// ENCODE: StartData
/// (REQUIRED)
pub fn encode_startdata(&mut self) -> Result<(), Errorfr> {
if *self.fr_debug_mode {
println!("Encoding StartData")
}
StartData(self.fr_ver).encode(self.fr_ver, self.fr_out).unwrap();
Ok(())
}
/// ENCODE: TypeData
/// (REQUIRED)
pub fn encode_typedata(&mut self, item_type_deser: ItemTypeDeser) -> Result<(), Errorfr> {
if *self.fr_debug_mode {
println!("Encoding TypeData: {:?}", item_type_deser);
}
TypeData(ItemType::from(item_type_deser)).encode(self.fr_ver, self.fr_out).unwrap();
Ok(())
}
/// ENCODE: NameData
pub fn encode_namedata(&mut self, real_name: &str) -> Result<(), Errorfr> {
if *self.fr_debug_mode {
println!("Encoding NameData: {:?}", &real_name)
}
NameData(real_name.trim().to_string()).encode(self.fr_ver, self.fr_out).unwrap();
Ok(())
}
/// ENCODE: IdentificationData
pub fn encode_iddata(&mut self, real_ids: &Vec<Identificationer>, idsmap: HashMap<String, u8>) -> Result<(), Errorfr> {
let mut idvec = Vec::new();
for eachid in real_ids {
let id_id = idsmap.get(eachid.id.trim());
let id_base = eachid.base;
let id_roll = eachid.roll;
idvec.push(Stat {
kind: match id_id {
Some(ide) => *ide,
None => std::panic!("There is a mismatched ID, and this message has replaced where the line is meant to be"),
},
base: Some(id_base),
roll: match id_roll {
Some(rolle) => RollType::Value(rolle),
None => RollType::PreIdentified,
},
});
}
if *self.fr_debug_mode {
println!("Encoding IdentificationData: {:?}", &idvec)
}
IdentificationData {
identifications: idvec,
extended_encoding: true,
}
.encode(self.fr_ver, self.fr_out)
.unwrap();
Ok(())
}
/// ENCODE: PowderData
pub fn encode_powderdata(&mut self, real_powders: &Vec<PowderFr>) -> Result<(), Errorfr> {
let mut powdervec = Vec::new();
for eachpowder in real_powders {
let powderamount: u8 = eachpowder.amount.unwrap_or(1);
// match for the powder type
for _ in 0..powderamount {
let eletype = match eachpowder.r#type.to_ascii_lowercase() {
'e' => Element::Earth,
't' => Element::Thunder,
'w' => Element::Water,
'f' => Element::Fire,
'a' => Element::Air,
_ => return Err(Errorfr::JsonUnknownPowderElement),
};
if *self.fr_debug_mode {
dbg!(eletype);
}
powdervec.push(Powder::new(eletype, 6).map_err(|_| Errorfr::JsonUnknownPowderTier)?);
// 6 is the tier. Wynntils ONLY really uses tier 6 so theres no point keeping others.
}
}
if *self.fr_debug_mode {
dbg!(&powdervec);
}
let powderlimitfr: u8 = powdervec.len() as u8; // min of the current number of powders and 255 (if you have over 255 powders stuff breaks)
PowderData {
powder_slots: powderlimitfr,
powders: powdervec,
}
.encode(self.fr_ver, self.fr_out)
.unwrap();
Ok(())
}
/// ENCODE: RerollData
pub fn encode_rerolldata(&mut self, rerollcount: u8) -> Result<(), Errorfr> {
if rerollcount != 0 {
RerollData(rerollcount).encode(self.fr_ver, self.fr_out).unwrap();
if *self.fr_debug_mode {
dbg!(rerollcount);
}
}
Ok(())
}
/// ENCODE: ShinyData
pub fn encode_shinydata(&mut self, shiny: &Shinyjson, json_shiny: &Vec<Shinystruct>) -> Result<(), Errorfr> {
let mut realshinykey: u8;
let _shinykey = &shiny.key;
let shinyvalue = shiny.value;
realshinykey = 1;
for i in json_shiny {
if i.key == shiny.key {
realshinykey = i.id;
if *self.fr_debug_mode {
dbg!(&shiny.key);
}
}
}
if *self.fr_debug_mode {
dbg!(&realshinykey);
dbg!(&shinyvalue);
}
ShinyData { id: realshinykey, val: shinyvalue }.encode(self.fr_ver, self.fr_out).unwrap();
Ok(())
}
/// ENCODE: EndData
/// (REQUIRED)
pub fn encode_enddata(&mut self) -> Result<(), Errorfr> {
if *self.fr_debug_mode {
println!("Encoding EndData")
}
EndData.encode(self.fr_ver, self.fr_out).unwrap();
Ok(())
}
/// ENCODE: CraftedConsumableTypeData or CraftedGearTypeData based on Type
pub fn encode_typedata_custom(&mut self, crafted_type: &str) -> Result<(), Errorfr> {
let frfr_type = CraftedTypesFr::try_from(crafted_type)?;
match frfr_type {
CraftedTypesFr::Gear(a) => {
if *self.fr_debug_mode {
println!("Encoding CustomTypeData: Gear");
}
CraftedGearTypeData(a).encode(self.fr_ver, self.fr_out).unwrap()
}
CraftedTypesFr::Consu(a) => {
if *self.fr_debug_mode {
println!("Encoding CustomTypeData: Consumable");
}
CraftedConsumableTypeData(a).encode(self.fr_ver, self.fr_out).unwrap()
}
}
Ok(())
}
/// ENCODE: DamageData
/// (CRAFTED ONLY)
pub fn encode_damagedata(&mut self) -> Result<(), Errorfr> {
unimplemented!();
}
/// ENCODE: DefenseData
/// (CRAFTED ONLY)
pub fn encode_defensedata(&mut self) -> Result<(), Errorfr> {
unimplemented!();
}
/// ENCODE: DurabilityData
/// (CRAFTED ONLY)
pub fn encode_duradata(&mut self, real_dura: &Durability) -> Result<(), Errorfr> {
let effect_strength_fr: u8; // but actually it should be 0 to 100, not 0 to 255. But i dunno how to use u7 data type.
if let Some(effstr) = real_dura.effect_strength {
if *self.fr_debug_mode {
println!("Encoding DurabilityData: Defined");
}
effect_strength_fr = effstr
} else {
// percentage of max durability
let current_percentage = real_dura.dura_cur / real_dura.dura_max;
// see this answer from Stackoverflow for transcribing range
// https://stackoverflow.com/a/929107
match current_percentage {
50..=100 => {
// dura more than or equal to 50%
// dura less than 100%
// effectiveness 100%
effect_strength_fr = 100
}
10..50 => {
// dura more than or equal to 10%
// dura less than 50%
// effectiveness scales from 100% to 50%
// old range is 50-10 = 40
let old_range = 40;
// new range is 100-50 = 50
let new_range = 50;
// NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin
effect_strength_fr = ((((current_percentage - 10) * new_range) / old_range) + 50) as u8
}
0..10 => {
// dura more than or equal to 0%
// dura less than 10%
// effectiveness scales from 50% to 10%
// old range is 10-0 = 10
let old_range = 10;
// new range is 50-10 = 40
let new_range = 40;
// NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin
effect_strength_fr = ((((current_percentage) * new_range) / old_range) + 10) as u8
}
_ => return Err(Errorfr::JsonDuraOutOfRange), // only get this if current durability is <0 or >100
}
}
if *self.fr_debug_mode {
println!("Encoding DurabilityData.effect_strenght: {}", effect_strength_fr);
println!("Encoding DurabilityData.current: {}", real_dura.dura_cur);
println!("Encoding DurabilityData.current: {}", real_dura.dura_max);
}
DurabilityData {
effect_strenght: effect_strength_fr,
current: real_dura.dura_cur,
max: real_dura.dura_max,
}
.encode(self.fr_ver, self.fr_out)
.unwrap();
Ok(())
}
/// ENCODE: RequirementsData
pub fn encode_reqdata(&mut self, real_reqdata: RequirementsDeser) -> Result<(), Errorfr> {
if *self.fr_debug_mode {
println!("Encoding RequirementData.Level: {:?}", real_reqdata.level.clone())
}
let mut fr_class: Option<ClassType> = None;
if let Some(actualclass) = real_reqdata.class {
fr_class = Some(ClassType::from(actualclass));
if *self.fr_debug_mode {
println!("Encoding RequirementData.Class: {:?}", actualclass.clone())
}
} else if *self.fr_debug_mode {
println!("Encoding RequirementData.Class: Undefined");
}
let spvec: Vec<(SkillType, i32)> = match real_reqdata.sp {
Some(real_sp) => Vec::<(SkillType, i32)>::from(real_sp),
None => Vec::new(),
};
if *self.fr_debug_mode {
println!("Encoding RequirementData.Skills: {:?}", spvec.clone())
}
RequirementsData {
level: real_reqdata.level,
class: fr_class,
skills: spvec,
}
.encode(self.fr_ver, self.fr_out)
.unwrap();
Ok(())
}
}

View file

@ -1,102 +0,0 @@
use thiserror::Error;
/// Errors yep
#[derive(Error, Debug)]
pub enum Errorfr {
/// item config json is missing
#[error("Error 1.1: item config json is missing.")]
ItemJsonMissing,
/// item config json is corrupt
#[error("Error 1.2: item config json is invalid. \nReread config.md.\n{0}")]
ItemJsonCorrupt(serde_json5::Error),
/// idmap is missing
#[error("Error 2.1: id_keys.json is missing. \nYou should run \"--download id_keys\" or \"--download All\".")]
IDMapJsonMissing,
/// idmap is corrupt
#[error("Error 2.2: id_keys.json is corrupt. \nYou should run \"--download id_keys\" or \"--download All\".\n{0}")]
IDMapJsonCorrupt(serde_json::Error),
/// shiny data json is missing
#[error("Error 2.3: shiny_stats.json is missing. \nYou should run \"--download ShinyStats\" or \"--download All\".")]
ShinyJsonMissing,
/// shiny data json is corrupt
#[error("Error 2.4: shiny_stats.json is corrupt. \nYou should run \"--download ShinyStats\" or \"--download All\".")]
ShinyJsonCorrupt,
/// gear json is missing
#[error("Error 2.5: gear.json is missing. It's only required for the \"perfect mode\" item gen. \nYou should run \"--download Gear\" or \"--download All\".")]
GearJsonMissing,
/// gear data json is corrupt
#[error("Error 2.6: gear.json is corrupt. It's only required for the \"perfect mode\" item gen. \nYou should run \"--download Gear\" or \"--download All\".\n{0:?}")]
GearJsonCorrupt(serde_json::Error),
/// gear json is missing
#[error("Error 2.7: gear_cache.json is missing. It's only required for the \"perfect mode\" item gen. \nYou should run \"--download Gear\" or \"--download All\".")]
GearJsonCacheMissing,
/// gear data json is corrupt
#[error("Error 2.8: gear_cache.json is corrupt. It's only required for the \"perfect mode\" item gen. \nYou should run \"--download Gear\" or \"--download All\".\n{0:?}")]
GearJsonCacheCorrupt(serde_json::Error),
/// gear data json cache could not be created
#[error("Error 2.8: unable to create file gear_cache.json.")]
GearJsonCacheCreateFail,
/// could not download the file
#[error("Error 3.1: Download request failed. Check your network settings.")]
JsonDlReqFail,
/// invalid body response after downloading
#[error("Error 3.2: Download body is invalid. Something is broken.")]
JsonDlReqBodyInvalid,
/// unable to create file after download
#[error("Error 3.3: Download successful, but unable to actually create the file.")]
JsonDlReqFileCreateFail,
/// unable to copy (write in) file content
#[error("Error 3.4: Download successful, but unable to write to file.")]
JsonDlReqFileWriteFail,
/// Name value was not found in json
#[error("Error 4.1: \"name\" field was not found in the json (required for Gear, Tome, Charm).")]
JsonNotFoundName,
/// unable to find the crafted_type field
#[error("Error 4.2: Missing \"crafted_type\" field")]
JsonNotFoundCraftedType,
/// invalid crafted_type field
#[error("Error 4.3: Invalid \"crafted_type\" value")]
JsonInvalidCraftedType,
/// Durability is out of allowed range (0 to 100)
#[error("Error 4.4: \"durability\" percentage is out of range (Should be between 0 and 100)")]
JsonDuraOutOfRange,
/// Durability was not found but is necessary
#[error("Error 4.5: \"durability\" was not found (necessary for Crafted Gear item type)")]
JsonNotFoundDura,
/// Requirements not found but is necessary
#[error("Error 4.6: \"requirements\" was not found (necessary for Crafted Gear / Consumable items)")]
JsonNotFoundReqs,
/// Unrecognisable Powder tier
#[error("Error 4.7: Unknown powder tier")]
JsonUnknownPowderTier,
/// Unrecognisable Powder element
#[error("Error 4.8: Unknown powder element")]
JsonUnknownPowderElement,
/// Unrecognisable item for the Perfect gen function
#[error("Error 4.9: Unknown item for perfect gen...")]
PerfectItemNotFound,
}

45
src/errorfr/mod.rs Normal file
View file

@ -0,0 +1,45 @@
use thiserror::Error;
/// Errors yep
#[derive(Error, Debug)]
pub enum Errorfr {
/// item config json is missing
#[error("Error 1.1: item config json is missing.")]
ItemJsonMissing,
/// item config json is corrupt
#[error("Error 1.2: item config json is invalid. \nReread config.md.\n{0}")]
ItemJsonCorrupt(serde_json::Error),
/// idmap is missing
#[error("Error 1.3: id_keys.json is missing. \nYou should run \"--download id_keys\" or \"--download All\".")]
IDMapJsonMissing,
/// idmap is corrupt
#[error("Error 2.1: id_keys.json is corrupt. \nYou should run \"--download id_keys\" or \"--download All\".")]
IDMapJsonCorrupt,
/// shiny data json is missing
#[error("Error 2.2: shiny_stats.json is missing. \nYou should run \"--download ShinyStats\" or \"--download All\".")]
ShinyJsonMissing,
/// shiny data json is corrupt
#[error("Error 2.3: shiny_stats.json is corrupt. \nYou should run \"--download ShinyStats\" or \"--download All\".")]
ShinyJsonCorrupt,
/// could not download the file
#[error("Error 3.1: Download request failed. Check your network settings.")]
JsonDlReqFail,
/// invalid body response after downloading
#[error("Error 3.2: Download body is invalid. Something is broken.")]
JsonDlReqBodyInvalid,
/// unable to create file after download
#[error("Error 3.3: Download successful, but unable to actually create the file.")]
JsonDlReqFileCreateFail,
/// unable to copy (write in) file content
#[error("Error 9: Download successful, but unable to write to file.")]
JsonDlReqFileWriteFail,
}

View file

@ -1,76 +0,0 @@
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use crate::errorfr::Errorfr;
use crate::jsonstruct::Identificationer;
// the struct for the stuff I need in in Hashmap<String, GearJson> gear.json. its a big ass pain
#[derive(Deserialize, Serialize, PartialEq, Eq, Debug, Clone)]
pub struct GearJsonItem {
identifications: Option<
HashMap<
String, GearJsonItemInner
>
>
}
#[derive(Deserialize, Serialize, PartialEq, Eq, Debug, Clone)]
#[serde(untagged)]
pub enum GearJsonItemInner {
r#Struct(GearJsonItemInnerStruct),
r#Int(i32)
}
#[derive(Deserialize, Serialize, PartialEq, Eq, Debug, Clone)]
pub struct GearJsonItemInnerStruct {
max: i32,
min: i32,
raw: i32
}
/// Function to generate a perfect item.
/// It returns Result\<Vec\<Identificationer\>, Errorfr\>
pub fn gen_perfect(name: &str, frjson: &HashMap<String, GearJsonItem>) -> Result<Vec<Identificationer>, Errorfr> {
let mut a: Vec<Identificationer> = Vec::new();
let name = name.to_lowercase();
match frjson.get(&name) {
Some(fr_idents) => {
if let Some(fr_identmap) = &fr_idents.identifications {
for i in fr_identmap {
println!("{i:?}");
if let &GearJsonItemInner::Struct(e) = &i.1 {
// hardcoded list of inverts. Don't question why it's like this, blame whatever the fuck wynncraft was smoking.
// I'm going to have to update this list manually too... why the fuck, wynncraft?
let invert_bool: bool = matches!(i.0.to_lowercase().as_str(),
"4thspellcost" |
"3rdspellcost" |
"2ndspellcost" |
"1stspellcost" |
"raw4thspellcost" |
"raw3rdspellcost" |
"raw2ndspellcost" |
"raw1stSpellCost");
let ider: Identificationer = Identificationer {
id: i.0.clone(),
base: {
if invert_bool {-e.clone().raw} // invert value if invert mode true
else {e.clone().raw} // else regular value
},
roll: Some(match &e.clone().raw {
fr if fr<&0 => 70,
fr if fr>&0 => {
if invert_bool {70} // value 70 if invert mode true
else {130}// else value 130
},
_ => 0
})
};
println!("ider: {ider:?}");
a.push(ider)
}
}
}
},
None => return Err(Errorfr::PerfectItemNotFound)
}
Ok(a)
}

View file

@ -1,134 +0,0 @@
use crate::{dl_json,
errorfr::Errorfr,
gearjson,
jsonstruct::Shinystruct
};
use serde::Deserialize;
use std::{
collections::HashMap,
fs,
io::{BufReader, Write}
};
pub fn load_idkeys(executable_path: &str) -> Result<HashMap<String, u8>, Errorfr> {
// id_keys.json
serde_json::from_reader(&mut BufReader::new(
&mut fs::File::open(executable_path.to_owned() + "/data/id_keys.json")
.map_err(|_| Errorfr::IDMapJsonMissing)?))
.map_err(Errorfr::IDMapJsonCorrupt)
}
pub fn load_shinystats(executable_path: &str) -> Result<Vec<Shinystruct>, Errorfr> {
// shiny_stats.json
serde_json::from_reader(&mut BufReader::new(
fs::File::open(executable_path.to_owned() + "/data/shiny_stats.json")
.map_err(|_| Errorfr::ShinyJsonMissing)?))
.map_err(|_| Errorfr::ShinyJsonCorrupt)
}
pub fn load_gear(executable_path: &str) -> Result<HashMap<String, gearjson::GearJsonItem>, Errorfr> {
// gear.json parse (ONLY FOR DL gear.json)
let a: HashMap<String, gearjson::GearJsonItem> = serde_json::from_reader(&mut BufReader::new(
fs::File::open(executable_path.to_owned() + "/data/gear.json")
.map_err(|_| Errorfr::GearJsonMissing)?))
.map_err(Errorfr::GearJsonCacheCorrupt)?;
// parse the original, "a", into lowercase as "b"
let mut b: HashMap<String, gearjson::GearJsonItem> = HashMap::new();
for i in &a {
let frname = i.0.to_lowercase();
let frvalue = i.1.clone();
b.insert(frname, frvalue);
}
Ok(b)
}
pub fn load_gear_cache(executable_path: &str) -> Result<HashMap<String, gearjson::GearJsonItem>, Errorfr> {
// gear_cache.json (ONLY FOR PERFECT ITEM FUNCTION GEN)
serde_json::from_reader(&mut BufReader::new(
fs::File::open(executable_path.to_owned() + "/data/gear_cache.json")
.map_err(|_| Errorfr::GearJsonCacheMissing)?))
.map_err(Errorfr::GearJsonCorrupt)
}
pub fn dl_json_fr(dlvalue: &String, executable_path: &str) {
let jsons = DownloadJsons::from(dlvalue.clone());
if let Err(e) = fs::create_dir_all(format!("{}{}", executable_path, "/data/")) {
println!("Unable to create path. Path: {} ", e)
}
if jsons == DownloadJsons::All || jsons == DownloadJsons::ShinyStats {
if let Err(e) = dl_json(
"https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Data-Storage/shiny_stats.json".parse().unwrap(),
format!("{}{}", executable_path, "/data/shiny_stats.json"),
) {
// error handling below
println!("{} Filename: {}", e, dlvalue)
}
}
if jsons == DownloadJsons::All || jsons == DownloadJsons::IdKeys {
if let Err(e) = dl_json(
"https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/id_keys.json".parse().unwrap(),
format!("{}{}", executable_path, "/data/id_keys.json"),
) {
// error handling below
println!("{} Filename: {}", e, dlvalue)
}
}
if jsons == DownloadJsons::All || jsons == DownloadJsons::Gear {
match dl_json(
"https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/gear.json".parse().unwrap(),
format!("{}{}", executable_path, "/data/gear.json"),
) {
Err(e) => {
// error handling below
println!("{} Filename: {}", e, dlvalue);
},
Ok(_) => {
let frfrnocap = serde_json::to_vec(
&load_gear(executable_path)
.unwrap()
).unwrap();
let mut outer = fs::File::create(format!("{}{}",executable_path, "/data/gear_cache.json")).map_err(|_| Errorfr::GearJsonCacheCreateFail).unwrap();
outer.write_all(&frfrnocap).unwrap();
println!("Making gearcache to {}/data/gear_cache.json", executable_path);
}
}
}
}
// stuff for the bit for downloading data jsons for ease of use
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Debug, Deserialize)]
pub enum DownloadJsons {
None,
IdKeys,
ShinyStats,
Gear,
All,
}
impl From<String> for DownloadJsons {
fn from(value: String) -> Self {
match value.to_lowercase().as_str().trim() {
"none" => {
println!("downloading NONE (Why? it's pointless...)");
DownloadJsons::None
}
"id_keys" | "idkeys" | "idkeys.json" | "id_keys.json" => {
println!("downloading ID_KEYS");
DownloadJsons::IdKeys
}
"shiny_stats" | "shinystats" | "shiny_stats.json" | "shinystats.json" => {
println!("downloading SHINY_STATS");
DownloadJsons::ShinyStats
}
"gear" | "gear.json" => {
println!("downloading GEAR");
DownloadJsons::Gear
}
"all" | "everything" | "both" => {
println!("downloading ALL jsons");
DownloadJsons::All
}
_ => {
println!("downloading NONE (unable to understand prompt)");
DownloadJsons::None
}
}
}
}

View file

@ -1,241 +0,0 @@
use crate::errorfr::Errorfr;
use crate::jsonstruct::CraftedTypesFr::{Consu, Gear};
use idmangler_lib::types::{AttackSpeed, ClassType, ConsumableType, ConsumableType::*, CraftedGearType, CraftedGearType::*, EncodingVersion, ItemType, SkillType};
use serde::Deserialize;
use std::fs;
// structs for the json parsing
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct Jsonconfig {
// not a thing to be encoded, this just toggles debug prints. Also settable using --debug
#[serde(alias = "Debug", alias = "DEBUG")]
pub debug: Option<bool>,
// Item Types (Gear, Tome, Charm, Crafted Gear, Crafted Consum)
#[serde(alias = "itemtype", alias = "ITEM_TYPE", alias = "ITEMTYPE", alias = "Item_Type", alias = "Item_type", alias = "ItemType", alias = "Itemtype")]
pub item_type: ItemTypeDeser,
// Crafted type for Crafted item types
#[serde(alias = "craftedtype", alias = "CRAFTED_TYPE", alias = "CRAFTEDTYPE", alias = "Crafted_Type", alias = "Crafted_type", alias = "CraftedType", alias = "Craftedtype")]
pub crafted_type: Option<String>,
// name of item
#[serde(alias = "Name", alias = "NAME")]
pub name: Option<String>,
// shiny data
#[serde(alias = "Shiny", alias = "SHINY")]
pub shiny: Option<Shinyjson>,
// identifications
#[serde(alias = "Ids", alias = "IDS", alias = "identifications", alias = "Identifications", alias = "IDENTIFICATIONS")]
pub ids: Option<Vec<Identificationer>>,
// powders stuff
#[serde(alias = "Powders", alias = "POWDERS", alias = "powder", alias = "Powder", alias = "POWDER")]
pub powders: Option<Vec<PowderFr>>,
// rerolls
#[serde(alias = "Rerolls", alias = "REROLLS", alias = "reroll", alias = "Reroll", alias = "REROLL")]
pub rerolls: Option<u8>,
// durability data (Crafted Gear)
#[serde(alias = "durability", alias = "Durability", alias = "DURABILITY", alias = "dura", alias = "Dura", alias = "DURA")]
pub crafted_durability: Option<Durability>,
// requirements data (Crafted)
#[serde(alias = "requirement", alias = "Requirement", alias = "REQUIREMENT", alias = "requirements", alias = "Requirements", alias = "REQUIREMENTS")]
pub crafted_requirements: Option<RequirementsDeser>,
// identifications (Crafted)
// to be honest i wish there was a better way instead of too many aliases
#[serde(
alias = "craftedids",
alias = "CRAFTED_IDS",
alias = "CRAFTEDIDS",
alias = "Crafted_Ids",
alias = "Crafted_ids",
alias = "CraftedIds",
alias = "Craftedids",
alias = "craftedidentifications",
alias = "CRAFTED_IDENTIFICATIONS",
alias = "CRAFTEDIDENTIFICATIONS",
alias = "Crafted_Identifications",
alias = "Crafted_identifications",
alias = "CraftedIdentifications",
alias = "Craftedidentifications"
)]
pub crafted_ids: Option<Vec<IdentificationerCrafted>>,
pub crafted_damage: Option<DamageDeser>,
}
// reimplementing this because it doesnt have Deserialize.
// Also, changing the SkillPoint stuff into NOT a vec.
// This avoids confusing end user.
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
pub struct RequirementsDeser {
pub level: u8,
pub class: Option<ClassDeser>,
pub sp: Option<SkillPointDeser>,
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
pub enum ClassDeser {
Archer,
Warrior,
Assassin,
Mage,
Shaman,
}
impl From<ClassDeser> for ClassType {
fn from(value: ClassDeser) -> Self {
match value {
ClassDeser::Archer => ClassType::Archer,
ClassDeser::Warrior => ClassType::Warrior,
ClassDeser::Assassin => ClassType::Assasin,
ClassDeser::Mage => ClassType::Mage,
ClassDeser::Shaman => ClassType::Shaman,
}
}
}
#[derive(Deserialize, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct SkillPointDeser {
#[serde(alias = "Str", alias = "str", alias = "strength")]
pub strength: Option<i32>,
#[serde(alias = "Dex", alias = "dex", alias = "dexterity")]
pub dexterity: Option<i32>,
#[serde(alias = "Def", alias = "def", alias = "defense")]
pub defense: Option<i32>,
#[serde(alias = "Int", alias = "int", alias = "intelligence")]
pub intelligence: Option<i32>,
#[serde(alias = "Agi", alias = "agi", alias = "agility")]
pub agility: Option<i32>,
}
impl From<SkillPointDeser> for Vec<(SkillType, i32)> {
fn from(value: SkillPointDeser) -> Self {
let mut returnedvec: Vec<(SkillType, i32)> = Vec::new();
if let Some(fr_str) = value.strength {
returnedvec.push((SkillType::Strength, fr_str))
}
if let Some(fr_dex) = value.dexterity {
returnedvec.push((SkillType::Dexterity, fr_dex))
}
if let Some(fr_int) = value.intelligence {
returnedvec.push((SkillType::Intelligence, fr_int))
}
if let Some(fr_def) = value.defense {
returnedvec.push((SkillType::Defence, fr_def))
}
if let Some(fr_agi) = value.agility {
returnedvec.push((SkillType::Agility, fr_agi))
}
returnedvec
}
}
#[derive(PartialEq, Eq, Hash, Debug)]
pub enum CraftedTypesFr {
Gear(CraftedGearType),
Consu(ConsumableType),
}
impl TryFrom<&str> for CraftedTypesFr {
type Error = Errorfr;
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value.to_lowercase().as_str() {
// consu types
"potion" | "pot" | "potions" => Ok(Consu(Potion)),
"food" | "meal" | "foods" | "meals" => Ok(Consu(Food)),
"scroll" | "paper" => Ok(Consu(Scroll)),
// 5 weapon types
"spear" => Ok(Gear(Spear)),
"wand" => Ok(Gear(Wand)),
"dagger" => Ok(Gear(Dagger)),
"bow" => Ok(Gear(Bow)),
"relik" => Ok(Gear(Relik)),
// 4 armour types
"helmet" | "hat" => Ok(Gear(Helmet)),
"chestplate" | "shirt" | "chest" | "cp" => Ok(Gear(Chestplate)),
"leggings" | "legs" | "pants" | "trousers" => Ok(Gear(Leggings)),
"boots" | "shoes" => Ok(Gear(Boots)),
// 4 accessory types
"ring" => Ok(Gear(Ring)),
"bracelet" | "brace" => Ok(Gear(Bracelet)),
"necklace" => Ok(Gear(Necklace)),
// General gear types (FALLBACK) (don't use these if not necessary)
"weapon" => Ok(Gear(Weapon)),
"accessory" => Ok(Gear(Accessory)),
// fallback error return
_ => Err(Errorfr::JsonInvalidCraftedType),
}
}
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct Durability {
pub effect_strength: Option<u8>,
pub dura_cur: i32,
pub dura_max: i32,
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct Shinystruct {
pub id: u8,
pub key: String,
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct Identificationer {
pub id: String,
pub base: i32,
pub roll: Option<u8>,
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct IdentificationerCrafted {
pub name: String,
pub max_roll: i32,
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct PowderFr {
pub r#type: char,
pub amount: Option<u8>,
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct Shinyjson {
pub key: String,
pub value: i64,
}
#[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone)]
pub struct DamageDeser {
pub attack_speed: AttackSpeed,
}
// I had to clone this and add Deserialize because the original idmangler_lib::types::ItemType does not
#[repr(u8)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Debug, Deserialize)]
pub enum ItemTypeDeser {
#[serde(alias = "gear")]
Gear = 0,
#[serde(alias = "tome")]
Tome = 1,
#[serde(alias = "charm")]
Charm = 2,
#[serde(alias = "craftedgear", alias = "cgear", alias = "CGear")]
CraftedGear = 3,
#[serde(alias = "craftedconsu", alias = "cconsu", alias = "CConsu")]
CraftedConsu = 4,
}
impl From<ItemTypeDeser> for ItemType {
fn from(value: ItemTypeDeser) -> ItemType {
match value {
ItemTypeDeser::Gear => ItemType::Gear,
ItemTypeDeser::Tome => ItemType::Tome,
ItemTypeDeser::Charm => ItemType::Charm,
ItemTypeDeser::CraftedConsu => ItemType::CraftedConsu,
ItemTypeDeser::CraftedGear => ItemType::CraftedGear,
}
}
}
pub fn load_jsonconfig(path: &String) -> Result<Jsonconfig, Errorfr> {
serde_json5::from_reader(&mut fs::File::open(path)
.map_err(|_| Errorfr::ItemJsonMissing)?)
.map_err(Errorfr::ItemJsonCorrupt)
}

View file

@ -1,21 +1,21 @@
#![allow(clippy::single_match)] use idmangler_lib::{
#![allow(non_camel_case_types, non_snake_case)] encoding::encode_string,
types::{
Element, ItemType, TransformVersion, {RollType, Stat},
},
DataEncoder, EndData, IdentificationData, NameData, PowderData, RerollData, ShinyData,
StartData, TypeData,
};
mod encode; use std::{collections::HashMap, env, fs, io, panic, path::PathBuf};
mod structures;
use crate::structures::*;
mod errorfr; mod errorfr;
mod gearjson;
mod jsondl;
mod jsonstruct;
use crate::errorfr::Errorfr; use crate::errorfr::Errorfr;
use crate::encode::FuncParams;
use crate::jsondl::*;
use crate::jsonstruct::*;
use crate::gearjson::gen_perfect;
use clap::Parser;
use idmangler_lib::{encoding::string::encode_string, types::EncodingVersion};
use reqwest::Url;
use std::{collections::HashMap, env, fs, io::Write, path::PathBuf};
use clap::Parser;
use reqwest::Url;
#[derive(Parser, Debug, Clone)] #[derive(Parser, Debug, Clone)]
#[command(version, about, long_about = None, arg_required_else_help(true))] #[command(version, about, long_about = None, arg_required_else_help(true))]
@ -24,37 +24,30 @@ struct Args {
#[arg(short, long)] #[arg(short, long)]
config: Option<String>, config: Option<String>,
/// Enable debug mode (for now this just prints debug info) /// Enable debug mode
#[arg(long, default_value_t = false)] #[arg(long, default_value_t = false)]
debug: bool, debug: bool,
/// Download jsons (for ease of use) /// Download jsons (for ease of use)
#[arg(short, long)] #[arg(short, long)]
download: Option<String>, download: Option<String>,
/// Function to generate perfect value items
#[arg(long)]
perfect: Option<String>,
} }
fn dl_json(
fn dl_json(url: Url, savename: String) -> Result<(), Errorfr> { url: Url,
savename: String,
) -> Result<(), Errorfr> {
let resp = reqwest::blocking::get(url).map_err(|_| Errorfr::JsonDlReqFail)?; let resp = reqwest::blocking::get(url).map_err(|_| Errorfr::JsonDlReqFail)?;
let body = resp.text().map_err(|_| Errorfr::JsonDlReqBodyInvalid)?; let body = resp.text().map_err(|_| Errorfr::JsonDlReqBodyInvalid)?;
let savepath = savename.to_string(); let savepath = savename.to_string();
println!("Downloading file to {savepath}"); println!("Downloading file to {savepath}");
let mut out = fs::File::create(savepath).map_err(|_| Errorfr::JsonDlReqFileCreateFail)?; let mut out = fs::File::create(savepath)
out.write_all(body.as_bytes()).map_err(|_| Errorfr::JsonDlReqFileWriteFail)?; .map_err(|_| Errorfr::JsonDlReqFileCreateFail)?;
io::copy(&mut body.as_bytes(), &mut out).map_err(|_| Errorfr::JsonDlReqFileWriteFail)?;
Ok(()) Ok(())
} }
fn main() { fn main() {
if let Err(e) = main_2() {
println!("{}", e)
}
}
fn main_2() -> Result<(), Errorfr> {
let args = Args::parse(); let args = Args::parse();
let mut executable_path = env::current_exe().unwrap(); let mut executable_path = env::current_exe().unwrap();
PathBuf::pop(&mut executable_path); PathBuf::pop(&mut executable_path);
@ -68,203 +61,205 @@ fn main_2() -> Result<(), Errorfr> {
// download jsons if necessary // download jsons if necessary
if let Some(dlvalue) = &args.download { if let Some(dlvalue) = &args.download {
dl_json_fr(dlvalue, executable_path) let jsons = DownloadJsons::from(dlvalue.clone());
if jsons == DownloadJsons::All || jsons == DownloadJsons::ShinyStats {
if let Err(e) = dl_json(
"https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Data-Storage/shiny_stats.json".parse().unwrap(),
format!("{}{}", executable_path, "/shiny_stats.json"),
) { // error handling below
println!("{} Filename: {}",e,dlvalue)
}
}
if jsons == DownloadJsons::All || jsons == DownloadJsons::IdKeys {
if let Err(e) = dl_json(
"https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/id_keys.json".parse().unwrap(),
format!("{}{}", executable_path, "/id_keys.json"),
) { // error handling below
println!("{} Filename: {}",e,dlvalue)
}
}
}; };
// check if files load properly and all that if let Some(T) = &args.config {
if let Err(e) = cook(args, executable_path, debug_mode) {
println!("{}", e);
}
}
}
let loaded_config: Jsonconfig = { fn cook(args: Args, executable_path: &str, mut debug_mode: bool) -> Result<(), Errorfr> {
if let Some(t) = &args.config { let config = args.config;
match load_jsonconfig(t) {
Ok(fr) => {
Ok(fr) // load configs
} let json_config: Jsonconfig =
Err(e) => Err(e), serde_json::from_reader(fs::File::open(config.unwrap()).map_err(|_| Errorfr::ItemJsonMissing)?)
} .map_err(Errorfr::ItemJsonCorrupt)?;
} let idsmap: HashMap<String, u8> = serde_json::from_reader(
else { fs::File::open(executable_path.to_owned() + "/id_keys.json")
println!("no config path provided, fallback to empty."); .map_err(|_| Errorfr::IDMapJsonMissing)?,
Ok(
Jsonconfig {
debug: Some(false),
item_type: ItemTypeDeser::Gear,
crafted_type: None,
name: None,
shiny: None,
ids: None,
powders: None,
rerolls: None,
crafted_durability: None,
crafted_requirements: None,
crafted_ids: None,
crafted_damage: None,
}
) )
} .map_err(|_| Errorfr::IDMapJsonCorrupt)?;
}?; let json_shiny: Vec<Shinystruct> = serde_json::from_reader(
let loaded_idkeys = load_idkeys(executable_path)?; fs::File::open(executable_path.to_owned() + "/shiny_stats.json")
let loaded_shinystats = load_shinystats(executable_path)?; .map_err(|_| Errorfr::ShinyJsonMissing)?,
)
.map_err(|_| Errorfr::ShinyJsonCorrupt)?;
// println!("{:?}",idsmap.get("airDamage"));
// check if perfect status and change name if so. otherwise blank yep if let Some(debugconfig) = json_config.debug {
let mut namefr: String = "".to_string();
if let Some(t1) = args.perfect {
namefr = t1
}
// debug mode on if in the loaded config
if let Some(debugconfig) = loaded_config.debug {
if debugconfig { if debugconfig {
debug_mode = true debug_mode = true
} }
} }
// main program everything starts here fr
let mut out: Vec<u8> = Vec::new();
// create necessary variables // create necessary variables
let ver = EncodingVersion::Version1; let mut out = Vec::new();
let ver = TransformVersion::Version1;
let mut loaded_config_clone = loaded_config.clone(); // ENCODE: StartData
StartData(ver).encode(ver, &mut out).unwrap();
let mut funcparamsfr: FuncParams = FuncParams { // ENCODE: TypeData
fr_out: &mut out, TypeData(ItemType::from(json_config.item_type))
fr_debug_mode: &debug_mode, .encode(ver, &mut out)
fr_ver: ver, .unwrap();
};
// ENCODE: A Lot Of Stuff // ENCODE: NameData
// Also print any mapped errors NameData(json_config.name.trim().to_string())
let cooking = cook(&mut funcparamsfr, &mut loaded_config_clone, loaded_idkeys, loaded_shinystats, namefr, executable_path); .encode(ver, &mut out)
if let Err(e) = cooking { .unwrap();
println!("{}", e); // print error if there is an error
} else { // json identification data handling
// final string print if there is no error let mut idvec = Vec::new();
println!("{}", cooking?) for eachid in json_config.ids {
let id_id = idsmap.get(eachid.id.trim());
let id_base = eachid.base;
let id_roll = eachid.roll;
idvec.push(
Stat {
kind: match id_id {
Some(ide) => *ide,
None => panic!("There is a mismatched ID, and this message has replaced where the line is meant to be")
},
base: Some(id_base),
roll: match id_roll{
Some(rolle) => RollType::Value(rolle),
None => RollType::PreIdentified
}
}
);
// println!("{:?} {:?} {:?}",id_id,id_base,id_roll)
} }
// ENCODE: IdentificationsData
IdentificationData {
identifications: idvec,
extended_encoding: true,
}
.encode(ver, &mut out)
.unwrap();
// json powder data handling
let mut powdervec = Vec::new();
for eachpowder in json_config.powders {
let powdertier = eachpowder.tier; // get the powder tier
let powderamount: u8 = eachpowder.amount.unwrap_or(1);
// match for the powder type
for _ in 0..powderamount {
let eletype = match eachpowder.r#type.to_ascii_lowercase() {
'e' => Element::Earth,
't' => Element::Thunder,
'w' => Element::Water,
'f' => Element::Fire,
'a' => Element::Air,
_ => Element::Thunder,
};
if debug_mode {
dbg!(powdertier);
dbg!(eletype);
}
powdervec.push(Some((eletype, powdertier)));
}
}
if debug_mode {
dbg!(&powdervec);
}
// ENCODE: PowderData
PowderData {
powder_slots: json_config.powder_limit,
powders: powdervec,
}
.encode(ver, &mut out)
.unwrap();
match json_config.rerolls {
Some(rerollcount) => {
if rerollcount != 0 {
// ENCODE: RerollData if applicable
RerollData(rerollcount).encode(ver, &mut out).unwrap();
if debug_mode {
dbg!(rerollcount);
};
};
}
None => pass(),
};
let mut realshinykey: u8;
if let Some(shiny) = json_config.shiny {
let _shinykey = &shiny.key;
let shinyvalue = shiny.value;
realshinykey = 1;
for i in json_shiny {
if i.key == shiny.key {
realshinykey = i.id;
if debug_mode {
dbg!(&shiny.key);
}
}
}
if debug_mode {
dbg!(&realshinykey);
dbg!(&shinyvalue);
}
// ENCODE: ShinyData (if applicable)
ShinyData {
id: realshinykey,
val: shinyvalue, //- 0b0100_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000,
// u16::MAX is the max value of unsigned 16bit value
}
.encode(ver, &mut out)
.unwrap();
}
// prints (Water,6) 255 times
// println!("{:?}",vec![(Powders::WATER, 6); 255]);
// ENCODE: EndData
EndData.encode(ver, &mut out).unwrap();
// final string print
println!("{}", encode_string(&out));
// I don't even know what the fuck this does
//for b in out {
// print!("{:02X}", b);
//}
// println!();
// decode test
//let input = "󰀀󰄀󰉁󶹴󶡲󶅣󶥴󶔠󴉡󶱬󶥳󷑡󰀃󰠁󰀞󾠇󵠑󳱩󳢠󱽴󴠧󷄡󱹵󳫠󰢂󱌨󵴅󲠞􏿮";
//let bytes = decode_string(&input);
//let mut bytes_iter = bytes.into_iter();
//let out = decode(&mut bytes_iter).unwrap();
// println!("{:#?}", out);
Ok(()) Ok(())
} }
fn cook(fr_params: &mut FuncParams, json_config: &mut Jsonconfig, idsmap: HashMap<String, u8>, json_shiny: Vec<Shinystruct>, namefr: String, executable_path: &str) -> Result<String, Errorfr> { fn pass() {}
// ENCODE: StartData and TypeData, ALWAYS
fr_params.encode_startdata()?;
fr_params.encode_typedata(json_config.item_type)?;
// ENCODE: CustomGearTypeData / CustomConsumableTypeData
match json_config.item_type {
ItemTypeDeser::CraftedGear | ItemTypeDeser::CraftedConsu => {
if let Some(real_crafted_type) = &json_config.crafted_type {
fr_params.encode_typedata_custom(real_crafted_type)?;
} else {
return Err(Errorfr::JsonNotFoundCraftedType);
}
}
_ => {}
}
// ENCODE: NameData, if ItemType is Gear, Tome, Charm
match json_config.item_type {
ItemTypeDeser::Gear | ItemTypeDeser::Tome | ItemTypeDeser::Charm => {
if namefr != *"" {
fr_params.encode_namedata(&namefr)?
}
else if let Some(real_name) = &json_config.name {
fr_params.encode_namedata(real_name)?
} else {
return Err(Errorfr::JsonNotFoundName);
}
}
_ => {}
}
// ENCODE: IdentificationData
match json_config.item_type {
ItemTypeDeser::Gear | ItemTypeDeser::Tome | ItemTypeDeser::Charm => {
if namefr != *"" {
println!("Overriding IDs with perfect ones!");
let fr_gear_cache = load_gear_cache(executable_path)?;
let resultantvec = gen_perfect(&namefr, &fr_gear_cache)?;
fr_params.encode_iddata(&resultantvec, idsmap)?
}
else if let Some(real_ids) = &json_config.ids {
fr_params.encode_iddata(real_ids, idsmap)?
}
}
_ => {}
}
// ENCODE: DurabilityData (REQUIRED for CraftedGear)
match json_config.item_type {
ItemTypeDeser::CraftedGear => {
if let Some(real_dura) = &json_config.crafted_durability {
fr_params.encode_duradata(real_dura)?;
} else {
return Err(Errorfr::JsonNotFoundDura);
}
}
_ => {}
}
// ENCODE: RequirementsData if ItemType is CraftedGear, CraftedConsu
match json_config.item_type {
ItemTypeDeser::CraftedGear | ItemTypeDeser::CraftedConsu => {
if let Some(real_reqs) = json_config.crafted_requirements {
fr_params.encode_reqdata(real_reqs)?
} else {
return Err(Errorfr::JsonNotFoundReqs);
}
}
_ => {}
}
// ENCODE: PowderData if ItemType is Gear, CraftedGear
match json_config.item_type {
ItemTypeDeser::Gear | ItemTypeDeser::CraftedGear => {
if let Some(real_powders) = &json_config.powders {
fr_params.encode_powderdata(real_powders)?
}
}
_ => {}
}
// ENCODE: RerollData if ItemType is Gear, Tome, Charm
match json_config.item_type {
ItemTypeDeser::Gear | ItemTypeDeser::Tome | ItemTypeDeser::Charm => {
if let Some(rerollcount) = json_config.rerolls {
// rerolldata
fr_params.encode_rerolldata(rerollcount)?
}
}
_ => {}
}
// ENCODE: ShinyData if ItemType is Gear
match json_config.item_type {
ItemTypeDeser::Gear => {
if let Some(shiny) = &json_config.shiny {
fr_params.encode_shinydata(shiny, &json_shiny)?
}
}
_ => {}
}
// ENCODE: EndData, ALWAYS
fr_params.encode_enddata()?;
let mut final_string: String = encode_string(fr_params.fr_out);
// add NameAfter. not actually an encode.
match json_config.item_type {
ItemTypeDeser::CraftedGear | ItemTypeDeser::CraftedConsu => {
if let Some(real_name) = &json_config.name {
final_string = format!("{} \"{}\"", final_string, real_name)
} else {
return Err(Errorfr::JsonNotFoundName);
}
}
_ => {}
}
Ok(final_string)
}

93
src/structures/mod.rs Normal file
View file

@ -0,0 +1,93 @@
use idmangler_lib::types::ItemType;
use serde::Deserialize;
// structs
#[derive(Deserialize)]
pub struct Powder {
pub r#type: char,
pub tier: u8,
pub amount: Option<u8>,
}
#[derive(Deserialize)]
pub struct Identificationer {
pub id: String,
pub base: i32,
pub roll: Option<u8>,
}
#[derive(Deserialize)]
pub struct Jsonconfig {
pub debug: Option<bool>,
pub name: String,
pub item_type: ItemTypeDeser,
pub shiny: Option<Shinyjson>,
pub ids: Vec<Identificationer>,
pub powder_limit: u8,
pub powders: Vec<Powder>,
pub rerolls: Option<u8>,
}
#[derive(Deserialize)]
pub struct Shinystruct {
pub id: u8,
pub key: String,
}
#[derive(Deserialize)]
pub struct Shinyjson {
pub key: String,
pub value: i64,
}
// I had to clone this and add Deserialize because the original idmangler_lib::types::ItemType does not
#[repr(u8)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Debug, Deserialize)]
pub enum ItemTypeDeser {
Gear = 0,
Tome = 1,
Charm = 2,
CraftedGear = 3,
CraftedConsu = 4,
}
impl From<ItemTypeDeser> for ItemType {
fn from(value: ItemTypeDeser) -> ItemType {
match value {
ItemTypeDeser::Gear => ItemType::Gear,
ItemTypeDeser::Tome => ItemType::Tome,
ItemTypeDeser::Charm => ItemType::Charm,
ItemTypeDeser::CraftedConsu => ItemType::CraftedConsu,
ItemTypeDeser::CraftedGear => ItemType::CraftedGear,
}
}
}
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Debug, Deserialize)]
pub enum DownloadJsons {
None,
IdKeys,
ShinyStats,
All,
}
impl From<String> for DownloadJsons {
fn from(value: String) -> Self {
match value.to_lowercase().as_str().trim() {
"none" => {
println!("download NONE");
DownloadJsons::None
}
"id_keys" | "idkeys" | "idkeys.json" | "id_keys.json" => {
println!("download ID_KEYS");
DownloadJsons::IdKeys
}
"shiny_stats" | "shinystats" | "shiny_stats.json" | "shinystats.json" => {
println!("download SHINY_STATS");
DownloadJsons::ShinyStats
}
"all" | "everything" | "both" => {
println!("download BOTH");
DownloadJsons::All
}
_ => {
println!("Could not understand what Jsons to download, sorry.");
DownloadJsons::None
}
}
}
}