Compare commits

..

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

View file

@ -26,7 +26,7 @@ struct Args {
/// Enable debug mode /// Enable debug mode
#[arg(short, long, default_value_t = false)] #[arg(short, long, default_value_t = false)]
debug: bool, debugmode: bool,
} }
// const fallbackconfigpath: String = "config.json".to_owned(); // const fallbackconfigpath: String = "config.json".to_owned();
@ -42,7 +42,7 @@ fn cook() -> Result<(), Errorfr> {
let args = Args::parse(); let args = Args::parse();
let mut debug_mode = false; let mut debug_mode = false;
if args.debug == true { if args.debugmode == true {
debug_mode = true; debug_mode = true;
println!("Debug mode enabled"); println!("Debug mode enabled");
}; };
@ -121,32 +121,47 @@ fn cook() -> Result<(), Errorfr> {
let eletype = match eachpowder.r#type.to_ascii_lowercase() { let eletype = match eachpowder.r#type.to_ascii_lowercase() {
'e' => { 'e' => {
if debug_mode { if debug_mode {
println!("Powder type: Earth");
} }
Element::Earth Element::Earth
} }
't' => { 't' => {
if debug_mode {
println!("Powder type: Thunder");
}
Element::Thunder Element::Thunder
} }
'w' => { 'w' => {
if debug_mode {
println!("Powder type: Water");
}
Element::Water Element::Water
} }
'f' => { 'f' => {
if debug_mode {
println!("Powder type: Fire");
}
Element::Fire Element::Fire
} }
'a' => { 'a' => {
if debug_mode {
println!("Powder type: Air");
}
Element::Air Element::Air
} }
_ => { _ => {
if debug_mode {
println!("Powder type: Broken, fallback Thunder");
}
Element::Thunder Element::Thunder
} }
}; };
if debug_mode {
dbg!(powdertier);
dbg!(eletype);
}
powdervec.push(Some((eletype,powdertier))); powdervec.push(Some((eletype,powdertier)));
if debug_mode {
println!("Powder tier: {}", powdertier);
println!("Powder amount: {}", powderamount);
}
}; };
@ -155,7 +170,7 @@ fn cook() -> Result<(), Errorfr> {
} }
if debug_mode { if debug_mode {
dbg!(&powdervec); println!("Powders Vec: {:?}", powdervec);
} }
// old powder data encode kinda, takes data from new encode // old powder data encode kinda, takes data from new encode
@ -167,16 +182,16 @@ fn cook() -> Result<(), Errorfr> {
.unwrap(); .unwrap();
match json_config.rerolls { match json_config.rerolls {
Some(rerollcount) => { Some(i) => {
if rerollcount != 0 { if i != 0 {
RerollData(rerollcount).encode(ver, &mut out).unwrap(); RerollData(i).encode(ver, &mut out).unwrap();
if debug_mode { if debug_mode {
dbg!(rerollcount); println!("Rerolls: {}", i)
}; }
}; }
} }
None => pass(), None => pass(),
}; }
let mut realshinykey: u8; let mut realshinykey: u8;
if let Some(shiny) = json_config.shiny { if let Some(shiny) = json_config.shiny {
@ -188,7 +203,7 @@ fn cook() -> Result<(), Errorfr> {
if i.key == shiny.key { if i.key == shiny.key {
realshinykey = i.id; realshinykey = i.id;
if debug_mode { if debug_mode {
dbg!(&shiny.key); println!("shiny key {}", shiny.key);
} }
} }
} }