fix powders changing in idmangler-lib 4.0
This commit is contained in:
parent
32740e8318
commit
6010d1be0d
3 changed files with 50 additions and 55 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -123,9 +123,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "idmangler-lib"
|
name = "idmangler-lib"
|
||||||
version = "0.3.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 = "01a4ccddf0b9d54668e06b249f940e4c376cc4393ef5d149c87759a774b385d5"
|
checksum = "0395df40b27e5b44d89befbf479c06df7554c0af28674fa663aebd8e0d8f400c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
clap = { version = "4.5.20", features = ["derive"] }
|
clap = { version = "4.5.20", features = ["derive"] }
|
||||||
idmangler-lib = "0.3.0"
|
idmangler-lib = "0.4.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
thiserror = "1.0.68"
|
thiserror = "1.0.68"
|
||||||
|
|
99
src/main.rs
99
src/main.rs
|
@ -1,7 +1,7 @@
|
||||||
use idmangler_lib::{
|
use idmangler_lib::{
|
||||||
encoding::encode_string,
|
encoding::encode_string,
|
||||||
types::{
|
types::{
|
||||||
ItemType, Powders, TransformVersion, {RollType, Stat},
|
ItemType, TransformVersion, {RollType, Stat}, Element
|
||||||
},
|
},
|
||||||
DataEncoder, EndData, IdentificationData, NameData, PowderData, RerollData, ShinyData,
|
DataEncoder, EndData, IdentificationData, NameData, PowderData, RerollData, ShinyData,
|
||||||
StartData, TypeData,
|
StartData, TypeData,
|
||||||
|
@ -117,62 +117,57 @@ fn cook() -> Result<(), Errorfr> {
|
||||||
let powdertier = eachpowder.tier; // get the powder tier
|
let powdertier = eachpowder.tier; // get the powder tier
|
||||||
let powderamount: u8 = eachpowder.amount.unwrap_or_else(|| 1);
|
let powderamount: u8 = eachpowder.amount.unwrap_or_else(|| 1);
|
||||||
// match for the powder type
|
// match for the powder type
|
||||||
// no need to return to variable or i'll need to rematch AGAIN
|
for _ in 0..powderamount {
|
||||||
match eachpowder.r#type.to_ascii_lowercase() {
|
let eletype = match eachpowder.r#type.to_ascii_lowercase() {
|
||||||
'e' => {
|
'e' => {
|
||||||
for _i in 0..powderamount {
|
if debug_mode {
|
||||||
powdervec.push((Powders::EARTH, powdertier))
|
println!("Powder type: Earth");
|
||||||
|
}
|
||||||
|
Element::Earth
|
||||||
}
|
}
|
||||||
if debug_mode {
|
't' => {
|
||||||
println!("Powder type: Earth");
|
|
||||||
}
|
if debug_mode {
|
||||||
}
|
println!("Powder type: Thunder");
|
||||||
't' => {
|
}
|
||||||
for _i in 0..powderamount {
|
Element::Thunder
|
||||||
powdervec.push((Powders::THUNDER, powdertier))
|
|
||||||
}
|
|
||||||
if debug_mode {
|
|
||||||
println!("Powder type: Thunder");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'w' => {
|
|
||||||
for _i in 0..powderamount {
|
|
||||||
powdervec.push((Powders::WATER, powdertier))
|
|
||||||
}
|
|
||||||
if debug_mode {
|
|
||||||
println!("Powder type: Water");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'f' => {
|
|
||||||
for _i in 0..powderamount {
|
|
||||||
powdervec.push((Powders::FIRE, powdertier))
|
|
||||||
}
|
|
||||||
if debug_mode {
|
|
||||||
println!("Powder type: Fire");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'a' => {
|
|
||||||
for _i in 0..powderamount {
|
|
||||||
powdervec.push((Powders::AIR, powdertier))
|
|
||||||
}
|
|
||||||
if debug_mode {
|
|
||||||
println!("Powder type: Air");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
for _i in 0..powderamount {
|
|
||||||
powdervec.push((Powders::THUNDER, powdertier))
|
|
||||||
}
|
|
||||||
if debug_mode {
|
|
||||||
println!("Powder type: Broken, fallback Thunder");
|
|
||||||
}
|
}
|
||||||
|
'w' => {
|
||||||
|
if debug_mode {
|
||||||
|
println!("Powder type: Water");
|
||||||
|
}
|
||||||
|
Element::Water
|
||||||
|
}
|
||||||
|
'f' => {
|
||||||
|
if debug_mode {
|
||||||
|
println!("Powder type: Fire");
|
||||||
|
}
|
||||||
|
Element::Fire
|
||||||
|
}
|
||||||
|
'a' => {
|
||||||
|
if debug_mode {
|
||||||
|
println!("Powder type: Air");
|
||||||
|
}
|
||||||
|
Element::Air
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
if debug_mode {
|
||||||
|
println!("Powder type: Broken, fallback Thunder");
|
||||||
|
}
|
||||||
|
Element::Thunder
|
||||||
|
}
|
||||||
|
};
|
||||||
|
powdervec.push(Some((eletype,powdertier)));
|
||||||
|
if debug_mode {
|
||||||
|
println!("Powder tier: {}", powdertier);
|
||||||
|
println!("Powder amount: {}", powderamount);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if debug_mode {
|
|
||||||
println!("Powder tier: {}", powdertier);
|
|
||||||
println!("Powder amount: {}", powderamount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if debug_mode {
|
if debug_mode {
|
||||||
println!("Powders Vec: {:?}", powdervec);
|
println!("Powders Vec: {:?}", powdervec);
|
||||||
|
|
Loading…
Reference in a new issue