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]]
|
||||
name = "idmangler-lib"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "01a4ccddf0b9d54668e06b249f940e4c376cc4393ef5d149c87759a774b385d5"
|
||||
checksum = "0395df40b27e5b44d89befbf479c06df7554c0af28674fa663aebd8e0d8f400c"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
]
|
||||
|
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||
[dependencies]
|
||||
base64 = "0.22.1"
|
||||
clap = { version = "4.5.20", features = ["derive"] }
|
||||
idmangler-lib = "0.3.0"
|
||||
idmangler-lib = "0.4.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
thiserror = "1.0.68"
|
||||
|
|
39
src/main.rs
39
src/main.rs
|
@ -1,7 +1,7 @@
|
|||
use idmangler_lib::{
|
||||
encoding::encode_string,
|
||||
types::{
|
||||
ItemType, Powders, TransformVersion, {RollType, Stat},
|
||||
ItemType, TransformVersion, {RollType, Stat}, Element
|
||||
},
|
||||
DataEncoder, EndData, IdentificationData, NameData, PowderData, RerollData, ShinyData,
|
||||
StartData, TypeData,
|
||||
|
@ -117,62 +117,57 @@ fn cook() -> Result<(), Errorfr> {
|
|||
let powdertier = eachpowder.tier; // get the powder tier
|
||||
let powderamount: u8 = eachpowder.amount.unwrap_or_else(|| 1);
|
||||
// match for the powder type
|
||||
// no need to return to variable or i'll need to rematch AGAIN
|
||||
match eachpowder.r#type.to_ascii_lowercase() {
|
||||
for _ in 0..powderamount {
|
||||
let eletype = match eachpowder.r#type.to_ascii_lowercase() {
|
||||
'e' => {
|
||||
for _i in 0..powderamount {
|
||||
powdervec.push((Powders::EARTH, powdertier))
|
||||
}
|
||||
if debug_mode {
|
||||
println!("Powder type: Earth");
|
||||
}
|
||||
Element::Earth
|
||||
}
|
||||
't' => {
|
||||
for _i in 0..powderamount {
|
||||
powdervec.push((Powders::THUNDER, powdertier))
|
||||
}
|
||||
|
||||
if debug_mode {
|
||||
println!("Powder type: Thunder");
|
||||
}
|
||||
Element::Thunder
|
||||
}
|
||||
'w' => {
|
||||
for _i in 0..powderamount {
|
||||
powdervec.push((Powders::WATER, powdertier))
|
||||
}
|
||||
if debug_mode {
|
||||
println!("Powder type: Water");
|
||||
}
|
||||
Element::Water
|
||||
}
|
||||
'f' => {
|
||||
for _i in 0..powderamount {
|
||||
powdervec.push((Powders::FIRE, powdertier))
|
||||
}
|
||||
if debug_mode {
|
||||
println!("Powder type: Fire");
|
||||
}
|
||||
Element::Fire
|
||||
}
|
||||
'a' => {
|
||||
for _i in 0..powderamount {
|
||||
powdervec.push((Powders::AIR, powdertier))
|
||||
}
|
||||
if debug_mode {
|
||||
println!("Powder type: Air");
|
||||
}
|
||||
Element::Air
|
||||
}
|
||||
_ => {
|
||||
for _i in 0..powderamount {
|
||||
powdervec.push((Powders::THUNDER, powdertier))
|
||||
}
|
||||
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!("Powders Vec: {:?}", powdervec);
|
||||
|
|
Loading…
Reference in a new issue